CISC to RISC
Collection
Language-Model Guided Assembly Transpilation
•
11 items
•
Updated
•
1
files
stringlengths 20
22
| x86
stringlengths 639
12.7k
| risc
stringlengths 363
8.21k
|
---|---|---|
eval/problem145/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 272
mov QWORD PTR -264[rbp], rdi
mov QWORD PTR -272[rbp], rsi
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
mov DWORD PTR -248[rbp], 0
jmp .L2
.L3:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -264[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -248[rbp]
cdqe
mov BYTE PTR -224[rbp+rax], dl
add DWORD PTR -248[rbp], 1
.L2:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -264[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 47
jne .L3
mov eax, DWORD PTR -248[rbp]
cdqe
mov BYTE PTR -224[rbp+rax], 0
lea rax, -224[rbp]
mov rdi, rax
call atoi@PLT
mov DWORD PTR -240[rbp], eax
mov DWORD PTR -244[rbp], 0
add DWORD PTR -248[rbp], 1
jmp .L4
.L5:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -264[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -244[rbp]
cdqe
mov BYTE PTR -112[rbp+rax], dl
add DWORD PTR -248[rbp], 1
add DWORD PTR -244[rbp], 1
.L4:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -264[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L5
mov eax, DWORD PTR -244[rbp]
cdqe
mov BYTE PTR -112[rbp+rax], 0
lea rax, -112[rbp]
mov rdi, rax
call atoi@PLT
mov DWORD PTR -236[rbp], eax
mov DWORD PTR -248[rbp], 0
jmp .L6
.L7:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -272[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -248[rbp]
cdqe
mov BYTE PTR -224[rbp+rax], dl
add DWORD PTR -248[rbp], 1
.L6:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -272[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 47
jne .L7
mov eax, DWORD PTR -248[rbp]
cdqe
mov BYTE PTR -224[rbp+rax], 0
lea rax, -224[rbp]
mov rdi, rax
call atoi@PLT
mov DWORD PTR -232[rbp], eax
mov DWORD PTR -244[rbp], 0
add DWORD PTR -248[rbp], 1
jmp .L8
.L9:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -272[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -244[rbp]
cdqe
mov BYTE PTR -112[rbp+rax], dl
add DWORD PTR -248[rbp], 1
add DWORD PTR -244[rbp], 1
.L8:
mov eax, DWORD PTR -248[rbp]
movsx rdx, eax
mov rax, QWORD PTR -272[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L9
mov eax, DWORD PTR -244[rbp]
cdqe
mov BYTE PTR -112[rbp+rax], 0
lea rax, -112[rbp]
mov rdi, rax
call atoi@PLT
mov DWORD PTR -228[rbp], eax
mov eax, DWORD PTR -240[rbp]
imul eax, DWORD PTR -232[rbp]
mov edx, DWORD PTR -236[rbp]
mov ecx, edx
imul ecx, DWORD PTR -228[rbp]
cdq
idiv ecx
mov eax, edx
test eax, eax
jne .L10
mov eax, 1
jmp .L12
.L10:
mov eax, 0
.L12:
mov rsi, QWORD PTR -8[rbp]
xor rsi, QWORD PTR fs:40
je .L13
call __stack_chk_fail@PLT
.L13:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-272
sd ra,264(sp)
sd s0,256(sp)
addi s0,sp,272
sd a0,-264(s0)
sd a1,-272(s0)
la a5,__stack_chk_guard
ld a5,0(a5)
sd a5,-24(s0)
sw zero,-256(s0)
j .L2
.L3:
lw a5,-256(s0)
ld a4,-264(s0)
add a5,a4,a5
lbu a4,0(a5)
lw a5,-256(s0)
addi a3,s0,-16
add a5,a3,a5
sb a4,-216(a5)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
.L2:
lw a5,-256(s0)
ld a4,-264(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,47
bne a4,a5,.L3
lw a5,-256(s0)
addi a4,s0,-16
add a5,a4,a5
sb zero,-216(a5)
addi a5,s0,-232
mv a0,a5
call atoi@plt
mv a5,a0
sw a5,-248(s0)
sw zero,-252(s0)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
j .L4
.L5:
lw a5,-256(s0)
ld a4,-264(s0)
add a5,a4,a5
lbu a4,0(a5)
lw a5,-252(s0)
addi a3,s0,-16
add a5,a3,a5
sb a4,-112(a5)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
lw a5,-252(s0)
addiw a5,a5,1
sw a5,-252(s0)
.L4:
lw a5,-256(s0)
ld a4,-264(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L5
lw a5,-252(s0)
addi a4,s0,-16
add a5,a4,a5
sb zero,-112(a5)
addi a5,s0,-128
mv a0,a5
call atoi@plt
mv a5,a0
sw a5,-244(s0)
sw zero,-256(s0)
j .L6
.L7:
lw a5,-256(s0)
ld a4,-272(s0)
add a5,a4,a5
lbu a4,0(a5)
lw a5,-256(s0)
addi a3,s0,-16
add a5,a3,a5
sb a4,-216(a5)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
.L6:
lw a5,-256(s0)
ld a4,-272(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,47
bne a4,a5,.L7
lw a5,-256(s0)
addi a4,s0,-16
add a5,a4,a5
sb zero,-216(a5)
addi a5,s0,-232
mv a0,a5
call atoi@plt
mv a5,a0
sw a5,-240(s0)
sw zero,-252(s0)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
j .L8
.L9:
lw a5,-256(s0)
ld a4,-272(s0)
add a5,a4,a5
lbu a4,0(a5)
lw a5,-252(s0)
addi a3,s0,-16
add a5,a3,a5
sb a4,-112(a5)
lw a5,-256(s0)
addiw a5,a5,1
sw a5,-256(s0)
lw a5,-252(s0)
addiw a5,a5,1
sw a5,-252(s0)
.L8:
lw a5,-256(s0)
ld a4,-272(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L9
lw a5,-252(s0)
addi a4,s0,-16
add a5,a4,a5
sb zero,-112(a5)
addi a5,s0,-128
mv a0,a5
call atoi@plt
mv a5,a0
sw a5,-236(s0)
lw a4,-248(s0)
lw a5,-240(s0)
mulw a5,a4,a5
sext.w a3,a5
lw a4,-244(s0)
lw a5,-236(s0)
mulw a5,a4,a5
sext.w a5,a5
mv a4,a3
remw a5,a4,a5
sext.w a5,a5
bnez a5,.L10
li a5,1
j .L12
.L10:
li a5,0
.L12:
mv a3,a5
la a5,__stack_chk_guard
ld a4,-24(s0)
ld a5,0(a5)
beq a4,a5,.L13
call __stack_chk_fail@plt
.L13:
mv a0,a3
ld ra,264(sp)
ld s0,256(sp)
addi sp,sp,272
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem44/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -8[rbp], 0
jmp .L2
.L7:
mov eax, DWORD PTR -8[rbp]
add eax, 1
mov DWORD PTR -4[rbp], eax
jmp .L3
.L6:
mov eax, DWORD PTR -8[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
mov eax, DWORD PTR [rax]
add eax, edx
test eax, eax
jne .L4
mov eax, 1
jmp .L5
.L4:
add DWORD PTR -4[rbp], 1
.L3:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L6
add DWORD PTR -8[rbp], 1
.L2:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L7
mov eax, 0
.L5:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-24(s0)
j .L2
.L7:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-20(s0)
j .L3
.L6:
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a3,-40(s0)
add a5,a3,a5
lw a5,0(a5)
addw a5,a4,a5
sext.w a5,a5
bnez a5,.L4
li a5,1
j .L5
.L4:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L3:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L2:
lw a4,-24(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L7
li a5,0
.L5:
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem55/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -8[rbp], eax
mov rax, QWORD PTR -48[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -4[rbp], eax
mov DWORD PTR -24[rbp], 0
jmp .L2
.L9:
mov BYTE PTR -26[rbp], 0
mov DWORD PTR -20[rbp], 0
jmp .L3
.L6:
mov eax, DWORD PTR -24[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -20[rbp]
movsx rcx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rcx
movzx eax, BYTE PTR [rax]
cmp dl, al
jne .L4
mov BYTE PTR -26[rbp], 1
jmp .L5
.L4:
add DWORD PTR -20[rbp], 1
.L3:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -4[rbp]
jl .L6
.L5:
movzx eax, BYTE PTR -26[rbp]
xor eax, 1
test al, al
je .L7
mov eax, 0
jmp .L8
.L7:
add DWORD PTR -24[rbp], 1
.L2:
mov eax, DWORD PTR -24[rbp]
cmp eax, DWORD PTR -8[rbp]
jl .L9
mov DWORD PTR -16[rbp], 0
jmp .L10
.L16:
mov BYTE PTR -25[rbp], 0
mov DWORD PTR -12[rbp], 0
jmp .L11
.L14:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -12[rbp]
movsx rcx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rcx
movzx eax, BYTE PTR [rax]
cmp dl, al
jne .L12
mov BYTE PTR -25[rbp], 1
jmp .L13
.L12:
add DWORD PTR -12[rbp], 1
.L11:
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -8[rbp]
jl .L14
.L13:
movzx eax, BYTE PTR -25[rbp]
xor eax, 1
test al, al
je .L15
mov eax, 0
jmp .L8
.L15:
add DWORD PTR -16[rbp], 1
.L10:
mov eax, DWORD PTR -16[rbp]
cmp eax, DWORD PTR -4[rbp]
jl .L16
mov eax, 1
.L8:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
sd a1,-64(s0)
ld a0,-56(s0)
call strlen@plt
mv a5,a0
sw a5,-24(s0)
ld a0,-64(s0)
call strlen@plt
mv a5,a0
sw a5,-20(s0)
sw zero,-40(s0)
j .L2
.L9:
sb zero,-42(s0)
sw zero,-36(s0)
j .L3
.L6:
lw a5,-40(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a3,0(a5)
lw a5,-36(s0)
ld a4,-64(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a3
bne a4,a5,.L4
li a5,1
sb a5,-42(s0)
j .L5
.L4:
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L3:
lw a4,-36(s0)
lw a5,-20(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
.L5:
lbu a5,-42(s0)
xori a5,a5,1
andi a5,a5,0xff
beqz a5,.L7
li a5,0
j .L8
.L7:
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-40(s0)
.L2:
lw a4,-40(s0)
lw a5,-24(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L9
sw zero,-32(s0)
j .L10
.L16:
sb zero,-41(s0)
sw zero,-28(s0)
j .L11
.L14:
lw a5,-32(s0)
ld a4,-64(s0)
add a5,a4,a5
lbu a3,0(a5)
lw a5,-28(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a3
bne a4,a5,.L12
li a5,1
sb a5,-41(s0)
j .L13
.L12:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L11:
lw a4,-28(s0)
lw a5,-24(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L14
.L13:
lbu a5,-41(s0)
xori a5,a5,1
andi a5,a5,0xff
beqz a5,.L15
li a5,0
j .L8
.L15:
lw a5,-32(s0)
addiw a5,a5,1
sw a5,-32(s0)
.L10:
lw a4,-32(s0)
lw a5,-20(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L16
li a5,1
.L8:
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem61/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov DWORD PTR -4[rbp], edi
mov eax, DWORD PTR -4[rbp]
add eax, 1
imul eax, DWORD PTR -4[rbp]
mov edx, eax
shr edx, 31
add eax, edx
sar eax
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-32
sd s0,24(sp)
addi s0,sp,32
mv a5,a0
sw a5,-20(s0)
lw a5,-20(s0)
addiw a5,a5,1
sext.w a5,a5
lw a4,-20(s0)
mulw a5,a4,a5
sext.w a5,a5
srliw a4,a5,31
addw a5,a4,a5
sraiw a5,a5,1
sext.w a5,a5
mv a0,a5
ld s0,24(sp)
addi sp,sp,32
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem10/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
cmp DWORD PTR -28[rbp], 0
jg .L2
mov eax, 0
jmp .L3
.L2:
mov eax, DWORD PTR -28[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
cmp QWORD PTR -8[rbp], 0
jne .L4
mov eax, 0
jmp .L3
.L4:
mov rax, QWORD PTR -24[rbp]
mov eax, DWORD PTR [rax]
mov DWORD PTR -16[rbp], eax
mov DWORD PTR -12[rbp], 0
jmp .L5
.L7:
mov eax, DWORD PTR -12[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp DWORD PTR -16[rbp], eax
jge .L6
mov eax, DWORD PTR -12[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -16[rbp], eax
.L6:
mov eax, DWORD PTR -12[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -16[rbp]
mov DWORD PTR [rdx], eax
add DWORD PTR -12[rbp], 1
.L5:
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L7
mov rax, QWORD PTR -8[rbp]
.L3:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
lw a5,-44(s0)
sext.w a5,a5
bgtz a5,.L2
li a5,0
j .L3
.L2:
lw a5,-44(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
ld a5,-24(s0)
bnez a5,.L4
li a5,0
j .L3
.L4:
ld a5,-40(s0)
lw a5,0(a5)
sw a5,-32(s0)
sw zero,-28(s0)
j .L5
.L7:
lw a5,-28(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-32(s0)
sext.w a5,a5
bge a5,a4,.L6
lw a5,-28(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-32(s0)
.L6:
lw a5,-28(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,-32(s0)
sw a4,0(a5)
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L5:
lw a4,-28(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L7
ld a5,-24(s0)
.L3:
mv a0,a5
ld ra,40(sp)
ld s0,32(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem56/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 4048
mov DWORD PTR -4036[rbp], edi
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rdx, -4016[rbp]
mov eax, 0
mov ecx, 500
mov rdi, rdx
rep stosq
mov DWORD PTR -4016[rbp], 0
mov DWORD PTR -4012[rbp], 1
mov DWORD PTR -4020[rbp], 2
jmp .L2
.L3:
mov eax, DWORD PTR -4020[rbp]
sub eax, 1
cdqe
mov edx, DWORD PTR -4016[rbp+rax*4]
mov eax, DWORD PTR -4020[rbp]
sub eax, 2
cdqe
mov eax, DWORD PTR -4016[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -4020[rbp]
cdqe
mov DWORD PTR -4016[rbp+rax*4], edx
add DWORD PTR -4020[rbp], 1
.L2:
mov eax, DWORD PTR -4020[rbp]
cmp eax, DWORD PTR -4036[rbp]
jle .L3
mov eax, DWORD PTR -4036[rbp]
cdqe
mov eax, DWORD PTR -4016[rbp+rax*4]
mov rsi, QWORD PTR -8[rbp]
xor rsi, QWORD PTR fs:40
je .L5
call __stack_chk_fail@PLT
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-2032
sd ra,2024(sp)
sd s0,2016(sp)
addi s0,sp,2032
addi sp,sp,-2016
mv a4,a0
li a5,-4096
addi a3,s0,-16
add a5,a3,a5
sw a4,76(a5)
la a5,__stack_chk_guard
ld a5,0(a5)
sd a5,-24(s0)
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
addi a4,a5,88
li a5,4096
addi a5,a5,-96
mv a2,a5
li a1,0
mv a0,a4
call memset@plt
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
sw zero,88(a5)
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
li a4,1
sw a4,92(a5)
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
li a4,2
sw a4,84(a5)
j .L2
.L3:
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
lw a5,84(a5)
addiw a5,a5,-1
sext.w a5,a5
li a4,-4096
addi a3,s0,-16
add a4,a3,a4
slli a5,a5,2
add a5,a4,a5
lw a4,88(a5)
li a5,-4096
addi a3,s0,-16
add a5,a3,a5
lw a5,84(a5)
addiw a5,a5,-2
sext.w a5,a5
li a3,-4096
addi a2,s0,-16
add a3,a2,a3
slli a5,a5,2
add a5,a3,a5
lw a5,88(a5)
addw a5,a4,a5
sext.w a4,a5
li a5,-4096
addi a3,s0,-16
add a3,a3,a5
li a5,-4096
addi a2,s0,-16
add a5,a2,a5
lw a5,84(a5)
slli a5,a5,2
add a5,a3,a5
sw a4,88(a5)
li a5,-4096
addi a4,s0,-16
add a5,a4,a5
li a4,-4096
addi a3,s0,-16
add a4,a3,a4
lw a4,84(a4)
addiw a4,a4,1
sw a4,84(a5)
.L2:
li a5,-4096
addi a4,s0,-16
add a4,a4,a5
li a5,-4096
addi a3,s0,-16
add a5,a3,a5
lw a4,84(a4)
lw a5,76(a5)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L3
li a5,-4096
addi a4,s0,-16
add a4,a4,a5
li a5,-4096
addi a3,s0,-16
add a5,a3,a5
lw a5,76(a5)
slli a5,a5,2
add a5,a4,a5
lw a5,88(a5)
mv a3,a5
la a5,__stack_chk_guard
ld a4,-24(s0)
ld a5,0(a5)
beq a4,a5,.L5
call __stack_chk_fail@plt
.L5:
mv a0,a3
addi sp,sp,2016
ld ra,2024(sp)
ld s0,2016(sp)
addi sp,sp,2032
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem11/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -12[rbp], eax
mov eax, DWORD PTR -12[rbp]
add eax, eax
add eax, 1
cdqe
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
cmp QWORD PTR -8[rbp], 0
jne .L2
mov eax, 0
jmp .L3
.L2:
mov DWORD PTR -24[rbp], 0
jmp .L4
.L12:
mov DWORD PTR -16[rbp], 1
mov DWORD PTR -20[rbp], 0
jmp .L5
.L8:
mov edx, DWORD PTR -24[rbp]
mov eax, DWORD PTR -20[rbp]
add eax, edx
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -12[rbp]
sub eax, 1
sub eax, DWORD PTR -20[rbp]
movsx rcx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rcx
movzx eax, BYTE PTR [rax]
cmp dl, al
je .L6
mov DWORD PTR -16[rbp], 0
jmp .L7
.L6:
add DWORD PTR -20[rbp], 1
.L5:
mov eax, DWORD PTR -12[rbp]
sub eax, DWORD PTR -24[rbp]
mov edx, eax
shr edx, 31
add eax, edx
sar eax
cmp DWORD PTR -20[rbp], eax
jl .L8
.L7:
cmp DWORD PTR -16[rbp], 0
je .L9
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rcx, QWORD PTR -40[rbp]
mov rax, QWORD PTR -8[rbp]
mov rsi, rcx
mov rdi, rax
call strncpy@PLT
mov DWORD PTR -20[rbp], 0
jmp .L10
.L11:
mov eax, DWORD PTR -24[rbp]
sub eax, DWORD PTR -20[rbp]
cdqe
lea rdx, -1[rax]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov ecx, DWORD PTR -12[rbp]
mov edx, DWORD PTR -20[rbp]
add edx, ecx
movsx rcx, edx
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
movzx eax, BYTE PTR [rax]
mov BYTE PTR [rdx], al
add DWORD PTR -20[rbp], 1
.L10:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -24[rbp]
jl .L11
mov edx, DWORD PTR -12[rbp]
mov eax, DWORD PTR -24[rbp]
add eax, edx
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
mov rax, QWORD PTR -8[rbp]
jmp .L3
.L9:
add DWORD PTR -24[rbp], 1
.L4:
mov eax, DWORD PTR -24[rbp]
cmp eax, DWORD PTR -12[rbp]
jl .L12
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rcx, QWORD PTR -40[rbp]
mov rax, QWORD PTR -8[rbp]
mov rsi, rcx
mov rdi, rax
call strncpy@PLT
mov DWORD PTR -20[rbp], 0
jmp .L13
.L14:
mov eax, DWORD PTR -12[rbp]
sub eax, DWORD PTR -20[rbp]
cdqe
lea rdx, -1[rax]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov ecx, DWORD PTR -12[rbp]
mov edx, DWORD PTR -20[rbp]
add edx, ecx
movsx rcx, edx
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
movzx eax, BYTE PTR [rax]
mov BYTE PTR [rdx], al
add DWORD PTR -20[rbp], 1
.L13:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -12[rbp]
jl .L14
mov eax, DWORD PTR -12[rbp]
add eax, eax
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
mov rax, QWORD PTR -8[rbp]
.L3:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
ld a0,-56(s0)
call strlen@plt
mv a5,a0
sw a5,-28(s0)
lw a5,-28(s0)
slliw a5,a5,1
sext.w a5,a5
addiw a5,a5,1
sext.w a5,a5
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
ld a5,-24(s0)
bnez a5,.L2
li a5,0
j .L3
.L2:
sw zero,-40(s0)
j .L4
.L12:
li a5,1
sw a5,-32(s0)
sw zero,-36(s0)
j .L5
.L8:
lw a4,-40(s0)
lw a5,-36(s0)
addw a5,a4,a5
sext.w a5,a5
mv a4,a5
ld a5,-56(s0)
add a5,a5,a4
lbu a3,0(a5)
lw a5,-28(s0)
addiw a5,a5,-1
sext.w a4,a5
lw a5,-36(s0)
subw a5,a4,a5
sext.w a5,a5
mv a4,a5
ld a5,-56(s0)
add a5,a5,a4
lbu a5,0(a5)
mv a4,a3
beq a4,a5,.L6
sw zero,-32(s0)
j .L7
.L6:
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L5:
lw a4,-28(s0)
lw a5,-40(s0)
subw a5,a4,a5
sext.w a5,a5
srliw a4,a5,31
addw a5,a4,a5
sraiw a5,a5,1
sext.w a4,a5
lw a5,-36(s0)
sext.w a5,a5
blt a5,a4,.L8
.L7:
lw a5,-32(s0)
sext.w a5,a5
beqz a5,.L9
lw a5,-28(s0)
mv a2,a5
ld a1,-56(s0)
ld a0,-24(s0)
call strncpy@plt
sw zero,-36(s0)
j .L10
.L11:
lw a4,-40(s0)
lw a5,-36(s0)
subw a5,a4,a5
sext.w a5,a5
addi a5,a5,-1
ld a4,-56(s0)
add a4,a4,a5
lw a3,-28(s0)
lw a5,-36(s0)
addw a5,a3,a5
sext.w a5,a5
mv a3,a5
ld a5,-24(s0)
add a5,a5,a3
lbu a4,0(a4)
sb a4,0(a5)
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L10:
lw a4,-36(s0)
lw a5,-40(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L11
lw a4,-28(s0)
lw a5,-40(s0)
addw a5,a4,a5
sext.w a5,a5
mv a4,a5
ld a5,-24(s0)
add a5,a5,a4
sb zero,0(a5)
ld a5,-24(s0)
j .L3
.L9:
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-40(s0)
.L4:
lw a4,-40(s0)
lw a5,-28(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L12
lw a5,-28(s0)
mv a2,a5
ld a1,-56(s0)
ld a0,-24(s0)
call strncpy@plt
sw zero,-36(s0)
j .L13
.L14:
lw a4,-28(s0)
lw a5,-36(s0)
subw a5,a4,a5
sext.w a5,a5
addi a5,a5,-1
ld a4,-56(s0)
add a4,a4,a5
lw a3,-28(s0)
lw a5,-36(s0)
addw a5,a3,a5
sext.w a5,a5
mv a3,a5
ld a5,-24(s0)
add a5,a5,a3
lbu a4,0(a4)
sb a4,0(a5)
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L13:
lw a4,-36(s0)
lw a5,-28(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L14
lw a5,-28(s0)
slliw a5,a5,1
sext.w a5,a5
mv a4,a5
ld a5,-24(s0)
add a5,a5,a4
sb zero,0(a5)
ld a5,-24(s0)
.L3:
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem5/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
pxor xmm0, xmm0
movss DWORD PTR -16[rbp], xmm0
mov DWORD PTR -8[rbp], 0
mov DWORD PTR -8[rbp], 0
jmp .L2
.L3:
mov eax, DWORD PTR -8[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movss xmm0, DWORD PTR [rax]
movss xmm1, DWORD PTR -16[rbp]
addss xmm0, xmm1
movss DWORD PTR -16[rbp], xmm0
add DWORD PTR -8[rbp], 1
.L2:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L3
cvtsi2ss xmm1, DWORD PTR -28[rbp]
movss xmm0, DWORD PTR -16[rbp]
divss xmm0, xmm1
movss DWORD PTR -4[rbp], xmm0
pxor xmm0, xmm0
movss DWORD PTR -12[rbp], xmm0
mov DWORD PTR -8[rbp], 0
jmp .L4
.L5:
mov eax, DWORD PTR -8[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movss xmm0, DWORD PTR [rax]
subss xmm0, DWORD PTR -4[rbp]
movss xmm1, DWORD PTR .LC1[rip]
andps xmm0, xmm1
movss xmm1, DWORD PTR -12[rbp]
addss xmm0, xmm1
movss DWORD PTR -12[rbp], xmm0
add DWORD PTR -8[rbp], 1
.L4:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L5
cvtsi2ss xmm1, DWORD PTR -28[rbp]
movss xmm0, DWORD PTR -12[rbp]
divss xmm0, xmm1
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.section .rodata
.align 16
.LC1:
.long 2147483647
.long 0
.long 0
.long 0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-32(s0)
sw zero,-24(s0)
sw zero,-24(s0)
j .L2
.L3:
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa5,0(a5)
flw fa4,-32(s0)
fadd.s fa5,fa4,fa5
fsw fa5,-32(s0)
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L2:
lw a4,-24(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L3
lw a5,-44(s0)
fcvt.s.w fa5,a5
flw fa4,-32(s0)
fdiv.s fa5,fa4,fa5
fsw fa5,-20(s0)
sw zero,-28(s0)
sw zero,-24(s0)
j .L4
.L5:
lw a5,-24(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa4,0(a5)
flw fa5,-20(s0)
fsub.s fa5,fa4,fa5
fabs.s fa5,fa5
flw fa4,-28(s0)
fadd.s fa5,fa4,fa5
fsw fa5,-28(s0)
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L4:
lw a4,-24(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L5
lw a5,-44(s0)
fcvt.s.w fa5,a5
flw fa4,-28(s0)
fdiv.s fa5,fa4,fa5
fmv.s fa0,fa5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem15/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push rbx
sub rsp, 56
.cfi_offset 3, -24
mov QWORD PTR -56[rbp], rdi
mov QWORD PTR -64[rbp], rsi
mov rax, QWORD PTR -56[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -44[rbp], eax
mov eax, DWORD PTR -44[rbp]
cdqe
sal rax, 3
mov rdi, rax
call malloc@PLT
mov QWORD PTR -32[rbp], rax
mov eax, DWORD PTR -44[rbp]
add eax, 1
cdqe
mov rdi, rax
call malloc@PLT
mov QWORD PTR -40[rbp], rax
mov rax, QWORD PTR -40[rbp]
mov BYTE PTR [rax], 0
mov DWORD PTR -48[rbp], 0
jmp .L2
.L3:
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
mov QWORD PTR -24[rbp], rax
mov rax, QWORD PTR -24[rbp]
lea rdx, 2[rax]
mov rax, QWORD PTR -40[rbp]
mov rsi, rdx
mov rdi, rax
call realloc@PLT
mov QWORD PTR -40[rbp], rax
mov eax, DWORD PTR -48[rbp]
movsx rdx, eax
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rcx, QWORD PTR -40[rbp]
mov rdx, QWORD PTR -24[rbp]
add rdx, rcx
movzx eax, BYTE PTR [rax]
mov BYTE PTR [rdx], al
mov rax, QWORD PTR -24[rbp]
lea rdx, 1[rax]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
add rax, 1
mov edx, DWORD PTR -48[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*8]
mov rdx, QWORD PTR -32[rbp]
lea rbx, [rcx+rdx]
mov rdi, rax
call malloc@PLT
mov QWORD PTR [rbx], rax
mov eax, DWORD PTR -48[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -32[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
mov rdx, QWORD PTR -40[rbp]
mov rsi, rdx
mov rdi, rax
call strcpy@PLT
add DWORD PTR -48[rbp], 1
.L2:
mov eax, DWORD PTR -48[rbp]
cmp eax, DWORD PTR -44[rbp]
jl .L3
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call free@PLT
mov rax, QWORD PTR -64[rbp]
mov edx, DWORD PTR -44[rbp]
mov DWORD PTR [rax], edx
mov rax, QWORD PTR -32[rbp]
add rsp, 56
pop rbx
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-80
sd ra,72(sp)
sd s0,64(sp)
sd s1,56(sp)
addi s0,sp,80
sd a0,-72(s0)
sd a1,-80(s0)
ld a0,-72(s0)
call strlen@plt
mv a5,a0
sw a5,-60(s0)
lw a5,-60(s0)
slli a5,a5,3
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-48(s0)
lw a5,-60(s0)
addiw a5,a5,1
sext.w a5,a5
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-56(s0)
ld a5,-56(s0)
sb zero,0(a5)
sw zero,-64(s0)
j .L2
.L3:
ld a0,-56(s0)
call strlen@plt
sd a0,-40(s0)
ld a5,-40(s0)
addi a5,a5,2
mv a1,a5
ld a0,-56(s0)
call realloc@plt
sd a0,-56(s0)
lw a5,-64(s0)
ld a4,-72(s0)
add a4,a4,a5
ld a3,-56(s0)
ld a5,-40(s0)
add a5,a3,a5
lbu a4,0(a4)
sb a4,0(a5)
ld a5,-40(s0)
addi a5,a5,1
ld a4,-56(s0)
add a5,a4,a5
sb zero,0(a5)
ld a0,-56(s0)
call strlen@plt
mv a5,a0
addi a3,a5,1
lw a5,-64(s0)
slli a5,a5,3
ld a4,-48(s0)
add s1,a4,a5
mv a0,a3
call malloc@plt
mv a5,a0
sd a5,0(s1)
lw a5,-64(s0)
slli a5,a5,3
ld a4,-48(s0)
add a5,a4,a5
ld a5,0(a5)
ld a1,-56(s0)
mv a0,a5
call strcpy@plt
lw a5,-64(s0)
addiw a5,a5,1
sw a5,-64(s0)
.L2:
lw a4,-64(s0)
lw a5,-60(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L3
ld a0,-56(s0)
call free@plt
ld a5,-80(s0)
lw a4,-60(s0)
sw a4,0(a5)
ld a5,-48(s0)
mv a0,a5
ld ra,72(sp)
ld s0,64(sp)
ld s1,56(sp)
addi sp,sp,80
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem41/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -12[rbp], 0
jmp .L2
.L9:
mov eax, DWORD PTR -12[rbp]
add eax, 1
mov DWORD PTR -8[rbp], eax
jmp .L3
.L8:
mov eax, DWORD PTR -8[rbp]
add eax, 1
mov DWORD PTR -4[rbp], eax
jmp .L4
.L7:
mov eax, DWORD PTR -12[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 -8[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
add edx, eax
mov eax, DWORD PTR -4[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
add eax, edx
test eax, eax
jne .L5
mov eax, 1
jmp .L6
.L5:
add DWORD PTR -4[rbp], 1
.L4:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L7
add DWORD PTR -8[rbp], 1
.L3:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L8
add DWORD PTR -12[rbp], 1
.L2:
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L9
mov eax, 0
.L6:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-28(s0)
j .L2
.L9:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-24(s0)
j .L3
.L8:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-20(s0)
j .L4
.L7:
lw a5,-28(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-24(s0)
slli a5,a5,2
ld a3,-40(s0)
add a5,a3,a5
lw a5,0(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-20(s0)
slli a5,a5,2
ld a3,-40(s0)
add a5,a3,a5
lw a5,0(a5)
addw a5,a4,a5
sext.w a5,a5
bnez a5,.L5
li a5,1
j .L6
.L5:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L4:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L7
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L3:
lw a4,-24(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L8
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L2:
lw a4,-28(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L9
li a5,0
.L6:
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem107/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov DWORD PTR -36[rbp], edi
mov eax, DWORD PTR -36[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
mov DWORD PTR -20[rbp], 0
mov DWORD PTR -16[rbp], 1
mov DWORD PTR -12[rbp], 1
jmp .L2
.L5:
mov eax, DWORD PTR -12[rbp]
add DWORD PTR -20[rbp], eax
mov eax, DWORD PTR -16[rbp]
imul eax, DWORD PTR -12[rbp]
mov DWORD PTR -16[rbp], eax
mov eax, DWORD PTR -12[rbp]
and eax, 1
test eax, eax
jne .L3
mov eax, DWORD PTR -12[rbp]
cdqe
sal rax, 2
lea rdx, -4[rax]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -16[rbp]
mov DWORD PTR [rdx], eax
jmp .L4
.L3:
mov eax, DWORD PTR -12[rbp]
cdqe
sal rax, 2
lea rdx, -4[rax]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -20[rbp]
mov DWORD PTR [rdx], eax
.L4:
add DWORD PTR -12[rbp], 1
.L2:
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -36[rbp]
jle .L5
mov rax, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
mv a5,a0
sw a5,-52(s0)
lw a5,-52(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
sw zero,-36(s0)
li a5,1
sw a5,-32(s0)
li a5,1
sw a5,-28(s0)
j .L2
.L5:
lw a4,-36(s0)
lw a5,-28(s0)
addw a5,a4,a5
sw a5,-36(s0)
lw a4,-32(s0)
lw a5,-28(s0)
mulw a5,a4,a5
sw a5,-32(s0)
lw a5,-28(s0)
andi a5,a5,1
sext.w a5,a5
bnez a5,.L3
lw a5,-28(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-24(s0)
add a5,a4,a5
lw a4,-32(s0)
sw a4,0(a5)
j .L4
.L3:
lw a5,-28(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-24(s0)
add a5,a4,a5
lw a4,-36(s0)
sw a4,0(a5)
.L4:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L2:
lw a4,-28(s0)
lw a5,-52(s0)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L5
ld a5,-24(s0)
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem110/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -8[rbp], 0
cmp DWORD PTR -28[rbp], 0
jne .L2
mov eax, 1
jmp .L3
.L2:
mov DWORD PTR -4[rbp], 1
jmp .L4
.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
sal rax, 2
lea rcx, -4[rax]
mov rax, QWORD PTR -24[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jge .L5
add DWORD PTR -8[rbp], 1
.L5:
add DWORD PTR -4[rbp], 1
.L4:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L6
mov eax, DWORD PTR -28[rbp]
cdqe
sal rax, 2
lea rdx, -4[rax]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov rax, QWORD PTR -24[rbp]
mov eax, DWORD PTR [rax]
cmp edx, eax
jle .L7
add DWORD PTR -8[rbp], 1
.L7:
cmp DWORD PTR -8[rbp], 1
jg .L8
mov eax, 1
jmp .L3
.L8:
mov eax, 0
.L3:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-24(s0)
lw a5,-44(s0)
sext.w a5,a5
bnez a5,.L2
li a5,1
j .L3
.L2:
li a5,1
sw a5,-20(s0)
j .L4
.L6:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bge a4,a5,.L5
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L5:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L4:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
lw a5,-44(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
ld a5,-40(s0)
lw a5,0(a5)
ble a4,a5,.L7
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L7:
lw a5,-24(s0)
sext.w a4,a5
li a5,1
bgt a4,a5,.L8
li a5,1
j .L3
.L8:
li a5,0
.L3:
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem119/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "AEIOUaeiou"
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
lea rax, .LC0[rip]
mov QWORD PTR -16[rbp], rax
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -8[rbp]
sub eax, 2
mov DWORD PTR -20[rbp], eax
jmp .L2
.L5:
mov eax, DWORD PTR -20[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
movsx edx, al
mov rax, QWORD PTR -16[rbp]
mov esi, edx
mov rdi, rax
call strchr@PLT
test rax, rax
je .L3
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 1[rax]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
movsx edx, al
mov rax, QWORD PTR -16[rbp]
mov esi, edx
mov rdi, rax
call strchr@PLT
test rax, rax
jne .L3
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, -1[rax]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
movsx edx, al
mov rax, QWORD PTR -16[rbp]
mov esi, edx
mov rdi, rax
call strchr@PLT
test rax, rax
jne .L3
mov eax, DWORD PTR -20[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
mov BYTE PTR out.2496[rip], al
lea rax, out.2496[rip]
jmp .L4
.L3:
sub DWORD PTR -20[rbp], 1
.L2:
cmp DWORD PTR -20[rbp], 0
jg .L5
mov BYTE PTR out.2496[rip], 0
lea rax, out.2496[rip]
.L4:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.local out.2496
.comm out.2496,2,1
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "AEIOUaeiou"
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
lla a5,.LC0
sd a5,-32(s0)
ld a0,-56(s0)
call strlen@plt
sd a0,-24(s0)
ld a5,-24(s0)
sext.w a5,a5
addiw a5,a5,-2
sext.w a5,a5
sw a5,-36(s0)
j .L2
.L5:
lw a5,-36(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
sext.w a5,a5
mv a1,a5
ld a0,-32(s0)
call strchr@plt
mv a5,a0
beqz a5,.L3
lw a5,-36(s0)
addi a5,a5,1
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
sext.w a5,a5
mv a1,a5
ld a0,-32(s0)
call strchr@plt
mv a5,a0
bnez a5,.L3
lw a5,-36(s0)
addi a5,a5,-1
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
sext.w a5,a5
mv a1,a5
ld a0,-32(s0)
call strchr@plt
mv a5,a0
bnez a5,.L3
lw a5,-36(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a4,0(a5)
lla a5,out.2084
sb a4,0(a5)
lla a5,out.2084
j .L4
.L3:
lw a5,-36(s0)
addiw a5,a5,-1
sw a5,-36(s0)
.L2:
lw a5,-36(s0)
sext.w a5,a5
bgtz a5,.L5
lla a5,out.2084
sb zero,0(a5)
lla a5,out.2084
.L4:
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.local out.2084
.comm out.2084,2,8
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem153/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov QWORD PTR -32[rbp], rsi
mov QWORD PTR -40[rbp], rdx
mov DWORD PTR -44[rbp], ecx
mov DWORD PTR -4[rbp], 0
jmp .L2
.L3:
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 -32[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
sub edx, eax
mov eax, edx
mov edx, DWORD PTR -4[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -40[rbp]
add rcx, rdx
cdq
xor eax, edx
sub eax, edx
mov DWORD PTR [rcx], eax
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -44[rbp]
jl .L3
nop
nop
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd s0,56(sp)
addi s0,sp,64
sd a0,-40(s0)
sd a1,-48(s0)
sd a2,-56(s0)
mv a5,a3
sw a5,-60(s0)
sw zero,-20(s0)
j .L2
.L3:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a3,-48(s0)
add a5,a3,a5
lw a5,0(a5)
subw a5,a4,a5
sext.w a4,a5
lw a5,-20(s0)
slli a5,a5,2
ld a3,-56(s0)
add a3,a3,a5
sraiw a5,a4,31
xor a4,a4,a5
subw a5,a4,a5
sext.w a5,a5
sw a5,0(a3)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-20(s0)
lw a5,-60(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L3
nop
nop
ld s0,56(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem136/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -8[rbp], -1
mov DWORD PTR -4[rbp], 1
jmp .L2
.L4:
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
sal rax, 2
lea rcx, -4[rax]
mov rax, QWORD PTR -24[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jge .L3
mov eax, DWORD PTR -4[rbp]
mov DWORD PTR -8[rbp], eax
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L4
mov eax, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
li a5,-1
sw a5,-24(s0)
li a5,1
sw a5,-20(s0)
j .L2
.L4:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-4
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bge a4,a5,.L3
lw a5,-20(s0)
sw a5,-24(s0)
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L4
lw a5,-24(s0)
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem151/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov DWORD PTR -20[rbp], edi
mov DWORD PTR -24[rbp], esi
mov DWORD PTR -28[rbp], edx
mov DWORD PTR -8[rbp], 1
cmp DWORD PTR -20[rbp], 1
jg .L2
mov DWORD PTR -8[rbp], 0
.L2:
mov DWORD PTR -4[rbp], 2
jmp .L3
.L5:
mov eax, DWORD PTR -20[rbp]
cdq
idiv DWORD PTR -4[rbp]
mov eax, edx
test eax, eax
jne .L4
mov DWORD PTR -8[rbp], 0
.L4:
add DWORD PTR -4[rbp], 1
.L3:
mov eax, DWORD PTR -4[rbp]
imul eax, eax
cmp DWORD PTR -20[rbp], eax
jge .L5
cmp DWORD PTR -8[rbp], 0
je .L6
mov eax, DWORD PTR -24[rbp]
jmp .L7
.L6:
mov eax, DWORD PTR -28[rbp]
.L7:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
mv a5,a0
mv a3,a1
mv a4,a2
sw a5,-36(s0)
mv a5,a3
sw a5,-40(s0)
mv a5,a4
sw a5,-44(s0)
li a5,1
sw a5,-24(s0)
lw a5,-36(s0)
sext.w a4,a5
li a5,1
bgt a4,a5,.L2
sw zero,-24(s0)
.L2:
li a5,2
sw a5,-20(s0)
j .L3
.L5:
lw a4,-36(s0)
lw a5,-20(s0)
remw a5,a4,a5
sext.w a5,a5
bnez a5,.L4
sw zero,-24(s0)
.L4:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L3:
lw a5,-20(s0)
mulw a5,a5,a5
sext.w a4,a5
lw a5,-36(s0)
sext.w a5,a5
bge a5,a4,.L5
lw a5,-24(s0)
sext.w a5,a5
beqz a5,.L6
lw a5,-40(s0)
j .L7
.L6:
lw a5,-44(s0)
.L7:
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem158/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movss DWORD PTR -4[rbp], xmm0
movss DWORD PTR -8[rbp], xmm1
movss DWORD PTR -12[rbp], xmm2
movss xmm0, DWORD PTR -4[rbp]
movaps xmm1, xmm0
mulss xmm1, xmm0
movss xmm0, DWORD PTR -8[rbp]
mulss xmm0, xmm0
addss xmm1, xmm0
movss xmm0, DWORD PTR -12[rbp]
mulss xmm0, xmm0
subss xmm1, xmm0
movaps xmm0, xmm1
movss xmm1, DWORD PTR .LC0[rip]
andps xmm0, xmm1
cvtss2sd xmm1, xmm0
movsd xmm0, QWORD PTR .LC1[rip]
comisd xmm0, xmm1
ja .L2
movss xmm0, DWORD PTR -4[rbp]
movaps xmm1, xmm0
mulss xmm1, xmm0
movss xmm0, DWORD PTR -12[rbp]
mulss xmm0, xmm0
addss xmm1, xmm0
movss xmm0, DWORD PTR -8[rbp]
mulss xmm0, xmm0
subss xmm1, xmm0
movaps xmm0, xmm1
movss xmm1, DWORD PTR .LC0[rip]
andps xmm0, xmm1
cvtss2sd xmm1, xmm0
movsd xmm0, QWORD PTR .LC1[rip]
comisd xmm0, xmm1
ja .L2
movss xmm0, DWORD PTR -8[rbp]
movaps xmm1, xmm0
mulss xmm1, xmm0
movss xmm0, DWORD PTR -12[rbp]
mulss xmm0, xmm0
addss xmm1, xmm0
movss xmm0, DWORD PTR -4[rbp]
mulss xmm0, xmm0
subss xmm1, xmm0
movaps xmm0, xmm1
movss xmm1, DWORD PTR .LC0[rip]
andps xmm0, xmm1
cvtss2sd xmm1, xmm0
movsd xmm0, QWORD PTR .LC1[rip]
comisd xmm0, xmm1
jbe .L6
.L2:
mov eax, 1
jmp .L5
.L6:
mov eax, 0
.L5:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.section .rodata
.align 16
.LC0:
.long 2147483647
.long 0
.long 0
.long 0
.align 8
.LC1:
.long 3944497965
.long 1058682594
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-32
sd s0,24(sp)
addi s0,sp,32
fsw fa0,-20(s0)
fsw fa1,-24(s0)
fsw fa2,-28(s0)
flw fa5,-20(s0)
fmul.s fa4,fa5,fa5
flw fa5,-24(s0)
fmul.s fa5,fa5,fa5
fadd.s fa4,fa4,fa5
flw fa5,-28(s0)
fmul.s fa5,fa5,fa5
fsub.s fa5,fa4,fa5
fabs.s fa5,fa5
fcvt.d.s fa4,fa5
lla a5,.LC0
fld fa5,0(a5)
flt.d a5,fa4,fa5
bnez a5,.L2
flw fa5,-20(s0)
fmul.s fa4,fa5,fa5
flw fa5,-28(s0)
fmul.s fa5,fa5,fa5
fadd.s fa4,fa4,fa5
flw fa5,-24(s0)
fmul.s fa5,fa5,fa5
fsub.s fa5,fa4,fa5
fabs.s fa5,fa5
fcvt.d.s fa4,fa5
lla a5,.LC0
fld fa5,0(a5)
flt.d a5,fa4,fa5
bnez a5,.L2
flw fa5,-24(s0)
fmul.s fa4,fa5,fa5
flw fa5,-28(s0)
fmul.s fa5,fa5,fa5
fadd.s fa4,fa4,fa5
flw fa5,-20(s0)
fmul.s fa5,fa5,fa5
fsub.s fa5,fa4,fa5
fabs.s fa5,fa5
fcvt.d.s fa4,fa5
lla a5,.LC0
fld fa5,0(a5)
flt.d a5,fa4,fa5
beqz a5,.L6
.L2:
li a5,1
j .L5
.L6:
li a5,0
.L5:
mv a0,a5
ld s0,24(sp)
addi sp,sp,32
jr ra
.size func0, .-func0
.section .rodata
.align 3
.LC0:
.word 3944497965
.word 1058682594
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem6/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -32[rbp], edx
mov QWORD PTR -40[rbp], rcx
cmp DWORD PTR -28[rbp], 0
jle .L2
mov eax, DWORD PTR -28[rbp]
add eax, eax
lea edx, -1[rax]
jmp .L3
.L2:
mov edx, 0
.L3:
mov rax, QWORD PTR -40[rbp]
mov DWORD PTR [rax], edx
mov rax, QWORD PTR -40[rbp]
mov eax, DWORD PTR [rax]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
cmp DWORD PTR -28[rbp], 0
jle .L4
mov rax, QWORD PTR -24[rbp]
mov edx, DWORD PTR [rax]
mov rax, QWORD PTR -8[rbp]
mov DWORD PTR [rax], edx
.L4:
mov DWORD PTR -16[rbp], 1
mov DWORD PTR -12[rbp], 1
jmp .L5
.L6:
mov eax, DWORD PTR -12[rbp]
lea edx, 1[rax]
mov DWORD PTR -12[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -32[rbp]
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -12[rbp]
lea edx, 1[rax]
mov DWORD PTR -12[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
add DWORD PTR -16[rbp], 1
.L5:
mov eax, DWORD PTR -16[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L6
mov rax, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-40(s0)
mv a5,a1
mv a4,a2
sd a3,-56(s0)
sw a5,-44(s0)
mv a5,a4
sw a5,-48(s0)
lw a5,-44(s0)
sext.w a5,a5
blez a5,.L2
lw a5,-44(s0)
slliw a5,a5,1
sext.w a5,a5
addiw a5,a5,-1
sext.w a5,a5
j .L3
.L2:
li a5,0
.L3:
ld a4,-56(s0)
sw a5,0(a4)
ld a5,-56(s0)
lw a5,0(a5)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
lw a5,-44(s0)
sext.w a5,a5
blez a5,.L4
ld a5,-40(s0)
lw a4,0(a5)
ld a5,-24(s0)
sw a4,0(a5)
.L4:
li a5,1
sw a5,-32(s0)
li a5,1
sw a5,-28(s0)
j .L5
.L6:
lw a5,-28(s0)
addiw a4,a5,1
sw a4,-28(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,-48(s0)
sw a4,0(a5)
lw a5,-32(s0)
slli a5,a5,2
ld a4,-40(s0)
add a4,a4,a5
lw a5,-28(s0)
addiw a3,a5,1
sw a3,-28(s0)
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
lw a5,-32(s0)
addiw a5,a5,1
sw a5,-32(s0)
.L5:
lw a4,-32(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
ld a5,-24(s0)
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem106/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string ""
.LC1:
.string "One"
.LC2:
.string "Two"
.LC3:
.string "Three"
.LC4:
.string "Four"
.LC5:
.string "Five"
.LC6:
.string "Six"
.LC7:
.string "Seven"
.LC8:
.string "Eight"
.LC9:
.string "Nine"
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 144
mov QWORD PTR -120[rbp], rdi
mov DWORD PTR -124[rbp], esi
mov QWORD PTR -136[rbp], rdx
mov QWORD PTR -144[rbp], rcx
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rax, .LC0[rip]
mov QWORD PTR -96[rbp], rax
lea rax, .LC1[rip]
mov QWORD PTR -88[rbp], rax
lea rax, .LC2[rip]
mov QWORD PTR -80[rbp], rax
lea rax, .LC3[rip]
mov QWORD PTR -72[rbp], rax
lea rax, .LC4[rip]
mov QWORD PTR -64[rbp], rax
lea rax, .LC5[rip]
mov QWORD PTR -56[rbp], rax
lea rax, .LC6[rip]
mov QWORD PTR -48[rbp], rax
lea rax, .LC7[rip]
mov QWORD PTR -40[rbp], rax
lea rax, .LC8[rip]
mov QWORD PTR -32[rbp], rax
lea rax, .LC9[rip]
mov QWORD PTR -24[rbp], rax
mov DWORD PTR -108[rbp], 0
jmp .L2
.L6:
mov DWORD PTR -104[rbp], 0
jmp .L3
.L5:
mov eax, DWORD PTR -104[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -104[rbp]
cdqe
add rax, 1
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jle .L4
mov eax, DWORD PTR -104[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -100[rbp], eax
mov eax, DWORD PTR -104[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov edx, DWORD PTR -104[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -120[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -104[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rdx, rax
mov eax, DWORD PTR -100[rbp]
mov DWORD PTR [rdx], eax
.L4:
add DWORD PTR -104[rbp], 1
.L3:
mov eax, DWORD PTR -124[rbp]
sub eax, DWORD PTR -108[rbp]
sub eax, 1
cmp DWORD PTR -104[rbp], eax
jl .L5
add DWORD PTR -108[rbp], 1
.L2:
mov eax, DWORD PTR -124[rbp]
sub eax, 1
cmp DWORD PTR -108[rbp], eax
jl .L6
mov rax, QWORD PTR -144[rbp]
mov DWORD PTR [rax], 0
mov eax, DWORD PTR -124[rbp]
sub eax, 1
mov DWORD PTR -108[rbp], eax
jmp .L7
.L9:
mov eax, DWORD PTR -108[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
test eax, eax
jle .L8
mov eax, DWORD PTR -108[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp eax, 9
jg .L8
mov rax, QWORD PTR -144[rbp]
mov eax, DWORD PTR [rax]
lea edx, 1[rax]
mov rax, QWORD PTR -144[rbp]
mov DWORD PTR [rax], edx
.L8:
sub DWORD PTR -108[rbp], 1
.L7:
cmp DWORD PTR -108[rbp], 0
jns .L9
mov rax, QWORD PTR -144[rbp]
mov eax, DWORD PTR [rax]
cdqe
sal rax, 3
mov rdi, rax
call malloc@PLT
mov rdx, rax
mov rax, QWORD PTR -136[rbp]
mov QWORD PTR [rax], rdx
mov eax, DWORD PTR -124[rbp]
sub eax, 1
mov DWORD PTR -108[rbp], eax
mov DWORD PTR -104[rbp], 0
jmp .L10
.L13:
mov eax, DWORD PTR -108[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
test eax, eax
jle .L11
mov eax, DWORD PTR -108[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp eax, 9
jg .L11
mov eax, DWORD PTR -108[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -120[rbp]
add rax, rdx
mov ecx, DWORD PTR [rax]
mov rax, QWORD PTR -136[rbp]
mov rsi, QWORD PTR [rax]
mov eax, DWORD PTR -104[rbp]
lea edx, 1[rax]
mov DWORD PTR -104[rbp], edx
cdqe
sal rax, 3
lea rdx, [rsi+rax]
movsx rax, ecx
mov rax, QWORD PTR -96[rbp+rax*8]
mov QWORD PTR [rdx], rax
.L11:
sub DWORD PTR -108[rbp], 1
.L10:
cmp DWORD PTR -108[rbp], 0
js .L15
mov rax, QWORD PTR -144[rbp]
mov eax, DWORD PTR [rax]
cmp DWORD PTR -104[rbp], eax
jl .L13
.L15:
nop
mov rax, QWORD PTR -8[rbp]
xor rax, QWORD PTR fs:40
je .L14
call __stack_chk_fail@PLT
.L14:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.section .rodata
.align 3
.LC0:
.string ""
.align 3
.LC1:
.string "One"
.align 3
.LC2:
.string "Two"
.align 3
.LC3:
.string "Three"
.align 3
.LC4:
.string "Four"
.align 3
.LC5:
.string "Five"
.align 3
.LC6:
.string "Six"
.align 3
.LC7:
.string "Seven"
.align 3
.LC8:
.string "Eight"
.align 3
.LC9:
.string "Nine"
.text
.data
.align 3
.LC11:
.dword .LC0
.dword .LC1
.dword .LC2
.dword .LC3
.dword .LC4
.dword .LC5
.dword .LC6
.dword .LC7
.dword .LC8
.dword .LC9
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-160
sd ra,152(sp)
sd s0,144(sp)
addi s0,sp,160
sd a0,-136(s0)
mv a5,a1
sd a2,-152(s0)
sd a3,-160(s0)
sw a5,-140(s0)
la a5,__stack_chk_guard
ld a5,0(a5)
sd a5,-24(s0)
lla a5,.LC11
ld t3,0(a5)
ld t1,8(a5)
ld a7,16(a5)
ld a6,24(a5)
ld a0,32(a5)
ld a1,40(a5)
ld a2,48(a5)
ld a3,56(a5)
ld a4,64(a5)
ld a5,72(a5)
sd t3,-104(s0)
sd t1,-96(s0)
sd a7,-88(s0)
sd a6,-80(s0)
sd a0,-72(s0)
sd a1,-64(s0)
sd a2,-56(s0)
sd a3,-48(s0)
sd a4,-40(s0)
sd a5,-32(s0)
sw zero,-116(s0)
j .L2
.L6:
sw zero,-112(s0)
j .L3
.L5:
lw a5,-112(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-112(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
ble a4,a5,.L4
lw a5,-112(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-108(s0)
lw a5,-112(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-136(s0)
add a4,a4,a5
lw a5,-112(s0)
slli a5,a5,2
ld a3,-136(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
lw a5,-112(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a4,-108(s0)
sw a4,0(a5)
.L4:
lw a5,-112(s0)
addiw a5,a5,1
sw a5,-112(s0)
.L3:
lw a4,-140(s0)
lw a5,-116(s0)
subw a5,a4,a5
sext.w a5,a5
addiw a5,a5,-1
sext.w a4,a5
lw a5,-112(s0)
sext.w a5,a5
blt a5,a4,.L5
lw a5,-116(s0)
addiw a5,a5,1
sw a5,-116(s0)
.L2:
lw a5,-140(s0)
addiw a5,a5,-1
sext.w a4,a5
lw a5,-116(s0)
sext.w a5,a5
blt a5,a4,.L6
ld a5,-160(s0)
sw zero,0(a5)
lw a5,-140(s0)
addiw a5,a5,-1
sw a5,-116(s0)
j .L7
.L9:
lw a5,-116(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
blez a5,.L8
lw a5,-116(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a5
li a5,9
bgt a4,a5,.L8
ld a5,-160(s0)
lw a5,0(a5)
addiw a5,a5,1
sext.w a4,a5
ld a5,-160(s0)
sw a4,0(a5)
.L8:
lw a5,-116(s0)
addiw a5,a5,-1
sw a5,-116(s0)
.L7:
lw a5,-116(s0)
sext.w a5,a5
bgez a5,.L9
ld a5,-160(s0)
lw a5,0(a5)
slli a5,a5,3
mv a0,a5
call malloc@plt
mv a5,a0
mv a4,a5
ld a5,-152(s0)
sd a4,0(a5)
lw a5,-140(s0)
addiw a5,a5,-1
sw a5,-116(s0)
sw zero,-112(s0)
j .L10
.L13:
lw a5,-116(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
blez a5,.L11
lw a5,-116(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a5
li a5,9
bgt a4,a5,.L11
lw a5,-116(s0)
slli a5,a5,2
ld a4,-136(s0)
add a5,a4,a5
lw a3,0(a5)
ld a5,-152(s0)
ld a4,0(a5)
lw a5,-112(s0)
addiw a2,a5,1
sw a2,-112(s0)
slli a5,a5,3
add a4,a4,a5
slli a5,a3,3
addi a3,s0,-16
add a5,a3,a5
ld a5,-88(a5)
sd a5,0(a4)
.L11:
lw a5,-116(s0)
addiw a5,a5,-1
sw a5,-116(s0)
.L10:
lw a5,-116(s0)
sext.w a5,a5
bltz a5,.L15
ld a5,-160(s0)
lw a4,0(a5)
lw a5,-112(s0)
sext.w a5,a5
blt a5,a4,.L13
.L15:
nop
la a5,__stack_chk_guard
ld a4,-24(s0)
ld a5,0(a5)
beq a4,a5,.L14
call __stack_chk_fail@plt
.L14:
ld ra,152(sp)
ld s0,144(sp)
addi sp,sp,160
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem47/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 448
mov DWORD PTR -436[rbp], edi
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
mov DWORD PTR -416[rbp], 0
mov DWORD PTR -412[rbp], 0
mov DWORD PTR -408[rbp], 2
mov DWORD PTR -404[rbp], 0
mov DWORD PTR -420[rbp], 4
jmp .L2
.L3:
mov eax, DWORD PTR -420[rbp]
sub eax, 1
cdqe
mov edx, DWORD PTR -416[rbp+rax*4]
mov eax, DWORD PTR -420[rbp]
sub eax, 2
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -420[rbp]
sub eax, 3
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -420[rbp]
sub eax, 4
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -420[rbp]
cdqe
mov DWORD PTR -416[rbp+rax*4], edx
add DWORD PTR -420[rbp], 1
.L2:
mov eax, DWORD PTR -420[rbp]
cmp eax, DWORD PTR -436[rbp]
jle .L3
mov eax, DWORD PTR -436[rbp]
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
mov rcx, QWORD PTR -8[rbp]
xor rcx, QWORD PTR fs:40
je .L5
call __stack_chk_fail@PLT
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-448
sd ra,440(sp)
sd s0,432(sp)
addi s0,sp,448
mv a5,a0
sw a5,-436(s0)
la a5,__stack_chk_guard
ld a5,0(a5)
sd a5,-24(s0)
sw zero,-424(s0)
sw zero,-420(s0)
li a5,2
sw a5,-416(s0)
sw zero,-412(s0)
li a5,4
sw a5,-428(s0)
j .L2
.L3:
lw a5,-428(s0)
addiw a5,a5,-1
sext.w a5,a5
slli a5,a5,2
addi a4,s0,-16
add a5,a4,a5
lw a4,-408(a5)
lw a5,-428(s0)
addiw a5,a5,-2
sext.w a5,a5
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
lw a5,-408(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-428(s0)
addiw a5,a5,-3
sext.w a5,a5
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
lw a5,-408(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-428(s0)
addiw a5,a5,-4
sext.w a5,a5
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
lw a5,-408(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-428(s0)
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
sw a4,-408(a5)
lw a5,-428(s0)
addiw a5,a5,1
sw a5,-428(s0)
.L2:
lw a4,-428(s0)
lw a5,-436(s0)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L3
lw a5,-436(s0)
slli a5,a5,2
addi a4,s0,-16
add a5,a4,a5
lw a5,-408(a5)
mv a3,a5
la a5,__stack_chk_guard
ld a4,-24(s0)
ld a5,0(a5)
beq a4,a5,.L5
call __stack_chk_fail@plt
.L5:
mv a0,a3
ld ra,440(sp)
ld s0,432(sp)
addi sp,sp,448
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem92/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -16[rbp], 1
mov DWORD PTR -12[rbp], 0
mov DWORD PTR -8[rbp], 0
mov DWORD PTR -4[rbp], 0
jmp .L2
.L9:
call __ctype_b_loc@PLT
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -4[rbp]
movsx rcx, edx
mov rdx, QWORD PTR -24[rbp]
add rdx, rcx
movzx edx, BYTE PTR [rdx]
movsx rdx, dl
add rdx, rdx
add rax, rdx
movzx eax, WORD PTR [rax]
movzx eax, ax
and eax, 8192
test eax, eax
je .L3
cmp DWORD PTR -12[rbp], 0
je .L3
mov DWORD PTR -12[rbp], 0
add DWORD PTR -8[rbp], 1
.L3:
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 73
jne .L4
cmp DWORD PTR -16[rbp], 0
je .L4
mov DWORD PTR -12[rbp], 1
jmp .L5
.L4:
call __ctype_b_loc@PLT
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -4[rbp]
movsx rcx, edx
mov rdx, QWORD PTR -24[rbp]
add rdx, rcx
movzx edx, BYTE PTR [rdx]
movsx rdx, dl
add rdx, rdx
add rax, rdx
movzx eax, WORD PTR [rax]
movzx eax, ax
and eax, 8192
test eax, eax
jne .L5
mov DWORD PTR -12[rbp], 0
.L5:
call __ctype_b_loc@PLT
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -4[rbp]
movsx rcx, edx
mov rdx, QWORD PTR -24[rbp]
add rdx, rcx
movzx edx, BYTE PTR [rdx]
movsx rdx, dl
add rdx, rdx
add rax, rdx
movzx eax, WORD PTR [rax]
movzx eax, ax
and eax, 8192
test eax, eax
jne .L6
mov DWORD PTR -16[rbp], 0
.L6:
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 46
je .L7
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 63
je .L7
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 33
jne .L8
.L7:
mov DWORD PTR -16[rbp], 1
.L8:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L9
mov eax, DWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
addi s0,sp,48
sd a0,-40(s0)
li a5,1
sw a5,-32(s0)
sw zero,-28(s0)
sw zero,-24(s0)
sw zero,-20(s0)
j .L2
.L9:
call __ctype_b_loc@plt
mv a5,a0
ld a4,0(a5)
lw a5,-20(s0)
ld a3,-40(s0)
add a5,a3,a5
lbu a5,0(a5)
slli a5,a5,1
add a5,a4,a5
lhu a5,0(a5)
sext.w a4,a5
li a5,8192
and a5,a4,a5
sext.w a5,a5
beqz a5,.L3
lw a5,-28(s0)
sext.w a5,a5
beqz a5,.L3
sw zero,-28(s0)
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L3:
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,73
bne a4,a5,.L4
lw a5,-32(s0)
sext.w a5,a5
beqz a5,.L4
li a5,1
sw a5,-28(s0)
j .L5
.L4:
call __ctype_b_loc@plt
mv a5,a0
ld a4,0(a5)
lw a5,-20(s0)
ld a3,-40(s0)
add a5,a3,a5
lbu a5,0(a5)
slli a5,a5,1
add a5,a4,a5
lhu a5,0(a5)
sext.w a4,a5
li a5,8192
and a5,a4,a5
sext.w a5,a5
bnez a5,.L5
sw zero,-28(s0)
.L5:
call __ctype_b_loc@plt
mv a5,a0
ld a4,0(a5)
lw a5,-20(s0)
ld a3,-40(s0)
add a5,a3,a5
lbu a5,0(a5)
slli a5,a5,1
add a5,a4,a5
lhu a5,0(a5)
sext.w a4,a5
li a5,8192
and a5,a4,a5
sext.w a5,a5
bnez a5,.L6
sw zero,-32(s0)
.L6:
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,46
beq a4,a5,.L7
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,63
beq a4,a5,.L7
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,33
bne a4,a5,.L8
.L7:
li a5,1
sw a5,-32(s0)
.L8:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L9
lw a5,-24(s0)
mv a0,a5
ld ra,40(sp)
ld s0,32(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem52/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "AEIOUaeiou"
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
lea rax, .LC0[rip]
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -24[rbp]
mov QWORD PTR -16[rbp], rax
jmp .L2
.L4:
mov rax, QWORD PTR -24[rbp]
movzx eax, BYTE PTR [rax]
movsx edx, al
mov rax, QWORD PTR -8[rbp]
mov esi, edx
mov rdi, rax
call strchr@PLT
test rax, rax
jne .L3
mov rax, QWORD PTR -16[rbp]
lea rdx, 1[rax]
mov QWORD PTR -16[rbp], rdx
mov rdx, QWORD PTR -24[rbp]
movzx edx, BYTE PTR [rdx]
mov BYTE PTR [rax], dl
.L3:
add QWORD PTR -24[rbp], 1
.L2:
mov rax, QWORD PTR -24[rbp]
movzx eax, BYTE PTR [rax]
test al, al
jne .L4
mov rax, QWORD PTR -16[rbp]
mov BYTE PTR [rax], 0
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "AEIOUaeiou"
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
addi s0,sp,48
sd a0,-40(s0)
lla a5,.LC0
sd a5,-24(s0)
ld a5,-40(s0)
sd a5,-32(s0)
j .L2
.L4:
ld a5,-40(s0)
lbu a5,0(a5)
sext.w a5,a5
mv a1,a5
ld a0,-24(s0)
call strchr@plt
mv a5,a0
bnez a5,.L3
ld a5,-32(s0)
addi a4,a5,1
sd a4,-32(s0)
ld a4,-40(s0)
lbu a4,0(a4)
sb a4,0(a5)
.L3:
ld a5,-40(s0)
addi a5,a5,1
sd a5,-40(s0)
.L2:
ld a5,-40(s0)
lbu a5,0(a5)
bnez a5,.L4
ld a5,-32(s0)
sb zero,0(a5)
nop
ld ra,40(sp)
ld s0,32(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem24/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -4[rbp], 0
jmp .L2
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
movsx rdx, eax
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L3
mov eax, DWORD PTR -4[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
sw zero,-20(s0)
j .L2
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a5,-20(s0)
ld a4,-40(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L3
lw a5,-20(s0)
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem71/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -40[rbp], rdi
mov DWORD PTR -44[rbp], esi
mov QWORD PTR -56[rbp], rdx
mov DWORD PTR -24[rbp], 0
jmp .L2
.L6:
mov eax, DWORD PTR -24[rbp]
add eax, 1
mov DWORD PTR -20[rbp], eax
jmp .L3
.L5:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -20[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jle .L4
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -4[rbp], eax
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov edx, DWORD PTR -24[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -40[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rdx, rax
mov eax, DWORD PTR -4[rbp]
mov DWORD PTR [rdx], eax
.L4:
add DWORD PTR -20[rbp], 1
.L3:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -44[rbp]
jl .L5
add DWORD PTR -24[rbp], 1
.L2:
mov eax, DWORD PTR -44[rbp]
sub eax, 1
cmp DWORD PTR -24[rbp], eax
jl .L6
mov DWORD PTR -16[rbp], 0
mov eax, DWORD PTR -44[rbp]
sub eax, 1
mov DWORD PTR -12[rbp], eax
mov DWORD PTR -8[rbp], 0
jmp .L7
.L9:
mov eax, DWORD PTR -16[rbp]
cmp eax, DWORD PTR -12[rbp]
jne .L8
mov eax, DWORD PTR -16[rbp]
lea edx, 1[rax]
mov DWORD PTR -16[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -8[rbp]
lea edx, 1[rax]
mov DWORD PTR -8[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -56[rbp]
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
jmp .L7
.L8:
mov eax, DWORD PTR -16[rbp]
lea edx, 1[rax]
mov DWORD PTR -16[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -8[rbp]
lea edx, 1[rax]
mov DWORD PTR -8[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -56[rbp]
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -12[rbp]
lea edx, -1[rax]
mov DWORD PTR -12[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -8[rbp]
lea edx, 1[rax]
mov DWORD PTR -8[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -56[rbp]
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
.L7:
mov eax, DWORD PTR -16[rbp]
cmp eax, DWORD PTR -12[rbp]
jle .L9
nop
nop
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-80
sd s0,72(sp)
addi s0,sp,80
sd a0,-56(s0)
mv a5,a1
sd a2,-72(s0)
sw a5,-60(s0)
sw zero,-40(s0)
j .L2
.L6:
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-36(s0)
j .L3
.L5:
lw a5,-40(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-36(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
ble a4,a5,.L4
lw a5,-40(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-20(s0)
lw a5,-36(s0)
slli a5,a5,2
ld a4,-56(s0)
add a4,a4,a5
lw a5,-40(s0)
slli a5,a5,2
ld a3,-56(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
lw a5,-36(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
lw a4,-20(s0)
sw a4,0(a5)
.L4:
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L3:
lw a4,-36(s0)
lw a5,-60(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L5
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-40(s0)
.L2:
lw a5,-60(s0)
addiw a5,a5,-1
sext.w a4,a5
lw a5,-40(s0)
sext.w a5,a5
blt a5,a4,.L6
sw zero,-32(s0)
lw a5,-60(s0)
addiw a5,a5,-1
sw a5,-28(s0)
sw zero,-24(s0)
j .L7
.L9:
lw a4,-32(s0)
lw a5,-28(s0)
sext.w a4,a4
sext.w a5,a5
bne a4,a5,.L8
lw a5,-32(s0)
addiw a4,a5,1
sw a4,-32(s0)
slli a5,a5,2
ld a4,-56(s0)
add a4,a4,a5
lw a5,-24(s0)
addiw a3,a5,1
sw a3,-24(s0)
slli a5,a5,2
ld a3,-72(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
j .L7
.L8:
lw a5,-32(s0)
addiw a4,a5,1
sw a4,-32(s0)
slli a5,a5,2
ld a4,-56(s0)
add a4,a4,a5
lw a5,-24(s0)
addiw a3,a5,1
sw a3,-24(s0)
slli a5,a5,2
ld a3,-72(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
lw a5,-28(s0)
addiw a4,a5,-1
sw a4,-28(s0)
slli a5,a5,2
ld a4,-56(s0)
add a4,a4,a5
lw a5,-24(s0)
addiw a3,a5,1
sw a3,-24(s0)
slli a5,a5,2
ld a3,-72(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L7:
lw a4,-32(s0)
lw a5,-28(s0)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L9
nop
nop
ld s0,72(sp)
addi sp,sp,80
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem27/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 112
mov QWORD PTR -88[rbp], rdi
mov DWORD PTR -92[rbp], esi
mov QWORD PTR -104[rbp], rdx
mov eax, DWORD PTR -92[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -24[rbp], rax
mov eax, DWORD PTR -92[rbp]
cdqe
mov esi, 4
mov rdi, rax
call calloc@PLT
mov QWORD PTR -16[rbp], rax
mov eax, DWORD PTR -92[rbp]
cdqe
mov esi, 4
mov rdi, rax
call calloc@PLT
mov QWORD PTR -8[rbp], rax
mov DWORD PTR -76[rbp], 0
mov DWORD PTR -72[rbp], 0
mov DWORD PTR -68[rbp], 0
mov DWORD PTR -64[rbp], 0
jmp .L2
.L14:
mov eax, DWORD PTR -64[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -88[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -28[rbp], eax
mov DWORD PTR -60[rbp], 0
mov DWORD PTR -56[rbp], 0
jmp .L3
.L6:
mov eax, DWORD PTR -56[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp DWORD PTR -28[rbp], eax
jne .L4
mov DWORD PTR -60[rbp], 1
jmp .L5
.L4:
add DWORD PTR -56[rbp], 1
.L3:
mov eax, DWORD PTR -56[rbp]
cmp eax, DWORD PTR -72[rbp]
jl .L6
.L5:
cmp DWORD PTR -60[rbp], 0
jne .L23
mov DWORD PTR -52[rbp], 0
mov DWORD PTR -48[rbp], 0
jmp .L9
.L12:
mov eax, DWORD PTR -48[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp DWORD PTR -28[rbp], eax
jne .L10
mov DWORD PTR -52[rbp], 1
jmp .L11
.L10:
add DWORD PTR -48[rbp], 1
.L9:
mov eax, DWORD PTR -48[rbp]
cmp eax, DWORD PTR -76[rbp]
jl .L12
.L11:
cmp DWORD PTR -52[rbp], 0
je .L13
mov eax, DWORD PTR -72[rbp]
lea edx, 1[rax]
mov DWORD PTR -72[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -28[rbp]
mov DWORD PTR [rdx], eax
jmp .L8
.L13:
mov eax, DWORD PTR -76[rbp]
lea edx, 1[rax]
mov DWORD PTR -76[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rdx, rax
mov eax, DWORD PTR -28[rbp]
mov DWORD PTR [rdx], eax
jmp .L8
.L23:
nop
.L8:
add DWORD PTR -64[rbp], 1
.L2:
mov eax, DWORD PTR -64[rbp]
cmp eax, DWORD PTR -92[rbp]
jl .L14
mov DWORD PTR -44[rbp], 0
jmp .L15
.L21:
mov eax, DWORD PTR -44[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -88[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -32[rbp], eax
mov DWORD PTR -40[rbp], 0
mov DWORD PTR -36[rbp], 0
jmp .L16
.L19:
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp DWORD PTR -32[rbp], eax
jne .L17
mov DWORD PTR -40[rbp], 1
jmp .L18
.L17:
add DWORD PTR -36[rbp], 1
.L16:
mov eax, DWORD PTR -36[rbp]
cmp eax, DWORD PTR -72[rbp]
jl .L19
.L18:
cmp DWORD PTR -40[rbp], 0
jne .L20
mov eax, DWORD PTR -68[rbp]
lea edx, 1[rax]
mov DWORD PTR -68[rbp], edx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rdx, rax
mov eax, DWORD PTR -32[rbp]
mov DWORD PTR [rdx], eax
.L20:
add DWORD PTR -44[rbp], 1
.L15:
mov eax, DWORD PTR -44[rbp]
cmp eax, DWORD PTR -92[rbp]
jl .L21
mov rax, QWORD PTR -104[rbp]
mov edx, DWORD PTR -68[rbp]
mov DWORD PTR [rax], edx
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call free@PLT
mov rax, QWORD PTR -8[rbp]
mov rdi, rax
call free@PLT
mov rax, QWORD PTR -24[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-128
sd ra,120(sp)
sd s0,112(sp)
addi s0,sp,128
sd a0,-104(s0)
mv a5,a1
sd a2,-120(s0)
sw a5,-108(s0)
lw a5,-108(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-40(s0)
lw a5,-108(s0)
li a1,4
mv a0,a5
call calloc@plt
mv a5,a0
sd a5,-32(s0)
lw a5,-108(s0)
li a1,4
mv a0,a5
call calloc@plt
mv a5,a0
sd a5,-24(s0)
sw zero,-92(s0)
sw zero,-88(s0)
sw zero,-84(s0)
sw zero,-80(s0)
j .L2
.L14:
lw a5,-80(s0)
slli a5,a5,2
ld a4,-104(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-44(s0)
sw zero,-76(s0)
sw zero,-72(s0)
j .L3
.L6:
lw a5,-72(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-44(s0)
sext.w a5,a5
bne a5,a4,.L4
li a5,1
sw a5,-76(s0)
j .L5
.L4:
lw a5,-72(s0)
addiw a5,a5,1
sw a5,-72(s0)
.L3:
lw a4,-72(s0)
lw a5,-88(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
.L5:
lw a5,-76(s0)
sext.w a5,a5
bnez a5,.L23
sw zero,-68(s0)
sw zero,-64(s0)
j .L9
.L12:
lw a5,-64(s0)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-44(s0)
sext.w a5,a5
bne a5,a4,.L10
li a5,1
sw a5,-68(s0)
j .L11
.L10:
lw a5,-64(s0)
addiw a5,a5,1
sw a5,-64(s0)
.L9:
lw a4,-64(s0)
lw a5,-92(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L12
.L11:
lw a5,-68(s0)
sext.w a5,a5
beqz a5,.L13
lw a5,-88(s0)
addiw a4,a5,1
sw a4,-88(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,-44(s0)
sw a4,0(a5)
j .L8
.L13:
lw a5,-92(s0)
addiw a4,a5,1
sw a4,-92(s0)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,-44(s0)
sw a4,0(a5)
j .L8
.L23:
nop
.L8:
lw a5,-80(s0)
addiw a5,a5,1
sw a5,-80(s0)
.L2:
lw a4,-80(s0)
lw a5,-108(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L14
sw zero,-60(s0)
j .L15
.L21:
lw a5,-60(s0)
slli a5,a5,2
ld a4,-104(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-48(s0)
sw zero,-56(s0)
sw zero,-52(s0)
j .L16
.L19:
lw a5,-52(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-48(s0)
sext.w a5,a5
bne a5,a4,.L17
li a5,1
sw a5,-56(s0)
j .L18
.L17:
lw a5,-52(s0)
addiw a5,a5,1
sw a5,-52(s0)
.L16:
lw a4,-52(s0)
lw a5,-88(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L19
.L18:
lw a5,-56(s0)
sext.w a5,a5
bnez a5,.L20
lw a5,-84(s0)
addiw a4,a5,1
sw a4,-84(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a4,-48(s0)
sw a4,0(a5)
.L20:
lw a5,-60(s0)
addiw a5,a5,1
sw a5,-60(s0)
.L15:
lw a4,-60(s0)
lw a5,-108(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L21
ld a5,-120(s0)
lw a4,-84(s0)
sw a4,0(a5)
ld a0,-32(s0)
call free@plt
ld a0,-24(s0)
call free@plt
ld a5,-40(s0)
mv a0,a5
ld ra,120(sp)
ld s0,112(sp)
addi sp,sp,128
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem36/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
movss xmm0, DWORD PTR .LC0[rip]
movss DWORD PTR -8[rbp], xmm0
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
movss xmm0, DWORD PTR [rax]
comiss xmm0, DWORD PTR -8[rbp]
jbe .L3
mov eax, DWORD PTR -4[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movss xmm0, DWORD PTR [rax]
movss DWORD PTR -8[rbp], xmm0
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L5
movss xmm0, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.section .rodata
.align 4
.LC0:
.long 3323740160
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
lla a5,.LC0
flw fa5,0(a5)
fsw fa5,-24(s0)
sw zero,-20(s0)
j .L2
.L5:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa5,0(a5)
flw fa4,-24(s0)
flt.s a5,fa4,fa5
beqz a5,.L3
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa5,0(a5)
fsw fa5,-24(s0)
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L5
flw fa5,-24(s0)
fmv.s fa0,fa5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.section .rodata
.align 2
.LC0:
.word 3323740160
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem31/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov QWORD PTR -40[rbp], rdx
mov eax, DWORD PTR -28[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -40[rbp]
mov DWORD PTR [rax], 0
mov DWORD PTR -12[rbp], 0
jmp .L2
.L5:
mov eax, DWORD PTR -12[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
movss xmm0, DWORD PTR [rax]
pxor xmm1, xmm1
comiss xmm0, xmm1
jbe .L3
mov eax, DWORD PTR -12[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
lea rsi, [rdx+rax]
mov rax, QWORD PTR -40[rbp]
mov eax, DWORD PTR [rax]
lea ecx, 1[rax]
mov rdx, QWORD PTR -40[rbp]
mov DWORD PTR [rdx], ecx
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
movss xmm0, DWORD PTR [rsi]
movss DWORD PTR [rax], xmm0
.L3:
add DWORD PTR -12[rbp], 1
.L2:
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L5
mov rax, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-40(s0)
mv a5,a1
sd a2,-56(s0)
sw a5,-44(s0)
lw a5,-44(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
ld a5,-56(s0)
sw zero,0(a5)
sw zero,-28(s0)
j .L2
.L5:
lw a5,-28(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa5,0(a5)
fmv.s.x fa4,zero
fgt.s a5,fa5,fa4
beqz a5,.L3
lw a5,-28(s0)
slli a5,a5,2
ld a4,-40(s0)
add a4,a4,a5
ld a5,-56(s0)
lw a5,0(a5)
addiw a3,a5,1
sext.w a2,a3
ld a3,-56(s0)
sw a2,0(a3)
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
flw fa5,0(a4)
fsw fa5,0(a5)
.L3:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L2:
lw a4,-28(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L5
ld a5,-24(s0)
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem86/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -8[rbp], 0
mov DWORD PTR -4[rbp], 0
jmp .L2
.L4:
mov eax, DWORD PTR -4[rbp]
add eax, eax
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
and eax, 1
test eax, eax
jne .L3
mov eax, DWORD PTR -4[rbp]
add eax, eax
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
add DWORD PTR -8[rbp], eax
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
add eax, eax
add eax, 1
cmp DWORD PTR -28[rbp], eax
jg .L4
mov eax, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-24(s0)
sw zero,-20(s0)
j .L2
.L4:
lw a5,-20(s0)
slliw a5,a5,1
sext.w a5,a5
addi a5,a5,1
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
sext.w a5,a5
andi a5,a5,1
sext.w a5,a5
bnez a5,.L3
lw a5,-20(s0)
slliw a5,a5,1
sext.w a5,a5
addi a5,a5,1
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
lw a4,-24(s0)
addw a5,a4,a5
sw a5,-24(s0)
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a5,-20(s0)
slliw a5,a5,1
sext.w a5,a5
addiw a5,a5,1
sext.w a4,a5
lw a5,-44(s0)
sext.w a5,a5
bgt a5,a4,.L4
lw a5,-24(s0)
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem77/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov DWORD PTR -20[rbp], edi
mov DWORD PTR -24[rbp], esi
mov DWORD PTR -8[rbp], 1
mov DWORD PTR -4[rbp], 0
jmp .L2
.L6:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -20[rbp]
jne .L3
mov eax, 1
jmp .L4
.L3:
mov eax, DWORD PTR -8[rbp]
imul eax, DWORD PTR -24[rbp]
mov DWORD PTR -8[rbp], eax
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -8[rbp]
cmp eax, DWORD PTR -20[rbp]
jg .L5
cmp DWORD PTR -4[rbp], 99
jle .L6
.L5:
mov eax, 0
.L4:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
mv a5,a0
mv a4,a1
sw a5,-36(s0)
mv a5,a4
sw a5,-40(s0)
li a5,1
sw a5,-24(s0)
sw zero,-20(s0)
j .L2
.L6:
lw a4,-24(s0)
lw a5,-36(s0)
sext.w a4,a4
sext.w a5,a5
bne a4,a5,.L3
li a5,1
j .L4
.L3:
lw a4,-24(s0)
lw a5,-40(s0)
mulw a5,a4,a5
sw a5,-24(s0)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-24(s0)
lw a5,-36(s0)
sext.w a4,a4
sext.w a5,a5
bgt a4,a5,.L5
lw a5,-20(s0)
sext.w a4,a5
li a5,99
ble a4,a5,.L6
.L5:
li a5,0
.L4:
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem9/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov QWORD PTR -40[rbp], rdx
mov DWORD PTR -12[rbp], 0
mov DWORD PTR -8[rbp], 1
mov DWORD PTR -4[rbp], 0
jmp .L2
.L3:
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]
add DWORD PTR -12[rbp], eax
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]
mov edx, DWORD PTR -8[rbp]
imul eax, edx
mov DWORD PTR -8[rbp], eax
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L3
mov rax, QWORD PTR -40[rbp]
mov edx, DWORD PTR -12[rbp]
mov DWORD PTR [rax], edx
mov rax, QWORD PTR -40[rbp]
lea rdx, 4[rax]
mov eax, DWORD PTR -8[rbp]
mov DWORD PTR [rdx], eax
nop
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd s0,56(sp)
addi s0,sp,64
sd a0,-40(s0)
mv a5,a1
sd a2,-56(s0)
sw a5,-44(s0)
sw zero,-28(s0)
li a5,1
sw a5,-24(s0)
sw zero,-20(s0)
j .L2
.L3:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
lw a4,-28(s0)
addw a5,a4,a5
sw a5,-28(s0)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
lw a4,-24(s0)
mulw a5,a4,a5
sw a5,-24(s0)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L3
ld a5,-56(s0)
lw a4,-28(s0)
sw a4,0(a5)
ld a5,-56(s0)
addi a5,a5,4
lw a4,-24(s0)
sw a4,0(a5)
nop
ld s0,56(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem64/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 448
mov DWORD PTR -436[rbp], edi
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rdx, -416[rbp]
mov eax, 0
mov ecx, 50
mov rdi, rdx
rep stosq
mov DWORD PTR -412[rbp], 0
mov DWORD PTR -408[rbp], 1
mov DWORD PTR -420[rbp], 3
jmp .L2
.L3:
mov eax, DWORD PTR -420[rbp]
sub eax, 1
cdqe
mov edx, DWORD PTR -416[rbp+rax*4]
mov eax, DWORD PTR -420[rbp]
sub eax, 2
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -420[rbp]
sub eax, 3
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
add edx, eax
mov eax, DWORD PTR -420[rbp]
cdqe
mov DWORD PTR -416[rbp+rax*4], edx
add DWORD PTR -420[rbp], 1
.L2:
mov eax, DWORD PTR -420[rbp]
cmp eax, DWORD PTR -436[rbp]
jle .L3
mov eax, DWORD PTR -436[rbp]
cdqe
mov eax, DWORD PTR -416[rbp+rax*4]
mov rsi, QWORD PTR -8[rbp]
xor rsi, QWORD PTR fs:40
je .L5
call __stack_chk_fail@PLT
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-448
sd ra,440(sp)
sd s0,432(sp)
addi s0,sp,448
mv a5,a0
sw a5,-436(s0)
la a5,__stack_chk_guard
ld a5,0(a5)
sd a5,-24(s0)
addi a5,s0,-424
li a4,400
mv a2,a4
li a1,0
mv a0,a5
call memset@plt
sw zero,-420(s0)
li a5,1
sw a5,-416(s0)
li a5,3
sw a5,-428(s0)
j .L2
.L3:
lw a5,-428(s0)
addiw a5,a5,-1
sext.w a5,a5
slli a5,a5,2
addi a4,s0,-16
add a5,a4,a5
lw a4,-408(a5)
lw a5,-428(s0)
addiw a5,a5,-2
sext.w a5,a5
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
lw a5,-408(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-428(s0)
addiw a5,a5,-3
sext.w a5,a5
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
lw a5,-408(a5)
addw a5,a4,a5
sext.w a4,a5
lw a5,-428(s0)
slli a5,a5,2
addi a3,s0,-16
add a5,a3,a5
sw a4,-408(a5)
lw a5,-428(s0)
addiw a5,a5,1
sw a5,-428(s0)
.L2:
lw a4,-428(s0)
lw a5,-436(s0)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L3
lw a5,-436(s0)
slli a5,a5,2
addi a4,s0,-16
add a5,a4,a5
lw a5,-408(a5)
mv a3,a5
la a5,__stack_chk_guard
ld a4,-24(s0)
ld a5,0(a5)
beq a4,a5,.L5
call __stack_chk_fail@plt
.L5:
mv a0,a3
ld ra,440(sp)
ld s0,432(sp)
addi sp,sp,448
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem123/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -8[rbp], 0
mov DWORD PTR -4[rbp], 0
jmp .L2
.L4:
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]
cmp eax, -99
jl .L3
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]
cmp eax, 99
jg .L3
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]
add DWORD PTR -8[rbp], eax
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -28[rbp]
jl .L4
mov eax, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd s0,40(sp)
addi s0,sp,48
sd a0,-40(s0)
mv a5,a1
sw a5,-44(s0)
sw zero,-24(s0)
sw zero,-20(s0)
j .L2
.L4:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a5
li a5,-99
blt a4,a5,.L3
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a5
li a5,99
bgt a4,a5,.L3
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
lw a5,0(a5)
lw a4,-24(s0)
addw a5,a4,a5
sw a5,-24(s0)
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a4,-20(s0)
lw a5,-44(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L4
lw a5,-24(s0)
mv a0,a5
ld s0,40(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem161/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "**"
.LC1:
.string "*"
.LC2:
.string "//"
.LC3:
.string "+"
.LC4:
.string "-"
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 80
mov QWORD PTR -56[rbp], rdi
mov QWORD PTR -64[rbp], rsi
mov DWORD PTR -68[rbp], edx
mov DWORD PTR -72[rbp], ecx
mov eax, DWORD PTR -72[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -16[rbp], rax
mov eax, DWORD PTR -72[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
mov DWORD PTR -36[rbp], 0
jmp .L2
.L3:
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -64[rbp]
add rax, rdx
mov edx, DWORD PTR -36[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -16[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rdx, rax
mov eax, DWORD PTR -36[rbp]
mov DWORD PTR [rdx], eax
add DWORD PTR -36[rbp], 1
.L2:
mov eax, DWORD PTR -36[rbp]
cmp eax, DWORD PTR -72[rbp]
jl .L3
mov DWORD PTR -32[rbp], 0
jmp .L4
.L10:
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC0[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
jne .L5
jmp .L6
.L7:
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -32[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L6:
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -32[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L7
jmp .L8
.L9:
mov eax, DWORD PTR -32[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -32[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L8:
mov eax, DWORD PTR -32[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -32[rbp]
cdqe
add rax, 1
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L9
mov eax, DWORD PTR -32[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cvtsi2sd xmm1, eax
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cvtsi2sd xmm0, eax
call pow@PLT
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rdx, rax
cvttsd2si eax, xmm0
mov DWORD PTR [rdx], eax
mov eax, DWORD PTR -32[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -32[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L5:
add DWORD PTR -32[rbp], 1
.L4:
mov eax, DWORD PTR -32[rbp]
cmp eax, DWORD PTR -68[rbp]
jl .L10
mov DWORD PTR -28[rbp], 0
jmp .L11
.L20:
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC1[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
je .L14
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC2[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
jne .L13
jmp .L14
.L15:
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -28[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L14:
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L15
jmp .L16
.L17:
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -28[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L16:
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, 1
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L17
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC1[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
jne .L18
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov ecx, DWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov edx, DWORD PTR -28[rbp]
movsx rdx, edx
lea rsi, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rsi
mov edx, DWORD PTR [rdx]
movsx rdx, edx
lea rsi, 0[0+rdx*4]
mov rdx, QWORD PTR -16[rbp]
add rdx, rsi
imul eax, ecx
mov DWORD PTR [rdx], eax
jmp .L19
.L18:
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov edx, DWORD PTR -28[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov edx, DWORD PTR [rdx]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -16[rbp]
add rdx, rcx
mov edi, DWORD PTR [rdx]
mov ecx, DWORD PTR -28[rbp]
movsx rcx, ecx
lea rsi, 0[0+rcx*4]
mov rcx, QWORD PTR -8[rbp]
add rcx, rsi
mov ecx, DWORD PTR [rcx]
movsx rcx, ecx
lea rsi, 0[0+rcx*4]
mov rcx, QWORD PTR -16[rbp]
add rcx, rsi
cdq
idiv edi
mov DWORD PTR [rcx], eax
.L19:
mov eax, DWORD PTR -28[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -28[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L13:
add DWORD PTR -28[rbp], 1
.L11:
mov eax, DWORD PTR -28[rbp]
cmp eax, DWORD PTR -68[rbp]
jl .L20
mov DWORD PTR -24[rbp], 0
jmp .L21
.L30:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC3[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
je .L24
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC4[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
jne .L23
jmp .L24
.L25:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -24[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L24:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L25
jmp .L26
.L27:
mov eax, DWORD PTR -24[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -24[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L26:
mov eax, DWORD PTR -24[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
add rax, 1
lea rcx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jne .L27
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
lea rsi, .LC3[rip]
mov rdi, rax
call strcmp@PLT
test eax, eax
jne .L28
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov ecx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
lea rsi, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rsi
mov eax, DWORD PTR [rax]
cdqe
lea rsi, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rsi
add edx, ecx
mov DWORD PTR [rax], edx
jmp .L29
.L28:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov ecx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
add rax, 1
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov edx, DWORD PTR [rax]
mov eax, DWORD PTR -24[rbp]
cdqe
lea rsi, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rsi
mov eax, DWORD PTR [rax]
cdqe
lea rsi, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rsi
sub ecx, edx
mov edx, ecx
mov DWORD PTR [rax], edx
.L29:
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov edx, DWORD PTR -24[rbp]
movsx rdx, edx
add rdx, 1
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -8[rbp]
add rdx, rcx
mov eax, DWORD PTR [rax]
mov DWORD PTR [rdx], eax
.L23:
add DWORD PTR -24[rbp], 1
.L21:
mov eax, DWORD PTR -24[rbp]
cmp eax, DWORD PTR -68[rbp]
jl .L30
mov rax, QWORD PTR -16[rbp]
mov eax, DWORD PTR [rax]
mov DWORD PTR -20[rbp], eax
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call free@PLT
mov rax, QWORD PTR -8[rbp]
mov rdi, rax
call free@PLT
mov eax, DWORD PTR -20[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "**"
.align 3
.LC1:
.string "*"
.align 3
.LC2:
.string "//"
.align 3
.LC3:
.string "+"
.align 3
.LC4:
.string "-"
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-96
sd ra,88(sp)
sd s0,80(sp)
addi s0,sp,96
sd a0,-72(s0)
sd a1,-80(s0)
mv a5,a2
mv a4,a3
sw a5,-84(s0)
mv a5,a4
sw a5,-88(s0)
lw a5,-88(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-32(s0)
lw a5,-88(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
sw zero,-52(s0)
j .L2
.L3:
lw a5,-52(s0)
slli a5,a5,2
ld a4,-80(s0)
add a4,a4,a5
lw a5,-52(s0)
slli a5,a5,2
ld a3,-32(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
lw a5,-52(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a4,-52(s0)
sw a4,0(a5)
lw a5,-52(s0)
addiw a5,a5,1
sw a5,-52(s0)
.L2:
lw a4,-52(s0)
lw a5,-88(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L3
sw zero,-48(s0)
j .L4
.L10:
lw a5,-48(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC0
mv a0,a5
call strcmp@plt
mv a5,a0
bnez a5,.L5
j .L6
.L7:
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-48(s0)
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L6:
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L7
j .L8
.L9:
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L8:
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L9
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a5,0(a5)
fcvt.d.w fa5,a5
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a5,0(a5)
fcvt.d.w fa4,a5
fmv.d fa1,fa4
fmv.d fa0,fa5
call pow@plt
fmv.d fa5,fa0
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
fcvt.w.d a4,fa5,rtz
sext.w a4,a4
sw a4,0(a5)
lw a5,-48(s0)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-48(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L5:
lw a5,-48(s0)
addiw a5,a5,1
sw a5,-48(s0)
.L4:
lw a4,-48(s0)
lw a5,-84(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L10
sw zero,-44(s0)
j .L11
.L20:
lw a5,-44(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC1
mv a0,a5
call strcmp@plt
mv a5,a0
beqz a5,.L14
lw a5,-44(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC2
mv a0,a5
call strcmp@plt
mv a5,a0
bnez a5,.L13
j .L14
.L15:
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-44(s0)
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L14:
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L15
j .L16
.L17:
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L16:
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L17
lw a5,-44(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC1
mv a0,a5
call strcmp@plt
mv a5,a0
bnez a5,.L18
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-44(s0)
slli a5,a5,2
ld a2,-24(s0)
add a5,a2,a5
lw a5,0(a5)
slli a5,a5,2
ld a2,-32(s0)
add a5,a2,a5
mulw a4,a3,a4
sext.w a4,a4
sw a4,0(a5)
j .L19
.L18:
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-44(s0)
slli a5,a5,2
ld a2,-24(s0)
add a5,a2,a5
lw a5,0(a5)
slli a5,a5,2
ld a2,-32(s0)
add a5,a2,a5
divw a4,a3,a4
sext.w a4,a4
sw a4,0(a5)
.L19:
lw a5,-44(s0)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-44(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L13:
lw a5,-44(s0)
addiw a5,a5,1
sw a5,-44(s0)
.L11:
lw a4,-44(s0)
lw a5,-84(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L20
sw zero,-40(s0)
j .L21
.L30:
lw a5,-40(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC3
mv a0,a5
call strcmp@plt
mv a5,a0
beqz a5,.L24
lw a5,-40(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC4
mv a0,a5
call strcmp@plt
mv a5,a0
bnez a5,.L23
j .L24
.L25:
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-40(s0)
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L24:
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L25
j .L26
.L27:
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L26:
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
bne a4,a5,.L27
lw a5,-40(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a5,0(a5)
lla a1,.LC3
mv a0,a5
call strcmp@plt
mv a5,a0
bnez a5,.L28
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-40(s0)
slli a5,a5,2
ld a2,-24(s0)
add a5,a2,a5
lw a5,0(a5)
slli a5,a5,2
ld a2,-32(s0)
add a5,a2,a5
addw a4,a3,a4
sext.w a4,a4
sw a4,0(a5)
j .L29
.L28:
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a3,0(a5)
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a4,-24(s0)
add a5,a4,a5
lw a5,0(a5)
slli a5,a5,2
ld a4,-32(s0)
add a5,a4,a5
lw a4,0(a5)
lw a5,-40(s0)
slli a5,a5,2
ld a2,-24(s0)
add a5,a2,a5
lw a5,0(a5)
slli a5,a5,2
ld a2,-32(s0)
add a5,a2,a5
subw a4,a3,a4
sext.w a4,a4
sw a4,0(a5)
.L29:
lw a5,-40(s0)
slli a5,a5,2
ld a4,-24(s0)
add a4,a4,a5
lw a5,-40(s0)
addi a5,a5,1
slli a5,a5,2
ld a3,-24(s0)
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
.L23:
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-40(s0)
.L21:
lw a4,-40(s0)
lw a5,-84(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L30
ld a5,-32(s0)
lw a5,0(a5)
sw a5,-36(s0)
ld a0,-32(s0)
call free@plt
ld a0,-24(s0)
call free@plt
lw a5,-36(s0)
mv a0,a5
ld ra,88(sp)
ld s0,80(sp)
addi sp,sp,96
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem114/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.align 8
.LC0:
.string "the number of odd elements %d in the string %d of the %d input."
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push rbx
sub rsp, 56
.cfi_offset 3, -24
mov QWORD PTR -56[rbp], rdi
mov DWORD PTR -60[rbp], esi
mov eax, DWORD PTR -60[rbp]
cdqe
sal rax, 3
mov rdi, rax
call malloc@PLT
mov QWORD PTR -24[rbp], rax
mov DWORD PTR -36[rbp], 0
jmp .L2
.L6:
mov DWORD PTR -32[rbp], 0
mov DWORD PTR -28[rbp], 0
jmp .L3
.L5:
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rdx, QWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 47
jle .L4
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rdx, QWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 57
jg .L4
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rdx, QWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, rdx
movzx eax, BYTE PTR [rax]
movsx eax, al
lea edx, -48[rax]
mov eax, edx
sar eax, 31
shr eax, 31
add edx, eax
and edx, 1
sub edx, eax
mov eax, edx
cmp eax, 1
jne .L4
add DWORD PTR -32[rbp], 1
.L4:
add DWORD PTR -28[rbp], 1
.L3:
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -56[rbp]
add rax, rdx
mov rdx, QWORD PTR [rax]
mov eax, DWORD PTR -28[rbp]
cdqe
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L5
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -24[rbp]
lea rbx, [rdx+rax]
mov edi, 100
call malloc@PLT
mov QWORD PTR [rbx], rax
mov eax, DWORD PTR -36[rbp]
cdqe
lea rdx, 0[0+rax*8]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov rax, QWORD PTR [rax]
mov esi, DWORD PTR -32[rbp]
mov ecx, DWORD PTR -32[rbp]
mov edx, DWORD PTR -32[rbp]
mov r8d, esi
lea rsi, .LC0[rip]
mov rdi, rax
mov eax, 0
call sprintf@PLT
add DWORD PTR -36[rbp], 1
.L2:
mov eax, DWORD PTR -36[rbp]
cmp eax, DWORD PTR -60[rbp]
jl .L6
mov rax, QWORD PTR -24[rbp]
add rsp, 56
pop rbx
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "the number of odd elements %d in the string %d of the %d input."
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-80
sd ra,72(sp)
sd s0,64(sp)
sd s1,56(sp)
addi s0,sp,80
sd a0,-72(s0)
mv a5,a1
sw a5,-76(s0)
lw a5,-76(s0)
slli a5,a5,3
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-40(s0)
sw zero,-52(s0)
j .L2
.L6:
sw zero,-48(s0)
sw zero,-44(s0)
j .L3
.L5:
lw a5,-52(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a4,0(a5)
lw a5,-44(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,47
bleu a4,a5,.L4
lw a5,-52(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a4,0(a5)
lw a5,-44(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,57
bgtu a4,a5,.L4
lw a5,-52(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a4,0(a5)
lw a5,-44(s0)
add a5,a4,a5
lbu a5,0(a5)
sext.w a5,a5
addiw a5,a5,-48
sext.w a5,a5
mv a4,a5
sraiw a5,a4,31
srliw a5,a5,31
addw a4,a4,a5
andi a4,a4,1
subw a5,a4,a5
sext.w a5,a5
mv a4,a5
li a5,1
bne a4,a5,.L4
lw a5,-48(s0)
addiw a5,a5,1
sw a5,-48(s0)
.L4:
lw a5,-44(s0)
addiw a5,a5,1
sw a5,-44(s0)
.L3:
lw a5,-52(s0)
slli a5,a5,3
ld a4,-72(s0)
add a5,a4,a5
ld a4,0(a5)
lw a5,-44(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L5
lw a5,-52(s0)
slli a5,a5,3
ld a4,-40(s0)
add s1,a4,a5
li a0,100
call malloc@plt
mv a5,a0
sd a5,0(s1)
lw a5,-52(s0)
slli a5,a5,3
ld a4,-40(s0)
add a5,a4,a5
ld a5,0(a5)
lw a4,-48(s0)
lw a3,-48(s0)
lw a2,-48(s0)
lla a1,.LC0
mv a0,a5
call sprintf@plt
lw a5,-52(s0)
addiw a5,a5,1
sw a5,-52(s0)
.L2:
lw a4,-52(s0)
lw a5,-76(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L6
ld a5,-40(s0)
mv a0,a5
ld ra,72(sp)
ld s0,64(sp)
ld s1,56(sp)
addi sp,sp,80
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem105/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 64
mov QWORD PTR -40[rbp], rdi
mov DWORD PTR -44[rbp], esi
mov QWORD PTR -56[rbp], rdx
mov QWORD PTR -64[rbp], rcx
mov eax, DWORD PTR -44[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov rdx, rax
mov rax, QWORD PTR -56[rbp]
mov QWORD PTR [rax], rdx
mov rax, QWORD PTR -64[rbp]
mov DWORD PTR [rax], 0
mov DWORD PTR -20[rbp], 0
jmp .L2
.L9:
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -16[rbp], eax
mov BYTE PTR -21[rbp], 0
cmp DWORD PTR -16[rbp], 0
jne .L4
mov BYTE PTR -21[rbp], 1
jmp .L4
.L7:
mov eax, DWORD PTR -16[rbp]
and eax, 1
test eax, eax
jne .L5
mov BYTE PTR -21[rbp], 1
.L5:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
imul rdx, rdx, 1717986919
shr rdx, 32
sar edx, 2
sar eax, 31
sub edx, eax
mov eax, edx
mov DWORD PTR -16[rbp], eax
.L4:
cmp DWORD PTR -16[rbp], 0
jle .L6
movzx eax, BYTE PTR -21[rbp]
xor eax, 1
test al, al
jne .L7
.L6:
movzx eax, BYTE PTR -21[rbp]
xor eax, 1
test al, al
je .L8
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -40[rbp]
lea rcx, [rdx+rax]
mov rax, QWORD PTR -56[rbp]
mov rdx, QWORD PTR [rax]
mov rax, QWORD PTR -64[rbp]
mov eax, DWORD PTR [rax]
cdqe
sal rax, 2
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
mov rax, QWORD PTR -64[rbp]
mov eax, DWORD PTR [rax]
lea edx, 1[rax]
mov rax, QWORD PTR -64[rbp]
mov DWORD PTR [rax], edx
.L8:
add DWORD PTR -20[rbp], 1
.L2:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -44[rbp]
jl .L9
mov DWORD PTR -12[rbp], 0
jmp .L10
.L14:
mov DWORD PTR -8[rbp], 0
jmp .L11
.L13:
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -8[rbp]
movsx rdx, edx
sal rdx, 2
add rax, rdx
mov edx, DWORD PTR [rax]
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov ecx, DWORD PTR -8[rbp]
movsx rcx, ecx
add rcx, 1
sal rcx, 2
add rax, rcx
mov eax, DWORD PTR [rax]
cmp edx, eax
jle .L12
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -8[rbp]
movsx rdx, edx
sal rdx, 2
add rax, rdx
mov eax, DWORD PTR [rax]
mov DWORD PTR -4[rbp], eax
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -8[rbp]
movsx rdx, edx
add rdx, 1
sal rdx, 2
lea rcx, [rax+rdx]
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -8[rbp]
movsx rdx, edx
sal rdx, 2
add rdx, rax
mov eax, DWORD PTR [rcx]
mov DWORD PTR [rdx], eax
mov rax, QWORD PTR -56[rbp]
mov rax, QWORD PTR [rax]
mov edx, DWORD PTR -8[rbp]
movsx rdx, edx
add rdx, 1
sal rdx, 2
add rdx, rax
mov eax, DWORD PTR -4[rbp]
mov DWORD PTR [rdx], eax
.L12:
add DWORD PTR -8[rbp], 1
.L11:
mov rax, QWORD PTR -64[rbp]
mov eax, DWORD PTR [rax]
sub eax, DWORD PTR -12[rbp]
sub eax, 1
cmp DWORD PTR -8[rbp], eax
jl .L13
add DWORD PTR -12[rbp], 1
.L10:
mov rax, QWORD PTR -64[rbp]
mov eax, DWORD PTR [rax]
sub eax, 1
cmp DWORD PTR -12[rbp], eax
jl .L14
nop
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-80
sd ra,72(sp)
sd s0,64(sp)
addi s0,sp,80
sd a0,-56(s0)
mv a5,a1
sd a2,-72(s0)
sd a3,-80(s0)
sw a5,-60(s0)
lw a5,-60(s0)
slli a5,a5,2
mv a0,a5
call malloc@plt
mv a5,a0
mv a4,a5
ld a5,-72(s0)
sd a4,0(a5)
ld a5,-80(s0)
sw zero,0(a5)
sw zero,-36(s0)
j .L2
.L9:
lw a5,-36(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
lw a5,0(a5)
sw a5,-32(s0)
sb zero,-37(s0)
lw a5,-32(s0)
sext.w a5,a5
bnez a5,.L4
li a5,1
sb a5,-37(s0)
j .L4
.L7:
lw a5,-32(s0)
andi a5,a5,1
sext.w a5,a5
bnez a5,.L5
li a5,1
sb a5,-37(s0)
.L5:
lw a4,-32(s0)
li a5,10
divw a5,a4,a5
sw a5,-32(s0)
.L4:
lw a5,-32(s0)
sext.w a5,a5
blez a5,.L6
lbu a5,-37(s0)
xori a5,a5,1
andi a5,a5,0xff
bnez a5,.L7
.L6:
lbu a5,-37(s0)
xori a5,a5,1
andi a5,a5,0xff
beqz a5,.L8
lw a5,-36(s0)
slli a5,a5,2
ld a4,-56(s0)
add a4,a4,a5
ld a5,-72(s0)
ld a3,0(a5)
ld a5,-80(s0)
lw a5,0(a5)
slli a5,a5,2
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
ld a5,-80(s0)
lw a5,0(a5)
addiw a5,a5,1
sext.w a4,a5
ld a5,-80(s0)
sw a4,0(a5)
.L8:
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L2:
lw a4,-36(s0)
lw a5,-60(s0)
sext.w a4,a4
sext.w a5,a5
blt a4,a5,.L9
sw zero,-28(s0)
j .L10
.L14:
sw zero,-24(s0)
j .L11
.L13:
ld a5,-72(s0)
ld a4,0(a5)
lw a5,-24(s0)
slli a5,a5,2
add a5,a4,a5
lw a3,0(a5)
ld a5,-72(s0)
ld a4,0(a5)
lw a5,-24(s0)
addi a5,a5,1
slli a5,a5,2
add a5,a4,a5
lw a5,0(a5)
mv a4,a3
ble a4,a5,.L12
ld a5,-72(s0)
ld a4,0(a5)
lw a5,-24(s0)
slli a5,a5,2
add a5,a4,a5
lw a5,0(a5)
sw a5,-20(s0)
ld a5,-72(s0)
ld a4,0(a5)
lw a5,-24(s0)
addi a5,a5,1
slli a5,a5,2
add a4,a4,a5
ld a5,-72(s0)
ld a3,0(a5)
lw a5,-24(s0)
slli a5,a5,2
add a5,a3,a5
lw a4,0(a4)
sw a4,0(a5)
ld a5,-72(s0)
ld a4,0(a5)
lw a5,-24(s0)
addi a5,a5,1
slli a5,a5,2
add a5,a4,a5
lw a4,-20(s0)
sw a4,0(a5)
.L12:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L11:
ld a5,-80(s0)
lw a4,0(a5)
lw a5,-28(s0)
subw a5,a4,a5
sext.w a5,a5
addiw a5,a5,-1
sext.w a4,a5
lw a5,-24(s0)
sext.w a5,a5
blt a5,a4,.L13
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L10:
ld a5,-80(s0)
lw a5,0(a5)
addiw a5,a5,-1
sext.w a4,a5
lw a5,-28(s0)
sext.w a5,a5
blt a5,a4,.L14
nop
nop
ld ra,72(sp)
ld s0,64(sp)
addi sp,sp,80
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem113/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "True"
.LC1:
.string "False"
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 80
mov QWORD PTR -56[rbp], rdi
mov QWORD PTR -64[rbp], rsi
mov QWORD PTR -72[rbp], rdx
mov QWORD PTR -80[rbp], rcx
mov rax, QWORD PTR -56[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -24[rbp], eax
mov eax, DWORD PTR -24[rbp]
add eax, 1
cdqe
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
mov DWORD PTR -36[rbp], 0
mov DWORD PTR -32[rbp], 0
jmp .L2
.L8:
mov rax, QWORD PTR -64[rbp]
mov QWORD PTR -16[rbp], rax
mov BYTE PTR -38[rbp], 0
jmp .L3
.L6:
mov eax, DWORD PTR -32[rbp]
movsx rdx, eax
mov rax, QWORD PTR -56[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov rax, QWORD PTR -16[rbp]
movzx eax, BYTE PTR [rax]
cmp dl, al
jne .L4
mov BYTE PTR -38[rbp], 1
jmp .L5
.L4:
add QWORD PTR -16[rbp], 1
.L3:
mov rax, QWORD PTR -16[rbp]
movzx eax, BYTE PTR [rax]
test al, al
jne .L6
.L5:
movzx eax, BYTE PTR -38[rbp]
xor eax, 1
test al, al
je .L7
mov eax, DWORD PTR -32[rbp]
movsx rdx, eax
mov rax, QWORD PTR -56[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -36[rbp]
lea edx, 1[rax]
mov DWORD PTR -36[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rdx, rax
movzx eax, BYTE PTR [rcx]
mov BYTE PTR [rdx], al
.L7:
add DWORD PTR -32[rbp], 1
.L2:
mov eax, DWORD PTR -32[rbp]
movsx rdx, eax
mov rax, QWORD PTR -56[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L8
mov eax, DWORD PTR -36[rbp]
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
mov rax, QWORD PTR -8[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -20[rbp], eax
mov BYTE PTR -37[rbp], 1
mov DWORD PTR -28[rbp], 0
jmp .L9
.L12:
mov eax, DWORD PTR -28[rbp]
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
movzx edx, BYTE PTR [rax]
mov eax, DWORD PTR -20[rbp]
sub eax, 1
sub eax, DWORD PTR -28[rbp]
movsx rcx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rcx
movzx eax, BYTE PTR [rax]
cmp dl, al
je .L10
mov BYTE PTR -37[rbp], 0
jmp .L11
.L10:
add DWORD PTR -28[rbp], 1
.L9:
mov eax, DWORD PTR -20[rbp]
mov edx, eax
shr edx, 31
add eax, edx
sar eax
cmp DWORD PTR -28[rbp], eax
jl .L12
.L11:
mov rdx, QWORD PTR -8[rbp]
mov rax, QWORD PTR -72[rbp]
mov rsi, rdx
mov rdi, rax
call strcpy@PLT
cmp BYTE PTR -37[rbp], 0
je .L13
lea rax, .LC0[rip]
jmp .L14
.L13:
lea rax, .LC1[rip]
.L14:
mov rdx, QWORD PTR -80[rbp]
mov rsi, rax
mov rdi, rdx
call strcpy@PLT
mov rax, QWORD PTR -8[rbp]
mov rdi, rax
call free@PLT
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "True"
.align 3
.LC1:
.string "False"
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-96
sd ra,88(sp)
sd s0,80(sp)
addi s0,sp,96
sd a0,-72(s0)
sd a1,-80(s0)
sd a2,-88(s0)
sd a3,-96(s0)
ld a0,-72(s0)
call strlen@plt
mv a5,a0
sw a5,-40(s0)
lw a5,-40(s0)
addiw a5,a5,1
sext.w a5,a5
mv a0,a5
call malloc@plt
mv a5,a0
sd a5,-24(s0)
sw zero,-52(s0)
sw zero,-48(s0)
j .L2
.L8:
ld a5,-80(s0)
sd a5,-32(s0)
sb zero,-54(s0)
j .L3
.L6:
lw a5,-48(s0)
ld a4,-72(s0)
add a5,a4,a5
lbu a4,0(a5)
ld a5,-32(s0)
lbu a5,0(a5)
bne a4,a5,.L4
li a5,1
sb a5,-54(s0)
j .L5
.L4:
ld a5,-32(s0)
addi a5,a5,1
sd a5,-32(s0)
.L3:
ld a5,-32(s0)
lbu a5,0(a5)
bnez a5,.L6
.L5:
lbu a5,-54(s0)
xori a5,a5,1
andi a5,a5,0xff
beqz a5,.L7
lw a5,-48(s0)
ld a4,-72(s0)
add a4,a4,a5
lw a5,-52(s0)
addiw a3,a5,1
sw a3,-52(s0)
mv a3,a5
ld a5,-24(s0)
add a5,a5,a3
lbu a4,0(a4)
sb a4,0(a5)
.L7:
lw a5,-48(s0)
addiw a5,a5,1
sw a5,-48(s0)
.L2:
lw a5,-48(s0)
ld a4,-72(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L8
lw a5,-52(s0)
ld a4,-24(s0)
add a5,a4,a5
sb zero,0(a5)
ld a0,-24(s0)
call strlen@plt
mv a5,a0
sw a5,-36(s0)
li a5,1
sb a5,-53(s0)
sw zero,-44(s0)
j .L9
.L12:
lw a5,-44(s0)
ld a4,-24(s0)
add a5,a4,a5
lbu a3,0(a5)
lw a5,-36(s0)
addiw a5,a5,-1
sext.w a4,a5
lw a5,-44(s0)
subw a5,a4,a5
sext.w a5,a5
mv a4,a5
ld a5,-24(s0)
add a5,a5,a4
lbu a5,0(a5)
mv a4,a3
beq a4,a5,.L10
sb zero,-53(s0)
j .L11
.L10:
lw a5,-44(s0)
addiw a5,a5,1
sw a5,-44(s0)
.L9:
lw a5,-36(s0)
srliw a4,a5,31
addw a5,a4,a5
sraiw a5,a5,1
sext.w a4,a5
lw a5,-44(s0)
sext.w a5,a5
blt a5,a4,.L12
.L11:
ld a1,-24(s0)
ld a0,-88(s0)
call strcpy@plt
lbu a5,-53(s0)
andi a5,a5,0xff
beqz a5,.L13
lla a5,.LC0
j .L14
.L13:
lla a5,.LC1
.L14:
mv a1,a5
ld a0,-96(s0)
call strcpy@plt
ld a0,-24(s0)
call free@plt
nop
ld ra,88(sp)
ld s0,80(sp)
addi sp,sp,96
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem108/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov DWORD PTR -36[rbp], edi
mov edi, 8
call malloc@PLT
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -8[rbp]
mov DWORD PTR [rax], 0
mov rax, QWORD PTR -8[rbp]
add rax, 4
mov DWORD PTR [rax], 0
mov DWORD PTR -24[rbp], 1
jmp .L2
.L7:
mov DWORD PTR -20[rbp], 0
mov eax, DWORD PTR -24[rbp]
mov DWORD PTR -12[rbp], eax
mov eax, DWORD PTR -24[rbp]
mov DWORD PTR -16[rbp], eax
jmp .L3
.L4:
mov edx, DWORD PTR -20[rbp]
mov eax, edx
sal eax, 2
add eax, edx
add eax, eax
mov esi, eax
mov ecx, DWORD PTR -16[rbp]
movsx rax, ecx
imul rax, rax, 1717986919
shr rax, 32
mov edx, eax
sar edx, 2
mov eax, ecx
sar eax, 31
sub edx, eax
mov eax, edx
sal eax, 2
add eax, edx
add eax, eax
sub ecx, eax
mov edx, ecx
lea eax, [rsi+rdx]
mov DWORD PTR -20[rbp], eax
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
imul rdx, rdx, 1717986919
shr rdx, 32
sar edx, 2
sar eax, 31
sub edx, eax
mov eax, edx
mov DWORD PTR -16[rbp], eax
.L3:
cmp DWORD PTR -16[rbp], 0
jne .L4
mov eax, DWORD PTR -12[rbp]
cmp eax, DWORD PTR -20[rbp]
jne .L5
mov eax, DWORD PTR -12[rbp]
and eax, 1
test eax, eax
jne .L6
mov rax, QWORD PTR -8[rbp]
mov eax, DWORD PTR [rax]
lea edx, 1[rax]
mov rax, QWORD PTR -8[rbp]
mov DWORD PTR [rax], edx
jmp .L5
.L6:
mov rax, QWORD PTR -8[rbp]
add rax, 4
mov edx, DWORD PTR [rax]
add edx, 1
mov DWORD PTR [rax], edx
.L5:
add DWORD PTR -24[rbp], 1
.L2:
mov eax, DWORD PTR -24[rbp]
cmp eax, DWORD PTR -36[rbp]
jle .L7
mov rax, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
mv a5,a0
sw a5,-52(s0)
li a0,8
call malloc@plt
mv a5,a0
sd a5,-24(s0)
ld a5,-24(s0)
sw zero,0(a5)
ld a5,-24(s0)
addi a5,a5,4
sw zero,0(a5)
li a5,1
sw a5,-40(s0)
j .L2
.L7:
sw zero,-36(s0)
lw a5,-40(s0)
sw a5,-28(s0)
lw a5,-40(s0)
sw a5,-32(s0)
j .L3
.L4:
lw a4,-36(s0)
mv a5,a4
slliw a5,a5,2
addw a5,a5,a4
slliw a5,a5,1
sext.w a4,a5
lw a3,-32(s0)
li a5,10
remw a5,a3,a5
sext.w a5,a5
addw a5,a4,a5
sw a5,-36(s0)
lw a4,-32(s0)
li a5,10
divw a5,a4,a5
sw a5,-32(s0)
.L3:
lw a5,-32(s0)
sext.w a5,a5
bnez a5,.L4
lw a4,-28(s0)
lw a5,-36(s0)
sext.w a4,a4
sext.w a5,a5
bne a4,a5,.L5
lw a5,-28(s0)
andi a5,a5,1
sext.w a5,a5
bnez a5,.L6
ld a5,-24(s0)
lw a5,0(a5)
addiw a5,a5,1
sext.w a4,a5
ld a5,-24(s0)
sw a4,0(a5)
j .L5
.L6:
ld a5,-24(s0)
addi a5,a5,4
lw a4,0(a5)
addiw a4,a4,1
sext.w a4,a4
sw a4,0(a5)
.L5:
lw a5,-40(s0)
addiw a5,a5,1
sw a5,-40(s0)
.L2:
lw a4,-40(s0)
lw a5,-52(s0)
sext.w a4,a4
sext.w a5,a5
ble a4,a5,.L7
ld a5,-24(s0)
mv a0,a5
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem83/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
mov rax, QWORD PTR -24[rbp]
mov rdi, rax
call strlen@PLT
mov DWORD PTR -4[rbp], eax
cmp DWORD PTR -4[rbp], 1
jg .L2
mov eax, 0
jmp .L3
.L2:
mov DWORD PTR -8[rbp], 2
jmp .L4
.L6:
mov eax, DWORD PTR -4[rbp]
cdq
idiv DWORD PTR -8[rbp]
mov eax, edx
test eax, eax
jne .L5
mov eax, 0
jmp .L3
.L5:
add DWORD PTR -8[rbp], 1
.L4:
mov eax, DWORD PTR -8[rbp]
imul eax, eax
cmp DWORD PTR -4[rbp], eax
jge .L6
mov eax, 1
.L3:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
addi s0,sp,48
sd a0,-40(s0)
ld a0,-40(s0)
call strlen@plt
mv a5,a0
sw a5,-20(s0)
lw a5,-20(s0)
sext.w a4,a5
li a5,1
bgt a4,a5,.L2
li a5,0
j .L3
.L2:
li a5,2
sw a5,-24(s0)
j .L4
.L6:
lw a4,-20(s0)
lw a5,-24(s0)
remw a5,a4,a5
sext.w a5,a5
bnez a5,.L5
li a5,0
j .L3
.L5:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L4:
lw a5,-24(s0)
mulw a5,a5,a5
sext.w a4,a5
lw a5,-20(s0)
sext.w a5,a5
bge a5,a4,.L6
li a5,1
.L3:
mv a0,a5
ld ra,40(sp)
ld s0,32(sp)
addi sp,sp,48
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem144/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
mov DWORD PTR -4[rbp], 0
mov DWORD PTR -20[rbp], 0
mov DWORD PTR -16[rbp], 0
mov DWORD PTR -12[rbp], 0
jmp .L2
.L13:
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 32
je .L3
add DWORD PTR -20[rbp], 1
jmp .L4
.L3:
cmp DWORD PTR -20[rbp], 1
jle .L5
mov BYTE PTR -21[rbp], 1
mov DWORD PTR -8[rbp], 2
jmp .L6
.L9:
mov eax, DWORD PTR -20[rbp]
cdq
idiv DWORD PTR -8[rbp]
mov eax, edx
test eax, eax
jne .L7
mov BYTE PTR -21[rbp], 0
jmp .L10
.L7:
add DWORD PTR -8[rbp], 1
.L6:
mov eax, DWORD PTR -8[rbp]
imul eax, eax
cmp DWORD PTR -20[rbp], eax
jge .L9
jmp .L10
.L5:
mov BYTE PTR -21[rbp], 0
.L10:
cmp BYTE PTR -21[rbp], 0
je .L11
cmp DWORD PTR -16[rbp], 0
jle .L12
mov eax, DWORD PTR -16[rbp]
lea edx, 1[rax]
mov DWORD PTR -16[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 32
.L12:
mov eax, DWORD PTR -20[rbp]
cdqe
mov edx, DWORD PTR -12[rbp]
movsx rcx, edx
mov edx, DWORD PTR -20[rbp]
movsx rdx, edx
sub rcx, rdx
mov rdx, QWORD PTR -40[rbp]
lea rsi, [rcx+rdx]
mov edx, DWORD PTR -16[rbp]
movsx rcx, edx
mov rdx, QWORD PTR -48[rbp]
add rcx, rdx
mov rdx, rax
mov rdi, rcx
call memcpy@PLT
mov eax, DWORD PTR -20[rbp]
add DWORD PTR -16[rbp], eax
.L11:
mov DWORD PTR -20[rbp], 0
.L4:
add DWORD PTR -12[rbp], 1
.L2:
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L13
cmp DWORD PTR -20[rbp], 1
jle .L14
mov BYTE PTR -21[rbp], 1
mov DWORD PTR -8[rbp], 2
jmp .L15
.L18:
mov eax, DWORD PTR -20[rbp]
cdq
idiv DWORD PTR -8[rbp]
mov eax, edx
test eax, eax
jne .L16
mov BYTE PTR -21[rbp], 0
jmp .L19
.L16:
add DWORD PTR -8[rbp], 1
.L15:
mov eax, DWORD PTR -8[rbp]
imul eax, eax
cmp DWORD PTR -20[rbp], eax
jge .L18
jmp .L19
.L14:
mov BYTE PTR -21[rbp], 0
.L19:
cmp BYTE PTR -21[rbp], 0
je .L20
cmp DWORD PTR -16[rbp], 0
jle .L21
mov eax, DWORD PTR -16[rbp]
lea edx, 1[rax]
mov DWORD PTR -16[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 32
.L21:
mov eax, DWORD PTR -20[rbp]
cdqe
mov edx, DWORD PTR -12[rbp]
movsx rcx, edx
mov edx, DWORD PTR -20[rbp]
movsx rdx, edx
sub rcx, rdx
mov rdx, QWORD PTR -40[rbp]
lea rsi, [rcx+rdx]
mov edx, DWORD PTR -16[rbp]
movsx rcx, edx
mov rdx, QWORD PTR -48[rbp]
add rcx, rdx
mov rdx, rax
mov rdi, rcx
call memcpy@PLT
mov eax, DWORD PTR -20[rbp]
add DWORD PTR -16[rbp], eax
.L20:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
sd a1,-64(s0)
sw zero,-20(s0)
sw zero,-36(s0)
sw zero,-32(s0)
sw zero,-28(s0)
j .L2
.L13:
lw a5,-28(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,32
beq a4,a5,.L3
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
j .L4
.L3:
lw a5,-36(s0)
sext.w a4,a5
li a5,1
ble a4,a5,.L5
li a5,1
sb a5,-37(s0)
li a5,2
sw a5,-24(s0)
j .L6
.L9:
lw a4,-36(s0)
lw a5,-24(s0)
remw a5,a4,a5
sext.w a5,a5
bnez a5,.L7
sb zero,-37(s0)
j .L10
.L7:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L6:
lw a5,-24(s0)
mulw a5,a5,a5
sext.w a4,a5
lw a5,-36(s0)
sext.w a5,a5
bge a5,a4,.L9
j .L10
.L5:
sb zero,-37(s0)
.L10:
lbu a5,-37(s0)
andi a5,a5,0xff
beqz a5,.L11
lw a5,-32(s0)
sext.w a5,a5
blez a5,.L12
lw a5,-32(s0)
addiw a4,a5,1
sw a4,-32(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,32
sb a4,0(a5)
.L12:
lw a5,-32(s0)
ld a4,-64(s0)
add a3,a4,a5
lw a4,-28(s0)
lw a5,-36(s0)
sub a5,a4,a5
ld a4,-56(s0)
add a5,a4,a5
lw a4,-36(s0)
mv a2,a4
mv a1,a5
mv a0,a3
call memcpy@plt
lw a4,-32(s0)
lw a5,-36(s0)
addw a5,a4,a5
sw a5,-32(s0)
.L11:
sw zero,-36(s0)
.L4:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L2:
lw a5,-28(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L13
lw a5,-36(s0)
sext.w a4,a5
li a5,1
ble a4,a5,.L14
li a5,1
sb a5,-37(s0)
li a5,2
sw a5,-24(s0)
j .L15
.L18:
lw a4,-36(s0)
lw a5,-24(s0)
remw a5,a4,a5
sext.w a5,a5
bnez a5,.L16
sb zero,-37(s0)
j .L19
.L16:
lw a5,-24(s0)
addiw a5,a5,1
sw a5,-24(s0)
.L15:
lw a5,-24(s0)
mulw a5,a5,a5
sext.w a4,a5
lw a5,-36(s0)
sext.w a5,a5
bge a5,a4,.L18
j .L19
.L14:
sb zero,-37(s0)
.L19:
lbu a5,-37(s0)
andi a5,a5,0xff
beqz a5,.L20
lw a5,-32(s0)
sext.w a5,a5
blez a5,.L21
lw a5,-32(s0)
addiw a4,a5,1
sw a4,-32(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,32
sb a4,0(a5)
.L21:
lw a5,-32(s0)
ld a4,-64(s0)
add a3,a4,a5
lw a4,-28(s0)
lw a5,-36(s0)
sub a5,a4,a5
ld a4,-56(s0)
add a5,a4,a5
lw a4,-36(s0)
mv a2,a4
mv a1,a5
mv a0,a3
call memcpy@plt
lw a4,-32(s0)
lw a5,-36(s0)
addw a5,a4,a5
sw a5,-32(s0)
.L20:
lw a5,-32(s0)
ld a4,-64(s0)
add a5,a4,a5
sb zero,0(a5)
nop
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem141/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push rbx
sub rsp, 40
.cfi_offset 3, -24
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
mov DWORD PTR -28[rbp], 0
mov DWORD PTR -24[rbp], 0
mov DWORD PTR -20[rbp], 0
jmp .L2
.L8:
mov eax, DWORD PTR -20[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp al, 32
jne .L3
add DWORD PTR -28[rbp], 1
jmp .L4
.L3:
cmp DWORD PTR -28[rbp], 1
jne .L5
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
.L5:
cmp DWORD PTR -28[rbp], 2
jne .L6
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
.L6:
cmp DWORD PTR -28[rbp], 2
jle .L7
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 45
.L7:
mov DWORD PTR -28[rbp], 0
mov eax, DWORD PTR -20[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
lea rcx, [rdx+rax]
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rdx, rax
movzx eax, BYTE PTR [rcx]
mov BYTE PTR [rdx], al
.L4:
add DWORD PTR -20[rbp], 1
.L2:
mov eax, DWORD PTR -20[rbp]
movsx rbx, eax
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call strlen@PLT
cmp rbx, rax
jb .L8
cmp DWORD PTR -28[rbp], 1
jne .L9
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
.L9:
cmp DWORD PTR -28[rbp], 2
jne .L10
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 95
.L10:
cmp DWORD PTR -28[rbp], 2
jle .L11
mov eax, DWORD PTR -24[rbp]
lea edx, 1[rax]
mov DWORD PTR -24[rbp], edx
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 45
.L11:
mov eax, DWORD PTR -24[rbp]
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
nop
add rsp, 40
pop rbx
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
sd s1,40(sp)
addi s0,sp,64
sd a0,-56(s0)
sd a1,-64(s0)
sw zero,-44(s0)
sw zero,-40(s0)
sw zero,-36(s0)
j .L2
.L8:
lw a5,-36(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
mv a4,a5
li a5,32
bne a4,a5,.L3
lw a5,-44(s0)
addiw a5,a5,1
sw a5,-44(s0)
j .L4
.L3:
lw a5,-44(s0)
sext.w a4,a5
li a5,1
bne a4,a5,.L5
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
.L5:
lw a5,-44(s0)
sext.w a4,a5
li a5,2
bne a4,a5,.L6
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
.L6:
lw a5,-44(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L7
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,45
sb a4,0(a5)
.L7:
sw zero,-44(s0)
lw a5,-36(s0)
ld a4,-56(s0)
add a4,a4,a5
lw a5,-40(s0)
addiw a3,a5,1
sw a3,-40(s0)
mv a3,a5
ld a5,-64(s0)
add a5,a5,a3
lbu a4,0(a4)
sb a4,0(a5)
.L4:
lw a5,-36(s0)
addiw a5,a5,1
sw a5,-36(s0)
.L2:
lw s1,-36(s0)
ld a0,-56(s0)
call strlen@plt
mv a5,a0
bltu s1,a5,.L8
lw a5,-44(s0)
sext.w a4,a5
li a5,1
bne a4,a5,.L9
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
.L9:
lw a5,-44(s0)
sext.w a4,a5
li a5,2
bne a4,a5,.L10
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,95
sb a4,0(a5)
.L10:
lw a5,-44(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L11
lw a5,-40(s0)
addiw a4,a5,1
sw a4,-40(s0)
mv a4,a5
ld a5,-64(s0)
add a5,a5,a4
li a4,45
sb a4,0(a5)
.L11:
lw a5,-40(s0)
ld a4,-64(s0)
add a5,a4,a5
sb zero,0(a5)
nop
ld ra,56(sp)
ld s0,48(sp)
ld s1,40(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem3/code.c | .file "code.c"
.intel_syntax noprefix
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movss DWORD PTR -4[rbp], xmm0
movss xmm0, DWORD PTR -4[rbp]
cvttss2si eax, xmm0
cvtsi2ss xmm1, eax
movss xmm0, DWORD PTR -4[rbp]
subss xmm0, xmm1
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-32
sd s0,24(sp)
addi s0,sp,32
fsw fa0,-20(s0)
flw fa5,-20(s0)
fcvt.w.s a5,fa5,rtz
sext.w a5,a5
fcvt.s.w fa5,a5
flw fa4,-20(s0)
fsub.s fa5,fa4,fa5
fmv.s fa0,fa5
ld s0,24(sp)
addi sp,sp,32
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
eval/problem94/code.c | .file "code.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "aeiouAEIOU"
.text
.globl func0
.type func0, @function
func0:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
lea rax, .LC0[rip]
mov QWORD PTR -8[rbp], rax
mov DWORD PTR -16[rbp], 0
jmp .L2
.L10:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
mov BYTE PTR -17[rbp], al
call __ctype_b_loc@PLT
mov rax, QWORD PTR [rax]
movsx rdx, BYTE PTR -17[rbp]
add rdx, rdx
add rax, rdx
movzx eax, WORD PTR [rax]
movzx eax, ax
and eax, 512
test eax, eax
je .L3
movsx eax, BYTE PTR -17[rbp]
mov edi, eax
call toupper@PLT
mov BYTE PTR -17[rbp], al
jmp .L4
.L3:
call __ctype_b_loc@PLT
mov rax, QWORD PTR [rax]
movsx rdx, BYTE PTR -17[rbp]
add rdx, rdx
add rax, rdx
movzx eax, WORD PTR [rax]
movzx eax, ax
and eax, 256
test eax, eax
je .L4
movsx eax, BYTE PTR -17[rbp]
mov edi, eax
call tolower@PLT
mov BYTE PTR -17[rbp], al
.L4:
mov DWORD PTR -12[rbp], 0
jmp .L5
.L9:
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
cmp BYTE PTR -17[rbp], al
jne .L6
cmp DWORD PTR -12[rbp], 9
jg .L11
movzx eax, BYTE PTR -17[rbp]
add eax, 2
mov BYTE PTR -17[rbp], al
jmp .L11
.L6:
add DWORD PTR -12[rbp], 1
.L5:
mov eax, DWORD PTR -12[rbp]
movsx rdx, eax
mov rax, QWORD PTR -8[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L9
jmp .L8
.L11:
nop
.L8:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rdx, rax
movzx eax, BYTE PTR -17[rbp]
mov BYTE PTR [rdx], al
add DWORD PTR -16[rbp], 1
.L2:
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
movzx eax, BYTE PTR [rax]
test al, al
jne .L10
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, QWORD PTR -48[rbp]
add rax, rdx
mov BYTE PTR [rax], 0
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 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:
| .file "code.c"
.option pic
.text
.section .rodata
.align 3
.LC0:
.string "aeiouAEIOU"
.text
.align 1
.globl func0
.type func0, @function
func0:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
addi s0,sp,64
sd a0,-56(s0)
sd a1,-64(s0)
lla a5,.LC0
sd a5,-24(s0)
sw zero,-32(s0)
j .L2
.L10:
lw a5,-32(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
sb a5,-33(s0)
call __ctype_b_loc@plt
mv a5,a0
ld a4,0(a5)
lbu a5,-33(s0)
slli a5,a5,1
add a5,a4,a5
lhu a5,0(a5)
sext.w a5,a5
andi a5,a5,512
sext.w a5,a5
beqz a5,.L3
lbu a5,-33(s0)
sext.w a5,a5
mv a0,a5
call toupper@plt
mv a5,a0
sb a5,-33(s0)
j .L4
.L3:
call __ctype_b_loc@plt
mv a5,a0
ld a4,0(a5)
lbu a5,-33(s0)
slli a5,a5,1
add a5,a4,a5
lhu a5,0(a5)
sext.w a5,a5
andi a5,a5,256
sext.w a5,a5
beqz a5,.L4
lbu a5,-33(s0)
sext.w a5,a5
mv a0,a5
call tolower@plt
mv a5,a0
sb a5,-33(s0)
.L4:
sw zero,-28(s0)
j .L5
.L9:
lw a5,-28(s0)
ld a4,-24(s0)
add a5,a4,a5
lbu a4,0(a5)
lbu a5,-33(s0)
andi a5,a5,0xff
bne a5,a4,.L6
lw a5,-28(s0)
sext.w a4,a5
li a5,9
bgt a4,a5,.L11
lbu a5,-33(s0)
addiw a5,a5,2
sb a5,-33(s0)
j .L11
.L6:
lw a5,-28(s0)
addiw a5,a5,1
sw a5,-28(s0)
.L5:
lw a5,-28(s0)
ld a4,-24(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L9
j .L8
.L11:
nop
.L8:
lw a5,-32(s0)
ld a4,-64(s0)
add a5,a4,a5
lbu a4,-33(s0)
sb a4,0(a5)
lw a5,-32(s0)
addiw a5,a5,1
sw a5,-32(s0)
.L2:
lw a5,-32(s0)
ld a4,-56(s0)
add a5,a4,a5
lbu a5,0(a5)
bnez a5,.L10
lw a5,-32(s0)
ld a4,-64(s0)
add a5,a4,a5
sb zero,0(a5)
nop
ld ra,56(sp)
ld s0,48(sp)
addi sp,sp,64
jr ra
.size func0, .-func0
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0"
.section .note.GNU-stack,"",@progbits
|
Please see paper & code for more information:
If you use this model in your research, please cite it as follows:
@article{heakl2024cisc,
title={From CISC to RISC: language-model guided assembly transpilation},
author={Heakl, Ahmed and Abi, Chaimaa and Hossam, Rania and Mahmoud, Abdulrahman},
journal={arXiv preprint arXiv:2411.16341},
year={2024}
}