ASM Long
Collection
Neural Long Context Assembly Transpilation
•
19 items
•
Updated
files
stringlengths 15
17
| arm
stringlengths 482
13.3k
| x86
stringlengths 628
13k
|
---|---|---|
problem1/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #16]
str w1, [sp, #12]
str s0, [sp, #8]
str wzr, [sp, #4]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldr w8, [sp, #4]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_8
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldrsw x9, [sp, #4]
ldr s0, [x8, x9, lsl #2]
ldr x8, [sp, #16]
ldrsw x9, [sp]
ldr s1, [x8, x9, lsl #2]
fsub s0, s0, s1
fcvt d0, s0
fabs d0, d0
ldr s1, [sp, #8]
fcvt d1, s1
fcmp d0, d1
cset w8, pl
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5:
mov w8, #1
str w8, [sp, #28]
b LBB0_11
LBB0_6: ; in Loop: Header=BB0_3 Depth=2
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp]
add w8, w8, #1
str w8, [sp]
b LBB0_3
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_1
LBB0_10:
str wzr, [sp, #28]
b LBB0_11
LBB0_11:
ldr w0, [sp, #28]
add sp, sp, #32
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.section .rodata.cst16,"aM",@progbits,16
.p2align 4 # -- Begin function func0
.LCPI0_0:
.quad 0x7fffffffffffffff # double NaN
.quad 0x7fffffffffffffff # double NaN
.text
.globl func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -16(%rbp)
movl %esi, -20(%rbp)
movss %xmm0, -24(%rbp)
movl $0, -28(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -28(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_10
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movl -32(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_8
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -16(%rbp), %rax
movslq -28(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero
movq -16(%rbp), %rax
movslq -32(%rbp), %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movaps .LCPI0_0(%rip), %xmm0 # xmm0 = [NaN,NaN]
pand %xmm0, %xmm1
movss -24(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe .LBB0_6
# %bb.5:
movl $1, -4(%rbp)
jmp .LBB0_11
.LBB0_6: # in Loop: Header=BB0_3 Depth=2
jmp .LBB0_7
.LBB0_7: # in Loop: Header=BB0_3 Depth=2
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
jmp .LBB0_3
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_1
.LBB0_10:
movl $0, -4(%rbp)
.LBB0_11:
movl -4(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem10/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur w1, [x29, #-20]
ldur w8, [x29, #-20]
subs w8, w8, #0
cset w8, gt
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
; kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b LBB0_11
LBB0_2:
ldursw x8, [x29, #-20]
lsl x0, x8, #2
bl _malloc
str x0, [sp, #16]
ldr x8, [sp, #16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3:
; kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b LBB0_11
LBB0_4:
ldur x8, [x29, #-16]
ldr w8, [x8]
str w8, [sp, #12]
str wzr, [sp, #8]
b LBB0_5
LBB0_5: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldur w9, [x29, #-20]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldr w8, [x8, x9, lsl #2]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #12]
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_5 Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldrsw x10, [sp, #8]
str w8, [x9, x10, lsl #2]
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_5 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_5
LBB0_10:
ldr x8, [sp, #16]
stur x8, [x29, #-8]
b LBB0_11
LBB0_11:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -16(%rbp)
movl %esi, -20(%rbp)
cmpl $0, -20(%rbp)
jg .LBB0_2
# %bb.1:
movq $0, -8(%rbp)
jmp .LBB0_11
.LBB0_2:
movslq -20(%rbp), %rdi
shlq $2, %rdi
callq malloc@PLT
movq %rax, -32(%rbp)
cmpq $0, -32(%rbp)
jne .LBB0_4
# %bb.3:
movq $0, -8(%rbp)
jmp .LBB0_11
.LBB0_4:
movq -16(%rbp), %rax
movl (%rax), %eax
movl %eax, -36(%rbp)
movl $0, -40(%rbp)
.LBB0_5: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_10
# %bb.6: # in Loop: Header=BB0_5 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -36(%rbp), %eax
jle .LBB0_8
# %bb.7: # in Loop: Header=BB0_5 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -36(%rbp)
.LBB0_8: # in Loop: Header=BB0_5 Depth=1
movl -36(%rbp), %edx
movq -32(%rbp), %rax
movslq -40(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
# %bb.9: # in Loop: Header=BB0_5 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_5
.LBB0_10:
movq -32(%rbp), %rax
movq %rax, -8(%rbp)
.LBB0_11:
movq -8(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem100/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
ldur x0, [x29, #-8]
bl _atof
str d0, [sp, #16]
ldr d0, [sp, #16]
fcmp d0, #0.0
cset w8, pl
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
ldr d0, [sp, #16]
fmov d1, #0.50000000
fsub d0, d0, d1
frintp d0, d0
str d0, [sp, #8] ; 8-byte Folded Spill
b LBB0_3
LBB0_2:
ldr d0, [sp, #16]
fmov d1, #0.50000000
fadd d0, d0, d1
frintm d0, d0
str d0, [sp, #8] ; 8-byte Folded Spill
b LBB0_3
LBB0_3:
ldr d0, [sp, #8] ; 8-byte Folded Reload
fcvtzs w0, d0
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3 # -- Begin function func0
.LCPI0_0:
.quad 0x3fe0000000000000 # double 0.5
.text
.globl func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $32, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rdi
callq atof@PLT
movsd %xmm0, -16(%rbp)
xorps %xmm0, %xmm0
ucomisd -16(%rbp), %xmm0
jbe .LBB0_2
# %bb.1:
movsd -16(%rbp), %xmm0 # xmm0 = mem[0],zero
movsd .LCPI0_0(%rip), %xmm1 # xmm1 = mem[0],zero
subsd %xmm1, %xmm0
callq ceil@PLT
movsd %xmm0, -24(%rbp) # 8-byte Spill
jmp .LBB0_3
.LBB0_2:
movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero
addsd -16(%rbp), %xmm0
callq floor@PLT
movsd %xmm0, -24(%rbp) # 8-byte Spill
.LBB0_3:
movsd -24(%rbp), %xmm0 # 8-byte Reload
# xmm0 = mem[0],zero
cvttsd2si %xmm0, %eax
addq $32, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym atof
|
problem101/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
ldursw x8, [x29, #-4]
lsl x0, x8, #2
bl _malloc
str x0, [sp, #16]
ldur w8, [x29, #-4]
ldr x9, [sp, #16]
str w8, [x9]
mov w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_4
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
ldrsw x9, [sp, #12]
add x8, x8, x9, lsl #2
ldur w8, [x8, #-4]
add w8, w8, #2
ldr x9, [sp, #16]
ldrsw x10, [sp, #12]
str w8, [x9, x10, lsl #2]
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_4:
ldr x0, [sp, #16]
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $32, %rsp
movl %edi, -4(%rbp)
movslq -4(%rbp), %rdi
shlq $2, %rdi
callq malloc@PLT
movq %rax, -16(%rbp)
movl -4(%rbp), %ecx
movq -16(%rbp), %rax
movl %ecx, (%rax)
movl $1, -20(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -20(%rbp), %eax
cmpl -4(%rbp), %eax
jge .LBB0_4
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movslq -20(%rbp), %rcx
movl -4(%rax,%rcx,4), %edx
addl $2, %edx
movq -16(%rbp), %rax
movslq -20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %eax
addl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_1
.LBB0_4:
movq -16(%rbp), %rax
addq $32, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem102/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #16
.cfi_def_cfa_offset 16
str w0, [sp, #8]
str w1, [sp, #4]
ldr w8, [sp, #4]
ldr w9, [sp, #8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
mov w8, #-1
str w8, [sp, #12]
b LBB0_8
LBB0_2:
ldr w8, [sp, #4]
ldr w9, [sp, #8]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_5
b LBB0_3
LBB0_3:
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4:
mov w8, #-1
str w8, [sp, #12]
b LBB0_8
LBB0_5:
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6:
ldr w8, [sp, #4]
subs w8, w8, #1
str w8, [sp, #12]
b LBB0_8
LBB0_7:
ldr w8, [sp, #4]
str w8, [sp, #12]
b LBB0_8
LBB0_8:
ldr w0, [sp, #12]
add sp, sp, #16
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movl %edi, -8(%rbp)
movl %esi, -12(%rbp)
movl -12(%rbp), %eax
cmpl -8(%rbp), %eax
jge .LBB0_2
# %bb.1:
movl $-1, -4(%rbp)
jmp .LBB0_8
.LBB0_2:
movl -12(%rbp), %eax
cmpl -8(%rbp), %eax
jne .LBB0_5
# %bb.3:
movl -12(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_5
# %bb.4:
movl $-1, -4(%rbp)
jmp .LBB0_8
.LBB0_5:
movl -12(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_7
# %bb.6:
movl -12(%rbp), %eax
subl $1, %eax
movl %eax, -4(%rbp)
jmp .LBB0_8
.LBB0_7:
movl -12(%rbp), %eax
movl %eax, -4(%rbp)
.LBB0_8:
movl -4(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem103/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #16
.cfi_def_cfa_offset 16
str w0, [sp, #8]
str w1, [sp, #4]
ldr w8, [sp, #4]
ldr w9, [sp, #8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
mov w8, #-1
str w8, [sp, #12]
b LBB0_8
LBB0_2:
ldr w8, [sp, #4]
ldr w9, [sp, #8]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_5
b LBB0_3
LBB0_3:
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4:
mov w8, #-1
str w8, [sp, #12]
b LBB0_8
LBB0_5:
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6:
ldr w8, [sp, #4]
subs w8, w8, #1
str w8, [sp, #12]
b LBB0_8
LBB0_7:
ldr w8, [sp, #4]
str w8, [sp, #12]
b LBB0_8
LBB0_8:
ldr w0, [sp, #12]
add sp, sp, #16
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movl %edi, -8(%rbp)
movl %esi, -12(%rbp)
movl -12(%rbp), %eax
cmpl -8(%rbp), %eax
jge .LBB0_2
# %bb.1:
movl $-1, -4(%rbp)
jmp .LBB0_8
.LBB0_2:
movl -12(%rbp), %eax
cmpl -8(%rbp), %eax
jne .LBB0_5
# %bb.3:
movl -12(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_5
# %bb.4:
movl $-1, -4(%rbp)
jmp .LBB0_8
.LBB0_5:
movl -12(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_7
# %bb.6:
movl -12(%rbp), %eax
subl $1, %eax
movl %eax, -4(%rbp)
jmp .LBB0_8
.LBB0_7:
movl -12(%rbp), %eax
movl %eax, -4(%rbp)
.LBB0_8:
movl -4(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem104/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-12]
stur w1, [x29, #-16]
ldur w8, [x29, #-12]
ldur w9, [x29, #-16]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
stur x8, [x29, #-8]
b LBB0_6
LBB0_2:
ldur w8, [x29, #-16]
ldur w9, [x29, #-12]
add w8, w8, w9
mov w9, #2
sdiv w8, w8, w9
stur w8, [x29, #-20]
mov x0, #33
bl _malloc
str x0, [sp, #16]
ldr x8, [sp, #16]
strb wzr, [x8]
mov w8, #32
str w8, [sp, #12]
ldr x8, [sp, #16]
ldrsw x9, [sp, #12]
mov x10, x9
subs w10, w10, #1
str w10, [sp, #12]
add x8, x8, x9
strb wzr, [x8]
b LBB0_3
LBB0_3: ; =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
mov w9, #2
sdiv w10, w8, w9
mul w10, w10, w9
subs w8, w8, w10
add w8, w8, #48
ldr x10, [sp, #16]
ldrsw x11, [sp, #12]
mov x12, x11
subs w12, w12, #1
str w12, [sp, #12]
strb w8, [x10, x11]
ldur w8, [x29, #-20]
sdiv w8, w8, w9
stur w8, [x29, #-20]
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=1
ldur w8, [x29, #-20]
subs w8, w8, #0
cset w8, gt
tbnz w8, #0, LBB0_3
b LBB0_5
LBB0_5:
ldr x8, [sp, #16]
ldr w9, [sp, #12]
add w9, w9, #1
add x8, x8, w9, sxtw
stur x8, [x29, #-8]
b LBB0_6
LBB0_6:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "-1"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movl %edi, -12(%rbp)
movl %esi, -16(%rbp)
movl -12(%rbp), %eax
cmpl -16(%rbp), %eax
jle .LBB0_2
# %bb.1:
leaq .L.str(%rip), %rax
movq %rax, -8(%rbp)
jmp .LBB0_6
.LBB0_2:
movl -16(%rbp), %eax
addl -12(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
movl %eax, -20(%rbp)
movl $33, %edi
callq malloc@PLT
movq %rax, -32(%rbp)
movq -32(%rbp), %rax
movb $0, (%rax)
movl $32, -36(%rbp)
movq -32(%rbp), %rax
movl -36(%rbp), %ecx
movl %ecx, %edx
addl $-1, %edx
movl %edx, -36(%rbp)
movslq %ecx, %rcx
movb $0, (%rax,%rcx)
.LBB0_3: # =>This Inner Loop Header: Depth=1
movl -20(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
addl $48, %edx
# kill: def $dl killed $dl killed $edx
movq -32(%rbp), %rax
movl -36(%rbp), %ecx
movl %ecx, %esi
addl $-1, %esi
movl %esi, -36(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -20(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
movl %eax, -20(%rbp)
# %bb.4: # in Loop: Header=BB0_3 Depth=1
cmpl $0, -20(%rbp)
jg .LBB0_3
# %bb.5:
movq -32(%rbp), %rax
movl -36(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -8(%rbp)
.LBB0_6:
movq -8(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "-1"
.size .L.str, 3
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem105/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] ; 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
str x3, [sp, #32]
ldursw x8, [x29, #-12]
lsl x0, x8, #2
bl _malloc
ldur x8, [x29, #-24]
str x0, [x8]
ldr x8, [sp, #32]
str wzr, [x8]
str wzr, [sp, #28]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_5 Depth 2
ldr w8, [sp, #28]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_15
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #28]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #24]
strb wzr, [sp, #23]
ldr w8, [sp, #24]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
mov w8, #1
strb w8, [sp, #23]
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
b LBB0_5
LBB0_5: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #24]
subs w8, w8, #0
cset w8, le
mov w9, #0
str w9, [sp, #4] ; 4-byte Folded Spill
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=2
ldrb w8, [sp, #23]
eor w8, w8, #0x1
str w8, [sp, #4] ; 4-byte Folded Spill
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_5 Depth=2
ldr w8, [sp, #4] ; 4-byte Folded Reload
tbz w8, #0, LBB0_11
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_5 Depth=2
ldr w8, [sp, #24]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_10
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_5 Depth=2
mov w8, #1
strb w8, [sp, #23]
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_5 Depth=2
ldr w8, [sp, #24]
mov w9, #10
sdiv w8, w8, w9
str w8, [sp, #24]
b LBB0_5
LBB0_11: ; in Loop: Header=BB0_1 Depth=1
ldrb w8, [sp, #23]
tbnz w8, #0, LBB0_13
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #28]
ldr w8, [x8, x9, lsl #2]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr x10, [sp, #32]
ldrsw x10, [x10]
str w8, [x9, x10, lsl #2]
ldr x9, [sp, #32]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_1 Depth=1
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
b LBB0_1
LBB0_15:
str wzr, [sp, #16]
b LBB0_16
LBB0_16: ; =>This Loop Header: Depth=1
; Child Loop BB0_18 Depth 2
ldr w8, [sp, #16]
ldr x9, [sp, #32]
ldr w9, [x9]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_25
b LBB0_17
LBB0_17: ; in Loop: Header=BB0_16 Depth=1
str wzr, [sp, #12]
b LBB0_18
LBB0_18: ; Parent Loop BB0_16 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #12]
ldr x9, [sp, #32]
ldr w9, [x9]
ldr w10, [sp, #16]
subs w9, w9, w10
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_23
b LBB0_19
LBB0_19: ; in Loop: Header=BB0_18 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr w10, [sp, #12]
add w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_21
b LBB0_20
LBB0_20: ; in Loop: Header=BB0_18 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #8]
ldur x8, [x29, #-24]
ldr x8, [x8]
ldr w9, [sp, #12]
add w9, w9, #1
ldr w8, [x8, w9, sxtw #2]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldrsw x10, [sp, #12]
str w8, [x9, x10, lsl #2]
ldr w8, [sp, #8]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr w10, [sp, #12]
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_21
LBB0_21: ; in Loop: Header=BB0_18 Depth=2
b LBB0_22
LBB0_22: ; in Loop: Header=BB0_18 Depth=2
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_18
LBB0_23: ; in Loop: Header=BB0_16 Depth=1
b LBB0_24
LBB0_24: ; in Loop: Header=BB0_16 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_16
LBB0_25:
ldp x29, x30, [sp, #64] ; 16-byte Folded Reload
add sp, sp, #80
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $64, %rsp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movq %rdx, -24(%rbp)
movq %rcx, -32(%rbp)
movslq -12(%rbp), %rdi
shlq $2, %rdi
callq malloc@PLT
movq %rax, %rcx
movq -24(%rbp), %rax
movq %rcx, (%rax)
movq -32(%rbp), %rax
movl $0, (%rax)
movl $0, -36(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_5 Depth 2
movl -36(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_15
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -40(%rbp)
movb $0, -41(%rbp)
cmpl $0, -40(%rbp)
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movb $1, -41(%rbp)
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_5
.LBB0_5: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
xorl %eax, %eax
# kill: def $al killed $al killed $eax
cmpl $0, -40(%rbp)
movb %al, -57(%rbp) # 1-byte Spill
jle .LBB0_7
# %bb.6: # in Loop: Header=BB0_5 Depth=2
movb -41(%rbp), %al
xorb $-1, %al
movb %al, -57(%rbp) # 1-byte Spill
.LBB0_7: # in Loop: Header=BB0_5 Depth=2
movb -57(%rbp), %al # 1-byte Reload
testb $1, %al
jne .LBB0_8
jmp .LBB0_11
.LBB0_8: # in Loop: Header=BB0_5 Depth=2
movl -40(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $0, %edx
jne .LBB0_10
# %bb.9: # in Loop: Header=BB0_5 Depth=2
movb $1, -41(%rbp)
.LBB0_10: # in Loop: Header=BB0_5 Depth=2
movl -40(%rbp), %eax
movl $10, %ecx
cltd
idivl %ecx
movl %eax, -40(%rbp)
jmp .LBB0_5
.LBB0_11: # in Loop: Header=BB0_1 Depth=1
testb $1, -41(%rbp)
jne .LBB0_13
# %bb.12: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -24(%rbp), %rax
movq (%rax), %rax
movq -32(%rbp), %rcx
movslq (%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movq -32(%rbp), %rax
movl (%rax), %ecx
addl $1, %ecx
movl %ecx, (%rax)
.LBB0_13: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_14
.LBB0_14: # in Loop: Header=BB0_1 Depth=1
movl -36(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_1
.LBB0_15:
movl $0, -48(%rbp)
.LBB0_16: # =>This Loop Header: Depth=1
# Child Loop BB0_18 Depth 2
movl -48(%rbp), %eax
movq -32(%rbp), %rcx
movl (%rcx), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_25
# %bb.17: # in Loop: Header=BB0_16 Depth=1
movl $0, -52(%rbp)
.LBB0_18: # Parent Loop BB0_16 Depth=1
# => This Inner Loop Header: Depth=2
movl -52(%rbp), %eax
movq -32(%rbp), %rcx
movl (%rcx), %ecx
subl -48(%rbp), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_23
# %bb.19: # in Loop: Header=BB0_18 Depth=2
movq -24(%rbp), %rax
movq (%rax), %rax
movslq -52(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -24(%rbp), %rcx
movq (%rcx), %rcx
movl -52(%rbp), %edx
addl $1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle .LBB0_21
# %bb.20: # in Loop: Header=BB0_18 Depth=2
movq -24(%rbp), %rax
movq (%rax), %rax
movslq -52(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -56(%rbp)
movq -24(%rbp), %rax
movq (%rax), %rax
movl -52(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -24(%rbp), %rax
movq (%rax), %rax
movslq -52(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -56(%rbp), %edx
movq -24(%rbp), %rax
movq (%rax), %rax
movl -52(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
.LBB0_21: # in Loop: Header=BB0_18 Depth=2
jmp .LBB0_22
.LBB0_22: # in Loop: Header=BB0_18 Depth=2
movl -52(%rbp), %eax
addl $1, %eax
movl %eax, -52(%rbp)
jmp .LBB0_18
.LBB0_23: # in Loop: Header=BB0_16 Depth=1
jmp .LBB0_24
.LBB0_24: # in Loop: Header=BB0_16 Depth=1
movl -48(%rbp), %eax
addl $1, %eax
movl %eax, -48(%rbp)
jmp .LBB0_16
.LBB0_25:
addq $64, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem106/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #160
.cfi_def_cfa_offset 160
stp x29, x30, [sp, #144] ; 16-byte Folded Spill
add x29, sp, #144
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, ___stack_chk_guard@GOTPAGE
ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
ldr x8, [x8]
stur x8, [x29, #-8]
str x0, [sp, #48]
str w1, [sp, #44]
str x2, [sp, #32]
str x3, [sp, #24]
add x0, sp, #56
adrp x1, l___const.func0.names@PAGE
add x1, x1, l___const.func0.names@PAGEOFF
mov x2, #80
bl _memcpy
str wzr, [sp, #20]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldr w8, [sp, #20]
ldr w9, [sp, #44]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #16]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #16]
ldr w9, [sp, #44]
ldr w10, [sp, #20]
subs w9, w9, w10
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_8
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #48]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
ldr x9, [sp, #48]
ldr w10, [sp, #16]
add w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #48]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #12]
ldr x8, [sp, #48]
ldr w9, [sp, #16]
add w9, w9, #1
ldr w8, [x8, w9, sxtw #2]
ldr x9, [sp, #48]
ldrsw x10, [sp, #16]
str w8, [x9, x10, lsl #2]
ldr w8, [sp, #12]
ldr x9, [sp, #48]
ldr w10, [sp, #16]
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_3 Depth=2
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_3
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_1
LBB0_10:
ldr x8, [sp, #24]
str wzr, [x8]
ldr w8, [sp, #44]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_11
LBB0_11: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, LBB0_17
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_11 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #1
cset w8, lt
tbnz w8, #0, LBB0_15
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_11 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #9
cset w8, gt
tbnz w8, #0, LBB0_15
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_11 Depth=1
ldr x9, [sp, #24]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b LBB0_15
LBB0_15: ; in Loop: Header=BB0_11 Depth=1
b LBB0_16
LBB0_16: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_11
LBB0_17:
ldr x8, [sp, #24]
ldrsw x8, [x8]
lsl x0, x8, #3
bl _malloc
ldr x8, [sp, #32]
str x0, [x8]
ldr w8, [sp, #44]
subs w8, w8, #1
str w8, [sp, #20]
str wzr, [sp, #16]
b LBB0_18
LBB0_18: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, lt
mov w9, #0
str w9, [sp, #8] ; 4-byte Folded Spill
tbnz w8, #0, LBB0_20
b LBB0_19
LBB0_19: ; in Loop: Header=BB0_18 Depth=1
ldr w8, [sp, #16]
ldr x9, [sp, #24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, lt
str w8, [sp, #8] ; 4-byte Folded Spill
b LBB0_20
LBB0_20: ; in Loop: Header=BB0_18 Depth=1
ldr w8, [sp, #8] ; 4-byte Folded Reload
tbz w8, #0, LBB0_26
b LBB0_21
LBB0_21: ; in Loop: Header=BB0_18 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #1
cset w8, lt
tbnz w8, #0, LBB0_24
b LBB0_22
LBB0_22: ; in Loop: Header=BB0_18 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #9
cset w8, gt
tbnz w8, #0, LBB0_24
b LBB0_23
LBB0_23: ; in Loop: Header=BB0_18 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #20]
ldrsw x9, [x8, x9, lsl #2]
add x8, sp, #56
ldr x8, [x8, x9, lsl #3]
ldr x9, [sp, #32]
ldr x9, [x9]
ldrsw x10, [sp, #16]
mov x11, x10
add w11, w11, #1
str w11, [sp, #16]
str x8, [x9, x10, lsl #3]
b LBB0_24
LBB0_24: ; in Loop: Header=BB0_18 Depth=1
b LBB0_25
LBB0_25: ; in Loop: Header=BB0_18 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_18
LBB0_26:
ldur x9, [x29, #-8]
adrp x8, ___stack_chk_guard@GOTPAGE
ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
ldr x8, [x8]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, LBB0_28
b LBB0_27
LBB0_27:
bl ___stack_chk_fail
LBB0_28:
ldp x29, x30, [sp, #144] ; 16-byte Folded Reload
add sp, sp, #160
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.space 1
l_.str.1: ; @.str.1
.asciz "One"
l_.str.2: ; @.str.2
.asciz "Two"
l_.str.3: ; @.str.3
.asciz "Three"
l_.str.4: ; @.str.4
.asciz "Four"
l_.str.5: ; @.str.5
.asciz "Five"
l_.str.6: ; @.str.6
.asciz "Six"
l_.str.7: ; @.str.7
.asciz "Seven"
l_.str.8: ; @.str.8
.asciz "Eight"
l_.str.9: ; @.str.9
.asciz "Nine"
.section __DATA,__const
.p2align 3 ; @__const.func0.names
l___const.func0.names:
.quad l_.str
.quad l_.str.1
.quad l_.str.2
.quad l_.str.3
.quad l_.str.4
.quad l_.str.5
.quad l_.str.6
.quad l_.str.7
.quad l_.str.8
.quad l_.str.9
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $128, %rsp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movq %rdx, -24(%rbp)
movq %rcx, -32(%rbp)
leaq -112(%rbp), %rdi
leaq .L__const.func0.names(%rip), %rsi
movl $80, %edx
callq memcpy@PLT
movl $0, -116(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -116(%rbp), %eax
movl -12(%rbp), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_10
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl $0, -120(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movl -120(%rbp), %eax
movl -12(%rbp), %ecx
subl -116(%rbp), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_8
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -120(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -8(%rbp), %rcx
movl -120(%rbp), %edx
addl $1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle .LBB0_6
# %bb.5: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -120(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -124(%rbp)
movq -8(%rbp), %rax
movl -120(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -8(%rbp), %rax
movslq -120(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -124(%rbp), %edx
movq -8(%rbp), %rax
movl -120(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
.LBB0_6: # in Loop: Header=BB0_3 Depth=2
jmp .LBB0_7
.LBB0_7: # in Loop: Header=BB0_3 Depth=2
movl -120(%rbp), %eax
addl $1, %eax
movl %eax, -120(%rbp)
jmp .LBB0_3
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
movl -116(%rbp), %eax
addl $1, %eax
movl %eax, -116(%rbp)
jmp .LBB0_1
.LBB0_10:
movq -32(%rbp), %rax
movl $0, (%rax)
movl -12(%rbp), %eax
subl $1, %eax
movl %eax, -116(%rbp)
.LBB0_11: # =>This Inner Loop Header: Depth=1
cmpl $0, -116(%rbp)
jl .LBB0_17
# %bb.12: # in Loop: Header=BB0_11 Depth=1
movq -8(%rbp), %rax
movslq -116(%rbp), %rcx
cmpl $1, (%rax,%rcx,4)
jl .LBB0_15
# %bb.13: # in Loop: Header=BB0_11 Depth=1
movq -8(%rbp), %rax
movslq -116(%rbp), %rcx
cmpl $9, (%rax,%rcx,4)
jg .LBB0_15
# %bb.14: # in Loop: Header=BB0_11 Depth=1
movq -32(%rbp), %rax
movl (%rax), %ecx
addl $1, %ecx
movl %ecx, (%rax)
.LBB0_15: # in Loop: Header=BB0_11 Depth=1
jmp .LBB0_16
.LBB0_16: # in Loop: Header=BB0_11 Depth=1
movl -116(%rbp), %eax
addl $-1, %eax
movl %eax, -116(%rbp)
jmp .LBB0_11
.LBB0_17:
movq -32(%rbp), %rax
movslq (%rax), %rdi
shlq $3, %rdi
callq malloc@PLT
movq %rax, %rcx
movq -24(%rbp), %rax
movq %rcx, (%rax)
movl -12(%rbp), %eax
subl $1, %eax
movl %eax, -116(%rbp)
movl $0, -120(%rbp)
.LBB0_18: # =>This Inner Loop Header: Depth=1
xorl %eax, %eax
# kill: def $al killed $al killed $eax
cmpl $0, -116(%rbp)
movb %al, -125(%rbp) # 1-byte Spill
jl .LBB0_20
# %bb.19: # in Loop: Header=BB0_18 Depth=1
movl -120(%rbp), %eax
movq -32(%rbp), %rcx
cmpl (%rcx), %eax
setl %al
movb %al, -125(%rbp) # 1-byte Spill
.LBB0_20: # in Loop: Header=BB0_18 Depth=1
movb -125(%rbp), %al # 1-byte Reload
testb $1, %al
jne .LBB0_21
jmp .LBB0_26
.LBB0_21: # in Loop: Header=BB0_18 Depth=1
movq -8(%rbp), %rax
movslq -116(%rbp), %rcx
cmpl $1, (%rax,%rcx,4)
jl .LBB0_24
# %bb.22: # in Loop: Header=BB0_18 Depth=1
movq -8(%rbp), %rax
movslq -116(%rbp), %rcx
cmpl $9, (%rax,%rcx,4)
jg .LBB0_24
# %bb.23: # in Loop: Header=BB0_18 Depth=1
movq -8(%rbp), %rax
movslq -116(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq -112(%rbp,%rax,8), %rdx
movq -24(%rbp), %rax
movq (%rax), %rax
movl -120(%rbp), %ecx
movl %ecx, %esi
addl $1, %esi
movl %esi, -120(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
.LBB0_24: # in Loop: Header=BB0_18 Depth=1
jmp .LBB0_25
.LBB0_25: # in Loop: Header=BB0_18 Depth=1
movl -116(%rbp), %eax
addl $-1, %eax
movl %eax, -116(%rbp)
jmp .LBB0_18
.LBB0_26:
addq $128, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.zero 1
.size .L.str, 1
.type .L.str.1,@object # @.str.1
.L.str.1:
.asciz "One"
.size .L.str.1, 4
.type .L.str.2,@object # @.str.2
.L.str.2:
.asciz "Two"
.size .L.str.2, 4
.type .L.str.3,@object # @.str.3
.L.str.3:
.asciz "Three"
.size .L.str.3, 6
.type .L.str.4,@object # @.str.4
.L.str.4:
.asciz "Four"
.size .L.str.4, 5
.type .L.str.5,@object # @.str.5
.L.str.5:
.asciz "Five"
.size .L.str.5, 5
.type .L.str.6,@object # @.str.6
.L.str.6:
.asciz "Six"
.size .L.str.6, 4
.type .L.str.7,@object # @.str.7
.L.str.7:
.asciz "Seven"
.size .L.str.7, 6
.type .L.str.8,@object # @.str.8
.L.str.8:
.asciz "Eight"
.size .L.str.8, 6
.type .L.str.9,@object # @.str.9
.L.str.9:
.asciz "Nine"
.size .L.str.9, 5
.type .L__const.func0.names,@object # @__const.func0.names
.section .data.rel.ro,"aw",@progbits
.p2align 4
.L__const.func0.names:
.quad .L.str
.quad .L.str.1
.quad .L.str.2
.quad .L.str.3
.quad .L.str.4
.quad .L.str.5
.quad .L.str.6
.quad .L.str.7
.quad .L.str.8
.quad .L.str.9
.size .L__const.func0.names, 80
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem107/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
ldursw x8, [x29, #-4]
lsl x0, x8, #2
bl _malloc
str x0, [sp, #16]
str wzr, [sp, #12]
mov w8, #1
str w8, [sp, #8]
str w8, [sp, #4]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #4]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, gt
tbnz w8, #0, LBB0_7
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr w9, [sp, #4]
ldr w8, [sp, #12]
add w8, w8, w9
str w8, [sp, #12]
ldr w9, [sp, #4]
ldr w8, [sp, #8]
mul w8, w8, w9
str w8, [sp, #8]
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #8]
ldr x9, [sp, #16]
ldr w10, [sp, #4]
subs w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_5
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w10, [sp, #4]
subs w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_1
LBB0_7:
ldr x0, [sp, #16]
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $32, %rsp
movl %edi, -4(%rbp)
movslq -4(%rbp), %rdi
shlq $2, %rdi
callq malloc@PLT
movq %rax, -16(%rbp)
movl $0, -20(%rbp)
movl $1, -24(%rbp)
movl $1, -28(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -28(%rbp), %eax
cmpl -4(%rbp), %eax
jg .LBB0_7
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl -20(%rbp), %eax
movl %eax, -20(%rbp)
movl -28(%rbp), %eax
imull -24(%rbp), %eax
movl %eax, -24(%rbp)
movl -28(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $0, %edx
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movl -24(%rbp), %edx
movq -16(%rbp), %rax
movl -28(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp .LBB0_5
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %edx
movq -16(%rbp), %rax
movl -28(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_6
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_1
.LBB0_7:
movq -16(%rbp), %rax
addq $32, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem108/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
mov x0, #8
bl _malloc
str x0, [sp, #16]
ldr x8, [sp, #16]
str wzr, [x8]
ldr x8, [sp, #16]
str wzr, [x8, #4]
mov w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldr w8, [sp, #12]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, gt
tbnz w8, #0, LBB0_12
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #8]
ldr w8, [sp, #12]
str w8, [sp, #4]
ldr w8, [sp, #12]
str w8, [sp]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #8]
mov w9, #10
mul w8, w8, w9
ldr w10, [sp]
sdiv w11, w10, w9
mul w11, w11, w9
subs w10, w10, w11
add w8, w8, w10
str w8, [sp, #8]
ldr w8, [sp]
sdiv w8, w8, w9
str w8, [sp]
b LBB0_3
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
ldr w9, [sp, #8]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_10
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldr x9, [sp, #16]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b LBB0_9
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
ldr x9, [sp, #16]
ldr w8, [x9, #4]
add w8, w8, #1
str w8, [x9, #4]
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_1 Depth=1
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_12:
ldr x0, [sp, #16]
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movl %edi, -4(%rbp)
movl $8, %edi
callq malloc@PLT
movq %rax, -16(%rbp)
movq -16(%rbp), %rax
movl $0, (%rax)
movq -16(%rbp), %rax
movl $0, 4(%rax)
movl $1, -20(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -20(%rbp), %eax
cmpl -4(%rbp), %eax
jg .LBB0_12
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl $0, -24(%rbp)
movl -20(%rbp), %eax
movl %eax, -28(%rbp)
movl -20(%rbp), %eax
movl %eax, -32(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
cmpl $0, -32(%rbp)
je .LBB0_5
# %bb.4: # in Loop: Header=BB0_3 Depth=2
imull $10, -24(%rbp), %eax
movl %eax, -36(%rbp) # 4-byte Spill
movl -32(%rbp), %eax
movl $10, %ecx
cltd
idivl %ecx
movl -36(%rbp), %eax # 4-byte Reload
addl %edx, %eax
movl %eax, -24(%rbp)
movl -32(%rbp), %eax
movl $10, %ecx
cltd
idivl %ecx
movl %eax, -32(%rbp)
jmp .LBB0_3
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
cmpl -24(%rbp), %eax
jne .LBB0_10
# %bb.6: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $0, %edx
jne .LBB0_8
# %bb.7: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movl (%rax), %ecx
addl $1, %ecx
movl %ecx, (%rax)
jmp .LBB0_9
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movl 4(%rax), %ecx
addl $1, %ecx
movl %ecx, 4(%rax)
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_10
.LBB0_10: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_11
.LBB0_11: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %eax
addl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_1
.LBB0_12:
movq -16(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
|
problem109/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
str wzr, [sp, #16]
str wzr, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_5 Depth 2
ldr w8, [sp, #12]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_12
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_10
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #8]
ldur x8, [x29, #-8]
ldrsw x9, [sp, #12]
ldr w0, [x8, x9, lsl #2]
bl _abs
str w0, [sp, #4]
b LBB0_5
LBB0_5: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #4]
subs w8, w8, #10
cset w8, lt
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=2
ldr w8, [sp, #4]
mov w9, #10
sdiv w10, w8, w9
mul w10, w10, w9
subs w10, w8, w10
ldr w8, [sp, #8]
add w8, w8, w10
str w8, [sp, #8]
ldr w8, [sp, #4]
sdiv w8, w8, w9
str w8, [sp, #4]
b LBB0_5
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldr w9, [sp, #4]
ldr w8, [sp, #8]
subs w8, w8, w9
str w8, [sp, #8]
ldr w8, [sp, #8]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, LBB0_9
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_1 Depth=1
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_12:
ldr w0, [sp, #16]
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $32, %rsp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl $0, -16(%rbp)
movl $0, -20(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_5 Depth 2
movl -20(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_12
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -20(%rbp), %rcx
cmpl $0, (%rax,%rcx,4)
jle .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movl -16(%rbp), %eax
addl $1, %eax
movl %eax, -16(%rbp)
jmp .LBB0_10
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
movl $0, -24(%rbp)
movq -8(%rbp), %rax
movslq -20(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq abs@PLT
movl %eax, -28(%rbp)
.LBB0_5: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
cmpl $10, -28(%rbp)
jl .LBB0_7
# %bb.6: # in Loop: Header=BB0_5 Depth=2
movl -28(%rbp), %eax
movl $10, %ecx
cltd
idivl %ecx
addl -24(%rbp), %edx
movl %edx, -24(%rbp)
movl -28(%rbp), %eax
movl $10, %ecx
cltd
idivl %ecx
movl %eax, -28(%rbp)
jmp .LBB0_5
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %ecx
movl -24(%rbp), %eax
subl %ecx, %eax
movl %eax, -24(%rbp)
cmpl $0, -24(%rbp)
jle .LBB0_9
# %bb.8: # in Loop: Header=BB0_1 Depth=1
movl -16(%rbp), %eax
addl $1, %eax
movl %eax, -16(%rbp)
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_10
.LBB0_10: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_11
.LBB0_11: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %eax
addl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_1
.LBB0_12:
movl -16(%rbp), %eax
addq $32, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym abs
|
problem11/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
ldur x0, [x29, #-16]
bl _strlen
mov x8, x0
stur w8, [x29, #-20]
ldur w9, [x29, #-20]
mov w8, #2
mul w8, w8, w9
add w9, w8, #1
; implicit-def: $x8
mov x8, x9
sxtw x0, w8
bl _malloc
str x0, [sp, #8]
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
; kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b LBB0_23
LBB0_2:
str wzr, [sp, #24]
b LBB0_3
LBB0_3: ; =>This Loop Header: Depth=1
; Child Loop BB0_5 Depth 2
ldr w8, [sp, #24]
ldur w9, [x29, #-20]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_18
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=1
mov w8, #1
str w8, [sp, #4]
str wzr, [sp, #20]
b LBB0_5
LBB0_5: ; Parent Loop BB0_3 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #20]
ldur w9, [x29, #-20]
ldr w10, [sp, #24]
subs w9, w9, w10
mov w10, #2
sdiv w9, w9, w10
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=2
ldur x8, [x29, #-16]
ldr w9, [sp, #24]
ldr w10, [sp, #20]
add w9, w9, w10
ldrsb w8, [x8, w9, sxtw]
ldur x9, [x29, #-16]
ldur w10, [x29, #-20]
subs w10, w10, #1
ldr w11, [sp, #20]
subs w10, w10, w11
ldrsb w9, [x9, w10, sxtw]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=1
str wzr, [sp, #4]
b LBB0_10
LBB0_8: ; in Loop: Header=BB0_5 Depth=2
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_5 Depth=2
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_5
LBB0_10: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #4]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_16
b LBB0_11
LBB0_11:
ldr x0, [sp, #8]
ldur x1, [x29, #-16]
ldursw x2, [x29, #-20]
mov x3, #-1
bl ___strncpy_chk
str wzr, [sp, #20]
b LBB0_12
LBB0_12: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #20]
ldr w9, [sp, #24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_15
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_12 Depth=1
ldur x8, [x29, #-16]
ldr w9, [sp, #24]
ldr w10, [sp, #20]
subs w9, w9, w10
subs w9, w9, #1
add x8, x8, w9, sxtw
ldrb w8, [x8]
ldr x9, [sp, #8]
ldur w10, [x29, #-20]
ldr w11, [sp, #20]
add w10, w10, w11
add x9, x9, w10, sxtw
strb w8, [x9]
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_12 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_12
LBB0_15:
ldr x8, [sp, #8]
ldur w9, [x29, #-20]
ldr w10, [sp, #24]
add w9, w9, w10
add x8, x8, w9, sxtw
strb wzr, [x8]
ldr x8, [sp, #8]
stur x8, [x29, #-8]
b LBB0_23
LBB0_16: ; in Loop: Header=BB0_3 Depth=1
b LBB0_17
LBB0_17: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #24]
add w8, w8, #1
str w8, [sp, #24]
b LBB0_3
LBB0_18:
ldr x0, [sp, #8]
ldur x1, [x29, #-16]
ldursw x2, [x29, #-20]
mov x3, #-1
bl ___strncpy_chk
str wzr, [sp, #20]
b LBB0_19
LBB0_19: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #20]
ldur w9, [x29, #-20]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_22
b LBB0_20
LBB0_20: ; in Loop: Header=BB0_19 Depth=1
ldur x8, [x29, #-16]
ldur w9, [x29, #-20]
ldr w10, [sp, #20]
subs w9, w9, w10
subs w9, w9, #1
add x8, x8, w9, sxtw
ldrb w8, [x8]
ldr x9, [sp, #8]
ldur w10, [x29, #-20]
ldr w11, [sp, #20]
add w10, w10, w11
add x9, x9, w10, sxtw
strb w8, [x9]
b LBB0_21
LBB0_21: ; in Loop: Header=BB0_19 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_19
LBB0_22:
ldr x8, [sp, #8]
ldur w10, [x29, #-20]
mov w9, #2
mul w9, w9, w10
add x8, x8, w9, sxtw
strb wzr, [x8]
ldr x8, [sp, #8]
stur x8, [x29, #-8]
b LBB0_23
LBB0_23:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -16(%rbp)
movq -16(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -20(%rbp)
movl -20(%rbp), %eax
shll $1, %eax
addl $1, %eax
movslq %eax, %rdi
callq malloc@PLT
movq %rax, -40(%rbp)
cmpq $0, -40(%rbp)
jne .LBB0_2
# %bb.1:
movq $0, -8(%rbp)
jmp .LBB0_23
.LBB0_2:
movl $0, -24(%rbp)
.LBB0_3: # =>This Loop Header: Depth=1
# Child Loop BB0_5 Depth 2
movl -24(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_18
# %bb.4: # in Loop: Header=BB0_3 Depth=1
movl $1, -44(%rbp)
movl $0, -28(%rbp)
.LBB0_5: # Parent Loop BB0_3 Depth=1
# => This Inner Loop Header: Depth=2
movl -28(%rbp), %eax
movl %eax, -48(%rbp) # 4-byte Spill
movl -20(%rbp), %eax
subl -24(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -48(%rbp), %eax # 4-byte Reload
cmpl %ecx, %eax
jge .LBB0_10
# %bb.6: # in Loop: Header=BB0_5 Depth=2
movq -16(%rbp), %rax
movl -24(%rbp), %ecx
addl -28(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movq -16(%rbp), %rcx
movl -20(%rbp), %edx
subl $1, %edx
subl -28(%rbp), %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je .LBB0_8
# %bb.7: # in Loop: Header=BB0_3 Depth=1
movl $0, -44(%rbp)
jmp .LBB0_10
.LBB0_8: # in Loop: Header=BB0_5 Depth=2
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_5 Depth=2
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_5
.LBB0_10: # in Loop: Header=BB0_3 Depth=1
cmpl $0, -44(%rbp)
je .LBB0_16
# %bb.11:
movq -40(%rbp), %rdi
movq -16(%rbp), %rsi
movslq -20(%rbp), %rdx
callq strncpy@PLT
movl $0, -28(%rbp)
.LBB0_12: # =>This Inner Loop Header: Depth=1
movl -28(%rbp), %eax
cmpl -24(%rbp), %eax
jge .LBB0_15
# %bb.13: # in Loop: Header=BB0_12 Depth=1
movq -16(%rbp), %rax
movl -24(%rbp), %ecx
subl -28(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -40(%rbp), %rax
movl -20(%rbp), %ecx
addl -28(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
# %bb.14: # in Loop: Header=BB0_12 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_12
.LBB0_15:
movq -40(%rbp), %rax
movl -20(%rbp), %ecx
addl -24(%rbp), %ecx
movslq %ecx, %rcx
movb $0, (%rax,%rcx)
movq -40(%rbp), %rax
movq %rax, -8(%rbp)
jmp .LBB0_23
.LBB0_16: # in Loop: Header=BB0_3 Depth=1
jmp .LBB0_17
.LBB0_17: # in Loop: Header=BB0_3 Depth=1
movl -24(%rbp), %eax
addl $1, %eax
movl %eax, -24(%rbp)
jmp .LBB0_3
.LBB0_18:
movq -40(%rbp), %rdi
movq -16(%rbp), %rsi
movslq -20(%rbp), %rdx
callq strncpy@PLT
movl $0, -28(%rbp)
.LBB0_19: # =>This Inner Loop Header: Depth=1
movl -28(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_22
# %bb.20: # in Loop: Header=BB0_19 Depth=1
movq -16(%rbp), %rax
movl -20(%rbp), %ecx
subl -28(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -40(%rbp), %rax
movl -20(%rbp), %ecx
addl -28(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
# %bb.21: # in Loop: Header=BB0_19 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_19
.LBB0_22:
movq -40(%rbp), %rax
movl -20(%rbp), %ecx
shll $1, %ecx
movslq %ecx, %rcx
movb $0, (%rax,%rcx)
movq -40(%rbp), %rax
movq %rax, -8(%rbp)
.LBB0_23:
movq -8(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym malloc
.addrsig_sym strncpy
|
problem110/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #16]
str w1, [sp, #12]
str wzr, [sp, #8]
ldr w8, [sp, #12]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
mov w8, #1
and w8, w8, #0x1
and w8, w8, #0x1
strb w8, [sp, #31]
b LBB0_13
LBB0_2:
mov w8, #1
str w8, [sp, #4]
b LBB0_3
LBB0_3: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #4]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_8
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=1
ldr x8, [sp, #16]
ldrsw x9, [sp, #4]
ldr w8, [x8, x9, lsl #2]
ldr x9, [sp, #16]
ldr w10, [sp, #4]
subs w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_3 Depth=1
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_3
LBB0_8:
ldr x8, [sp, #16]
ldr w9, [sp, #12]
subs w9, w9, #1
ldr w8, [x8, w9, sxtw #2]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_10
b LBB0_9
LBB0_9:
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_10
LBB0_10:
ldr w8, [sp, #8]
subs w8, w8, #2
cset w8, ge
tbnz w8, #0, LBB0_12
b LBB0_11
LBB0_11:
mov w8, #1
and w8, w8, #0x1
and w8, w8, #0x1
strb w8, [sp, #31]
b LBB0_13
LBB0_12:
mov w8, #0
and w8, w8, #0x1
and w8, w8, #0x1
strb w8, [sp, #31]
b LBB0_13
LBB0_13:
ldrb w8, [sp, #31]
and w0, w8, #0x1
add sp, sp, #32
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -16(%rbp)
movl %esi, -20(%rbp)
movl $0, -24(%rbp)
cmpl $0, -20(%rbp)
jne .LBB0_2
# %bb.1:
movb $1, -1(%rbp)
jmp .LBB0_13
.LBB0_2:
movl $1, -28(%rbp)
.LBB0_3: # =>This Inner Loop Header: Depth=1
movl -28(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_8
# %bb.4: # in Loop: Header=BB0_3 Depth=1
movq -16(%rbp), %rax
movslq -28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -16(%rbp), %rcx
movl -28(%rbp), %edx
subl $1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge .LBB0_6
# %bb.5: # in Loop: Header=BB0_3 Depth=1
movl -24(%rbp), %eax
addl $1, %eax
movl %eax, -24(%rbp)
.LBB0_6: # in Loop: Header=BB0_3 Depth=1
jmp .LBB0_7
.LBB0_7: # in Loop: Header=BB0_3 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_3
.LBB0_8:
movq -16(%rbp), %rax
movl -20(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq -16(%rbp), %rcx
cmpl (%rcx), %eax
jle .LBB0_10
# %bb.9:
movl -24(%rbp), %eax
addl $1, %eax
movl %eax, -24(%rbp)
.LBB0_10:
cmpl $2, -24(%rbp)
jge .LBB0_12
# %bb.11:
movb $1, -1(%rbp)
jmp .LBB0_13
.LBB0_12:
movb $0, -1(%rbp)
.LBB0_13:
movb -1(%rbp), %al
andb $1, %al
movzbl %al, %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem111/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
str x0, [sp, #32]
str w1, [sp, #28]
str x2, [sp, #16]
str w3, [sp, #12]
str wzr, [sp, #8]
str wzr, [sp, #4]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #4]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_6
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
ldrsw x9, [sp, #4]
ldr w8, [x8, x9, lsl #2]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_1
LBB0_6:
str wzr, [sp]
b LBB0_7
LBB0_7: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_12
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_7 Depth=1
ldr x8, [sp, #16]
ldrsw x9, [sp]
ldr w8, [x8, x9, lsl #2]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_10
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_7 Depth=1
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_7 Depth=1
ldr w8, [sp]
add w8, w8, #1
str w8, [sp]
b LBB0_7
LBB0_12:
ldr w8, [sp, #8]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, LBB0_14
b LBB0_13
LBB0_13:
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
str x8, [sp, #40]
b LBB0_15
LBB0_14:
adrp x8, l_.str.1@PAGE
add x8, x8, l_.str.1@PAGEOFF
str x8, [sp, #40]
b LBB0_15
LBB0_15:
ldr x0, [sp, #40]
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "YES"
l_.str.1: ; @.str.1
.asciz "NO"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -16(%rbp)
movl %esi, -20(%rbp)
movq %rdx, -32(%rbp)
movl %ecx, -36(%rbp)
movl $0, -40(%rbp)
movl $0, -44(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -44(%rbp), %eax
cmpl -20(%rbp), %eax
jge .LBB0_6
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movslq -44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $0, %edx
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_5
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
movl -44(%rbp), %eax
addl $1, %eax
movl %eax, -44(%rbp)
jmp .LBB0_1
.LBB0_6:
movl $0, -48(%rbp)
.LBB0_7: # =>This Inner Loop Header: Depth=1
movl -48(%rbp), %eax
cmpl -36(%rbp), %eax
jge .LBB0_12
# %bb.8: # in Loop: Header=BB0_7 Depth=1
movq -32(%rbp), %rax
movslq -48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $0, %edx
jne .LBB0_10
# %bb.9: # in Loop: Header=BB0_7 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
.LBB0_10: # in Loop: Header=BB0_7 Depth=1
jmp .LBB0_11
.LBB0_11: # in Loop: Header=BB0_7 Depth=1
movl -48(%rbp), %eax
addl $1, %eax
movl %eax, -48(%rbp)
jmp .LBB0_7
.LBB0_12:
movl -40(%rbp), %eax
cmpl -20(%rbp), %eax
jl .LBB0_14
# %bb.13:
leaq .L.str(%rip), %rax
movq %rax, -8(%rbp)
jmp .LBB0_15
.LBB0_14:
leaq .L.str.1(%rip), %rax
movq %rax, -8(%rbp)
.LBB0_15:
movq -8(%rbp), %rax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "YES"
.size .L.str, 4
.type .L.str.1,@object # @.str.1
.L.str.1:
.asciz "NO"
.size .L.str.1, 3
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem112/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #192
.cfi_def_cfa_offset 192
stp x29, x30, [sp, #176] ; 16-byte Folded Spill
add x29, sp, #176
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, ___stack_chk_guard@GOTPAGE
ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
ldr x8, [x8]
stur x8, [x29, #-8]
str x0, [sp, #56]
str x1, [sp, #48]
str x2, [sp, #40]
str x3, [sp, #32]
add x0, sp, #64
mov w1, #0
mov x2, #104
bl _memset
str wzr, [sp, #28]
ldr x8, [sp, #56]
str x8, [sp, #16]
str wzr, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr x8, [sp, #16]
ldrb w8, [x8]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_7
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
ldrsb w8, [x8]
subs w8, w8, #32
cset w8, eq
tbnz w8, #0, LBB0_6
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
ldrsb w8, [x8]
subs w8, w8, #97
str w8, [sp, #8]
ldrsw x10, [sp, #8]
add x8, sp, #64
mov x9, x8
add x10, x9, x10, lsl #2
ldr w9, [x10]
add w9, w9, #1
str w9, [x10]
ldrsw x9, [sp, #8]
ldr w8, [x8, x9, lsl #2]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldrsw x9, [sp, #8]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #28]
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
add x8, x8, #1
str x8, [sp, #16]
b LBB0_1
LBB0_7:
str wzr, [sp, #4]
b LBB0_8
LBB0_8: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #4]
subs w8, w8, #26
cset w8, ge
tbnz w8, #0, LBB0_13
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_8 Depth=1
ldrsw x9, [sp, #4]
add x8, sp, #64
ldr w9, [x8, x9, lsl #2]
ldr x10, [sp, #48]
ldrsw x11, [sp, #4]
str w9, [x10, x11, lsl #2]
ldrsw x9, [sp, #4]
ldr w8, [x8, x9, lsl #2]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_11
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_8 Depth=1
ldr w8, [sp, #4]
add w8, w8, #97
ldr x9, [sp, #32]
ldrsw x10, [sp, #12]
mov x11, x10
add w11, w11, #1
str w11, [sp, #12]
strb w8, [x9, x10]
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_8 Depth=1
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_8 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_8
LBB0_13:
ldr w8, [sp, #28]
ldr x9, [sp, #40]
str w8, [x9]
ldr x8, [sp, #32]
ldrsw x9, [sp, #12]
add x8, x8, x9
strb wzr, [x8]
ldur x9, [x29, #-8]
adrp x8, ___stack_chk_guard@GOTPAGE
ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
ldr x8, [x8]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, LBB0_15
b LBB0_14
LBB0_14:
bl ___stack_chk_fail
LBB0_15:
ldp x29, x30, [sp, #176] ; 16-byte Folded Reload
add sp, sp, #192
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $176, %rsp
movq %rdi, -8(%rbp)
movq %rsi, -16(%rbp)
movq %rdx, -24(%rbp)
movq %rcx, -32(%rbp)
leaq -144(%rbp), %rdi
xorl %esi, %esi
movl $104, %edx
callq memset@PLT
movl $0, -148(%rbp)
movq -8(%rbp), %rax
movq %rax, -160(%rbp)
movl $0, -164(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movq -160(%rbp), %rax
cmpb $0, (%rax)
je .LBB0_7
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -160(%rbp), %rax
movsbl (%rax), %eax
cmpl $32, %eax
je .LBB0_6
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -160(%rbp), %rax
movsbl (%rax), %eax
subl $97, %eax
movl %eax, -168(%rbp)
movslq -168(%rbp), %rax
movl -144(%rbp,%rax,4), %ecx
addl $1, %ecx
movl %ecx, -144(%rbp,%rax,4)
movslq -168(%rbp), %rax
movl -144(%rbp,%rax,4), %eax
cmpl -148(%rbp), %eax
jle .LBB0_5
# %bb.4: # in Loop: Header=BB0_1 Depth=1
movslq -168(%rbp), %rax
movl -144(%rbp,%rax,4), %eax
movl %eax, -148(%rbp)
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_6
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
movq -160(%rbp), %rax
addq $1, %rax
movq %rax, -160(%rbp)
jmp .LBB0_1
.LBB0_7:
movl $0, -172(%rbp)
.LBB0_8: # =>This Inner Loop Header: Depth=1
cmpl $26, -172(%rbp)
jge .LBB0_13
# %bb.9: # in Loop: Header=BB0_8 Depth=1
movslq -172(%rbp), %rax
movl -144(%rbp,%rax,4), %edx
movq -16(%rbp), %rax
movslq -172(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movslq -172(%rbp), %rax
movl -144(%rbp,%rax,4), %eax
cmpl -148(%rbp), %eax
jne .LBB0_11
# %bb.10: # in Loop: Header=BB0_8 Depth=1
movl -172(%rbp), %eax
addl $97, %eax
movb %al, %dl
movq -32(%rbp), %rax
movl -164(%rbp), %ecx
movl %ecx, %esi
addl $1, %esi
movl %esi, -164(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
.LBB0_11: # in Loop: Header=BB0_8 Depth=1
jmp .LBB0_12
.LBB0_12: # in Loop: Header=BB0_8 Depth=1
movl -172(%rbp), %eax
addl $1, %eax
movl %eax, -172(%rbp)
jmp .LBB0_8
.LBB0_13:
movl -148(%rbp), %ecx
movq -24(%rbp), %rax
movl %ecx, (%rax)
movq -32(%rbp), %rax
movslq -164(%rbp), %rcx
movb $0, (%rax,%rcx)
addq $176, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem113/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] ; 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
stur x3, [x29, #-32]
ldur x0, [x29, #-8]
bl _strlen
mov x8, x0
stur w8, [x29, #-36]
ldur w8, [x29, #-36]
add w9, w8, #1
; implicit-def: $x8
mov x8, x9
sxtw x8, w8
lsr x0, x8, #0
bl _malloc
str x0, [sp, #48]
str wzr, [sp, #44]
str wzr, [sp, #40]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldur x8, [x29, #-8]
ldrsw x9, [sp, #40]
ldrsb w8, [x8, x9]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_11
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
str x8, [sp, #32]
strb wzr, [sp, #31]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr x8, [sp, #32]
ldrsb w8, [x8]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_7
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-8]
ldrsw x9, [sp, #40]
ldrsb w8, [x8, x9]
ldr x9, [sp, #32]
ldrsb w9, [x9]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
mov w8, #1
strb w8, [sp, #31]
b LBB0_7
LBB0_6: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #32]
add x8, x8, #1
str x8, [sp, #32]
b LBB0_3
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldrb w8, [sp, #31]
tbnz w8, #0, LBB0_9
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #40]
add x8, x8, x9
ldrb w8, [x8]
ldr x9, [sp, #48]
ldrsw x10, [sp, #44]
mov x11, x10
add w11, w11, #1
str w11, [sp, #44]
add x9, x9, x10
strb w8, [x9]
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #40]
add w8, w8, #1
str w8, [sp, #40]
b LBB0_1
LBB0_11:
ldr x8, [sp, #48]
ldrsw x9, [sp, #44]
add x8, x8, x9
strb wzr, [x8]
ldr x0, [sp, #48]
bl _strlen
mov x8, x0
str w8, [sp, #24]
mov w8, #1
strb w8, [sp, #23]
str wzr, [sp, #16]
b LBB0_12
LBB0_12: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #16]
ldr w9, [sp, #24]
mov w10, #2
sdiv w9, w9, w10
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_17
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_12 Depth=1
ldr x8, [sp, #48]
ldrsw x9, [sp, #16]
ldrsb w8, [x8, x9]
ldr x9, [sp, #48]
ldr w10, [sp, #24]
subs w10, w10, #1
ldr w11, [sp, #16]
subs w10, w10, w11
ldrsb w9, [x9, w10, sxtw]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, LBB0_15
b LBB0_14
LBB0_14:
strb wzr, [sp, #23]
b LBB0_17
LBB0_15: ; in Loop: Header=BB0_12 Depth=1
b LBB0_16
LBB0_16: ; in Loop: Header=BB0_12 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_12
LBB0_17:
ldur x0, [x29, #-24]
ldr x1, [sp, #48]
mov x2, #-1
str x2, [sp, #8] ; 8-byte Folded Spill
bl ___strcpy_chk
ldr x2, [sp, #8] ; 8-byte Folded Reload
ldur x0, [x29, #-32]
ldrb w8, [sp, #23]
and w10, w8, #0x1
adrp x9, l_.str.1@PAGE
add x9, x9, l_.str.1@PAGEOFF
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
ands w10, w10, #0x1
csel x1, x8, x9, ne
bl ___strcpy_chk
ldr x0, [sp, #48]
bl _free
ldp x29, x30, [sp, #96] ; 16-byte Folded Reload
add sp, sp, #112
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "True"
l_.str.1: ; @.str.1
.asciz "False"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $96, %rsp
movq %rdi, -8(%rbp)
movq %rsi, -16(%rbp)
movq %rdx, -24(%rbp)
movq %rcx, -32(%rbp)
movq -8(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -36(%rbp)
movl -36(%rbp), %eax
addl $1, %eax
movslq %eax, %rdi
shlq $0, %rdi
callq malloc@PLT
movq %rax, -48(%rbp)
movl $0, -52(%rbp)
movl $0, -56(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movq -8(%rbp), %rax
movslq -56(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0, %eax
je .LBB0_11
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movq %rax, -64(%rbp)
movb $0, -65(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movq -64(%rbp), %rax
movsbl (%rax), %eax
cmpl $0, %eax
je .LBB0_7
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -56(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -64(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne .LBB0_6
# %bb.5: # in Loop: Header=BB0_1 Depth=1
movb $1, -65(%rbp)
jmp .LBB0_7
.LBB0_6: # in Loop: Header=BB0_3 Depth=2
movq -64(%rbp), %rax
addq $1, %rax
movq %rax, -64(%rbp)
jmp .LBB0_3
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
testb $1, -65(%rbp)
jne .LBB0_9
# %bb.8: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -56(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -48(%rbp), %rax
movl -52(%rbp), %ecx
movl %ecx, %esi
addl $1, %esi
movl %esi, -52(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_10
.LBB0_10: # in Loop: Header=BB0_1 Depth=1
movl -56(%rbp), %eax
addl $1, %eax
movl %eax, -56(%rbp)
jmp .LBB0_1
.LBB0_11:
movq -48(%rbp), %rax
movslq -52(%rbp), %rcx
movb $0, (%rax,%rcx)
movq -48(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -72(%rbp)
movb $1, -73(%rbp)
movl $0, -80(%rbp)
.LBB0_12: # =>This Inner Loop Header: Depth=1
movl -80(%rbp), %eax
movl %eax, -84(%rbp) # 4-byte Spill
movl -72(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -84(%rbp), %eax # 4-byte Reload
cmpl %ecx, %eax
jge .LBB0_17
# %bb.13: # in Loop: Header=BB0_12 Depth=1
movq -48(%rbp), %rax
movslq -80(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -48(%rbp), %rcx
movl -72(%rbp), %edx
subl $1, %edx
subl -80(%rbp), %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je .LBB0_15
# %bb.14:
movb $0, -73(%rbp)
jmp .LBB0_17
.LBB0_15: # in Loop: Header=BB0_12 Depth=1
jmp .LBB0_16
.LBB0_16: # in Loop: Header=BB0_12 Depth=1
movl -80(%rbp), %eax
addl $1, %eax
movl %eax, -80(%rbp)
jmp .LBB0_12
.LBB0_17:
movq -24(%rbp), %rdi
movq -48(%rbp), %rsi
callq strcpy@PLT
movq -32(%rbp), %rdi
movb -73(%rbp), %cl
leaq .L.str.1(%rip), %rsi
leaq .L.str(%rip), %rax
testb $1, %cl
cmovneq %rax, %rsi
callq strcpy@PLT
movq -48(%rbp), %rdi
callq free@PLT
addq $96, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "True"
.size .L.str, 5
.type .L.str.1,@object # @.str.1
.L.str.1:
.asciz "False"
.size .L.str.1, 6
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym malloc
.addrsig_sym strcpy
.addrsig_sym free
|
problem114/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] ; 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
ldursw x8, [x29, #-12]
lsl x0, x8, #3
bl _malloc
stur x0, [x29, #-24]
stur wzr, [x29, #-28]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldur w8, [x29, #-28]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_12
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #32]
str wzr, [sp, #28]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldur x8, [x29, #-8]
ldursw x9, [x29, #-28]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #28]
ldrsb w8, [x8, x9]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_10
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-8]
ldursw x9, [x29, #-28]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #28]
ldrsb w8, [x8, x9]
subs w8, w8, #48
cset w8, lt
tbnz w8, #0, LBB0_8
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-8]
ldursw x9, [x29, #-28]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #28]
ldrsb w8, [x8, x9]
subs w8, w8, #57
cset w8, gt
tbnz w8, #0, LBB0_8
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-8]
ldursw x9, [x29, #-28]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #28]
ldrsb w8, [x8, x9]
subs w8, w8, #48
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #32]
add w8, w8, #1
str w8, [sp, #32]
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_3 Depth=2
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
b LBB0_3
LBB0_10: ; in Loop: Header=BB0_1 Depth=1
mov x0, #100
bl _malloc
ldur x8, [x29, #-24]
ldursw x9, [x29, #-28]
str x0, [x8, x9, lsl #3]
ldur x8, [x29, #-24]
ldursw x9, [x29, #-28]
ldr x0, [x8, x9, lsl #3]
ldr w8, [sp, #32]
; implicit-def: $x11
mov x11, x8
ldr w8, [sp, #32]
; implicit-def: $x10
mov x10, x8
ldr w9, [sp, #32]
; implicit-def: $x8
mov x8, x9
mov x9, sp
str x11, [x9]
str x10, [x9, #8]
str x8, [x9, #16]
mov w1, #0
mov x2, #-1
adrp x3, l_.str@PAGE
add x3, x3, l_.str@PAGEOFF
bl ___sprintf_chk
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b LBB0_1
LBB0_12:
ldur x0, [x29, #-24]
ldp x29, x30, [sp, #64] ; 16-byte Folded Reload
add sp, sp, #80
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "the number of odd elements %d in the string %d of the %d input."
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movslq -12(%rbp), %rdi
shlq $3, %rdi
callq malloc@PLT
movq %rax, -24(%rbp)
movl $0, -28(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -28(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_12
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl $0, -32(%rbp)
movl $0, -36(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movq -8(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -36(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0, %eax
je .LBB0_10
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -36(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $48, %eax
jl .LBB0_8
# %bb.5: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -36(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $57, %eax
jg .LBB0_8
# %bb.6: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -36(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $48, %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_8
# %bb.7: # in Loop: Header=BB0_3 Depth=2
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
.LBB0_8: # in Loop: Header=BB0_3 Depth=2
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_3 Depth=2
movl -36(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_3
.LBB0_10: # in Loop: Header=BB0_1 Depth=1
movl $100, %edi
callq malloc@PLT
movq %rax, %rdx
movq -24(%rbp), %rax
movslq -28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -24(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -32(%rbp), %edx
movl -32(%rbp), %ecx
movl -32(%rbp), %r8d
leaq .L.str(%rip), %rsi
movb $0, %al
callq sprintf@PLT
# %bb.11: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_1
.LBB0_12:
movq -24(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "the number of odd elements %d in the string %d of the %d input."
.size .L.str, 64
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym sprintf
|
problem115/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
str x0, [sp, #40]
str w1, [sp, #36]
ldr x8, [sp, #40]
ldr x8, [x8]
str x8, [sp, #24]
ldr x8, [sp, #40]
ldr x8, [x8]
str x8, [sp, #16]
mov w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr w9, [sp, #36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_9
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
subs x8, x8, #0
cset w8, ge
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x9, [sp, #40]
ldrsw x10, [sp, #12]
ldr x9, [x9, x10, lsl #3]
add x8, x8, x9
str x8, [sp] ; 8-byte Folded Spill
b LBB0_5
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldrsw x9, [sp, #12]
ldr x8, [x8, x9, lsl #3]
str x8, [sp] ; 8-byte Folded Spill
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp] ; 8-byte Folded Reload
str x8, [sp, #24]
ldr x8, [sp, #24]
ldr x9, [sp, #16]
subs x8, x8, x9
cset w8, ge
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
str x8, [sp, #16]
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_9:
ldr x0, [sp, #16]
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movq -8(%rbp), %rax
movq (%rax), %rax
movq %rax, -24(%rbp)
movq -8(%rbp), %rax
movq (%rax), %rax
movq %rax, -32(%rbp)
movl $1, -36(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -36(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_9
# %bb.2: # in Loop: Header=BB0_1 Depth=1
cmpq $0, -24(%rbp)
jge .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rax
movq -8(%rbp), %rcx
movslq -36(%rbp), %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -48(%rbp) # 8-byte Spill
jmp .LBB0_5
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -48(%rbp) # 8-byte Spill
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
movq -48(%rbp), %rax # 8-byte Reload
movq %rax, -24(%rbp)
movq -24(%rbp), %rax
cmpq -32(%rbp), %rax
jge .LBB0_7
# %bb.6: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rax
movq %rax, -32(%rbp)
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_8
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
movl -36(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_1
.LBB0_9:
movq -32(%rbp), %rax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem116/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
str x0, [sp, #40]
str w1, [sp, #36]
str w2, [sp, #32]
str w3, [sp, #28]
str wzr, [sp, #24]
str wzr, [sp, #20]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldr w8, [sp, #20]
ldr w9, [sp, #36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #16]
str wzr, [sp, #12]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #12]
ldr w9, [sp, #32]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_6
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #20]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #12]
ldr w9, [x8, x9, lsl #2]
ldr w8, [sp, #16]
add w8, w8, w9
str w8, [sp, #16]
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_3
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
ldr w9, [sp, #28]
add w8, w8, w9
subs w8, w8, #1
ldr w9, [sp, #28]
sdiv w9, w8, w9
ldr w8, [sp, #24]
add w8, w8, w9
str w8, [sp, #24]
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_1
LBB0_10:
ldr w0, [sp, #24]
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl %edx, -16(%rbp)
movl %ecx, -20(%rbp)
movl $0, -24(%rbp)
movl $0, -28(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -28(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_10
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl $0, -32(%rbp)
movl $0, -36(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movl -36(%rbp), %eax
cmpl -16(%rbp), %eax
jge .LBB0_6
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -32(%rbp), %eax
movl %eax, -32(%rbp)
# %bb.5: # in Loop: Header=BB0_3 Depth=2
movl -36(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_3
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
cmpl $0, -32(%rbp)
jle .LBB0_8
# %bb.7: # in Loop: Header=BB0_1 Depth=1
movl -32(%rbp), %eax
addl -20(%rbp), %eax
subl $1, %eax
cltd
idivl -20(%rbp)
addl -24(%rbp), %eax
movl %eax, -24(%rbp)
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_1
.LBB0_10:
movl -24(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem117/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
str x0, [sp, #40]
str w1, [sp, #36]
str wzr, [sp, #16]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
; Child Loop BB0_5 Depth 3
; Child Loop BB0_8 Depth 3
ldr w8, [sp, #16]
ldr w9, [sp, #36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_18
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Loop Header: Depth=2
; Child Loop BB0_5 Depth 3
; Child Loop BB0_8 Depth 3
ldr w8, [sp, #12]
ldr w9, [sp, #36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_16
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
str wzr, [sp, #32]
ldr x8, [sp, #40]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #28]
ldr x8, [sp, #40]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #24]
b LBB0_5
LBB0_5: ; Parent Loop BB0_1 Depth=1
; Parent Loop BB0_3 Depth=2
; => This Inner Loop Header: Depth=3
ldr w8, [sp, #28]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=3
ldr w8, [sp, #28]
and w9, w8, #0x1
ldr w8, [sp, #32]
add w8, w8, w9
str w8, [sp, #32]
ldr w8, [sp, #28]
asr w8, w8, #1
str w8, [sp, #28]
b LBB0_5
LBB0_7: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #32]
str w8, [sp, #28]
str wzr, [sp, #32]
b LBB0_8
LBB0_8: ; Parent Loop BB0_1 Depth=1
; Parent Loop BB0_3 Depth=2
; => This Inner Loop Header: Depth=3
ldr w8, [sp, #24]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, LBB0_10
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_8 Depth=3
ldr w8, [sp, #24]
and w9, w8, #0x1
ldr w8, [sp, #32]
add w8, w8, w9
str w8, [sp, #32]
ldr w8, [sp, #24]
asr w8, w8, #1
str w8, [sp, #24]
b LBB0_8
LBB0_10: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #32]
str w8, [sp, #24]
ldr w8, [sp, #24]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, LBB0_13
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #24]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_14
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
ldr x9, [sp, #40]
ldrsw x10, [sp, #16]
ldr w9, [x9, x10, lsl #2]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_14
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #20]
ldr x8, [sp, #40]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
ldr x9, [sp, #40]
ldrsw x10, [sp, #16]
str w8, [x9, x10, lsl #2]
ldr w8, [sp, #20]
ldr x9, [sp, #40]
ldrsw x10, [sp, #12]
str w8, [x9, x10, lsl #2]
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_3 Depth=2
b LBB0_15
LBB0_15: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_3
LBB0_16: ; in Loop: Header=BB0_1 Depth=1
b LBB0_17
LBB0_17: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_1
LBB0_18:
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl $0, -32(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
# Child Loop BB0_5 Depth 3
# Child Loop BB0_8 Depth 3
movl -32(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_18
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Loop Header: Depth=2
# Child Loop BB0_5 Depth 3
# Child Loop BB0_8 Depth 3
movl -36(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_16
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movl $0, -16(%rbp)
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -20(%rbp)
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -24(%rbp)
.LBB0_5: # Parent Loop BB0_1 Depth=1
# Parent Loop BB0_3 Depth=2
# => This Inner Loop Header: Depth=3
cmpl $0, -20(%rbp)
jle .LBB0_7
# %bb.6: # in Loop: Header=BB0_5 Depth=3
movl -20(%rbp), %eax
andl $1, %eax
addl -16(%rbp), %eax
movl %eax, -16(%rbp)
movl -20(%rbp), %eax
sarl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_5
.LBB0_7: # in Loop: Header=BB0_3 Depth=2
movl -16(%rbp), %eax
movl %eax, -20(%rbp)
movl $0, -16(%rbp)
.LBB0_8: # Parent Loop BB0_1 Depth=1
# Parent Loop BB0_3 Depth=2
# => This Inner Loop Header: Depth=3
cmpl $0, -24(%rbp)
jle .LBB0_10
# %bb.9: # in Loop: Header=BB0_8 Depth=3
movl -24(%rbp), %eax
andl $1, %eax
addl -16(%rbp), %eax
movl %eax, -16(%rbp)
movl -24(%rbp), %eax
sarl $1, %eax
movl %eax, -24(%rbp)
jmp .LBB0_8
.LBB0_10: # in Loop: Header=BB0_3 Depth=2
movl -16(%rbp), %eax
movl %eax, -24(%rbp)
movl -24(%rbp), %eax
cmpl -20(%rbp), %eax
jl .LBB0_13
# %bb.11: # in Loop: Header=BB0_3 Depth=2
movl -24(%rbp), %eax
cmpl -20(%rbp), %eax
jne .LBB0_14
# %bb.12: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -8(%rbp), %rcx
movslq -32(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge .LBB0_14
.LBB0_13: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -28(%rbp)
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -28(%rbp), %edx
movq -8(%rbp), %rax
movslq -36(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
.LBB0_14: # in Loop: Header=BB0_3 Depth=2
jmp .LBB0_15
.LBB0_15: # in Loop: Header=BB0_3 Depth=2
movl -36(%rbp), %eax
addl $1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_3
.LBB0_16: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_17
.LBB0_17: # in Loop: Header=BB0_1 Depth=1
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
jmp .LBB0_1
.LBB0_18:
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem118/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] ; 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
stur x8, [x29, #-32]
; kill: def $x8 killed $xzr
str xzr, [sp, #40]
str wzr, [sp, #36]
str wzr, [sp, #32]
str wzr, [sp, #28]
ldur x0, [x29, #-8]
bl _strlen
str x0, [sp, #16]
ldr x8, [sp, #16]
add x0, x8, #1
bl _malloc
str x0, [sp, #8]
str wzr, [sp, #4]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldrsw x8, [sp, #4]
ldr x9, [sp, #16]
subs x8, x8, x9
cset w8, hi
tbnz w8, #0, LBB0_13
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #4]
ldrsb w0, [x8, x9]
bl _isspace
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #4]
ldrsb w8, [x8, x9]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_7
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #36]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr w9, [sp, #4]
ldr w10, [sp, #28]
subs w9, w9, w10
add x8, x8, w9, sxtw
strb wzr, [x8]
ldr x0, [sp, #40]
ldr w8, [sp, #32]
add w9, w8, #1
; implicit-def: $x8
mov x8, x9
sxtw x9, w8
mov x8, #8
mul x1, x8, x9
bl _realloc
str x0, [sp, #40]
ldr x0, [sp, #8]
bl _strlen
add x0, x0, #1
bl _malloc
ldr x8, [sp, #40]
ldrsw x9, [sp, #32]
str x0, [x8, x9, lsl #3]
ldr x8, [sp, #40]
ldrsw x9, [sp, #32]
ldr x0, [x8, x9, lsl #3]
ldr x1, [sp, #8]
mov x2, #-1
bl ___strcpy_chk
ldr w8, [sp, #32]
add w8, w8, #1
str w8, [sp, #32]
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #28]
str wzr, [sp, #36]
b LBB0_11
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #4]
add x8, x8, x9
ldrb w8, [x8]
ldr x9, [sp, #8]
ldr w10, [sp, #4]
ldr w11, [sp, #28]
subs w10, w10, w11
add x9, x9, w10, sxtw
strb w8, [x9]
ldur x0, [x29, #-32]
ldur x8, [x29, #-8]
ldrsw x9, [sp, #4]
ldrsb w1, [x8, x9]
bl _strchr
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, LBB0_10
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldrsw x9, [sp, #4]
ldrb w0, [x8, x9]
bl _isalpha
subs w8, w0, #0
cset w8, eq
tbnz w8, #0, LBB0_10
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #36]
add w8, w8, #1
str w8, [sp, #36]
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_1 Depth=1
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_1 Depth=1
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b LBB0_1
LBB0_13:
ldr x0, [sp, #8]
bl _free
ldr w8, [sp, #32]
ldur x9, [x29, #-24]
str w8, [x9]
ldr x0, [sp, #40]
ldp x29, x30, [sp, #80] ; 16-byte Folded Reload
add sp, sp, #96
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "aeiouAEIOU"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $80, %rsp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movq %rdx, -24(%rbp)
leaq .L.str(%rip), %rax
movq %rax, -32(%rbp)
movq $0, -40(%rbp)
movl $0, -44(%rbp)
movl $0, -48(%rbp)
movl $0, -52(%rbp)
movq -8(%rbp), %rdi
callq strlen@PLT
movq %rax, -64(%rbp)
movq -64(%rbp), %rdi
addq $1, %rdi
callq malloc@PLT
movq %rax, -72(%rbp)
movl $0, -76(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movslq -76(%rbp), %rax
cmpq -64(%rbp), %rax
ja .LBB0_13
# %bb.2: # in Loop: Header=BB0_1 Depth=1
callq __ctype_b_loc@PLT
movq (%rax), %rax
movq -8(%rbp), %rcx
movslq -76(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $8192, %eax # imm = 0x2000
cmpl $0, %eax
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -76(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0, %eax
jne .LBB0_7
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
movl -44(%rbp), %eax
cmpl -12(%rbp), %eax
jne .LBB0_6
# %bb.5: # in Loop: Header=BB0_1 Depth=1
movq -72(%rbp), %rax
movl -76(%rbp), %ecx
subl -52(%rbp), %ecx
movslq %ecx, %rcx
movb $0, (%rax,%rcx)
movq -40(%rbp), %rdi
movl -48(%rbp), %eax
addl $1, %eax
movslq %eax, %rsi
shlq $3, %rsi
callq realloc@PLT
movq %rax, -40(%rbp)
movq -72(%rbp), %rdi
callq strlen@PLT
movq %rax, %rdi
addq $1, %rdi
callq malloc@PLT
movq %rax, %rdx
movq -40(%rbp), %rax
movslq -48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -40(%rbp), %rax
movslq -48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -72(%rbp), %rsi
callq strcpy@PLT
movl -48(%rbp), %eax
addl $1, %eax
movl %eax, -48(%rbp)
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
movl -76(%rbp), %eax
addl $1, %eax
movl %eax, -52(%rbp)
movl $0, -44(%rbp)
jmp .LBB0_11
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -76(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -72(%rbp), %rax
movl -76(%rbp), %ecx
subl -52(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -32(%rbp), %rdi
movq -8(%rbp), %rax
movslq -76(%rbp), %rcx
movsbl (%rax,%rcx), %esi
callq strchr@PLT
cmpq $0, %rax
jne .LBB0_10
# %bb.8: # in Loop: Header=BB0_1 Depth=1
callq __ctype_b_loc@PLT
movq (%rax), %rax
movq -8(%rbp), %rcx
movslq -76(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $1024, %eax # imm = 0x400
cmpl $0, %eax
je .LBB0_10
# %bb.9: # in Loop: Header=BB0_1 Depth=1
movl -44(%rbp), %eax
addl $1, %eax
movl %eax, -44(%rbp)
.LBB0_10: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_11
.LBB0_11: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_12
.LBB0_12: # in Loop: Header=BB0_1 Depth=1
movl -76(%rbp), %eax
addl $1, %eax
movl %eax, -76(%rbp)
jmp .LBB0_1
.LBB0_13:
movq -72(%rbp), %rdi
callq free@PLT
movl -48(%rbp), %ecx
movq -24(%rbp), %rax
movl %ecx, (%rax)
movq -40(%rbp), %rax
addq $80, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "aeiouAEIOU"
.size .L.str, 11
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym malloc
.addrsig_sym __ctype_b_loc
.addrsig_sym realloc
.addrsig_sym strcpy
.addrsig_sym strchr
.addrsig_sym free
|
problem119/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
str x8, [sp, #24]
ldur x0, [x29, #-16]
bl _strlen
str x0, [sp, #16]
ldr x8, [sp, #16]
subs x8, x8, #2
; kill: def $w8 killed $w8 killed $x8
str w8, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
subs w8, w8, #1
cset w8, lt
tbnz w8, #0, LBB0_8
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x0, [sp, #24]
ldur x8, [x29, #-16]
ldrsw x9, [sp, #12]
ldrsb w1, [x8, x9]
bl _strchr
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, LBB0_6
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x0, [sp, #24]
ldur x8, [x29, #-16]
ldr w9, [sp, #12]
add w9, w9, #1
ldrsb w1, [x8, w9, sxtw]
bl _strchr
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr x0, [sp, #24]
ldur x8, [x29, #-16]
ldr w9, [sp, #12]
subs w9, w9, #1
ldrsb w1, [x8, w9, sxtw]
bl _strchr
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5:
ldur x8, [x29, #-16]
ldrsw x9, [sp, #12]
add x8, x8, x9
ldrb w9, [x8]
adrp x10, _func0.out@PAGE
adrp x8, _func0.out@PAGE
add x8, x8, _func0.out@PAGEOFF
strb w9, [x10, _func0.out@PAGEOFF]
stur x8, [x29, #-8]
b LBB0_9
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
subs w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_8:
adrp x9, _func0.out@PAGE
adrp x8, _func0.out@PAGE
add x8, x8, _func0.out@PAGEOFF
strb wzr, [x9, _func0.out@PAGEOFF]
stur x8, [x29, #-8]
b LBB0_9
LBB0_9:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.zerofill __DATA,__bss,_func0.out,2,0 ; @func0.out
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "AEIOUaeiou"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -16(%rbp)
leaq .L.str(%rip), %rax
movq %rax, -24(%rbp)
movq -16(%rbp), %rdi
callq strlen@PLT
movq %rax, -32(%rbp)
movq -32(%rbp), %rax
subq $2, %rax
# kill: def $eax killed $eax killed $rax
movl %eax, -36(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
cmpl $1, -36(%rbp)
jl .LBB0_8
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rdi
movq -16(%rbp), %rax
movslq -36(%rbp), %rcx
movsbl (%rax,%rcx), %esi
callq strchr@PLT
cmpq $0, %rax
je .LBB0_6
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rdi
movq -16(%rbp), %rax
movl -36(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %esi
callq strchr@PLT
cmpq $0, %rax
jne .LBB0_6
# %bb.4: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rdi
movq -16(%rbp), %rax
movl -36(%rbp), %ecx
subl $1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %esi
callq strchr@PLT
cmpq $0, %rax
jne .LBB0_6
# %bb.5:
movq -16(%rbp), %rax
movslq -36(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, func0.out(%rip)
leaq func0.out(%rip), %rax
movq %rax, -8(%rbp)
jmp .LBB0_9
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_7
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
movl -36(%rbp), %eax
addl $-1, %eax
movl %eax, -36(%rbp)
jmp .LBB0_1
.LBB0_8:
movb $0, func0.out(%rip)
leaq func0.out(%rip), %rax
movq %rax, -8(%rbp)
.LBB0_9:
movq -8(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type func0.out,@object # @func0.out
.local func0.out
.comm func0.out,2,1
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "AEIOUaeiou"
.size .L.str, 11
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym strchr
.addrsig_sym func0.out
|
problem12/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] ; 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur x1, [x29, #-24]
ldur x0, [x29, #-16]
bl _strlen
mov x8, x0
stur w8, [x29, #-28]
ldur x0, [x29, #-24]
bl _strlen
mov x8, x0
str w8, [sp, #32]
ldur w8, [x29, #-28]
ldr w9, [sp, #32]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
ldur w8, [x29, #-28]
str w8, [sp, #8] ; 4-byte Folded Spill
b LBB0_3
LBB0_2:
ldr w8, [sp, #32]
str w8, [sp, #8] ; 4-byte Folded Spill
b LBB0_3
LBB0_3:
ldr w8, [sp, #8] ; 4-byte Folded Reload
str w8, [sp, #28]
ldr w8, [sp, #28]
add w9, w8, #1
; implicit-def: $x8
mov x8, x9
sxtw x8, w8
lsr x0, x8, #0
bl _malloc
str x0, [sp, #16]
ldr x8, [sp, #16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4:
; kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b LBB0_10
LBB0_5:
str wzr, [sp, #12]
b LBB0_6
LBB0_6: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr w9, [sp, #28]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_9
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_6 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #12]
ldrsb w8, [x8, x9]
ldur x9, [x29, #-24]
ldrsw x10, [sp, #12]
ldrsb w9, [x9, x10]
subs w8, w8, w9
cset w8, eq
and w10, w8, #0x1
mov w9, #49
mov w8, #48
ands w10, w10, #0x1
csel w8, w8, w9, ne
ldr x9, [sp, #16]
ldrsw x10, [sp, #12]
strb w8, [x9, x10]
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_6 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_6
LBB0_9:
ldr x8, [sp, #16]
ldrsw x9, [sp, #28]
add x8, x8, x9
strb wzr, [x8]
ldr x8, [sp, #16]
stur x8, [x29, #-8]
b LBB0_10
LBB0_10:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #64] ; 16-byte Folded Reload
add sp, sp, #80
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $64, %rsp
movq %rdi, -16(%rbp)
movq %rsi, -24(%rbp)
movq -16(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -28(%rbp)
movq -24(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -32(%rbp)
movl -28(%rbp), %eax
cmpl -32(%rbp), %eax
jge .LBB0_2
# %bb.1:
movl -28(%rbp), %eax
movl %eax, -56(%rbp) # 4-byte Spill
jmp .LBB0_3
.LBB0_2:
movl -32(%rbp), %eax
movl %eax, -56(%rbp) # 4-byte Spill
.LBB0_3:
movl -56(%rbp), %eax # 4-byte Reload
movl %eax, -36(%rbp)
movl -36(%rbp), %eax
addl $1, %eax
movslq %eax, %rdi
shlq $0, %rdi
callq malloc@PLT
movq %rax, -48(%rbp)
cmpq $0, -48(%rbp)
jne .LBB0_5
# %bb.4:
movq $0, -8(%rbp)
jmp .LBB0_10
.LBB0_5:
movl $0, -52(%rbp)
.LBB0_6: # =>This Inner Loop Header: Depth=1
movl -52(%rbp), %eax
cmpl -36(%rbp), %eax
jge .LBB0_9
# %bb.7: # in Loop: Header=BB0_6 Depth=1
movq -16(%rbp), %rax
movslq -52(%rbp), %rcx
movsbl (%rax,%rcx), %edx
movq -24(%rbp), %rax
movslq -52(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movl $49, %eax
movl $48, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
movb %al, %dl
movq -48(%rbp), %rax
movslq -52(%rbp), %rcx
movb %dl, (%rax,%rcx)
# %bb.8: # in Loop: Header=BB0_6 Depth=1
movl -52(%rbp), %eax
addl $1, %eax
movl %eax, -52(%rbp)
jmp .LBB0_6
.LBB0_9:
movq -48(%rbp), %rax
movslq -36(%rbp), %rcx
movb $0, (%rax,%rcx)
movq -48(%rbp), %rax
movq %rax, -8(%rbp)
.LBB0_10:
movq -8(%rbp), %rax
addq $64, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym malloc
|
problem120/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
str x1, [sp, #24]
str wzr, [sp, #20]
ldur x0, [x29, #-16]
bl _strlen
mov x8, x0
str w8, [sp, #16]
ldr x0, [sp, #24]
bl _strlen
mov x8, x0
str w8, [sp, #12]
mov w8, #1
str w8, [sp, #4]
str wzr, [sp, #8]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #16]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #40
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #41
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #4]
b LBB0_8
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_1
LBB0_10:
str wzr, [sp, #8]
b LBB0_11
LBB0_11: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_20
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_11 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #40
cset w8, ne
tbnz w8, #0, LBB0_14
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_11 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #41
cset w8, ne
tbnz w8, #0, LBB0_16
b LBB0_15
LBB0_15: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_16
LBB0_16: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, LBB0_18
b LBB0_17
LBB0_17: ; in Loop: Header=BB0_11 Depth=1
str wzr, [sp, #4]
b LBB0_18
LBB0_18: ; in Loop: Header=BB0_11 Depth=1
b LBB0_19
LBB0_19: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_11
LBB0_20:
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_23
b LBB0_21
LBB0_21:
ldr w8, [sp, #4]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_23
b LBB0_22
LBB0_22:
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
stur x8, [x29, #-8]
b LBB0_47
LBB0_23:
str wzr, [sp, #20]
mov w8, #1
str w8, [sp, #4]
str wzr, [sp, #8]
b LBB0_24
LBB0_24: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_33
b LBB0_25
LBB0_25: ; in Loop: Header=BB0_24 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #40
cset w8, ne
tbnz w8, #0, LBB0_27
b LBB0_26
LBB0_26: ; in Loop: Header=BB0_24 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_27
LBB0_27: ; in Loop: Header=BB0_24 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #41
cset w8, ne
tbnz w8, #0, LBB0_29
b LBB0_28
LBB0_28: ; in Loop: Header=BB0_24 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_29
LBB0_29: ; in Loop: Header=BB0_24 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, LBB0_31
b LBB0_30
LBB0_30: ; in Loop: Header=BB0_24 Depth=1
str wzr, [sp, #4]
b LBB0_31
LBB0_31: ; in Loop: Header=BB0_24 Depth=1
b LBB0_32
LBB0_32: ; in Loop: Header=BB0_24 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_24
LBB0_33:
str wzr, [sp, #8]
b LBB0_34
LBB0_34: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #16]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_43
b LBB0_35
LBB0_35: ; in Loop: Header=BB0_34 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #40
cset w8, ne
tbnz w8, #0, LBB0_37
b LBB0_36
LBB0_36: ; in Loop: Header=BB0_34 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_37
LBB0_37: ; in Loop: Header=BB0_34 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldrsb w8, [x8, x9]
subs w8, w8, #41
cset w8, ne
tbnz w8, #0, LBB0_39
b LBB0_38
LBB0_38: ; in Loop: Header=BB0_34 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #1
str w8, [sp, #20]
b LBB0_39
LBB0_39: ; in Loop: Header=BB0_34 Depth=1
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, LBB0_41
b LBB0_40
LBB0_40: ; in Loop: Header=BB0_34 Depth=1
str wzr, [sp, #4]
b LBB0_41
LBB0_41: ; in Loop: Header=BB0_34 Depth=1
b LBB0_42
LBB0_42: ; in Loop: Header=BB0_34 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_34
LBB0_43:
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_46
b LBB0_44
LBB0_44:
ldr w8, [sp, #4]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, LBB0_46
b LBB0_45
LBB0_45:
adrp x8, l_.str@PAGE
add x8, x8, l_.str@PAGEOFF
stur x8, [x29, #-8]
b LBB0_47
LBB0_46:
adrp x8, l_.str.1@PAGE
add x8, x8, l_.str.1@PAGEOFF
stur x8, [x29, #-8]
b LBB0_47
LBB0_47:
ldur x0, [x29, #-8]
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "Yes"
l_.str.1: ; @.str.1
.asciz "No"
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -16(%rbp)
movq %rsi, -24(%rbp)
movl $0, -28(%rbp)
movq -16(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -32(%rbp)
movq -24(%rbp), %rdi
callq strlen@PLT
# kill: def $eax killed $eax killed $rax
movl %eax, -36(%rbp)
movl $1, -44(%rbp)
movl $0, -40(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -32(%rbp), %eax
jge .LBB0_10
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $40, %eax
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $41, %eax
jne .LBB0_6
# %bb.5: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $-1, %eax
movl %eax, -28(%rbp)
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
cmpl $0, -28(%rbp)
jge .LBB0_8
# %bb.7: # in Loop: Header=BB0_1 Depth=1
movl $0, -44(%rbp)
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_1
.LBB0_10:
movl $0, -40(%rbp)
.LBB0_11: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -36(%rbp), %eax
jge .LBB0_20
# %bb.12: # in Loop: Header=BB0_11 Depth=1
movq -24(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $40, %eax
jne .LBB0_14
# %bb.13: # in Loop: Header=BB0_11 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
.LBB0_14: # in Loop: Header=BB0_11 Depth=1
movq -24(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $41, %eax
jne .LBB0_16
# %bb.15: # in Loop: Header=BB0_11 Depth=1
movl -28(%rbp), %eax
addl $-1, %eax
movl %eax, -28(%rbp)
.LBB0_16: # in Loop: Header=BB0_11 Depth=1
cmpl $0, -28(%rbp)
jge .LBB0_18
# %bb.17: # in Loop: Header=BB0_11 Depth=1
movl $0, -44(%rbp)
.LBB0_18: # in Loop: Header=BB0_11 Depth=1
jmp .LBB0_19
.LBB0_19: # in Loop: Header=BB0_11 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_11
.LBB0_20:
cmpl $0, -28(%rbp)
jne .LBB0_23
# %bb.21:
cmpl $0, -44(%rbp)
je .LBB0_23
# %bb.22:
leaq .L.str(%rip), %rax
movq %rax, -8(%rbp)
jmp .LBB0_47
.LBB0_23:
movl $0, -28(%rbp)
movl $1, -44(%rbp)
movl $0, -40(%rbp)
.LBB0_24: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -36(%rbp), %eax
jge .LBB0_33
# %bb.25: # in Loop: Header=BB0_24 Depth=1
movq -24(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $40, %eax
jne .LBB0_27
# %bb.26: # in Loop: Header=BB0_24 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
.LBB0_27: # in Loop: Header=BB0_24 Depth=1
movq -24(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $41, %eax
jne .LBB0_29
# %bb.28: # in Loop: Header=BB0_24 Depth=1
movl -28(%rbp), %eax
addl $-1, %eax
movl %eax, -28(%rbp)
.LBB0_29: # in Loop: Header=BB0_24 Depth=1
cmpl $0, -28(%rbp)
jge .LBB0_31
# %bb.30: # in Loop: Header=BB0_24 Depth=1
movl $0, -44(%rbp)
.LBB0_31: # in Loop: Header=BB0_24 Depth=1
jmp .LBB0_32
.LBB0_32: # in Loop: Header=BB0_24 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_24
.LBB0_33:
movl $0, -40(%rbp)
.LBB0_34: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -32(%rbp), %eax
jge .LBB0_43
# %bb.35: # in Loop: Header=BB0_34 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $40, %eax
jne .LBB0_37
# %bb.36: # in Loop: Header=BB0_34 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
.LBB0_37: # in Loop: Header=BB0_34 Depth=1
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $41, %eax
jne .LBB0_39
# %bb.38: # in Loop: Header=BB0_34 Depth=1
movl -28(%rbp), %eax
addl $-1, %eax
movl %eax, -28(%rbp)
.LBB0_39: # in Loop: Header=BB0_34 Depth=1
cmpl $0, -28(%rbp)
jge .LBB0_41
# %bb.40: # in Loop: Header=BB0_34 Depth=1
movl $0, -44(%rbp)
.LBB0_41: # in Loop: Header=BB0_34 Depth=1
jmp .LBB0_42
.LBB0_42: # in Loop: Header=BB0_34 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_34
.LBB0_43:
cmpl $0, -28(%rbp)
jne .LBB0_46
# %bb.44:
cmpl $0, -44(%rbp)
je .LBB0_46
# %bb.45:
leaq .L.str(%rip), %rax
movq %rax, -8(%rbp)
jmp .LBB0_47
.LBB0_46:
leaq .L.str.1(%rip), %rax
movq %rax, -8(%rbp)
.LBB0_47:
movq -8(%rbp), %rax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Yes"
.size .L.str, 4
.type .L.str.1,@object # @.str.1
.L.str.1:
.asciz "No"
.size .L.str.1, 3
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
|
problem121/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
str x0, [sp, #40]
str w1, [sp, #36]
str w2, [sp, #32]
str x3, [sp, #24]
str wzr, [sp, #20]
b LBB0_1
LBB0_1: ; =>This Loop Header: Depth=1
; Child Loop BB0_3 Depth 2
ldr w8, [sp, #20]
ldr w9, [sp, #36]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_10
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #16]
b LBB0_3
LBB0_3: ; Parent Loop BB0_1 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #16]
ldr w9, [sp, #36]
ldr w10, [sp, #20]
subs w9, w9, w10
subs w9, w9, #1
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_8
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
ldr x9, [sp, #40]
ldr w10, [sp, #16]
add w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #12]
ldr x8, [sp, #40]
ldr w9, [sp, #16]
add w9, w9, #1
ldr w8, [x8, w9, sxtw #2]
ldr x9, [sp, #40]
ldrsw x10, [sp, #16]
str w8, [x9, x10, lsl #2]
ldr w8, [sp, #12]
ldr x9, [sp, #40]
ldr w10, [sp, #16]
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_3 Depth=2
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_3
LBB0_8: ; in Loop: Header=BB0_1 Depth=1
b LBB0_9
LBB0_9: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b LBB0_1
LBB0_10:
str wzr, [sp, #8]
b LBB0_11
LBB0_11: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #32]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_14
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_11 Depth=1
ldr x8, [sp, #40]
ldr w9, [sp, #36]
ldr w10, [sp, #32]
subs w9, w9, w10
ldr w10, [sp, #8]
add w9, w9, w10
ldr w8, [x8, w9, sxtw #2]
ldr x9, [sp, #24]
ldrsw x10, [sp, #8]
str w8, [x9, x10, lsl #2]
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b LBB0_11
LBB0_14:
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl %edx, -16(%rbp)
movq %rcx, -24(%rbp)
movl $0, -28(%rbp)
.LBB0_1: # =>This Loop Header: Depth=1
# Child Loop BB0_3 Depth 2
movl -28(%rbp), %eax
movl -12(%rbp), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_10
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl $0, -32(%rbp)
.LBB0_3: # Parent Loop BB0_1 Depth=1
# => This Inner Loop Header: Depth=2
movl -32(%rbp), %eax
movl -12(%rbp), %ecx
subl -28(%rbp), %ecx
subl $1, %ecx
cmpl %ecx, %eax
jge .LBB0_8
# %bb.4: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -8(%rbp), %rcx
movl -32(%rbp), %edx
addl $1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle .LBB0_6
# %bb.5: # in Loop: Header=BB0_3 Depth=2
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -36(%rbp)
movq -8(%rbp), %rax
movl -32(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -8(%rbp), %rax
movslq -32(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -36(%rbp), %edx
movq -8(%rbp), %rax
movl -32(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
.LBB0_6: # in Loop: Header=BB0_3 Depth=2
jmp .LBB0_7
.LBB0_7: # in Loop: Header=BB0_3 Depth=2
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
jmp .LBB0_3
.LBB0_8: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_9
.LBB0_9: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
addl $1, %eax
movl %eax, -28(%rbp)
jmp .LBB0_1
.LBB0_10:
movl $0, -40(%rbp)
.LBB0_11: # =>This Inner Loop Header: Depth=1
movl -40(%rbp), %eax
cmpl -16(%rbp), %eax
jge .LBB0_14
# %bb.12: # in Loop: Header=BB0_11 Depth=1
movq -8(%rbp), %rax
movl -12(%rbp), %ecx
subl -16(%rbp), %ecx
addl -40(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -24(%rbp), %rax
movslq -40(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
# %bb.13: # in Loop: Header=BB0_11 Depth=1
movl -40(%rbp), %eax
addl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_11
.LBB0_14:
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem122/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #24]
str w1, [sp, #20]
str wzr, [sp, #16]
str wzr, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w9, [sp, #12]
ldr w8, [sp, #20]
subs w8, w8, w9, lsl #1
cset w8, le
tbnz w8, #0, LBB0_6
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w9, [sp, #12]
lsl w9, w9, #1
ldr w8, [x8, w9, sxtw #2]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w9, [sp, #12]
lsl w9, w9, #1
ldr w9, [x8, w9, sxtw #2]
ldr w8, [sp, #16]
add w8, w8, w9
str w8, [sp, #16]
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_6:
ldr w0, [sp, #16]
add sp, sp, #32
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl $0, -16(%rbp)
movl $0, -20(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -20(%rbp), %eax
shll $1, %eax
cmpl -12(%rbp), %eax
jge .LBB0_6
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movl -20(%rbp), %ecx
shll $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_4
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movl -20(%rbp), %ecx
shll $1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addl -16(%rbp), %eax
movl %eax, -16(%rbp)
.LBB0_4: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_5
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %eax
addl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_1
.LBB0_6:
movl -16(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem123/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #24]
str w1, [sp, #20]
str wzr, [sp, #16]
str wzr, [sp, #12]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr w9, [sp, #20]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_7
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #99
cset w8, lt
tbnz w8, #0, LBB0_5
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #12]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #99
cset w8, gt
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldrsw x9, [sp, #12]
ldr w9, [x8, x9, lsl #2]
ldr w8, [sp, #16]
add w8, w8, w9
str w8, [sp, #16]
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b LBB0_1
LBB0_7:
ldr w0, [sp, #16]
add sp, sp, #32
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movl %esi, -12(%rbp)
movl $0, -16(%rbp)
movl $0, -20(%rbp)
.LBB0_1: # =>This Inner Loop Header: Depth=1
movl -20(%rbp), %eax
cmpl -12(%rbp), %eax
jge .LBB0_7
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -20(%rbp), %rcx
cmpl $-99, (%rax,%rcx,4)
jl .LBB0_5
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -20(%rbp), %rcx
cmpl $99, (%rax,%rcx,4)
jg .LBB0_5
# %bb.4: # in Loop: Header=BB0_1 Depth=1
movq -8(%rbp), %rax
movslq -20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -16(%rbp), %eax
movl %eax, -16(%rbp)
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_6
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
movl -20(%rbp), %eax
addl $1, %eax
movl %eax, -20(%rbp)
jmp .LBB0_1
.LBB0_7:
movl -16(%rbp), %eax
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
|
problem124/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
stur x1, [x29, #-16]
str x2, [sp, #24]
mov w8, #10
str w8, [sp, #20]
ldr x9, [sp, #24]
mov w8, #1
str w8, [x9]
ldur x9, [x29, #-16]
str w8, [x9]
b LBB0_1
LBB0_1: ; =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
subs w8, w8, #1
cset w8, eq
tbnz w8, #0, LBB0_8
b LBB0_2
LBB0_2: ; in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, LBB0_6
b LBB0_3
LBB0_3: ; in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w8, [x8]
ldr w9, [sp, #20]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, LBB0_5
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
lsl w8, w8, #1
str w8, [sp, #20]
ldur x0, [x29, #-16]
ldrsw x8, [sp, #20]
lsl x1, x8, #2
bl _realloc
stur x0, [x29, #-16]
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
ldur x9, [x29, #-16]
ldr x12, [sp, #24]
ldrsw x10, [x12]
mov x11, x10
add w11, w11, #1
str w11, [x12]
str w8, [x9, x10, lsl #2]
ldur w8, [x29, #-4]
mov w9, #3
mul w8, w8, w9
add w8, w8, #1
stur w8, [x29, #-4]
b LBB0_7
LBB0_6: ; in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
mov w9, #2
sdiv w8, w8, w9
stur w8, [x29, #-4]
b LBB0_7
LBB0_7: ; in Loop: Header=BB0_1 Depth=1
b LBB0_1
LBB0_8:
mov w8, #1
str w8, [sp, #16]
b LBB0_9
LBB0_9: ; =>This Loop Header: Depth=1
; Child Loop BB0_11 Depth 2
ldr w8, [sp, #16]
ldr x9, [sp, #24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_17
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_9 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #16]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #12]
ldr w8, [sp, #16]
subs w8, w8, #1
str w8, [sp, #8]
b LBB0_11
LBB0_11: ; Parent Loop BB0_9 Depth=1
; => This Inner Loop Header: Depth=2
ldr w8, [sp, #8]
subs w8, w8, #0
cset w8, lt
mov w9, #0
str w9, [sp, #4] ; 4-byte Folded Spill
tbnz w8, #0, LBB0_13
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_11 Depth=2
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldr w8, [x8, x9, lsl #2]
ldr w9, [sp, #12]
subs w8, w8, w9
cset w8, gt
str w8, [sp, #4] ; 4-byte Folded Spill
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_11 Depth=2
ldr w8, [sp, #4] ; 4-byte Folded Reload
tbz w8, #0, LBB0_15
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_11 Depth=2
ldur x8, [x29, #-16]
ldrsw x9, [sp, #8]
ldr w8, [x8, x9, lsl #2]
ldur x9, [x29, #-16]
ldr w10, [sp, #8]
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
ldr w8, [sp, #8]
subs w8, w8, #1
str w8, [sp, #8]
b LBB0_11
LBB0_15: ; in Loop: Header=BB0_9 Depth=1
ldr w8, [sp, #12]
ldur x9, [x29, #-16]
ldr w10, [sp, #8]
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
b LBB0_16
LBB0_16: ; in Loop: Header=BB0_9 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_9
LBB0_17:
ldp x29, x30, [sp, #48] ; 16-byte Folded Reload
add sp, sp, #64
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movq %rdx, -24(%rbp)
movl $10, -28(%rbp)
movq -24(%rbp), %rax
movl $1, (%rax)
movq -16(%rbp), %rax
movl $1, (%rax)
.LBB0_1: # =>This Inner Loop Header: Depth=1
cmpl $1, -4(%rbp)
je .LBB0_8
# %bb.2: # in Loop: Header=BB0_1 Depth=1
movl -4(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
cmpl $1, %edx
jne .LBB0_6
# %bb.3: # in Loop: Header=BB0_1 Depth=1
movq -24(%rbp), %rax
movl (%rax), %eax
cmpl -28(%rbp), %eax
jl .LBB0_5
# %bb.4: # in Loop: Header=BB0_1 Depth=1
movl -28(%rbp), %eax
shll $1, %eax
movl %eax, -28(%rbp)
movq -16(%rbp), %rdi
movslq -28(%rbp), %rsi
shlq $2, %rsi
callq realloc@PLT
movq %rax, -16(%rbp)
.LBB0_5: # in Loop: Header=BB0_1 Depth=1
movl -4(%rbp), %edx
movq -16(%rbp), %rax
movq -24(%rbp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
imull $3, -4(%rbp), %eax
addl $1, %eax
movl %eax, -4(%rbp)
jmp .LBB0_7
.LBB0_6: # in Loop: Header=BB0_1 Depth=1
movl -4(%rbp), %eax
movl $2, %ecx
cltd
idivl %ecx
movl %eax, -4(%rbp)
.LBB0_7: # in Loop: Header=BB0_1 Depth=1
jmp .LBB0_1
.LBB0_8:
movl $1, -32(%rbp)
.LBB0_9: # =>This Loop Header: Depth=1
# Child Loop BB0_11 Depth 2
movl -32(%rbp), %eax
movq -24(%rbp), %rcx
cmpl (%rcx), %eax
jge .LBB0_17
# %bb.10: # in Loop: Header=BB0_9 Depth=1
movq -16(%rbp), %rax
movslq -32(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -36(%rbp)
movl -32(%rbp), %eax
subl $1, %eax
movl %eax, -40(%rbp)
.LBB0_11: # Parent Loop BB0_9 Depth=1
# => This Inner Loop Header: Depth=2
xorl %eax, %eax
# kill: def $al killed $al killed $eax
cmpl $0, -40(%rbp)
movb %al, -41(%rbp) # 1-byte Spill
jl .LBB0_13
# %bb.12: # in Loop: Header=BB0_11 Depth=2
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -36(%rbp), %eax
setg %al
movb %al, -41(%rbp) # 1-byte Spill
.LBB0_13: # in Loop: Header=BB0_11 Depth=2
movb -41(%rbp), %al # 1-byte Reload
testb $1, %al
jne .LBB0_14
jmp .LBB0_15
.LBB0_14: # in Loop: Header=BB0_11 Depth=2
movq -16(%rbp), %rax
movslq -40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -16(%rbp), %rax
movl -40(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -40(%rbp), %eax
subl $1, %eax
movl %eax, -40(%rbp)
jmp .LBB0_11
.LBB0_15: # in Loop: Header=BB0_9 Depth=1
movl -36(%rbp), %edx
movq -16(%rbp), %rax
movl -40(%rbp), %ecx
addl $1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
# %bb.16: # in Loop: Header=BB0_9 Depth=1
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
jmp .LBB0_9
.LBB0_17:
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym realloc
|
problem125/code.c | .section __TEXT,__text,regular,pure_instructions
.build_version macos, 13, 0 sdk_version 13, 3
.globl _func0 ; -- Begin function func0
.p2align 2
_func0: ; @func0
.cfi_startproc
; %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] ; 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
ldur x0, [x29, #-16]
bl _strlen
subs x8, x0, #10
cset w8, eq
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_2:
str wzr, [sp, #32]
b LBB0_3
LBB0_3: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #32]
subs w8, w8, #10
cset w8, ge
tbnz w8, #0, LBB0_15
b LBB0_4
LBB0_4: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #32]
subs w8, w8, #2
cset w8, eq
tbnz w8, #0, LBB0_6
b LBB0_5
LBB0_5: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #32]
subs w8, w8, #5
cset w8, ne
tbnz w8, #0, LBB0_9
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #32]
ldrsb w8, [x8, x9]
subs w8, w8, #45
cset w8, eq
tbnz w8, #0, LBB0_8
b LBB0_7
LBB0_7:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_8: ; in Loop: Header=BB0_3 Depth=1
b LBB0_13
LBB0_9: ; in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #32]
ldrsb w8, [x8, x9]
subs w8, w8, #48
cset w8, lt
tbnz w8, #0, LBB0_11
b LBB0_10
LBB0_10: ; in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldrsw x9, [sp, #32]
ldrsb w8, [x8, x9]
subs w8, w8, #57
cset w8, le
tbnz w8, #0, LBB0_12
b LBB0_11
LBB0_11:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_12: ; in Loop: Header=BB0_3 Depth=1
b LBB0_13
LBB0_13: ; in Loop: Header=BB0_3 Depth=1
b LBB0_14
LBB0_14: ; in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #32]
add w8, w8, #1
str w8, [sp, #32]
b LBB0_3
LBB0_15:
ldur x8, [x29, #-16]
ldrb w8, [x8]
add x0, sp, #29
strb w8, [sp, #29]
ldur x8, [x29, #-16]
ldrb w8, [x8, #1]
strb w8, [sp, #30]
strb wzr, [sp, #31]
ldur x8, [x29, #-16]
ldrb w8, [x8, #3]
add x9, sp, #26
str x9, [sp] ; 8-byte Folded Spill
strb w8, [sp, #26]
ldur x8, [x29, #-16]
ldrb w8, [x8, #4]
strb w8, [sp, #27]
strb wzr, [sp, #28]
ldur x8, [x29, #-16]
ldrb w8, [x8, #6]
add x9, sp, #21
str x9, [sp, #8] ; 8-byte Folded Spill
strb w8, [sp, #21]
ldur x8, [x29, #-16]
ldrb w8, [x8, #7]
strb w8, [sp, #22]
ldur x8, [x29, #-16]
ldrb w8, [x8, #8]
strb w8, [sp, #23]
ldur x8, [x29, #-16]
ldrb w8, [x8, #9]
strb w8, [sp, #24]
strb wzr, [sp, #25]
bl _atoi
mov x8, x0
ldr x0, [sp] ; 8-byte Folded Reload
stur w8, [x29, #-20]
bl _atoi
mov x8, x0
ldr x0, [sp, #8] ; 8-byte Folded Reload
stur w8, [x29, #-24]
bl _atoi
stur w0, [x29, #-28]
ldur w8, [x29, #-20]
subs w8, w8, #1
cset w8, lt
tbnz w8, #0, LBB0_17
b LBB0_16
LBB0_16:
ldur w8, [x29, #-20]
subs w8, w8, #12
cset w8, le
tbnz w8, #0, LBB0_18
b LBB0_17
LBB0_17:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_18:
ldur w8, [x29, #-24]
subs w8, w8, #1
cset w8, lt
tbnz w8, #0, LBB0_20
b LBB0_19
LBB0_19:
ldur w8, [x29, #-24]
subs w8, w8, #31
cset w8, le
tbnz w8, #0, LBB0_21
b LBB0_20
LBB0_20:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_21:
ldur w8, [x29, #-20]
subs w8, w8, #4
cset w8, eq
tbnz w8, #0, LBB0_25
b LBB0_22
LBB0_22:
ldur w8, [x29, #-20]
subs w8, w8, #6
cset w8, eq
tbnz w8, #0, LBB0_25
b LBB0_23
LBB0_23:
ldur w8, [x29, #-20]
subs w8, w8, #9
cset w8, eq
tbnz w8, #0, LBB0_25
b LBB0_24
LBB0_24:
ldur w8, [x29, #-20]
subs w8, w8, #11
cset w8, ne
tbnz w8, #0, LBB0_27
b LBB0_25
LBB0_25:
ldur w8, [x29, #-24]
subs w8, w8, #31
cset w8, ne
tbnz w8, #0, LBB0_27
b LBB0_26
LBB0_26:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_27:
ldur w8, [x29, #-20]
subs w8, w8, #2
cset w8, ne
tbnz w8, #0, LBB0_30
b LBB0_28
LBB0_28:
ldur w8, [x29, #-24]
subs w8, w8, #29
cset w8, le
tbnz w8, #0, LBB0_30
b LBB0_29
LBB0_29:
stur wzr, [x29, #-4]
b LBB0_31
LBB0_30:
mov w8, #1
stur w8, [x29, #-4]
b LBB0_31
LBB0_31:
ldur w0, [x29, #-4]
ldp x29, x30, [sp, #64] ; 16-byte Folded Reload
add sp, sp, #80
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
| .text
.file "code.c"
.globl func0 # -- Begin function func0
.p2align 4, 0x90
.type func0,@function
func0: # @func0
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq %rdi, -16(%rbp)
movq -16(%rbp), %rdi
callq strlen@PLT
cmpq $10, %rax
je .LBB0_2
# %bb.1:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_2:
movl $0, -32(%rbp)
.LBB0_3: # =>This Inner Loop Header: Depth=1
cmpl $10, -32(%rbp)
jge .LBB0_15
# %bb.4: # in Loop: Header=BB0_3 Depth=1
cmpl $2, -32(%rbp)
je .LBB0_6
# %bb.5: # in Loop: Header=BB0_3 Depth=1
cmpl $5, -32(%rbp)
jne .LBB0_9
.LBB0_6: # in Loop: Header=BB0_3 Depth=1
movq -16(%rbp), %rax
movslq -32(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $45, %eax
je .LBB0_8
# %bb.7:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_8: # in Loop: Header=BB0_3 Depth=1
jmp .LBB0_13
.LBB0_9: # in Loop: Header=BB0_3 Depth=1
movq -16(%rbp), %rax
movslq -32(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $48, %eax
jl .LBB0_11
# %bb.10: # in Loop: Header=BB0_3 Depth=1
movq -16(%rbp), %rax
movslq -32(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $57, %eax
jle .LBB0_12
.LBB0_11:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_12: # in Loop: Header=BB0_3 Depth=1
jmp .LBB0_13
.LBB0_13: # in Loop: Header=BB0_3 Depth=1
jmp .LBB0_14
.LBB0_14: # in Loop: Header=BB0_3 Depth=1
movl -32(%rbp), %eax
addl $1, %eax
movl %eax, -32(%rbp)
jmp .LBB0_3
.LBB0_15:
movq -16(%rbp), %rax
movb (%rax), %al
movb %al, -35(%rbp)
movq -16(%rbp), %rax
movb 1(%rax), %al
movb %al, -34(%rbp)
movb $0, -33(%rbp)
movq -16(%rbp), %rax
movb 3(%rax), %al
movb %al, -38(%rbp)
movq -16(%rbp), %rax
movb 4(%rax), %al
movb %al, -37(%rbp)
movb $0, -36(%rbp)
movq -16(%rbp), %rax
movb 6(%rax), %al
movb %al, -43(%rbp)
movq -16(%rbp), %rax
movb 7(%rax), %al
movb %al, -42(%rbp)
movq -16(%rbp), %rax
movb 8(%rax), %al
movb %al, -41(%rbp)
movq -16(%rbp), %rax
movb 9(%rax), %al
movb %al, -40(%rbp)
movb $0, -39(%rbp)
leaq -35(%rbp), %rdi
callq atoi@PLT
movl %eax, -20(%rbp)
leaq -38(%rbp), %rdi
callq atoi@PLT
movl %eax, -24(%rbp)
leaq -43(%rbp), %rdi
callq atoi@PLT
movl %eax, -28(%rbp)
cmpl $1, -20(%rbp)
jl .LBB0_17
# %bb.16:
cmpl $12, -20(%rbp)
jle .LBB0_18
.LBB0_17:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_18:
cmpl $1, -24(%rbp)
jl .LBB0_20
# %bb.19:
cmpl $31, -24(%rbp)
jle .LBB0_21
.LBB0_20:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_21:
cmpl $4, -20(%rbp)
je .LBB0_25
# %bb.22:
cmpl $6, -20(%rbp)
je .LBB0_25
# %bb.23:
cmpl $9, -20(%rbp)
je .LBB0_25
# %bb.24:
cmpl $11, -20(%rbp)
jne .LBB0_27
.LBB0_25:
cmpl $31, -24(%rbp)
jne .LBB0_27
# %bb.26:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_27:
cmpl $2, -20(%rbp)
jne .LBB0_30
# %bb.28:
cmpl $29, -24(%rbp)
jle .LBB0_30
# %bb.29:
movl $0, -4(%rbp)
jmp .LBB0_31
.LBB0_30:
movl $1, -4(%rbp)
.LBB0_31:
movl -4(%rbp), %eax
addq $48, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size func0, .Lfunc_end0-func0
.cfi_endproc
# -- End function
.ident "Ubuntu clang version 14.0.0-1ubuntu1.1"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strlen
.addrsig_sym atoi
|