-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharrayprocessor.s
66 lines (66 loc) · 1.09 KB
/
arrayprocessor.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.file "arrayprocessor.c"
.intel_syntax noprefix
.text
.globl process_array
.type process_array, @function
process_array:
endbr64
push rbp
mov rbp, rsp
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -4[rbp], 0
jmp .L2
.L5:
mov eax, DWORD PTR -4[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
test eax, eax
jg .L6
mov eax, DWORD PTR -4[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -4[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rcx
sub edx, 5
mov DWORD PTR [rax], edx
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L5
jmp .L7
.L6:
nop
.L7:
nop
pop rbp
ret
.size process_array, .-process_array
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4: