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
problem126/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] 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, #8] b LBB0_3 LBB0_3: ; =>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_12 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] 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: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_13 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #8] subs w8, w8, #2 cset w8, lt tbnz w8, #0, LBB0_10 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] subs w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] subs w10, w10, #2 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_13 LBB0_10: ; in Loop: Header=BB0_3 Depth=1 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_3 LBB0_12: mov w8, #1 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) cmpl $0, -20(%rbp) jne .LBB0_2 # %bb.1: movb $1, -1(%rbp) jmp .LBB0_13 .LBB0_2: movl $1, -24(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_12 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jge .LBB0_6 # %bb.5: movb $0, -1(%rbp) jmp .LBB0_13 .LBB0_6: # in Loop: Header=BB0_3 Depth=1 cmpl $2, -24(%rbp) jl .LBB0_10 # %bb.7: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jne .LBB0_10 # %bb.8: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $2, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jne .LBB0_10 # %bb.9: movb $0, -1(%rbp) jmp .LBB0_13 .LBB0_10: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_3 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_3 .LBB0_12: movb $1, -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
problem127/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] 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, #8] b LBB0_3 LBB0_3: ; =>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_12 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] 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: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_13 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #8] subs w8, w8, #2 cset w8, lt tbnz w8, #0, LBB0_10 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] subs w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldr w10, [sp, #8] subs w10, w10, #2 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_13 LBB0_10: ; in Loop: Header=BB0_3 Depth=1 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_3 LBB0_12: mov w8, #1 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) cmpl $0, -20(%rbp) jne .LBB0_2 # %bb.1: movb $1, -1(%rbp) jmp .LBB0_13 .LBB0_2: movl $1, -24(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_12 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jge .LBB0_6 # %bb.5: movb $0, -1(%rbp) jmp .LBB0_13 .LBB0_6: # in Loop: Header=BB0_3 Depth=1 cmpl $2, -24(%rbp) jl .LBB0_10 # %bb.7: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jne .LBB0_10 # %bb.8: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -24(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -16(%rbp), %rcx movl -24(%rbp), %edx subl $2, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jne .LBB0_10 # %bb.9: movb $0, -1(%rbp) jmp .LBB0_13 .LBB0_10: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_3 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_3 .LBB0_12: movb $1, -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
problem128/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 w0, [sp, #36] str w1, [sp, #32] str w2, [sp, #28] str w3, [sp, #24] ldr w8, [sp, #36] ldr w9, [sp, #28] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr w8, [sp, #36] str w8, [sp, #4] ; 4-byte Folded Spill b LBB0_3 LBB0_2: ldr w8, [sp, #28] str w8, [sp, #4] ; 4-byte Folded Spill b LBB0_3 LBB0_3: ldr w8, [sp, #4] ; 4-byte Folded Reload str w8, [sp, #20] ldr w8, [sp, #32] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ldr w8, [sp, #32] str w8, [sp] ; 4-byte Folded Spill b LBB0_6 LBB0_5: ldr w8, [sp, #24] str w8, [sp] ; 4-byte Folded Spill b LBB0_6 LBB0_6: ldr w8, [sp] ; 4-byte Folded Reload str w8, [sp, #16] ldr w8, [sp, #16] ldr w9, [sp, #20] subs w8, w8, w9 str w8, [sp, #12] ldr w8, [sp, #12] subs w8, w8, #2 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF str x8, [sp, #40] b LBB0_15 LBB0_8: mov w8, #2 str w8, [sp, #8] b LBB0_9 LBB0_9: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #8] mul w8, w8, w9 ldr w9, [sp, #12] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_14 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_9 Depth=1 ldr w8, [sp, #12] ldr w10, [sp, #8] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF str x8, [sp, #40] b LBB0_15 LBB0_12: ; in Loop: Header=BB0_9 Depth=1 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_9 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_9 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 "NO" l_.str.1: ; @.str.1 .asciz "YES" .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, -12(%rbp) movl %esi, -16(%rbp) movl %edx, -20(%rbp) movl %ecx, -24(%rbp) movl -12(%rbp), %eax cmpl -20(%rbp), %eax jle .LBB0_2 # %bb.1: movl -12(%rbp), %eax movl %eax, -44(%rbp) # 4-byte Spill jmp .LBB0_3 .LBB0_2: movl -20(%rbp), %eax movl %eax, -44(%rbp) # 4-byte Spill .LBB0_3: movl -44(%rbp), %eax # 4-byte Reload movl %eax, -28(%rbp) movl -16(%rbp), %eax cmpl -24(%rbp), %eax jge .LBB0_5 # %bb.4: movl -16(%rbp), %eax movl %eax, -48(%rbp) # 4-byte Spill jmp .LBB0_6 .LBB0_5: movl -24(%rbp), %eax movl %eax, -48(%rbp) # 4-byte Spill .LBB0_6: movl -48(%rbp), %eax # 4-byte Reload movl %eax, -32(%rbp) movl -32(%rbp), %eax subl -28(%rbp), %eax movl %eax, -36(%rbp) cmpl $2, -36(%rbp) jge .LBB0_8 # %bb.7: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_15 .LBB0_8: movl $2, -40(%rbp) .LBB0_9: # =>This Inner Loop Header: Depth=1 movl -40(%rbp), %eax imull -40(%rbp), %eax cmpl -36(%rbp), %eax jg .LBB0_14 # %bb.10: # in Loop: Header=BB0_9 Depth=1 movl -36(%rbp), %eax cltd idivl -40(%rbp) cmpl $0, %edx jne .LBB0_12 # %bb.11: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_15 .LBB0_12: # in Loop: Header=BB0_9 Depth=1 jmp .LBB0_13 .LBB0_13: # in Loop: Header=BB0_9 Depth=1 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_9 .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 "NO" .size .L.str, 3 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "YES" .size .L.str.1, 4 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig
problem129/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 str x0, [sp, #16] str w1, [sp, #12] ldr w8, [sp, #12] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: mov w8, #-32768 stur w8, [x29, #-4] b LBB0_11 LBB0_2: str wzr, [sp, #8] mov w8, #1 str w8, [sp, #4] str wzr, [sp] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp] ldr w9, [sp, #12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp] ldr w0, [x8, x9, lsl #2] bl _abs ldr w8, [sp, #8] add w8, w8, w0 str w8, [sp, #8] ldr x8, [sp, #16] ldrsw x9, [sp] ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 str wzr, [sp, #4] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp] ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 ldr w9, [sp, #4] mov w8, #0 subs w8, w8, w9 str w8, [sp, #4] b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] add w8, w8, #1 str w8, [sp] b LBB0_3 LBB0_10: ldr w8, [sp, #8] ldr w9, [sp, #4] mul w8, w8, w9 stur w8, [x29, #-4] b LBB0_11 LBB0_11: ldur w0, [x29, #-4] 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, -16(%rbp) movl %esi, -20(%rbp) cmpl $0, -20(%rbp) jne .LBB0_2 # %bb.1: movl $-32768, -4(%rbp) # imm = 0x8000 jmp .LBB0_11 .LBB0_2: movl $0, -24(%rbp) movl $1, -28(%rbp) movl $0, -32(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -32(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_10 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -32(%rbp), %rcx movl (%rax,%rcx,4), %edi callq abs@PLT addl -24(%rbp), %eax movl %eax, -24(%rbp) movq -16(%rbp), %rax movslq -32(%rbp), %rcx cmpl $0, (%rax,%rcx,4) jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl $0, -28(%rbp) .LBB0_6: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -32(%rbp), %rcx cmpl $0, (%rax,%rcx,4) jge .LBB0_8 # %bb.7: # in Loop: Header=BB0_3 Depth=1 xorl %eax, %eax subl -28(%rbp), %eax movl %eax, -28(%rbp) .LBB0_8: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_9 .LBB0_9: # in Loop: Header=BB0_3 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_3 .LBB0_10: movl -24(%rbp), %eax imull -28(%rbp), %eax movl %eax, -4(%rbp) .LBB0_11: movl -4(%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
problem13/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, #-8] stur w1, [x29, #-12] adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF str x8, [sp, #24] str wzr, [sp, #20] str wzr, [sp, #16] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #16] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #16] ldr x0, [x8, x9, lsl #3] bl _strlen mov x8, x0 str w8, [sp, #12] ldr w8, [sp, #12] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #16] ldr x8, [x8, x9, lsl #3] str x8, [sp, #24] ldr w8, [sp, #12] str w8, [sp, #20] 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, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_1 LBB0_6: ldr x0, [sp, #24] 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 .space 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 movq %rdi, -8(%rbp) movl %esi, -12(%rbp) leaq .L.str(%rip), %rax movq %rax, -24(%rbp) movl $0, -28(%rbp) movl $0, -32(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -32(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -36(%rbp) movl -36(%rbp), %eax cmpl -28(%rbp), %eax jle .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -24(%rbp) movl -36(%rbp), %eax movl %eax, -28(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_5 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_1 .LBB0_6: 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: .zero 1 .size .L.str, 1 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strlen
problem130/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 w2, [x29, #-16] stur x3, [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_10 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 str wzr, [sp, #32] b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #32] ldur w9, [x29, #-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 ldur x8, [x29, #-8] ldursw x9, [x29, #-28] ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #32] ldr w8, [x8, x9, lsl #2] subs w8, w8, #1 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldur w8, [x29, #-28] str w8, [sp, #28] ldr w8, [sp, #32] str w8, [sp, #24] 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, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_3 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-28] add w8, w8, #1 stur w8, [x29, #-28] b LBB0_1 LBB0_10: ldur w8, [x29, #-12] ldur w9, [x29, #-12] mul w8, w8, w9 str w8, [sp, #20] ldr w8, [sp, #28] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_13 b LBB0_11 LBB0_11: ldur x8, [x29, #-8] ldr w9, [sp, #28] subs w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_13 b LBB0_12 LBB0_12: ldur x8, [x29, #-8] ldr w9, [sp, #28] subs w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] str w8, [sp, #20] b LBB0_13 LBB0_13: ldr w8, [sp, #28] ldur w9, [x29, #-12] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_14 LBB0_14: ldur x8, [x29, #-8] ldr w9, [sp, #28] add w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_15 LBB0_15: ldur x8, [x29, #-8] ldr w9, [sp, #28] add w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] str w8, [sp, #20] b LBB0_16 LBB0_16: ldr w8, [sp, #24] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_19 b LBB0_17 LBB0_17: ldur x8, [x29, #-8] ldrsw x9, [sp, #28] ldr x8, [x8, x9, lsl #3] ldr w9, [sp, #24] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_19 b LBB0_18 LBB0_18: ldur x8, [x29, #-8] ldrsw x9, [sp, #28] ldr x8, [x8, x9, lsl #3] ldr w9, [sp, #24] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] str w8, [sp, #20] b LBB0_19 LBB0_19: ldr w8, [sp, #24] ldur w9, [x29, #-12] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_22 b LBB0_20 LBB0_20: ldur x8, [x29, #-8] ldrsw x9, [sp, #28] ldr x8, [x8, x9, lsl #3] ldr w9, [sp, #24] add w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_22 b LBB0_21 LBB0_21: ldur x8, [x29, #-8] ldrsw x9, [sp, #28] ldr x8, [x8, x9, lsl #3] ldr w9, [sp, #24] add w9, w9, #1 ldr w8, [x8, w9, sxtw #2] str w8, [sp, #20] b LBB0_22 LBB0_22: ldur w8, [x29, #-16] ldur x9, [x29, #-24] str w8, [x9] ldursw x8, [x29, #-16] lsl x0, x8, #2 bl _malloc str x0, [sp, #8] stur wzr, [x29, #-28] b LBB0_23 LBB0_23: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-28] ldur w9, [x29, #-16] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_29 b LBB0_24 LBB0_24: ; in Loop: Header=BB0_23 Depth=1 ldur w8, [x29, #-28] 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_26 b LBB0_25 LBB0_25: ; in Loop: Header=BB0_23 Depth=1 ldr x9, [sp, #8] ldursw x10, [x29, #-28] mov w8, #1 str w8, [x9, x10, lsl #2] b LBB0_27 LBB0_26: ; in Loop: Header=BB0_23 Depth=1 ldr w8, [sp, #20] ldr x9, [sp, #8] ldursw x10, [x29, #-28] str w8, [x9, x10, lsl #2] b LBB0_27 LBB0_27: ; in Loop: Header=BB0_23 Depth=1 b LBB0_28 LBB0_28: ; in Loop: Header=BB0_23 Depth=1 ldur w8, [x29, #-28] add w8, w8, #1 stur w8, [x29, #-28] b LBB0_23 LBB0_29: ldr x0, [sp, #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, -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 cmpl -12(%rbp), %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 cmpl -12(%rbp), %eax jge .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -32(%rbp), %rcx cmpl $1, (%rax,%rcx,4) jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=2 movl -28(%rbp), %eax movl %eax, -36(%rbp) movl -32(%rbp), %eax movl %eax, -40(%rbp) .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 -12(%rbp), %eax imull -12(%rbp), %eax movl %eax, -44(%rbp) cmpl $0, -36(%rbp) jle .LBB0_13 # %bb.11: movq -8(%rbp), %rax movl -36(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -40(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -44(%rbp), %eax jge .LBB0_13 # %bb.12: movq -8(%rbp), %rax movl -36(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -40(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -44(%rbp) .LBB0_13: movl -36(%rbp), %eax movl -12(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_16 # %bb.14: movq -8(%rbp), %rax movl -36(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -40(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -44(%rbp), %eax jge .LBB0_16 # %bb.15: movq -8(%rbp), %rax movl -36(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -40(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -44(%rbp) .LBB0_16: cmpl $0, -40(%rbp) jle .LBB0_19 # %bb.17: movq -8(%rbp), %rax movslq -36(%rbp), %rcx movq (%rax,%rcx,8), %rax movl -40(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax cmpl -44(%rbp), %eax jge .LBB0_19 # %bb.18: movq -8(%rbp), %rax movslq -36(%rbp), %rcx movq (%rax,%rcx,8), %rax movl -40(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movl %eax, -44(%rbp) .LBB0_19: movl -40(%rbp), %eax movl -12(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_22 # %bb.20: movq -8(%rbp), %rax movslq -36(%rbp), %rcx movq (%rax,%rcx,8), %rax movl -40(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax cmpl -44(%rbp), %eax jge .LBB0_22 # %bb.21: movq -8(%rbp), %rax movslq -36(%rbp), %rcx movq (%rax,%rcx,8), %rax movl -40(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movl %eax, -44(%rbp) .LBB0_22: movl -16(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movslq -16(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -56(%rbp) movl $0, -28(%rbp) .LBB0_23: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -16(%rbp), %eax jge .LBB0_29 # %bb.24: # in Loop: Header=BB0_23 Depth=1 movl -28(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_26 # %bb.25: # in Loop: Header=BB0_23 Depth=1 movq -56(%rbp), %rax movslq -28(%rbp), %rcx movl $1, (%rax,%rcx,4) jmp .LBB0_27 .LBB0_26: # in Loop: Header=BB0_23 Depth=1 movl -44(%rbp), %edx movq -56(%rbp), %rax movslq -28(%rbp), %rcx movl %edx, (%rax,%rcx,4) .LBB0_27: # in Loop: Header=BB0_23 Depth=1 jmp .LBB0_28 .LBB0_28: # in Loop: Header=BB0_23 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_23 .LBB0_29: movq -56(%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 malloc
problem131/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, #-12] ldur w8, [x29, #-12] mov w9, #1 str w9, [sp] ; 4-byte Folded Spill add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x8, w8 lsl x0, x8, #2 bl _malloc ldr w8, [sp] ; 4-byte Folded Reload str x0, [sp, #8] ldr x9, [sp, #8] str w8, [x9] ldur w8, [x29, #-12] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr x8, [sp, #8] stur x8, [x29, #-8] b LBB0_10 LBB0_2: ldr x9, [sp, #8] mov w8, #3 str w8, [x9, #4] mov w8, #2 str w8, [sp, #4] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_9 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 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_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #4] mov w9, #2 sdiv w8, w8, w9 add w8, w8, #1 ldr x9, [sp, #8] ldrsw x10, [sp, #4] str w8, [x9, x10, lsl #2] b LBB0_7 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #8] ldr w9, [sp, #4] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldr x9, [sp, #8] ldr w11, [sp, #4] mov w10, #2 subs w11, w11, #2 ldr w9, [x9, w11, sxtw #2] add w8, w8, w9 add w8, w8, #1 ldr w9, [sp, #4] add w9, w9, #1 sdiv w9, w9, w10 add w8, w8, w9 ldr x9, [sp, #8] ldrsw x10, [sp, #4] str w8, [x9, x10, lsl #2] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_3 LBB0_9: ldr x8, [sp, #8] stur x8, [x29, #-8] b LBB0_10 LBB0_10: ldur x0, [x29, #-8] 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, -12(%rbp) movl -12(%rbp), %eax addl $1, %eax movslq %eax, %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -24(%rbp) movq -24(%rbp), %rax movl $1, (%rax) cmpl $0, -12(%rbp) jne .LBB0_2 # %bb.1: movq -24(%rbp), %rax movq %rax, -8(%rbp) jmp .LBB0_10 .LBB0_2: movq -24(%rbp), %rax movl $3, 4(%rax) movl $2, -28(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -12(%rbp), %eax jg .LBB0_9 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movl -28(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl -28(%rbp), %eax movl $2, %ecx cltd idivl %ecx movl %eax, %edx addl $1, %edx movq -24(%rbp), %rax movslq -28(%rbp), %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_7 .LBB0_6: # in Loop: Header=BB0_3 Depth=1 movq -24(%rbp), %rax movl -28(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movq -24(%rbp), %rcx movl -28(%rbp), %edx subl $2, %edx movslq %edx, %rdx addl (%rcx,%rdx,4), %eax addl $1, %eax movl %eax, -32(%rbp) # 4-byte Spill movl -28(%rbp), %eax addl $1, %eax movl $2, %ecx cltd idivl %ecx movl -32(%rbp), %edx # 4-byte Reload addl %eax, %edx movq -24(%rbp), %rax movslq -28(%rbp), %rcx movl %edx, (%rax,%rcx,4) .LBB0_7: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_3 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_3 .LBB0_9: movq -24(%rbp), %rax movq %rax, -8(%rbp) .LBB0_10: movq -8(%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
problem132/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 w0, [sp, #28] mov w8, #1 str w8, [sp, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #28] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_5 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] mov w10, #10 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 str w8, [sp, #16] ldr w8, [sp, #16] 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 mov w8, #1 str w8, [sp, #20] ldr w9, [sp, #16] ldr w8, [sp, #24] mul w8, w8, w9 str w8, [sp, #24] b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] mov w9, #10 sdiv w8, w8, w9 str w8, [sp, #28] b LBB0_1 LBB0_5: ldr w8, [sp, #20] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_7 b LBB0_6 LBB0_6: ldr w8, [sp, #24] str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_8 LBB0_7: mov w8, #0 str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_8 LBB0_8: ldr w0, [sp, #12] ; 4-byte Folded Reload 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 movl %edi, -4(%rbp) movl $1, -8(%rbp) movl $0, -12(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 cmpl $0, -4(%rbp) jle .LBB0_5 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -4(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %edx, -16(%rbp) movl -16(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $1, %edx jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl $1, -12(%rbp) movl -16(%rbp), %eax imull -8(%rbp), %eax movl %eax, -8(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movl -4(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %eax, -4(%rbp) jmp .LBB0_1 .LBB0_5: cmpl $0, -12(%rbp) je .LBB0_7 # %bb.6: movl -8(%rbp), %eax movl %eax, -20(%rbp) # 4-byte Spill jmp .LBB0_8 .LBB0_7: xorl %eax, %eax movl %eax, -20(%rbp) # 4-byte Spill jmp .LBB0_8 .LBB0_8: movl -20(%rbp), %eax # 4-byte Reload 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
problem133/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 wzr, [x29, #-20] str wzr, [sp, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldrsw x8, [sp, #20] str x8, [sp, #8] ; 8-byte Folded Spill ldur x0, [x29, #-16] bl _strlen ldr x8, [sp, #8] ; 8-byte Folded Reload subs x8, x8, x0 cset w8, hs tbnz w8, #0, LBB0_14 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #91 cset w8, ne tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] add w8, w8, #1 stur w8, [x29, #-20] b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #93 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] subs w8, w8, #1 stur w8, [x29, #-20] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-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 stur wzr, [x29, #-20] b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] str w8, [sp, #24] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] ldr w9, [sp, #24] subs w9, w9, #2 subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: mov w8, #1 stur w8, [x29, #-4] b LBB0_15 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_1 LBB0_14: stur wzr, [x29, #-4] b LBB0_15 LBB0_15: ldur w0, [x29, #-4] 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 $0, -20(%rbp) movl $0, -24(%rbp) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movslq -28(%rbp), %rax movq %rax, -40(%rbp) # 8-byte Spill movq -16(%rbp), %rdi callq strlen@PLT movq %rax, %rcx movq -40(%rbp), %rax # 8-byte Reload cmpq %rcx, %rax jae .LBB0_14 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -28(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $91, %eax jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax addl $1, %eax movl %eax, -20(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -28(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $93, %eax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax subl $1, %eax movl %eax, -20(%rbp) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -20(%rbp) jge .LBB0_8 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movl $0, -20(%rbp) .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax cmpl -24(%rbp), %eax jle .LBB0_10 # %bb.9: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax movl %eax, -24(%rbp) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax movl -24(%rbp), %ecx subl $2, %ecx cmpl %ecx, %eax jg .LBB0_12 # %bb.11: movl $1, -4(%rbp) jmp .LBB0_15 .LBB0_12: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_13 .LBB0_13: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_14: movl $0, -4(%rbp) .LBB0_15: 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
problem134/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_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] fcvt d0, s0 fcvtps w8, d0 ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldr s0, [x9, x10, lsl #2] fcvt d0, s0 fcvtps w9, d0 mul w9, w8, w9 ldr w8, [sp, #16] add w8, w8, w9 str w8, [sp, #16] 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 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 subq $32, %rsp 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_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq ceil@PLT cvttsd2si %xmm0, %eax movl %eax, -24(%rbp) # 4-byte Spill movq -8(%rbp), %rax movslq -20(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq ceil@PLT movl -24(%rbp), %eax # 4-byte Reload cvttsd2si %xmm0, %ecx imull %ecx, %eax addl -16(%rbp), %eax movl %eax, -16(%rbp) # %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: 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
problem135/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 str x0, [sp, #16] ldr x0, [sp, #16] bl _strlen mov x8, x0 str w8, [sp, #12] ldr w8, [sp, #12] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: stur wzr, [x29, #-4] b LBB0_9 LBB0_2: ldr x8, [sp, #16] ldr w9, [sp, #12] subs w9, w9, #1 add x8, x8, w9, sxtw ldrb w8, [x8] strb w8, [sp, #11] ldrb w0, [sp, #11] bl _isalpha subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: stur wzr, [x29, #-4] b LBB0_9 LBB0_4: ldr w8, [sp, #12] subs w8, w8, #1 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: mov w8, #1 stur w8, [x29, #-4] b LBB0_9 LBB0_6: ldr x8, [sp, #16] ldr w9, [sp, #12] subs w9, w9, #2 add x8, x8, w9, sxtw ldrb w8, [x8] strb w8, [sp, #10] ldrb w0, [sp, #10] bl _isalpha subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: stur wzr, [x29, #-4] b LBB0_9 LBB0_8: mov w8, #1 stur w8, [x29, #-4] b LBB0_9 LBB0_9: ldur w0, [x29, #-4] 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, -16(%rbp) movq -16(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -20(%rbp) cmpl $0, -20(%rbp) jne .LBB0_2 # %bb.1: movl $0, -4(%rbp) jmp .LBB0_9 .LBB0_2: movq -16(%rbp), %rax movl -20(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movb (%rax,%rcx), %al movb %al, -21(%rbp) callq __ctype_b_loc@PLT movq (%rax), %rax movzbl -21(%rbp), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $1024, %eax # imm = 0x400 cmpl $0, %eax jne .LBB0_4 # %bb.3: movl $0, -4(%rbp) jmp .LBB0_9 .LBB0_4: cmpl $1, -20(%rbp) jne .LBB0_6 # %bb.5: movl $1, -4(%rbp) jmp .LBB0_9 .LBB0_6: movq -16(%rbp), %rax movl -20(%rbp), %ecx subl $2, %ecx movslq %ecx, %rcx movb (%rax,%rcx), %al movb %al, -22(%rbp) callq __ctype_b_loc@PLT movq (%rax), %rax movzbl -22(%rbp), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $1024, %eax # imm = 0x400 cmpl $0, %eax je .LBB0_8 # %bb.7: movl $0, -4(%rbp) jmp .LBB0_9 .LBB0_8: movl $1, -4(%rbp) .LBB0_9: movl -4(%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 strlen .addrsig_sym __ctype_b_loc
problem136/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] mov w8, #-1 str w8, [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, #20] 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, #24] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #12] subs w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] 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 $-1, -16(%rbp) movl $1, -20(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -20(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -8(%rbp), %rcx movl -20(%rbp), %edx subl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax jge .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -20(%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
problem137/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 x2, [sp, #24] str wzr, [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, #36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_12 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] str w8, [sp, #20] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_10 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #16] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_9 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #16] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] str w8, [sp, #16] 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 w8, [sp, #20] ldr x9, [sp, #24] str w8, [x9] ldr w8, [sp, #16] ldr x9, [sp, #24] str w8, [x9, #4] 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 %rdx, -24(%rbp) movl $0, -28(%rbp) movl $0, -32(%rbp) movl $0, -36(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_12 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx cmpl $0, (%rax,%rcx,4) jge .LBB0_6 # %bb.3: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -28(%rbp) je .LBB0_5 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -28(%rbp), %eax jle .LBB0_6 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -28(%rbp) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx cmpl $0, (%rax,%rcx,4) jle .LBB0_10 # %bb.7: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -32(%rbp) je .LBB0_9 # %bb.8: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -32(%rbp), %eax jge .LBB0_10 .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -32(%rbp) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_12: movl -28(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movl -32(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, 4(%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
problem138/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] ldr w8, [sp, #8] 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_3 b LBB0_1 LBB0_1: ldr w8, [sp, #8] subs w8, w8, #8 cset w8, lt tbnz w8, #0, LBB0_3 b LBB0_2 LBB0_2: mov w8, #1 str w8, [sp, #12] b LBB0_4 LBB0_3: str wzr, [sp, #12] b LBB0_4 LBB0_4: 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 -8(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_3 # %bb.1: cmpl $8, -8(%rbp) jl .LBB0_3 # %bb.2: movl $1, -4(%rbp) jmp .LBB0_4 .LBB0_3: movl $0, -4(%rbp) .LBB0_4: 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
problem139/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] ldr w8, [sp, #8] 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_3 b LBB0_1 LBB0_1: ldr w8, [sp, #8] subs w8, w8, #8 cset w8, lt tbnz w8, #0, LBB0_3 b LBB0_2 LBB0_2: mov w8, #1 str w8, [sp, #12] b LBB0_4 LBB0_3: str wzr, [sp, #12] b LBB0_4 LBB0_4: 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 -8(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_3 # %bb.1: cmpl $8, -8(%rbp) jl .LBB0_3 # %bb.2: movl $1, -4(%rbp) jmp .LBB0_4 .LBB0_3: movl $0, -4(%rbp) .LBB0_4: 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
problem14/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, #12] str w1, [sp, #8] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_3 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] ldr w10, [sp, #8] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 str w8, [sp, #4] ldr w8, [sp, #8] str w8, [sp, #12] ldr w8, [sp, #4] str w8, [sp, #8] b LBB0_1 LBB0_3: 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, -4(%rbp) movl %esi, -8(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 cmpl $0, -8(%rbp) je .LBB0_3 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -4(%rbp), %eax cltd idivl -8(%rbp) movl %edx, -12(%rbp) movl -8(%rbp), %eax movl %eax, -4(%rbp) movl -12(%rbp), %eax movl %eax, -8(%rbp) jmp .LBB0_1 .LBB0_3: 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
problem140/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 w0, [sp, #28] mov x8, #1 str x8, [sp, #16] str x8, [sp, #8] mov w8, #1 str w8, [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, gt tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #4] mul x8, x8, x9 str x8, [sp, #16] ldr x8, [sp, #8] ldr x9, [sp, #16] mul x8, x8, x9 str x8, [sp, #8] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_1 LBB0_4: ldr x0, [sp, #8] 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 movl %edi, -4(%rbp) movq $1, -16(%rbp) movq $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_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -28(%rbp), %rcx imulq %rcx, %rax movq %rax, -16(%rbp) movq -24(%rbp), %rax imulq -16(%rbp), %rax movq %rax, -24(%rbp) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_4: movq -24(%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
problem141/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, #-8] stur x1, [x29, #-16] stur wzr, [x29, #-20] str wzr, [sp, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldrsw x8, [sp, #20] str x8, [sp, #8] ; 8-byte Folded Spill ldur x0, [x29, #-8] bl _strlen ldr x8, [sp, #8] ; 8-byte Folded Reload subs x8, x8, x0 cset w8, hs tbnz w8, #0, LBB0_13 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #32 cset w8, ne tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] add w8, w8, #1 stur w8, [x29, #-20] b LBB0_11 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] subs w8, w8, #1 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #95 strb w8, [x9] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] subs w8, w8, #2 cset w8, ne tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #95 strb w8, [x9] ldur x9, [x29, #-16] ldrsw x10, [sp, #24] mov x11, x10 add w11, w11, #1 str w11, [sp, #24] add x9, x9, x10 strb w8, [x9] b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] subs w8, w8, #2 cset w8, le tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #45 strb w8, [x9] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 stur wzr, [x29, #-20] ldur x8, [x29, #-8] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldur x9, [x29, #-16] ldrsw x10, [sp, #24] mov x11, x10 add w11, w11, #1 str w11, [sp, #24] add x9, x9, x10 strb w8, [x9] 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, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_1 LBB0_13: ldur w8, [x29, #-20] subs w8, w8, #1 cset w8, ne tbnz w8, #0, LBB0_15 b LBB0_14 LBB0_14: ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #95 strb w8, [x9] b LBB0_15 LBB0_15: ldur w8, [x29, #-20] subs w8, w8, #2 cset w8, ne tbnz w8, #0, LBB0_17 b LBB0_16 LBB0_16: ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #95 strb w8, [x9] ldur x9, [x29, #-16] ldrsw x10, [sp, #24] mov x11, x10 add w11, w11, #1 str w11, [sp, #24] add x9, x9, x10 strb w8, [x9] b LBB0_17 LBB0_17: ldur w8, [x29, #-20] subs w8, w8, #2 cset w8, le tbnz w8, #0, LBB0_19 b LBB0_18 LBB0_18: ldur x8, [x29, #-16] ldrsw x9, [sp, #24] mov x10, x9 add w10, w10, #1 str w10, [sp, #24] add x9, x8, x9 mov w8, #45 strb w8, [x9] b LBB0_19 LBB0_19: ldur x8, [x29, #-16] ldrsw x9, [sp, #24] add x8, x8, x9 strb wzr, [x8] 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, -8(%rbp) movq %rsi, -16(%rbp) movl $0, -20(%rbp) movl $0, -24(%rbp) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movslq -28(%rbp), %rax movq %rax, -40(%rbp) # 8-byte Spill movq -8(%rbp), %rdi callq strlen@PLT movq %rax, %rcx movq -40(%rbp), %rax # 8-byte Reload cmpq %rcx, %rax jae .LBB0_13 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $32, %eax jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax addl $1, %eax movl %eax, -20(%rbp) jmp .LBB0_11 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 cmpl $1, -20(%rbp) jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 cmpl $2, -20(%rbp) jne .LBB0_8 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) .LBB0_8: # in Loop: Header=BB0_1 Depth=1 cmpl $2, -20(%rbp) jle .LBB0_10 # %bb.9: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $45, (%rax,%rcx) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movl $0, -20(%rbp) movq -8(%rbp), %rax movslq -28(%rbp), %rcx movb (%rax,%rcx), %dl movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -24(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) .LBB0_11: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_12 .LBB0_12: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_13: cmpl $1, -20(%rbp) jne .LBB0_15 # %bb.14: movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) .LBB0_15: cmpl $2, -20(%rbp) jne .LBB0_17 # %bb.16: movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $95, (%rax,%rcx) .LBB0_17: cmpl $2, -20(%rbp) jle .LBB0_19 # %bb.18: movq -16(%rbp), %rax movl -24(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -24(%rbp) movslq %ecx, %rcx movb $45, (%rax,%rcx) .LBB0_19: movq -16(%rbp), %rax movslq -24(%rbp), %rcx movb $0, (%rax,%rcx) 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
problem142/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 wzr, [x29, #-20] str wzr, [sp, #24] ldur x0, [x29, #-16] bl _strlen mov x8, x0 str w8, [sp, #20] ldr w8, [sp, #20] subs w8, w8, #5 cset w8, ge 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_24 LBB0_2: ldur x8, [x29, #-16] ldrb w8, [x8] strb w8, [sp, #19] ldrsb w8, [sp, #19] subs w8, w8, #65 cset w8, lt tbnz w8, #0, LBB0_6 b LBB0_3 LBB0_3: ldrsb w8, [sp, #19] subs w8, w8, #90 cset w8, le tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ldrsb w8, [sp, #19] subs w8, w8, #97 cset w8, lt tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ldrsb w8, [sp, #19] subs w8, w8, #122 cset w8, le tbnz w8, #0, LBB0_7 b LBB0_6 LBB0_6: adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF stur x8, [x29, #-8] b LBB0_24 LBB0_7: ldur x8, [x29, #-16] ldrsw x9, [sp, #20] add x8, x8, x9 subs x8, x8, #4 str x8, [sp, #8] ldr x0, [sp, #8] adrp x1, l_.str.1@PAGE add x1, x1, l_.str.1@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_11 b LBB0_8 LBB0_8: ldr x0, [sp, #8] adrp x1, l_.str.2@PAGE add x1, x1, l_.str.2@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_11 b LBB0_9 LBB0_9: ldr x0, [sp, #8] adrp x1, l_.str.3@PAGE add x1, x1, l_.str.3@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_11 b LBB0_10 LBB0_10: adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF stur x8, [x29, #-8] b LBB0_24 LBB0_11: str wzr, [sp, #4] b LBB0_12 LBB0_12: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_20 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_12 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #4] ldrsb w8, [x8, x9] subs w8, w8, #48 cset w8, lt tbnz w8, #0, LBB0_16 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_12 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #4] ldrsb w8, [x8, x9] subs w8, w8, #57 cset w8, gt tbnz w8, #0, LBB0_16 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_12 Depth=1 ldur w8, [x29, #-20] add w8, w8, #1 stur w8, [x29, #-20] b LBB0_16 LBB0_16: ; in Loop: Header=BB0_12 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #4] ldrsb w8, [x8, x9] subs w8, w8, #46 cset w8, ne tbnz w8, #0, LBB0_18 b LBB0_17 LBB0_17: ; in Loop: Header=BB0_12 Depth=1 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_18 LBB0_18: ; in Loop: Header=BB0_12 Depth=1 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_12 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_12 LBB0_20: ldur w8, [x29, #-20] subs w8, w8, #3 cset w8, gt tbnz w8, #0, LBB0_22 b LBB0_21 LBB0_21: ldr w8, [sp, #24] subs w8, w8, #1 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_24 LBB0_23: adrp x8, l_.str.4@PAGE add x8, x8, l_.str.4@PAGEOFF stur x8, [x29, #-8] b LBB0_24 LBB0_24: 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 "No" l_.str.1: ; @.str.1 .asciz ".txt" l_.str.2: ; @.str.2 .asciz ".exe" l_.str.3: ; @.str.3 .asciz ".dll" l_.str.4: ; @.str.4 .asciz "Yes" .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 $0, -20(%rbp) movl $0, -24(%rbp) movq -16(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -28(%rbp) cmpl $5, -28(%rbp) jge .LBB0_2 # %bb.1: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_24 .LBB0_2: movq -16(%rbp), %rax movb (%rax), %al movb %al, -29(%rbp) movsbl -29(%rbp), %eax cmpl $65, %eax jl .LBB0_6 # %bb.3: movsbl -29(%rbp), %eax cmpl $90, %eax jle .LBB0_5 # %bb.4: movsbl -29(%rbp), %eax cmpl $97, %eax jl .LBB0_6 .LBB0_5: movsbl -29(%rbp), %eax cmpl $122, %eax jle .LBB0_7 .LBB0_6: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_24 .LBB0_7: movq -16(%rbp), %rax movslq -28(%rbp), %rcx addq %rcx, %rax addq $-4, %rax movq %rax, -40(%rbp) movq -40(%rbp), %rdi leaq .L.str.1(%rip), %rsi callq strcmp@PLT cmpl $0, %eax je .LBB0_11 # %bb.8: movq -40(%rbp), %rdi leaq .L.str.2(%rip), %rsi callq strcmp@PLT cmpl $0, %eax je .LBB0_11 # %bb.9: movq -40(%rbp), %rdi leaq .L.str.3(%rip), %rsi callq strcmp@PLT cmpl $0, %eax je .LBB0_11 # %bb.10: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_24 .LBB0_11: movl $0, -44(%rbp) .LBB0_12: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -28(%rbp), %eax jge .LBB0_20 # %bb.13: # in Loop: Header=BB0_12 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $48, %eax jl .LBB0_16 # %bb.14: # in Loop: Header=BB0_12 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $57, %eax jg .LBB0_16 # %bb.15: # in Loop: Header=BB0_12 Depth=1 movl -20(%rbp), %eax addl $1, %eax movl %eax, -20(%rbp) .LBB0_16: # in Loop: Header=BB0_12 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $46, %eax jne .LBB0_18 # %bb.17: # in Loop: Header=BB0_12 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) .LBB0_18: # in Loop: Header=BB0_12 Depth=1 jmp .LBB0_19 .LBB0_19: # in Loop: Header=BB0_12 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_12 .LBB0_20: cmpl $3, -20(%rbp) jg .LBB0_22 # %bb.21: cmpl $1, -24(%rbp) je .LBB0_23 .LBB0_22: leaq .L.str(%rip), %rax movq %rax, -8(%rbp) jmp .LBB0_24 .LBB0_23: leaq .L.str.4(%rip), %rax movq %rax, -8(%rbp) .LBB0_24: 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 "No" .size .L.str, 3 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz ".txt" .size .L.str.1, 5 .type .L.str.2,@object # @.str.2 .L.str.2: .asciz ".exe" .size .L.str.2, 5 .type .L.str.3,@object # @.str.3 .L.str.3: .asciz ".dll" .size .L.str.3, 5 .type .L.str.4,@object # @.str.4 .L.str.4: .asciz "Yes" .size .L.str.4, 4 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strlen .addrsig_sym strcmp
problem143/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_10 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] mov w10, #3 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 x8, [sp, #24] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldr w9, [x9, x10, lsl #2] mul w9, w8, w9 ldr w8, [sp, #16] add w8, w8, w9 str w8, [sp, #16] b LBB0_8 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] mov w10, #4 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldr w9, [x9, x10, lsl #2] mul w8, w8, w9 ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldr w9, [x9, x10, lsl #2] mul w9, w8, w9 ldr w8, [sp, #16] add w8, w8, w9 str w8, [sp, #16] b LBB0_7 LBB0_6: ; 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_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 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, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_1 LBB0_10: 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_10 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax movl $3, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx imull (%rcx,%rdx,4), %eax addl -16(%rbp), %eax movl %eax, -16(%rbp) jmp .LBB0_8 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax movl $4, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx imull (%rcx,%rdx,4), %eax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx imull (%rcx,%rdx,4), %eax addl -16(%rbp), %eax movl %eax, -16(%rbp) jmp .LBB0_7 .LBB0_6: # 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_7: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_9 .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax addl $1, %eax movl %eax, -20(%rbp) jmp .LBB0_1 .LBB0_10: 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
problem144/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, #-8] stur x1, [x29, #-16] stur wzr, [x29, #-20] str wzr, [sp, #24] str wzr, [sp, #20] str wzr, [sp, #12] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_6 Depth 2 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_20 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrsb w8, [x8, x9] subs w8, w8, #32 cset w8, eq tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_18 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #24] subs w8, w8, #1 cset w8, le tbnz w8, #0, LBB0_12 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 mov w8, #1 strb w8, [sp, #19] mov w8, #2 str w8, [sp, #8] b LBB0_6 LBB0_6: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #8] ldr w9, [sp, #8] mul w8, w8, w9 ldr w9, [sp, #24] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_11 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_6 Depth=2 ldr w8, [sp, #24] ldr w10, [sp, #8] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_9 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 strb wzr, [sp, #19] b LBB0_11 LBB0_9: ; in Loop: Header=BB0_6 Depth=2 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_6 Depth=2 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_6 LBB0_11: ; in Loop: Header=BB0_1 Depth=1 b LBB0_13 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 strb wzr, [sp, #19] b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldrb w8, [sp, #19] tbz w8, #0, LBB0_17 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_16 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] mov x10, x9 add w10, w10, #1 str w10, [sp, #20] add x9, x8, x9 mov w8, #32 strb w8, [x9] b LBB0_16 LBB0_16: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] add x0, x8, x9 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] add x8, x8, x9 ldrsw x9, [sp, #24] subs x1, x8, x9 ldrsw x2, [sp, #24] mov x3, #-1 bl ___memcpy_chk ldr w9, [sp, #24] ldr w8, [sp, #20] add w8, w8, w9 str w8, [sp, #20] b LBB0_17 LBB0_17: ; in Loop: Header=BB0_1 Depth=1 str wzr, [sp, #24] b LBB0_18 LBB0_18: ; in Loop: Header=BB0_1 Depth=1 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_1 LBB0_20: ldr w8, [sp, #24] subs w8, w8, #1 cset w8, le tbnz w8, #0, LBB0_28 b LBB0_21 LBB0_21: mov w8, #1 strb w8, [sp, #19] mov w8, #2 str w8, [sp, #8] b LBB0_22 LBB0_22: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #8] mul w8, w8, w9 ldr w9, [sp, #24] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_27 b LBB0_23 LBB0_23: ; in Loop: Header=BB0_22 Depth=1 ldr w8, [sp, #24] ldr w10, [sp, #8] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_25 b LBB0_24 LBB0_24: strb wzr, [sp, #19] b LBB0_27 LBB0_25: ; in Loop: Header=BB0_22 Depth=1 b LBB0_26 LBB0_26: ; in Loop: Header=BB0_22 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_22 LBB0_27: b LBB0_29 LBB0_28: strb wzr, [sp, #19] b LBB0_29 LBB0_29: ldrb w8, [sp, #19] tbz w8, #0, LBB0_33 b LBB0_30 LBB0_30: ldr w8, [sp, #20] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_32 b LBB0_31 LBB0_31: ldur x8, [x29, #-16] ldrsw x9, [sp, #20] mov x10, x9 add w10, w10, #1 str w10, [sp, #20] add x9, x8, x9 mov w8, #32 strb w8, [x9] b LBB0_32 LBB0_32: ldur x8, [x29, #-16] ldrsw x9, [sp, #20] add x0, x8, x9 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] add x8, x8, x9 ldrsw x9, [sp, #24] subs x1, x8, x9 ldrsw x2, [sp, #24] mov x3, #-1 bl ___memcpy_chk ldr w9, [sp, #24] ldr w8, [sp, #20] add w8, w8, w9 str w8, [sp, #20] b LBB0_33 LBB0_33: ldur x8, [x29, #-16] ldrsw x9, [sp, #20] add x8, x8, x9 strb wzr, [x8] 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, -8(%rbp) movq %rsi, -16(%rbp) movl $0, -20(%rbp) movl $0, -24(%rbp) movl $0, -28(%rbp) movl $0, -36(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_6 Depth 2 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_20 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $32, %eax je .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_18 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 cmpl $1, -24(%rbp) jle .LBB0_12 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movb $1, -29(%rbp) movl $2, -40(%rbp) .LBB0_6: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -40(%rbp), %eax imull -40(%rbp), %eax cmpl -24(%rbp), %eax jg .LBB0_11 # %bb.7: # in Loop: Header=BB0_6 Depth=2 movl -24(%rbp), %eax cltd idivl -40(%rbp) cmpl $0, %edx jne .LBB0_9 # %bb.8: # in Loop: Header=BB0_1 Depth=1 movb $0, -29(%rbp) jmp .LBB0_11 .LBB0_9: # in Loop: Header=BB0_6 Depth=2 jmp .LBB0_10 .LBB0_10: # in Loop: Header=BB0_6 Depth=2 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_6 .LBB0_11: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_13 .LBB0_12: # in Loop: Header=BB0_1 Depth=1 movb $0, -29(%rbp) .LBB0_13: # in Loop: Header=BB0_1 Depth=1 testb $1, -29(%rbp) je .LBB0_17 # %bb.14: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -28(%rbp) jle .LBB0_16 # %bb.15: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movl -28(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -28(%rbp) movslq %ecx, %rcx movb $32, (%rax,%rcx) .LBB0_16: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rdi movslq -28(%rbp), %rax addq %rax, %rdi movq -8(%rbp), %rsi movslq -36(%rbp), %rax addq %rax, %rsi movslq -24(%rbp), %rcx xorl %eax, %eax # kill: def $rax killed $eax subq %rcx, %rax addq %rax, %rsi movslq -24(%rbp), %rdx callq memcpy@PLT movl -24(%rbp), %eax addl -28(%rbp), %eax movl %eax, -28(%rbp) .LBB0_17: # in Loop: Header=BB0_1 Depth=1 movl $0, -24(%rbp) .LBB0_18: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_19 .LBB0_19: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_20: cmpl $1, -24(%rbp) jle .LBB0_28 # %bb.21: movb $1, -29(%rbp) movl $2, -40(%rbp) .LBB0_22: # =>This Inner Loop Header: Depth=1 movl -40(%rbp), %eax imull -40(%rbp), %eax cmpl -24(%rbp), %eax jg .LBB0_27 # %bb.23: # in Loop: Header=BB0_22 Depth=1 movl -24(%rbp), %eax cltd idivl -40(%rbp) cmpl $0, %edx jne .LBB0_25 # %bb.24: movb $0, -29(%rbp) jmp .LBB0_27 .LBB0_25: # in Loop: Header=BB0_22 Depth=1 jmp .LBB0_26 .LBB0_26: # in Loop: Header=BB0_22 Depth=1 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_22 .LBB0_27: jmp .LBB0_29 .LBB0_28: movb $0, -29(%rbp) .LBB0_29: testb $1, -29(%rbp) je .LBB0_33 # %bb.30: cmpl $0, -28(%rbp) jle .LBB0_32 # %bb.31: movq -16(%rbp), %rax movl -28(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -28(%rbp) movslq %ecx, %rcx movb $32, (%rax,%rcx) .LBB0_32: movq -16(%rbp), %rdi movslq -28(%rbp), %rax addq %rax, %rdi movq -8(%rbp), %rsi movslq -36(%rbp), %rax addq %rax, %rsi movslq -24(%rbp), %rcx xorl %eax, %eax # kill: def $rax killed $eax subq %rcx, %rax addq %rax, %rsi movslq -24(%rbp), %rdx callq memcpy@PLT movl -24(%rbp), %eax addl -28(%rbp), %eax movl %eax, -28(%rbp) .LBB0_33: movq -16(%rbp), %rax movslq -28(%rbp), %rcx movb $0, (%rax,%rcx) 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
problem145/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, #304 .cfi_def_cfa_offset 304 stp x28, x27, [sp, #272] ; 16-byte Folded Spill stp x29, x30, [sp, #288] ; 16-byte Folded Spill add x29, sp, #288 .cfi_def_cfa w29, 16 .cfi_offset w30, -8 .cfi_offset w29, -16 .cfi_offset w27, -24 .cfi_offset w28, -32 adrp x8, ___stack_chk_guard@GOTPAGE ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF] ldr x8, [x8] stur x8, [x29, #-24] str x0, [sp, #48] str x1, [sp, #40] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #47 cset w8, eq tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #20] sub x9, x29, #125 add x9, x9, x10 strb w8, [x9] 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_1 LBB0_4: ldrsw x9, [sp, #20] sub x0, x29, #125 mov x8, x0 add x8, x8, x9 strb wzr, [x8] bl _atoi str w0, [sp, #36] str wzr, [sp, #16] ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_5 LBB0_5: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_8 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #16] add x9, sp, #62 add x9, x9, x10 strb w8, [x9] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] ldr w8, [sp, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_5 LBB0_8: ldrsw x9, [sp, #16] add x0, sp, #62 mov x8, x0 add x8, x8, x9 strb wzr, [x8] bl _atoi str w0, [sp, #32] str wzr, [sp, #20] b LBB0_9 LBB0_9: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #47 cset w8, eq tbnz w8, #0, LBB0_12 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_9 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #20] sub x9, x29, #125 add x9, x9, x10 strb w8, [x9] b LBB0_11 LBB0_11: ; in Loop: Header=BB0_9 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_9 LBB0_12: ldrsw x9, [sp, #20] sub x0, x29, #125 mov x8, x0 add x8, x8, x9 strb wzr, [x8] bl _atoi str w0, [sp, #28] str wzr, [sp, #16] ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_13 LBB0_13: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #20] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_16 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_13 Depth=1 ldr x8, [sp, #40] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #16] add x9, sp, #62 add x9, x9, x10 strb w8, [x9] b LBB0_15 LBB0_15: ; in Loop: Header=BB0_13 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] ldr w8, [sp, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_13 LBB0_16: ldrsw x9, [sp, #16] add x0, sp, #62 mov x8, x0 add x8, x8, x9 strb wzr, [x8] bl _atoi str w0, [sp, #24] ldr w8, [sp, #36] ldr w9, [sp, #28] mul w8, w8, w9 ldr w9, [sp, #32] ldr w10, [sp, #24] mul w10, w9, w10 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_18 b LBB0_17 LBB0_17: mov w8, #1 str w8, [sp, #56] b LBB0_19 LBB0_18: str wzr, [sp, #56] b LBB0_19 LBB0_19: ldr w8, [sp, #56] str w8, [sp, #12] ; 4-byte Folded Spill ldur x9, [x29, #-24] 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_21 b LBB0_20 LBB0_20: bl ___stack_chk_fail LBB0_21: ldr w0, [sp, #12] ; 4-byte Folded Reload ldp x29, x30, [sp, #288] ; 16-byte Folded Reload ldp x28, x27, [sp, #272] ; 16-byte Folded Reload add sp, sp, #304 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 $272, %rsp # imm = 0x110 movq %rdi, -16(%rbp) movq %rsi, -24(%rbp) movl $0, -44(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $47, %eax je .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movb (%rax,%rcx), %cl movslq -44(%rbp), %rax movb %cl, -160(%rbp,%rax) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_1 .LBB0_4: movslq -44(%rbp), %rax movb $0, -160(%rbp,%rax) leaq -160(%rbp), %rdi callq atoi@PLT movl %eax, -28(%rbp) movl $0, -48(%rbp) movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) .LBB0_5: # =>This Inner Loop Header: Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_8 # %bb.6: # in Loop: Header=BB0_5 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movb (%rax,%rcx), %cl movslq -48(%rbp), %rax movb %cl, -272(%rbp,%rax) # %bb.7: # in Loop: Header=BB0_5 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_5 .LBB0_8: movslq -48(%rbp), %rax movb $0, -272(%rbp,%rax) leaq -272(%rbp), %rdi callq atoi@PLT movl %eax, -32(%rbp) movl $0, -44(%rbp) .LBB0_9: # =>This Inner Loop Header: Depth=1 movq -24(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $47, %eax je .LBB0_12 # %bb.10: # in Loop: Header=BB0_9 Depth=1 movq -24(%rbp), %rax movslq -44(%rbp), %rcx movb (%rax,%rcx), %cl movslq -44(%rbp), %rax movb %cl, -160(%rbp,%rax) # %bb.11: # in Loop: Header=BB0_9 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_9 .LBB0_12: movslq -44(%rbp), %rax movb $0, -160(%rbp,%rax) leaq -160(%rbp), %rdi callq atoi@PLT movl %eax, -36(%rbp) movl $0, -48(%rbp) movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) .LBB0_13: # =>This Inner Loop Header: Depth=1 movq -24(%rbp), %rax movslq -44(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_16 # %bb.14: # in Loop: Header=BB0_13 Depth=1 movq -24(%rbp), %rax movslq -44(%rbp), %rcx movb (%rax,%rcx), %cl movslq -48(%rbp), %rax movb %cl, -272(%rbp,%rax) # %bb.15: # in Loop: Header=BB0_13 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_13 .LBB0_16: movslq -48(%rbp), %rax movb $0, -272(%rbp,%rax) leaq -272(%rbp), %rdi callq atoi@PLT movl %eax, -40(%rbp) movl -28(%rbp), %eax imull -36(%rbp), %eax movl -32(%rbp), %ecx imull -40(%rbp), %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_18 # %bb.17: movl $1, -4(%rbp) jmp .LBB0_19 .LBB0_18: movl $0, -4(%rbp) .LBB0_19: movl -4(%rbp), %eax addq $272, %rsp # imm = 0x110 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 atoi
problem146/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, #128 .cfi_def_cfa_offset 128 stp x29, x30, [sp, #112] ; 16-byte Folded Spill add x29, sp, #112 .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] stur x0, [x29, #-32] stur w1, [x29, #-36] ldursw x8, [x29, #-36] lsl x0, x8, #2 bl _malloc stur x0, [x29, #-48] stur wzr, [x29, #-52] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ldur w8, [x29, #-52] ldur w9, [x29, #-36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_11 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-32] ldursw x9, [x29, #-52] ldr w0, [x8, x9, lsl #2] bl _abs mov x9, sp ; implicit-def: $x8 mov x8, x0 str x8, [x9] sub x0, x29, #20 str x0, [sp, #24] ; 8-byte Folded Spill mov w1, #0 mov x2, #12 adrp x3, l_.str@PAGE add x3, x3, l_.str@PAGEOFF bl ___sprintf_chk ldr x0, [sp, #24] ; 8-byte Folded Reload str wzr, [sp, #56] bl _strlen mov x8, x0 str w8, [sp, #52] mov w8, #1 str w8, [sp, #48] b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #48] ldr w9, [sp, #52] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldrsw x9, [sp, #48] sub x8, x29, #20 ldrsb w8, [x8, x9] subs w9, w8, #48 ldr w8, [sp, #56] add w8, w8, w9 str w8, [sp, #56] b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #48] add w8, w8, #1 str w8, [sp, #48] b LBB0_3 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-32] ldursw x9, [x29, #-52] ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldursb w8, [x29, #-20] subs w9, w8, #48 ldr w8, [sp, #56] add w8, w8, w9 str w8, [sp, #56] b LBB0_9 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldursb w8, [x29, #-20] subs w9, w8, #48 ldr w8, [sp, #56] subs w8, w8, w9 str w8, [sp, #56] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #56] ldur x9, [x29, #-48] ldursw x10, [x29, #-52] str w8, [x9, x10, lsl #2] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-52] add w8, w8, #1 stur w8, [x29, #-52] b LBB0_1 LBB0_11: str wzr, [sp, #40] b LBB0_12 LBB0_12: ; =>This Loop Header: Depth=1 ; Child Loop BB0_14 Depth 2 ldr w8, [sp, #40] ldur w9, [x29, #-36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_21 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_12 Depth=1 mov w8, #1 str w8, [sp, #36] b LBB0_14 LBB0_14: ; Parent Loop BB0_12 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #36] ldur w9, [x29, #-36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_19 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_14 Depth=2 ldur x8, [x29, #-48] ldr w9, [sp, #36] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldur x9, [x29, #-48] ldrsw x10, [sp, #36] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_17 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_14 Depth=2 ldur x8, [x29, #-48] ldrsw x9, [sp, #36] ldr w8, [x8, x9, lsl #2] str w8, [sp, #44] ldur x8, [x29, #-48] ldr w9, [sp, #36] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldur x9, [x29, #-48] ldrsw x10, [sp, #36] str w8, [x9, x10, lsl #2] ldr w8, [sp, #44] ldur x9, [x29, #-48] ldr w10, [sp, #36] subs w10, w10, #1 str w8, [x9, w10, sxtw #2] ldur x8, [x29, #-32] ldrsw x9, [sp, #36] ldr w8, [x8, x9, lsl #2] str w8, [sp, #44] ldur x8, [x29, #-32] ldr w9, [sp, #36] subs w9, w9, #1 ldr w8, [x8, w9, sxtw #2] ldur x9, [x29, #-32] ldrsw x10, [sp, #36] str w8, [x9, x10, lsl #2] ldr w8, [sp, #44] ldur x9, [x29, #-32] ldr w10, [sp, #36] subs w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_17 LBB0_17: ; in Loop: Header=BB0_14 Depth=2 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_14 Depth=2 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_14 LBB0_19: ; in Loop: Header=BB0_12 Depth=1 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_12 Depth=1 ldr w8, [sp, #40] add w8, w8, #1 str w8, [sp, #40] b LBB0_12 LBB0_21: ldur x0, [x29, #-48] bl _free ldur x8, [x29, #-32] str x8, [sp, #16] ; 8-byte Folded Spill 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_23 b LBB0_22 LBB0_22: bl ___stack_chk_fail LBB0_23: ldr x0, [sp, #16] ; 8-byte Folded Reload ldp x29, x30, [sp, #112] ; 16-byte Folded Reload add sp, sp, #128 ret .cfi_endproc ; -- End function .section __TEXT,__cstring,cstring_literals l_.str: ; @.str .asciz "%d" .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) movslq -12(%rbp), %rdi shlq $2, %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_11 # %bb.2: # in Loop: Header=BB0_1 Depth=1 leaq -40(%rbp), %rax movq %rax, -72(%rbp) # 8-byte Spill movq -8(%rbp), %rax movslq -28(%rbp), %rcx movl (%rax,%rcx,4), %edi callq abs@PLT movq -72(%rbp), %rdi # 8-byte Reload movl %eax, %edx leaq .L.str(%rip), %rsi movb $0, %al callq sprintf@PLT movl $0, -44(%rbp) leaq -40(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -48(%rbp) movl $1, -52(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -52(%rbp), %eax cmpl -48(%rbp), %eax jge .LBB0_6 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movslq -52(%rbp), %rax movsbl -40(%rbp,%rax), %eax subl $48, %eax addl -44(%rbp), %eax movl %eax, -44(%rbp) # %bb.5: # in Loop: Header=BB0_3 Depth=2 movl -52(%rbp), %eax addl $1, %eax movl %eax, -52(%rbp) jmp .LBB0_3 .LBB0_6: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx cmpl $0, (%rax,%rcx,4) jle .LBB0_8 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movsbl -40(%rbp), %eax subl $48, %eax addl -44(%rbp), %eax movl %eax, -44(%rbp) jmp .LBB0_9 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movsbl -40(%rbp), %ecx subl $48, %ecx movl -44(%rbp), %eax subl %ecx, %eax movl %eax, -44(%rbp) .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %edx movq -24(%rbp), %rax movslq -28(%rbp), %rcx movl %edx, (%rax,%rcx,4) # %bb.10: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_11: movl $0, -60(%rbp) .LBB0_12: # =>This Loop Header: Depth=1 # Child Loop BB0_14 Depth 2 movl -60(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_21 # %bb.13: # in Loop: Header=BB0_12 Depth=1 movl $1, -64(%rbp) .LBB0_14: # Parent Loop BB0_12 Depth=1 # => This Inner Loop Header: Depth=2 movl -64(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_19 # %bb.15: # in Loop: Header=BB0_14 Depth=2 movq -24(%rbp), %rax movl -64(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movq -24(%rbp), %rcx movslq -64(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax jle .LBB0_17 # %bb.16: # in Loop: Header=BB0_14 Depth=2 movq -24(%rbp), %rax movslq -64(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -56(%rbp) movq -24(%rbp), %rax movl -64(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %edx movq -24(%rbp), %rax movslq -64(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -56(%rbp), %edx movq -24(%rbp), %rax movl -64(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) movq -8(%rbp), %rax movslq -64(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -56(%rbp) movq -8(%rbp), %rax movl -64(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %edx movq -8(%rbp), %rax movslq -64(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -56(%rbp), %edx movq -8(%rbp), %rax movl -64(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_17: # in Loop: Header=BB0_14 Depth=2 jmp .LBB0_18 .LBB0_18: # in Loop: Header=BB0_14 Depth=2 movl -64(%rbp), %eax addl $1, %eax movl %eax, -64(%rbp) jmp .LBB0_14 .LBB0_19: # in Loop: Header=BB0_12 Depth=1 jmp .LBB0_20 .LBB0_20: # in Loop: Header=BB0_12 Depth=1 movl -60(%rbp), %eax addl $1, %eax movl %eax, -60(%rbp) jmp .LBB0_12 .LBB0_21: movq -24(%rbp), %rdi callq free@PLT movq -8(%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 "%d" .size .L.str, 3 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym malloc .addrsig_sym sprintf .addrsig_sym abs .addrsig_sym strlen .addrsig_sym free
problem147/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 Loop Header: Depth=1 ; Child Loop BB0_4 Depth 2 ldr w8, [sp, #12] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_12 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] subs w8, w8, #10 cset w8, le tbnz w8, #0, LBB0_10 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] mov w10, #10 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 str w8, [sp, #4] ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] str w8, [sp] b LBB0_4 LBB0_4: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp] subs w8, w8, #10 cset w8, lt tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_4 Depth=2 ldr w8, [sp] mov w9, #10 sdiv w8, w8, w9 str w8, [sp] b LBB0_4 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp] str w8, [sp, #8] ldr w8, [sp, #8] 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_9 b LBB0_7 LBB0_7: ; 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, #1 cset w8, ne 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] 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 Loop Header: Depth=1 # Child Loop BB0_4 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 $10, (%rax,%rcx,4) jle .LBB0_10 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movl (%rax,%rcx,4), %eax movl $10, %ecx cltd idivl %ecx movl %edx, -28(%rbp) movq -8(%rbp), %rax movslq -20(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -32(%rbp) .LBB0_4: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 cmpl $10, -32(%rbp) jl .LBB0_6 # %bb.5: # in Loop: Header=BB0_4 Depth=2 movl -32(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %eax, -32(%rbp) jmp .LBB0_4 .LBB0_6: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax movl %eax, -24(%rbp) movl -24(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $1, %edx jne .LBB0_9 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $1, %edx jne .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 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
problem148/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 w0, [x29, #-4] ldursw x8, [x29, #-4] lsl x0, x8, #2 bl _malloc stur x0, [x29, #-16] ldur w8, [x29, #-4] add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x8, w8 lsl x0, x8, #3 bl _malloc stur x0, [x29, #-24] ldur w8, [x29, #-4] add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x8, w8 lsl x0, x8, #3 bl _malloc stur x0, [x29, #-32] stur wzr, [x29, #-36] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-36] ldur w9, [x29, #-4] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 mov x0, #3 str x0, [sp, #8] ; 8-byte Folded Spill mov x1, #4 str x1, [sp] ; 8-byte Folded Spill bl _calloc ldr x1, [sp] ; 8-byte Folded Reload mov x8, x0 ldr x0, [sp, #8] ; 8-byte Folded Reload ldur x9, [x29, #-24] ldursw x10, [x29, #-36] str x8, [x9, x10, lsl #3] bl _calloc ldur x8, [x29, #-32] ldursw x9, [x29, #-36] str x0, [x8, x9, lsl #3] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-36] add w8, w8, #1 stur w8, [x29, #-36] b LBB0_1 LBB0_4: ldur x8, [x29, #-24] ldr x8, [x8] str wzr, [x8, #8] ldur x8, [x29, #-24] ldr x8, [x8] str wzr, [x8, #4] ldur x8, [x29, #-24] ldr x8, [x8] str wzr, [x8] ldur x8, [x29, #-32] ldr x8, [x8] str wzr, [x8, #8] ldur x8, [x29, #-32] ldr x8, [x8] str wzr, [x8, #4] ldur x8, [x29, #-32] ldr x8, [x8] str wzr, [x8] mov w8, #1 stur w8, [x29, #-40] b LBB0_5 LBB0_5: ; =>This Loop Header: Depth=1 ; Child Loop BB0_7 Depth 2 ldur w8, [x29, #-40] ldur w9, [x29, #-4] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_12 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=1 ldur w8, [x29, #-40] ldur w9, [x29, #-40] mul w8, w8, w9 ldur w9, [x29, #-40] subs w8, w8, w9 add w8, w8, #1 mov w10, #3 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 ldur x9, [x29, #-16] ldur w10, [x29, #-40] subs w10, w10, #1 str w8, [x9, w10, sxtw #2] stur wzr, [x29, #-44] b LBB0_7 LBB0_7: ; Parent Loop BB0_5 Depth=1 ; => This Inner Loop Header: Depth=2 ldur w8, [x29, #-44] subs w8, w8, #3 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=2 ldur x8, [x29, #-24] ldur w9, [x29, #-40] subs w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldursw x9, [x29, #-44] ldr w8, [x8, x9, lsl #2] ldur x9, [x29, #-24] ldursw x10, [x29, #-40] ldr x9, [x9, x10, lsl #3] ldursw x10, [x29, #-44] str w8, [x9, x10, lsl #2] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_7 Depth=2 ldur w8, [x29, #-44] add w8, w8, #1 stur w8, [x29, #-44] b LBB0_7 LBB0_10: ; in Loop: Header=BB0_5 Depth=1 ldur x8, [x29, #-24] ldursw x9, [x29, #-40] ldr x8, [x8, x9, lsl #3] ldur x9, [x29, #-16] ldur w10, [x29, #-40] subs w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] add x9, x8, x9, lsl #2 ldr w8, [x9] add w8, w8, #1 str w8, [x9] b LBB0_11 LBB0_11: ; in Loop: Header=BB0_5 Depth=1 ldur w8, [x29, #-40] add w8, w8, #1 stur w8, [x29, #-40] b LBB0_5 LBB0_12: mov w8, #1 str w8, [sp, #48] b LBB0_13 LBB0_13: ; =>This Loop Header: Depth=1 ; Child Loop BB0_15 Depth 2 ; Child Loop BB0_17 Depth 3 ; Child Loop BB0_22 Depth 3 ; Child Loop BB0_29 Depth 2 ; Child Loop BB0_31 Depth 3 ldr w8, [sp, #48] subs w8, w8, #3 cset w8, ge tbnz w8, #0, LBB0_38 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_13 Depth=1 mov w8, #1 str w8, [sp, #44] b LBB0_15 LBB0_15: ; Parent Loop BB0_13 Depth=1 ; => This Loop Header: Depth=2 ; Child Loop BB0_17 Depth 3 ; Child Loop BB0_22 Depth 3 ldr w8, [sp, #44] ldur w9, [x29, #-4] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_28 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_15 Depth=2 str wzr, [sp, #40] b LBB0_17 LBB0_17: ; Parent Loop BB0_13 Depth=1 ; Parent Loop BB0_15 Depth=2 ; => This Inner Loop Header: Depth=3 ldr w8, [sp, #40] subs w8, w8, #3 cset w8, ge tbnz w8, #0, LBB0_20 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_17 Depth=3 ldur x8, [x29, #-32] ldr w9, [sp, #44] subs w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #40] ldr w8, [x8, x9, lsl #2] ldur x9, [x29, #-32] ldrsw x10, [sp, #44] ldr x9, [x9, x10, lsl #3] ldrsw x10, [sp, #40] str w8, [x9, x10, lsl #2] b LBB0_19 LBB0_19: ; in Loop: Header=BB0_17 Depth=3 ldr w8, [sp, #40] add w8, w8, #1 str w8, [sp, #40] b LBB0_17 LBB0_20: ; in Loop: Header=BB0_15 Depth=2 ldr w8, [sp, #44] subs w8, w8, #1 cset w8, lt tbnz w8, #0, LBB0_26 b LBB0_21 LBB0_21: ; in Loop: Header=BB0_15 Depth=2 str wzr, [sp, #36] b LBB0_22 LBB0_22: ; Parent Loop BB0_13 Depth=1 ; Parent Loop BB0_15 Depth=2 ; => This Inner Loop Header: Depth=3 ldr w8, [sp, #36] subs w8, w8, #2 cset w8, gt tbnz w8, #0, LBB0_25 b LBB0_23 LBB0_23: ; in Loop: Header=BB0_22 Depth=3 ldur x8, [x29, #-24] ldr w9, [sp, #44] subs w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldrsw x9, [sp, #36] ldr w10, [x8, x9, lsl #2] ldur x8, [x29, #-32] ldrsw x9, [sp, #44] ldr x8, [x8, x9, lsl #3] ldur x9, [x29, #-16] ldr w11, [sp, #44] subs w11, w11, #1 ldr w9, [x9, w11, sxtw #2] ldr w11, [sp, #36] add w9, w9, w11 mov w12, #3 sdiv w11, w9, w12 mul w11, w11, w12 subs w9, w9, w11 add x9, x8, w9, sxtw #2 ldr w8, [x9] add w8, w8, w10 str w8, [x9] b LBB0_24 LBB0_24: ; in Loop: Header=BB0_22 Depth=3 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_22 LBB0_25: ; in Loop: Header=BB0_15 Depth=2 b LBB0_26 LBB0_26: ; in Loop: Header=BB0_15 Depth=2 b LBB0_27 LBB0_27: ; in Loop: Header=BB0_15 Depth=2 ldr w8, [sp, #44] add w8, w8, #1 str w8, [sp, #44] b LBB0_15 LBB0_28: ; in Loop: Header=BB0_13 Depth=1 str wzr, [sp, #32] b LBB0_29 LBB0_29: ; Parent Loop BB0_13 Depth=1 ; => This Loop Header: Depth=2 ; Child Loop BB0_31 Depth 3 ldr w8, [sp, #32] ldur w9, [x29, #-4] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_36 b LBB0_30 LBB0_30: ; in Loop: Header=BB0_29 Depth=2 str wzr, [sp, #28] b LBB0_31 LBB0_31: ; Parent Loop BB0_13 Depth=1 ; Parent Loop BB0_29 Depth=2 ; => This Inner Loop Header: Depth=3 ldr w8, [sp, #28] subs w8, w8, #3 cset w8, ge tbnz w8, #0, LBB0_34 b LBB0_32 LBB0_32: ; in Loop: Header=BB0_31 Depth=3 ldur x8, [x29, #-32] ldrsw x9, [sp, #32] ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #28] ldr w8, [x8, x9, lsl #2] ldur x9, [x29, #-24] ldrsw x10, [sp, #32] ldr x9, [x9, x10, lsl #3] ldrsw x10, [sp, #28] str w8, [x9, x10, lsl #2] ldur x8, [x29, #-32] ldrsw x9, [sp, #32] ldr x9, [x8, x9, lsl #3] ldrsw x10, [sp, #28] mov w8, #0 str w8, [x9, x10, lsl #2] b LBB0_33 LBB0_33: ; in Loop: Header=BB0_31 Depth=3 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_31 LBB0_34: ; in Loop: Header=BB0_29 Depth=2 b LBB0_35 LBB0_35: ; in Loop: Header=BB0_29 Depth=2 ldr w8, [sp, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_29 LBB0_36: ; in Loop: Header=BB0_13 Depth=1 b LBB0_37 LBB0_37: ; in Loop: Header=BB0_13 Depth=1 ldr w8, [sp, #48] add w8, w8, #1 str w8, [sp, #48] b LBB0_13 LBB0_38: ldur x8, [x29, #-24] ldursw x9, [x29, #-4] ldr x8, [x8, x9, lsl #3] ldr w8, [x8] str w8, [sp, #24] str wzr, [sp, #20] b LBB0_39 LBB0_39: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #20] ldur w9, [x29, #-4] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_42 b LBB0_40 LBB0_40: ; in Loop: Header=BB0_39 Depth=1 ldur x8, [x29, #-24] ldrsw x9, [sp, #20] ldr x0, [x8, x9, lsl #3] bl _free ldur x8, [x29, #-32] ldrsw x9, [sp, #20] ldr x0, [x8, x9, lsl #3] bl _free b LBB0_41 LBB0_41: ; in Loop: Header=BB0_39 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_39 LBB0_42: ldur x0, [x29, #-24] bl _free ldur x0, [x29, #-32] bl _free ldur x0, [x29, #-16] bl _free ldr w0, [sp, #24] ldp x29, x30, [sp, #96] ; 16-byte Folded Reload add sp, sp, #112 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 $96, %rsp movl %edi, -4(%rbp) movslq -4(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -16(%rbp) movl -4(%rbp), %eax addl $1, %eax movslq %eax, %rdi shlq $3, %rdi callq malloc@PLT movq %rax, -24(%rbp) movl -4(%rbp), %eax addl $1, %eax movslq %eax, %rdi shlq $3, %rdi callq malloc@PLT movq %rax, -32(%rbp) movl $0, -36(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl $3, %edi movl $4, %esi callq calloc@PLT movq %rax, %rdx movq -24(%rbp), %rax movslq -36(%rbp), %rcx movq %rdx, (%rax,%rcx,8) movl $3, %edi movl $4, %esi callq calloc@PLT movq %rax, %rdx movq -32(%rbp), %rax movslq -36(%rbp), %rcx movq %rdx, (%rax,%rcx,8) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_4: movq -24(%rbp), %rax movq (%rax), %rax movl $0, 8(%rax) movq -24(%rbp), %rax movq (%rax), %rax movl $0, 4(%rax) movq -24(%rbp), %rax movq (%rax), %rax movl $0, (%rax) movq -32(%rbp), %rax movq (%rax), %rax movl $0, 8(%rax) movq -32(%rbp), %rax movq (%rax), %rax movl $0, 4(%rax) movq -32(%rbp), %rax movq (%rax), %rax movl $0, (%rax) movl $1, -40(%rbp) .LBB0_5: # =>This Loop Header: Depth=1 # Child Loop BB0_7 Depth 2 movl -40(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_12 # %bb.6: # in Loop: Header=BB0_5 Depth=1 movl -40(%rbp), %eax imull -40(%rbp), %eax subl -40(%rbp), %eax addl $1, %eax movl $3, %ecx cltd idivl %ecx movq -16(%rbp), %rax movl -40(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) movl $0, -44(%rbp) .LBB0_7: # Parent Loop BB0_5 Depth=1 # => This Inner Loop Header: Depth=2 cmpl $3, -44(%rbp) jge .LBB0_10 # %bb.8: # in Loop: Header=BB0_7 Depth=2 movq -24(%rbp), %rax movl -40(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -24(%rbp), %rax movslq -40(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -44(%rbp), %rcx movl %edx, (%rax,%rcx,4) # %bb.9: # in Loop: Header=BB0_7 Depth=2 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_7 .LBB0_10: # in Loop: Header=BB0_5 Depth=1 movq -24(%rbp), %rax movslq -40(%rbp), %rcx movq (%rax,%rcx,8), %rax movq -16(%rbp), %rcx movl -40(%rbp), %edx subl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx addl $1, %edx movl %edx, (%rax,%rcx,4) # %bb.11: # in Loop: Header=BB0_5 Depth=1 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_5 .LBB0_12: movl $1, -48(%rbp) .LBB0_13: # =>This Loop Header: Depth=1 # Child Loop BB0_15 Depth 2 # Child Loop BB0_17 Depth 3 # Child Loop BB0_22 Depth 3 # Child Loop BB0_29 Depth 2 # Child Loop BB0_31 Depth 3 cmpl $3, -48(%rbp) jge .LBB0_38 # %bb.14: # in Loop: Header=BB0_13 Depth=1 movl $1, -52(%rbp) .LBB0_15: # Parent Loop BB0_13 Depth=1 # => This Loop Header: Depth=2 # Child Loop BB0_17 Depth 3 # Child Loop BB0_22 Depth 3 movl -52(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_28 # %bb.16: # in Loop: Header=BB0_15 Depth=2 movl $0, -56(%rbp) .LBB0_17: # Parent Loop BB0_13 Depth=1 # Parent Loop BB0_15 Depth=2 # => This Inner Loop Header: Depth=3 cmpl $3, -56(%rbp) jge .LBB0_20 # %bb.18: # in Loop: Header=BB0_17 Depth=3 movq -32(%rbp), %rax movl -52(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -56(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -56(%rbp), %rcx movl %edx, (%rax,%rcx,4) # %bb.19: # in Loop: Header=BB0_17 Depth=3 movl -56(%rbp), %eax addl $1, %eax movl %eax, -56(%rbp) jmp .LBB0_17 .LBB0_20: # in Loop: Header=BB0_15 Depth=2 cmpl $1, -52(%rbp) jl .LBB0_26 # %bb.21: # in Loop: Header=BB0_15 Depth=2 movl $0, -60(%rbp) .LBB0_22: # Parent Loop BB0_13 Depth=1 # Parent Loop BB0_15 Depth=2 # => This Inner Loop Header: Depth=3 cmpl $2, -60(%rbp) jg .LBB0_25 # %bb.23: # in Loop: Header=BB0_22 Depth=3 movq -24(%rbp), %rax movl -52(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movslq -60(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -80(%rbp) # 4-byte Spill movq -32(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -88(%rbp) # 8-byte Spill movq -16(%rbp), %rax movl -52(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax addl -60(%rbp), %eax movl $3, %ecx cltd idivl %ecx movq -88(%rbp), %rax # 8-byte Reload movl %edx, %ecx movl -80(%rbp), %edx # 4-byte Reload movslq %ecx, %rcx addl (%rax,%rcx,4), %edx movl %edx, (%rax,%rcx,4) # %bb.24: # in Loop: Header=BB0_22 Depth=3 movl -60(%rbp), %eax addl $1, %eax movl %eax, -60(%rbp) jmp .LBB0_22 .LBB0_25: # in Loop: Header=BB0_15 Depth=2 jmp .LBB0_26 .LBB0_26: # in Loop: Header=BB0_15 Depth=2 jmp .LBB0_27 .LBB0_27: # in Loop: Header=BB0_15 Depth=2 movl -52(%rbp), %eax addl $1, %eax movl %eax, -52(%rbp) jmp .LBB0_15 .LBB0_28: # in Loop: Header=BB0_13 Depth=1 movl $0, -64(%rbp) .LBB0_29: # Parent Loop BB0_13 Depth=1 # => This Loop Header: Depth=2 # Child Loop BB0_31 Depth 3 movl -64(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_36 # %bb.30: # in Loop: Header=BB0_29 Depth=2 movl $0, -68(%rbp) .LBB0_31: # Parent Loop BB0_13 Depth=1 # Parent Loop BB0_29 Depth=2 # => This Inner Loop Header: Depth=3 cmpl $3, -68(%rbp) jge .LBB0_34 # %bb.32: # in Loop: Header=BB0_31 Depth=3 movq -32(%rbp), %rax movslq -64(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -68(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -24(%rbp), %rax movslq -64(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -68(%rbp), %rcx movl %edx, (%rax,%rcx,4) movq -32(%rbp), %rax movslq -64(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -68(%rbp), %rcx movl $0, (%rax,%rcx,4) # %bb.33: # in Loop: Header=BB0_31 Depth=3 movl -68(%rbp), %eax addl $1, %eax movl %eax, -68(%rbp) jmp .LBB0_31 .LBB0_34: # in Loop: Header=BB0_29 Depth=2 jmp .LBB0_35 .LBB0_35: # in Loop: Header=BB0_29 Depth=2 movl -64(%rbp), %eax addl $1, %eax movl %eax, -64(%rbp) jmp .LBB0_29 .LBB0_36: # in Loop: Header=BB0_13 Depth=1 jmp .LBB0_37 .LBB0_37: # in Loop: Header=BB0_13 Depth=1 movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_13 .LBB0_38: movq -24(%rbp), %rax movslq -4(%rbp), %rcx movq (%rax,%rcx,8), %rax movl (%rax), %eax movl %eax, -72(%rbp) movl $0, -76(%rbp) .LBB0_39: # =>This Inner Loop Header: Depth=1 movl -76(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_42 # %bb.40: # in Loop: Header=BB0_39 Depth=1 movq -24(%rbp), %rax movslq -76(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq free@PLT movq -32(%rbp), %rax movslq -76(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq free@PLT # %bb.41: # in Loop: Header=BB0_39 Depth=1 movl -76(%rbp), %eax addl $1, %eax movl %eax, -76(%rbp) jmp .LBB0_39 .LBB0_42: movq -24(%rbp), %rdi callq free@PLT movq -32(%rbp), %rdi callq free@PLT movq -16(%rbp), %rdi callq free@PLT movl -72(%rbp), %eax addq $96, %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 .addrsig_sym calloc .addrsig_sym free
problem149/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, #56] str x1, [sp, #48] str x2, [sp, #40] add x0, sp, #72 adrp x1, l___const.func0.planets@PAGE add x1, x1, l___const.func0.planets@PAGEOFF mov x2, #64 bl _memcpy mov w8, #-1 str w8, [sp, #36] str w8, [sp, #32] str wzr, [sp, #28] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #28] subs w8, w8, #8 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldrsw x9, [sp, #28] add x8, sp, #72 ldr x0, [x8, x9, lsl #3] ldr x1, [sp, #56] bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] str w8, [sp, #36] b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldrsw x9, [sp, #28] add x8, sp, #72 ldr x0, [x8, x9, lsl #3] ldr x1, [sp, #48] bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] str w8, [sp, #32] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_1 LBB0_8: ldr w8, [sp, #36] adds w8, w8, #1 cset w8, eq tbnz w8, #0, LBB0_11 b LBB0_9 LBB0_9: ldr w8, [sp, #32] adds w8, w8, #1 cset w8, eq tbnz w8, #0, LBB0_11 b LBB0_10 LBB0_10: ldr w8, [sp, #36] ldr w9, [sp, #32] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: ldr x8, [sp, #40] str wzr, [x8] ; kill: def $x8 killed $xzr str xzr, [sp, #64] b LBB0_21 LBB0_12: ldr w8, [sp, #36] ldr w9, [sp, #32] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ldr w8, [sp, #36] str w8, [sp, #24] ldr w8, [sp, #32] str w8, [sp, #36] ldr w8, [sp, #24] str w8, [sp, #32] b LBB0_14 LBB0_14: ldr w8, [sp, #32] ldr w9, [sp, #36] subs w8, w8, w9 subs w8, w8, #1 ldr x9, [sp, #40] str w8, [x9] ldr x8, [sp, #40] ldr w8, [x8] subs w8, w8, #0 cset w8, gt tbnz w8, #0, LBB0_16 b LBB0_15 LBB0_15: ldr x8, [sp, #40] str wzr, [x8] ; kill: def $x8 killed $xzr str xzr, [sp, #64] b LBB0_21 LBB0_16: ldr x8, [sp, #40] ldrsw x8, [x8] lsl x0, x8, #3 bl _malloc str x0, [sp, #16] ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #28] b LBB0_17 LBB0_17: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #28] ldr w9, [sp, #32] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_20 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_17 Depth=1 ldrsw x9, [sp, #28] add x8, sp, #72 ldr x8, [x8, x9, lsl #3] ldr x9, [sp, #16] ldr w10, [sp, #28] ldr w11, [sp, #36] subs w10, w10, w11 subs w10, w10, #1 str x8, [x9, w10, sxtw #3] b LBB0_19 LBB0_19: ; in Loop: Header=BB0_17 Depth=1 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_17 LBB0_20: ldr x8, [sp, #16] str x8, [sp, #64] b LBB0_21 LBB0_21: ldr x8, [sp, #64] str x8, [sp, #8] ; 8-byte Folded Spill 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_23 b LBB0_22 LBB0_22: bl ___stack_chk_fail LBB0_23: ldr x0, [sp, #8] ; 8-byte Folded Reload 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 .asciz "Mercury" l_.str.1: ; @.str.1 .asciz "Venus" l_.str.2: ; @.str.2 .asciz "Earth" l_.str.3: ; @.str.3 .asciz "Mars" l_.str.4: ; @.str.4 .asciz "Jupiter" l_.str.5: ; @.str.5 .asciz "Saturn" l_.str.6: ; @.str.6 .asciz "Uranus" l_.str.7: ; @.str.7 .asciz "Neptune" .section __DATA,__const .p2align 3 ; @__const.func0.planets l___const.func0.planets: .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 .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, -16(%rbp) movq %rsi, -24(%rbp) movq %rdx, -32(%rbp) leaq -96(%rbp), %rdi leaq .L__const.func0.planets(%rip), %rsi movl $64, %edx callq memcpy@PLT movl $-1, -100(%rbp) movl $-1, -104(%rbp) movl $0, -108(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 cmpl $8, -108(%rbp) jge .LBB0_8 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movslq -108(%rbp), %rax movq -96(%rbp,%rax,8), %rdi movq -16(%rbp), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -108(%rbp), %eax movl %eax, -100(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movslq -108(%rbp), %rax movq -96(%rbp,%rax,8), %rdi movq -24(%rbp), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movl -108(%rbp), %eax movl %eax, -104(%rbp) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_1 Depth=1 movl -108(%rbp), %eax addl $1, %eax movl %eax, -108(%rbp) jmp .LBB0_1 .LBB0_8: cmpl $-1, -100(%rbp) je .LBB0_11 # %bb.9: cmpl $-1, -104(%rbp) je .LBB0_11 # %bb.10: movl -100(%rbp), %eax cmpl -104(%rbp), %eax jne .LBB0_12 .LBB0_11: movq -32(%rbp), %rax movl $0, (%rax) movq $0, -8(%rbp) jmp .LBB0_21 .LBB0_12: movl -100(%rbp), %eax cmpl -104(%rbp), %eax jle .LBB0_14 # %bb.13: movl -100(%rbp), %eax movl %eax, -112(%rbp) movl -104(%rbp), %eax movl %eax, -100(%rbp) movl -112(%rbp), %eax movl %eax, -104(%rbp) .LBB0_14: movl -104(%rbp), %ecx subl -100(%rbp), %ecx subl $1, %ecx movq -32(%rbp), %rax movl %ecx, (%rax) movq -32(%rbp), %rax cmpl $0, (%rax) jg .LBB0_16 # %bb.15: movq -32(%rbp), %rax movl $0, (%rax) movq $0, -8(%rbp) jmp .LBB0_21 .LBB0_16: movq -32(%rbp), %rax movslq (%rax), %rdi shlq $3, %rdi callq malloc@PLT movq %rax, -120(%rbp) movl -100(%rbp), %eax addl $1, %eax movl %eax, -108(%rbp) .LBB0_17: # =>This Inner Loop Header: Depth=1 movl -108(%rbp), %eax cmpl -104(%rbp), %eax jge .LBB0_20 # %bb.18: # in Loop: Header=BB0_17 Depth=1 movslq -108(%rbp), %rax movq -96(%rbp,%rax,8), %rdx movq -120(%rbp), %rax movl -108(%rbp), %ecx subl -100(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movq %rdx, (%rax,%rcx,8) # %bb.19: # in Loop: Header=BB0_17 Depth=1 movl -108(%rbp), %eax addl $1, %eax movl %eax, -108(%rbp) jmp .LBB0_17 .LBB0_20: movq -120(%rbp), %rax movq %rax, -8(%rbp) .LBB0_21: movq -8(%rbp), %rax 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: .asciz "Mercury" .size .L.str, 8 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "Venus" .size .L.str.1, 6 .type .L.str.2,@object # @.str.2 .L.str.2: .asciz "Earth" .size .L.str.2, 6 .type .L.str.3,@object # @.str.3 .L.str.3: .asciz "Mars" .size .L.str.3, 5 .type .L.str.4,@object # @.str.4 .L.str.4: .asciz "Jupiter" .size .L.str.4, 8 .type .L.str.5,@object # @.str.5 .L.str.5: .asciz "Saturn" .size .L.str.5, 7 .type .L.str.6,@object # @.str.6 .L.str.6: .asciz "Uranus" .size .L.str.6, 7 .type .L.str.7,@object # @.str.7 .L.str.7: .asciz "Neptune" .size .L.str.7, 8 .type .L__const.func0.planets,@object # @__const.func0.planets .section .data.rel.ro,"aw",@progbits .p2align 4 .L__const.func0.planets: .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 .size .L__const.func0.planets, 64 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strcmp .addrsig_sym malloc
problem15/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 x1, [x29, #-16] ldur x0, [x29, #-8] bl _strlen mov x8, x0 stur w8, [x29, #-20] ldursw x8, [x29, #-20] lsl x0, x8, #3 bl _malloc str x0, [sp, #32] ldur w8, [x29, #-20] add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x0, w8 bl _malloc str x0, [sp, #24] ldr x8, [sp, #24] strb wzr, [x8] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>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_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x0, [sp, #24] bl _strlen str x0, [sp, #8] ldr x0, [sp, #24] ldr x8, [sp, #8] add x1, x8, #2 bl _realloc str x0, [sp, #24] ldur x8, [x29, #-8] ldrsw x9, [sp, #20] add x8, x8, x9 ldrb w8, [x8] ldr x9, [sp, #24] ldr x10, [sp, #8] add x9, x9, x10 strb w8, [x9] ldr x8, [sp, #24] ldr x9, [sp, #8] add x9, x9, #1 add x8, x8, x9 strb wzr, [x8] ldr x0, [sp, #24] bl _strlen add x0, x0, #1 bl _malloc ldr x8, [sp, #32] ldrsw x9, [sp, #20] str x0, [x8, x9, lsl #3] ldr x8, [sp, #32] ldrsw x9, [sp, #20] ldr x0, [x8, x9, lsl #3] ldr x1, [sp, #24] mov x2, #-1 bl ___strcpy_chk 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_1 LBB0_4: ldr x0, [sp, #24] bl _free ldur w8, [x29, #-20] ldur x9, [x29, #-16] str w8, [x9] ldr x0, [sp, #32] 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) movq %rsi, -16(%rbp) movq -8(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -20(%rbp) movslq -20(%rbp), %rdi shlq $3, %rdi callq malloc@PLT movq %rax, -32(%rbp) movl -20(%rbp), %eax addl $1, %eax movslq %eax, %rdi callq malloc@PLT movq %rax, -40(%rbp) movq -40(%rbp), %rax movb $0, (%rax) movl $0, -44(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -40(%rbp), %rdi callq strlen@PLT movq %rax, -56(%rbp) movq -40(%rbp), %rdi movq -56(%rbp), %rsi addq $2, %rsi callq realloc@PLT movq %rax, -40(%rbp) movq -8(%rbp), %rax movslq -44(%rbp), %rcx movb (%rax,%rcx), %dl movq -40(%rbp), %rax movq -56(%rbp), %rcx movb %dl, (%rax,%rcx) movq -40(%rbp), %rax movq -56(%rbp), %rcx movb $0, 1(%rax,%rcx) movq -40(%rbp), %rdi callq strlen@PLT movq %rax, %rdi addq $1, %rdi callq malloc@PLT movq %rax, %rdx movq -32(%rbp), %rax movslq -44(%rbp), %rcx movq %rdx, (%rax,%rcx,8) movq -32(%rbp), %rax movslq -44(%rbp), %rcx movq (%rax,%rcx,8), %rdi movq -40(%rbp), %rsi callq strcpy@PLT # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_1 .LBB0_4: movq -40(%rbp), %rdi callq free@PLT movl -20(%rbp), %ecx movq -16(%rbp), %rax movl %ecx, (%rax) movq -32(%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 .addrsig_sym realloc .addrsig_sym strcpy .addrsig_sym free
problem150/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] ldur x8, [x29, #-24] str wzr, [x8] stur wzr, [x29, #-28] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-28] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldursw x9, [x29, #-28] ldr x0, [x8, x9, lsl #3] bl _strlen mov x9, #2 udiv x8, x0, x9 mul x8, x8, x9 subs x8, x0, x8 subs x8, x8, #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] ldursw x9, [x29, #-28] ldr x8, [x8, x9, lsl #3] ldur x9, [x29, #-8] ldur x10, [x29, #-24] ldrsw x10, [x10] str x8, [x9, x10, lsl #3] ldur x9, [x29, #-24] ldr w8, [x9] add w8, w8, #1 str w8, [x9] b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-28] add w8, w8, #1 stur w8, [x29, #-28] b LBB0_1 LBB0_6: stur wzr, [x29, #-28] b LBB0_7 LBB0_7: ; =>This Loop Header: Depth=1 ; Child Loop BB0_9 Depth 2 ldur w8, [x29, #-28] ldur x9, [x29, #-24] ldr w9, [x9] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_18 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=1 str wzr, [sp, #32] b LBB0_9 LBB0_9: ; Parent Loop BB0_7 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #32] ldur x9, [x29, #-24] ldr w9, [x9] ldur w10, [x29, #-28] subs w9, w9, w10 subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_9 Depth=2 ldur x8, [x29, #-8] ldrsw x9, [sp, #32] ldr x0, [x8, x9, lsl #3] bl _strlen str x0, [sp, #16] ldur x8, [x29, #-8] ldr w9, [sp, #32] add w9, w9, #1 ldr x0, [x8, w9, sxtw #3] bl _strlen str x0, [sp, #8] ldr x8, [sp, #16] ldr x9, [sp, #8] subs x8, x8, x9 cset w8, hi tbnz w8, #0, LBB0_13 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_9 Depth=2 ldr x8, [sp, #16] ldr x9, [sp, #8] subs x8, x8, x9 cset w8, ne tbnz w8, #0, LBB0_14 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_9 Depth=2 ldur x8, [x29, #-8] ldrsw x9, [sp, #32] ldr x0, [x8, x9, lsl #3] ldur x8, [x29, #-8] ldr w9, [sp, #32] add w9, w9, #1 ldr x1, [x8, w9, sxtw #3] bl _strcmp subs w8, w0, #0 cset w8, le tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_9 Depth=2 ldur x8, [x29, #-8] ldrsw x9, [sp, #32] ldr x8, [x8, x9, lsl #3] str x8, [sp, #24] ldur x8, [x29, #-8] ldr w9, [sp, #32] add w9, w9, #1 ldr x8, [x8, w9, sxtw #3] ldur x9, [x29, #-8] ldrsw x10, [sp, #32] str x8, [x9, x10, lsl #3] ldr x8, [sp, #24] ldur x9, [x29, #-8] ldr w10, [sp, #32] add w10, w10, #1 str x8, [x9, w10, sxtw #3] b LBB0_14 LBB0_14: ; in Loop: Header=BB0_9 Depth=2 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_9 Depth=2 ldr w8, [sp, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_9 LBB0_16: ; in Loop: Header=BB0_7 Depth=1 b LBB0_17 LBB0_17: ; in Loop: Header=BB0_7 Depth=1 ldur w8, [x29, #-28] add w8, w8, #1 stur w8, [x29, #-28] b LBB0_7 LBB0_18: ldur x8, [x29, #-24] ldrsw x8, [x8] lsl x0, x8, #3 bl _malloc str x0, [sp] stur wzr, [x29, #-28] b LBB0_19 LBB0_19: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-28] ldur x9, [x29, #-24] ldr w9, [x9] 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, #-8] ldursw x9, [x29, #-28] ldr x8, [x8, x9, lsl #3] ldr x9, [sp] ldursw x10, [x29, #-28] str x8, [x9, x10, lsl #3] b LBB0_21 LBB0_21: ; in Loop: Header=BB0_19 Depth=1 ldur w8, [x29, #-28] add w8, w8, #1 stur w8, [x29, #-28] b LBB0_19 LBB0_22: ldr x0, [sp] 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 -24(%rbp), %rax movl $0, (%rax) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq strlen@PLT andq $1, %rax cmpq $0, %rax jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movq (%rax,%rcx,8), %rdx movq -8(%rbp), %rax movq -24(%rbp), %rcx movslq (%rcx), %rcx movq %rdx, (%rax,%rcx,8) movq -24(%rbp), %rax movl (%rax), %ecx addl $1, %ecx movl %ecx, (%rax) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_5 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_6: movl $0, -28(%rbp) .LBB0_7: # =>This Loop Header: Depth=1 # Child Loop BB0_9 Depth 2 movl -28(%rbp), %eax movq -24(%rbp), %rcx movl (%rcx), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_18 # %bb.8: # in Loop: Header=BB0_7 Depth=1 movl $0, -32(%rbp) .LBB0_9: # Parent Loop BB0_7 Depth=1 # => This Inner Loop Header: Depth=2 movl -32(%rbp), %eax movq -24(%rbp), %rcx movl (%rcx), %ecx subl -28(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_16 # %bb.10: # in Loop: Header=BB0_9 Depth=2 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq strlen@PLT movq %rax, -48(%rbp) movq -8(%rbp), %rax movl -32(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rdi callq strlen@PLT movq %rax, -56(%rbp) movq -48(%rbp), %rax cmpq -56(%rbp), %rax ja .LBB0_13 # %bb.11: # in Loop: Header=BB0_9 Depth=2 movq -48(%rbp), %rax cmpq -56(%rbp), %rax jne .LBB0_14 # %bb.12: # in Loop: Header=BB0_9 Depth=2 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rdi movq -8(%rbp), %rax movl -32(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rsi callq strcmp@PLT cmpl $0, %eax jle .LBB0_14 .LBB0_13: # in Loop: Header=BB0_9 Depth=2 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -40(%rbp) movq -8(%rbp), %rax movl -32(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rdx movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq %rdx, (%rax,%rcx,8) movq -40(%rbp), %rdx movq -8(%rbp), %rax movl -32(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movq %rdx, (%rax,%rcx,8) .LBB0_14: # in Loop: Header=BB0_9 Depth=2 jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_9 Depth=2 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_9 .LBB0_16: # in Loop: Header=BB0_7 Depth=1 jmp .LBB0_17 .LBB0_17: # in Loop: Header=BB0_7 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_7 .LBB0_18: movq -24(%rbp), %rax movslq (%rax), %rdi shlq $3, %rdi callq malloc@PLT movq %rax, -64(%rbp) movl $0, -28(%rbp) .LBB0_19: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax movq -24(%rbp), %rcx cmpl (%rcx), %eax jge .LBB0_22 # %bb.20: # in Loop: Header=BB0_19 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movq (%rax,%rcx,8), %rdx movq -64(%rbp), %rax movslq -28(%rbp), %rcx movq %rdx, (%rax,%rcx,8) # %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 -64(%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 strcmp .addrsig_sym malloc
problem151/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 w0, [sp, #24] str w1, [sp, #20] str w2, [sp, #16] mov w8, #1 str w8, [sp, #12] ldr w8, [sp, #24] subs w8, w8, #2 cset w8, ge tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: str wzr, [sp, #12] b LBB0_2 LBB0_2: mov w8, #2 str w8, [sp, #8] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #8] mul w8, w8, w9 ldr w9, [sp, #24] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #24] ldr w10, [sp, #8] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 str wzr, [sp, #12] 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, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_3 LBB0_8: ldr w8, [sp, #12] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ldr w8, [sp, #20] str w8, [sp, #28] b LBB0_11 LBB0_10: ldr w8, [sp, #16] str w8, [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" .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 %edx, -16(%rbp) movl $1, -20(%rbp) cmpl $2, -8(%rbp) jge .LBB0_2 # %bb.1: movl $0, -20(%rbp) .LBB0_2: movl $2, -24(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax imull -24(%rbp), %eax cmpl -8(%rbp), %eax jg .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movl -8(%rbp), %eax cltd idivl -24(%rbp) cmpl $0, %edx jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl $0, -20(%rbp) .LBB0_6: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_3 .LBB0_8: cmpl $0, -20(%rbp) je .LBB0_10 # %bb.9: movl -12(%rbp), %eax movl %eax, -4(%rbp) jmp .LBB0_11 .LBB0_10: movl -16(%rbp), %eax movl %eax, -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
problem152/code.c
.section __TEXT,__text,regular,pure_instructions .build_version macos, 13, 0 sdk_version 13, 3 .section __TEXT,__literal8,8byte_literals .p2align 3 ; -- Begin function func0 lCPI0_0: .quad 0x3f1a36e2eb1c432d ; double 1.0E-4 .section __TEXT,__text,regular,pure_instructions .globl _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 xzr, [sp, #8] str wzr, [sp, #4] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldr w9, [sp, #20] 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] ldrsw x9, [sp, #4] ldr s0, [x8, x9, lsl #2] fcvt d0, s0 ldr x8, [sp, #24] ldrsw x9, [sp, #4] ldr s1, [x8, x9, lsl #2] fcvt d1, s1 frinta d1, d1 fabd d0, d0, d1 adrp x8, lCPI0_0@PAGE ldr d1, [x8, lCPI0_0@PAGEOFF] fcmp d0, d1 cset w8, pl tbnz w8, #0, LBB0_7 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #4] ldr s0, [x8, x9, lsl #2] fcmp s0, #0.0 cset w8, le tbnz w8, #0, LBB0_6 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #4] ldr s0, [x8, x9, lsl #2] fcvt d0, s0 fcvtas w8, d0 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_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #4] ldr s0, [x8, x9, lsl #2] fcvt d0, s0 fcvtas w8, d0 ldr x9, [sp, #24] ldrsw x10, [sp, #4] ldr s0, [x9, x10, lsl #2] fcvt d0, s0 fcvtas w9, d0 mul w9, w8, w9 ldr x8, [sp, #8] add x8, x8, w9, sxtw str x8, [sp, #8] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 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, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_1 LBB0_9: ldr x0, [sp, #8] add sp, sp, #32 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 0x3f1a36e2eb1c432d # double 1.0E-4 .section .rodata.cst16,"aM",@progbits,16 .p2align 4 .LCPI0_1: .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 subq $48, %rsp movq %rdi, -8(%rbp) movl %esi, -12(%rbp) movq $0, -24(%rbp) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_9 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 movsd %xmm0, -40(%rbp) # 8-byte Spill movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq round@PLT movsd -40(%rbp), %xmm1 # 8-byte Reload # xmm1 = mem[0],zero subsd %xmm0, %xmm1 movaps .LCPI0_1(%rip), %xmm0 # xmm0 = [NaN,NaN] pand %xmm0, %xmm1 movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero ucomisd %xmm1, %xmm0 jbe .LBB0_7 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jbe .LBB0_6 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq round@PLT cvttsd2si %xmm0, %eax movl $2, %ecx cltd idivl %ecx cmpl $1, %edx jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq round@PLT cvttsd2si %xmm0, %eax movl %eax, -44(%rbp) # 4-byte Spill movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero cvtss2sd %xmm0, %xmm0 callq round@PLT movl -44(%rbp), %eax # 4-byte Reload cvttsd2si %xmm0, %ecx imull %ecx, %eax cltq addq -24(%rbp), %rax movq %rax, -24(%rbp) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_9: 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 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig
problem153/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] str x1, [sp, #16] str x2, [sp, #8] str w3, [sp, #4] str wzr, [sp] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp] ldr w9, [sp, #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 ldur x8, [x29, #-8] ldrsw x9, [sp] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #16] ldrsw x10, [sp] ldr w9, [x9, x10, lsl #2] subs w0, w8, w9 bl _abs ldr x8, [sp, #8] ldrsw x9, [sp] str w0, [x8, x9, lsl #2] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp] add w8, w8, #1 str w8, [sp] b LBB0_1 LBB0_4: 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) movq %rsi, -16(%rbp) movq %rdx, -24(%rbp) movl %ecx, -28(%rbp) movl $0, -32(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -32(%rbp), %eax cmpl -28(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movl (%rax,%rcx,4), %edi movq -16(%rbp), %rax movslq -32(%rbp), %rcx subl (%rax,%rcx,4), %edi callq abs@PLT movl %eax, %edx movq -24(%rbp), %rax movslq -32(%rbp), %rcx movl %edx, (%rax,%rcx,4) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_1 .LBB0_4: 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
problem154/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 w2, [x29, #-20] stur x3, [x29, #-32] mov w8, #-1000 stur w8, [x29, #-36] ; kill: def $x8 killed $xzr str xzr, [sp, #48] str wzr, [sp, #44] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ldr w8, [sp, #44] ldur w9, [x29, #-20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #44] ldr x8, [x8, x9, lsl #3] str x8, [sp, #32] str wzr, [sp, #28] str wzr, [sp, #24] b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #32] ldrsw x9, [sp, #24] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_12 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #32] ldrsw x9, [sp, #24] add x8, x8, x9 ldrb w8, [x8] strb w8, [sp, #23] ldrsb w8, [sp, #23] subs w8, w8, #65 cset w8, lt tbnz w8, #0, LBB0_7 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldrsb w8, [sp, #23] subs w8, w8, #90 cset w8, gt tbnz w8, #0, LBB0_7 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=2 ldrsb w8, [sp, #23] subs w8, w8, #97 cset w8, lt tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=2 ldrsb w8, [sp, #23] subs w8, w8, #122 cset w8, gt tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #28] subs w8, w8, #1 str w8, [sp, #28] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_3 Depth=2 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_3 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] ldur w9, [x29, #-36] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] stur w8, [x29, #-36] ldr x8, [sp, #32] str x8, [sp, #48] b LBB0_14 LBB0_14: ; in Loop: Header=BB0_1 Depth=1 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #44] add w8, w8, #1 str w8, [sp, #44] b LBB0_1 LBB0_16: ldur x0, [x29, #-32] ldur x10, [x29, #-8] ldr x8, [sp, #48] mov x9, sp str x10, [x9] str x8, [x9, #8] mov w1, #0 mov x2, #-1 adrp x3, l_.str@PAGE add x3, x3, l_.str@PAGEOFF bl ___sprintf_chk 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 "%s.%s" .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) movq %rsi, -16(%rbp) movl %edx, -20(%rbp) movq %rcx, -32(%rbp) movl $-1000, -36(%rbp) # imm = 0xFC18 movq $0, -48(%rbp) movl $0, -52(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -52(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_16 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -64(%rbp) movl $0, -68(%rbp) movl $0, -72(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movq -64(%rbp), %rax movslq -72(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_12 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -64(%rbp), %rax movslq -72(%rbp), %rcx movb (%rax,%rcx), %al movb %al, -73(%rbp) movsbl -73(%rbp), %eax cmpl $65, %eax jl .LBB0_7 # %bb.5: # in Loop: Header=BB0_3 Depth=2 movsbl -73(%rbp), %eax cmpl $90, %eax jg .LBB0_7 # %bb.6: # in Loop: Header=BB0_3 Depth=2 movl -68(%rbp), %eax addl $1, %eax movl %eax, -68(%rbp) .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movsbl -73(%rbp), %eax cmpl $97, %eax jl .LBB0_10 # %bb.8: # in Loop: Header=BB0_3 Depth=2 movsbl -73(%rbp), %eax cmpl $122, %eax jg .LBB0_10 # %bb.9: # in Loop: Header=BB0_3 Depth=2 movl -68(%rbp), %eax addl $-1, %eax movl %eax, -68(%rbp) .LBB0_10: # in Loop: Header=BB0_3 Depth=2 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_3 Depth=2 movl -72(%rbp), %eax addl $1, %eax movl %eax, -72(%rbp) jmp .LBB0_3 .LBB0_12: # in Loop: Header=BB0_1 Depth=1 movl -68(%rbp), %eax cmpl -36(%rbp), %eax jle .LBB0_14 # %bb.13: # in Loop: Header=BB0_1 Depth=1 movl -68(%rbp), %eax movl %eax, -36(%rbp) movq -64(%rbp), %rax movq %rax, -48(%rbp) .LBB0_14: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_1 Depth=1 movl -52(%rbp), %eax addl $1, %eax movl %eax, -52(%rbp) jmp .LBB0_1 .LBB0_16: movq -32(%rbp), %rdi movq -8(%rbp), %rdx movq -48(%rbp), %rcx leaq .L.str(%rip), %rsi movb $0, %al callq sprintf@PLT 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 "%s.%s" .size .L.str, 6 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym sprintf
problem155/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] ldr w9, [sp, #32] 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, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #20] ldr w9, [sp, #32] 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 x0, [sp, #24] ldur x8, [x29, #-24] ldrsw x9, [sp, #20] add x1, x8, x9 ldr w8, [sp, #32] ldr w9, [sp, #20] subs w9, w8, w9 ; implicit-def: $x8 mov x8, x9 sxtw x2, w8 mov x3, #-1 str x3, [sp, #8] ; 8-byte Folded Spill bl ___strncpy_chk ldr x3, [sp, #8] ; 8-byte Folded Reload ldr x8, [sp, #24] ldrsw x9, [sp, #32] add x8, x8, x9 ldrsw x9, [sp, #20] subs x0, x8, x9 ldur x1, [x29, #-24] ldrsw x2, [sp, #20] bl ___strncpy_chk ldr x8, [sp, #24] ldrsw x9, [sp, #32] add x8, x8, x9 strb wzr, [x8] ldur x0, [x29, #-16] ldr x1, [sp, #24] bl _strstr subs x8, x0, #0 cset w8, eq tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ldr x0, [sp, #24] bl _free mov w8, #1 and w8, w8, #0x1 and w8, w8, #0x1 sturb w8, [x29, #-1] b LBB0_7 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_1 LBB0_6: ldr x0, [sp, #24] bl _free mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 sturb w8, [x29, #-1] b LBB0_7 LBB0_7: ldurb w8, [x29, #-1] and w0, w8, #0x1 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 %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 -32(%rbp), %eax shll $1, %eax addl $1, %eax movslq %eax, %rdi callq malloc@PLT movq %rax, -40(%rbp) movl $0, -44(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -32(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -40(%rbp), %rdi movq -24(%rbp), %rsi movslq -44(%rbp), %rax addq %rax, %rsi movl -32(%rbp), %eax subl -44(%rbp), %eax movslq %eax, %rdx callq strncpy@PLT movq -40(%rbp), %rdi movslq -32(%rbp), %rax addq %rax, %rdi movslq -44(%rbp), %rcx xorl %eax, %eax # kill: def $rax killed $eax subq %rcx, %rax addq %rax, %rdi movq -24(%rbp), %rsi movslq -44(%rbp), %rdx callq strncpy@PLT movq -40(%rbp), %rax movslq -32(%rbp), %rcx movb $0, (%rax,%rcx) movq -16(%rbp), %rdi movq -40(%rbp), %rsi callq strstr@PLT cmpq $0, %rax je .LBB0_4 # %bb.3: movq -40(%rbp), %rdi callq free@PLT movb $1, -1(%rbp) jmp .LBB0_7 .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: movq -40(%rbp), %rdi callq free@PLT movb $0, -1(%rbp) .LBB0_7: movb -1(%rbp), %al andb $1, %al movzbl %al, %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 malloc .addrsig_sym strncpy .addrsig_sym strstr .addrsig_sym free
problem156/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] str x1, [sp, #16] str wzr, [sp, #12] str wzr, [sp, #8] ldur w0, [x29, #-4] bl _abs stur w0, [x29, #-4] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-4] mov w10, #10 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 str w8, [sp, #4] 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_3 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_4 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 ldur w8, [x29, #-4] mov w9, #10 sdiv w8, w8, w9 stur w8, [x29, #-4] b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-4] subs w8, w8, #0 cset w8, gt tbnz w8, #0, LBB0_1 b LBB0_6 LBB0_6: ldr w8, [sp, #12] ldr x9, [sp, #16] str w8, [x9] ldr w8, [sp, #8] ldr x9, [sp, #16] str w8, [x9, #4] 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) movq %rsi, -16(%rbp) movl $0, -20(%rbp) movl $0, -24(%rbp) movl -4(%rbp), %edi callq abs@PLT movl %eax, -4(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -4(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %edx, -28(%rbp) movl -28(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_3 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %eax addl $1, %eax movl %eax, -20(%rbp) jmp .LBB0_4 .LBB0_3: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movl -4(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %eax, -4(%rbp) # %bb.5: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -4(%rbp) jg .LBB0_1 # %bb.6: movl -20(%rbp), %ecx movq -16(%rbp), %rax movl %ecx, (%rax) movl -24(%rbp), %ecx movq -16(%rbp), %rax movl %ecx, 4(%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 abs
problem157/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, #208 .cfi_def_cfa_offset 208 stp x29, x30, [sp, #192] ; 16-byte Folded Spill add x29, sp, #192 .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 w0, [sp, #24] str x1, [sp, #16] add x0, sp, #80 adrp x1, l___const.func0.rep@PAGE add x1, x1, l___const.func0.rep@PAGEOFF mov x2, #104 bl _memcpy add x0, sp, #28 adrp x1, l___const.func0.num@PAGE add x1, x1, l___const.func0.num@PAGEOFF mov x2, #52 bl _memcpy str wzr, [sp, #12] ldr x8, [sp, #16] strb wzr, [x8] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ldr w8, [sp, #24] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_8 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #24] ldrsw x10, [sp, #12] add x9, sp, #28 ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, lt tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr x0, [sp, #16] ldrsw x9, [sp, #12] add x8, sp, #80 ldr x1, [x8, x9, lsl #3] mov x2, #-1 bl ___strcat_chk ldrsw x9, [sp, #12] add x8, sp, #28 ldr w9, [x8, x9, lsl #2] ldr w8, [sp, #24] subs w8, w8, w9 str w8, [sp, #24] b LBB0_3 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #24] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_7 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_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 b LBB0_1 LBB0_8: 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_10 b LBB0_9 LBB0_9: bl ___stack_chk_fail LBB0_10: ldp x29, x30, [sp, #192] ; 16-byte Folded Reload add sp, sp, #208 ret .cfi_endproc ; -- End function .section __TEXT,__cstring,cstring_literals l_.str: ; @.str .asciz "m" l_.str.1: ; @.str.1 .asciz "cm" l_.str.2: ; @.str.2 .asciz "d" l_.str.3: ; @.str.3 .asciz "cd" l_.str.4: ; @.str.4 .asciz "c" l_.str.5: ; @.str.5 .asciz "xc" l_.str.6: ; @.str.6 .asciz "l" l_.str.7: ; @.str.7 .asciz "xl" l_.str.8: ; @.str.8 .asciz "x" l_.str.9: ; @.str.9 .asciz "ix" l_.str.10: ; @.str.10 .asciz "v" l_.str.11: ; @.str.11 .asciz "iv" l_.str.12: ; @.str.12 .asciz "i" .section __DATA,__const .p2align 3 ; @__const.func0.rep l___const.func0.rep: .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 .quad l_.str.10 .quad l_.str.11 .quad l_.str.12 .section __TEXT,__const .p2align 2 ; @__const.func0.num l___const.func0.num: .long 1000 ; 0x3e8 .long 900 ; 0x384 .long 500 ; 0x1f4 .long 400 ; 0x190 .long 100 ; 0x64 .long 90 ; 0x5a .long 50 ; 0x32 .long 40 ; 0x28 .long 10 ; 0xa .long 9 ; 0x9 .long 5 ; 0x5 .long 4 ; 0x4 .long 1 ; 0x1 .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 $208, %rsp movl %edi, -4(%rbp) movq %rsi, -16(%rbp) leaq -128(%rbp), %rdi leaq .L__const.func0.rep(%rip), %rsi movl $104, %edx callq memcpy@PLT leaq -192(%rbp), %rdi leaq .L__const.func0.num(%rip), %rsi movl $52, %edx callq memcpy@PLT movl $0, -196(%rbp) movq -16(%rbp), %rax movb $0, (%rax) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 cmpl $0, -4(%rbp) jle .LBB0_8 # %bb.2: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_3 .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -4(%rbp), %eax movslq -196(%rbp), %rcx cmpl -192(%rbp,%rcx,4), %eax jl .LBB0_5 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -16(%rbp), %rdi movslq -196(%rbp), %rax movq -128(%rbp,%rax,8), %rsi callq strcat@PLT movslq -196(%rbp), %rax movl -192(%rbp,%rax,4), %ecx movl -4(%rbp), %eax subl %ecx, %eax movl %eax, -4(%rbp) jmp .LBB0_3 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -4(%rbp) jle .LBB0_7 # %bb.6: # in Loop: Header=BB0_1 Depth=1 movl -196(%rbp), %eax addl $1, %eax movl %eax, -196(%rbp) .LBB0_7: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_1 .LBB0_8: addq $208, %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 "m" .size .L.str, 2 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "cm" .size .L.str.1, 3 .type .L.str.2,@object # @.str.2 .L.str.2: .asciz "d" .size .L.str.2, 2 .type .L.str.3,@object # @.str.3 .L.str.3: .asciz "cd" .size .L.str.3, 3 .type .L.str.4,@object # @.str.4 .L.str.4: .asciz "c" .size .L.str.4, 2 .type .L.str.5,@object # @.str.5 .L.str.5: .asciz "xc" .size .L.str.5, 3 .type .L.str.6,@object # @.str.6 .L.str.6: .asciz "l" .size .L.str.6, 2 .type .L.str.7,@object # @.str.7 .L.str.7: .asciz "xl" .size .L.str.7, 3 .type .L.str.8,@object # @.str.8 .L.str.8: .asciz "x" .size .L.str.8, 2 .type .L.str.9,@object # @.str.9 .L.str.9: .asciz "ix" .size .L.str.9, 3 .type .L.str.10,@object # @.str.10 .L.str.10: .asciz "v" .size .L.str.10, 2 .type .L.str.11,@object # @.str.11 .L.str.11: .asciz "iv" .size .L.str.11, 3 .type .L.str.12,@object # @.str.12 .L.str.12: .asciz "i" .size .L.str.12, 2 .type .L__const.func0.rep,@object # @__const.func0.rep .section .data.rel.ro,"aw",@progbits .p2align 4 .L__const.func0.rep: .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 .quad .L.str.10 .quad .L.str.11 .quad .L.str.12 .size .L__const.func0.rep, 104 .type .L__const.func0.num,@object # @__const.func0.num .section .rodata,"a",@progbits .p2align 4 .L__const.func0.num: .long 1000 # 0x3e8 .long 900 # 0x384 .long 500 # 0x1f4 .long 400 # 0x190 .long 100 # 0x64 .long 90 # 0x5a .long 50 # 0x32 .long 40 # 0x28 .long 10 # 0xa .long 9 # 0x9 .long 5 # 0x5 .long 4 # 0x4 .long 1 # 0x1 .size .L__const.func0.num, 52 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strcat
problem158/code.c
.section __TEXT,__text,regular,pure_instructions .build_version macos, 13, 0 sdk_version 13, 3 .section __TEXT,__literal8,8byte_literals .p2align 3 ; -- Begin function func0 lCPI0_0: .quad 0x3f1a36e2eb1c432d ; double 1.0E-4 .section __TEXT,__text,regular,pure_instructions .globl _func0 .p2align 2 _func0: ; @func0 .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str s0, [sp, #8] str s1, [sp, #4] str s2, [sp] ldr s0, [sp, #8] ldr s1, [sp, #8] ldr s2, [sp, #4] ldr s3, [sp, #4] fmul s2, s2, s3 fmadd s2, s0, s1, s2 ldr s0, [sp] ldr s1, [sp] fmsub s0, s0, s1, s2 fcvt d0, s0 fabs d0, d0 adrp x8, lCPI0_0@PAGE ldr d1, [x8, lCPI0_0@PAGEOFF] fcmp d0, d1 cset w8, mi tbnz w8, #0, LBB0_3 b LBB0_1 LBB0_1: ldr s0, [sp, #8] ldr s1, [sp, #8] ldr s2, [sp] ldr s3, [sp] fmul s2, s2, s3 fmadd s2, s0, s1, s2 ldr s0, [sp, #4] ldr s1, [sp, #4] fmsub s0, s0, s1, s2 fcvt d0, s0 fabs d0, d0 adrp x8, lCPI0_0@PAGE ldr d1, [x8, lCPI0_0@PAGEOFF] fcmp d0, d1 cset w8, mi tbnz w8, #0, LBB0_3 b LBB0_2 LBB0_2: ldr s0, [sp, #4] ldr s1, [sp, #4] ldr s2, [sp] ldr s3, [sp] fmul s2, s2, s3 fmadd s2, s0, s1, s2 ldr s0, [sp, #8] ldr s1, [sp, #8] fmsub s0, s0, s1, s2 fcvt d0, s0 fabs d0, d0 adrp x8, lCPI0_0@PAGE ldr d1, [x8, lCPI0_0@PAGEOFF] fcmp d0, d1 cset w8, pl tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: mov w8, #1 str w8, [sp, #12] b LBB0_5 LBB0_4: str wzr, [sp, #12] b LBB0_5 LBB0_5: ldr w0, [sp, #12] add sp, sp, #16 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 0x3f1a36e2eb1c432d # double 1.0E-4 .section .rodata.cst16,"aM",@progbits,16 .p2align 4 .LCPI0_1: .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 movss %xmm0, -8(%rbp) movss %xmm1, -12(%rbp) movss %xmm2, -16(%rbp) movss -8(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero movss -8(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movss -12(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero mulss -12(%rbp), %xmm0 mulss %xmm2, %xmm1 addss %xmm0, %xmm1 movss -16(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movss -16(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movd %xmm0, %eax xorl $2147483648, %eax # imm = 0x80000000 movd %eax, %xmm0 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 cvtss2sd %xmm0, %xmm1 movaps .LCPI0_1(%rip), %xmm0 # xmm0 = [NaN,NaN] pand %xmm0, %xmm1 movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero ucomisd %xmm1, %xmm0 ja .LBB0_3 # %bb.1: movss -8(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero movss -8(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movss -16(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero mulss -16(%rbp), %xmm0 mulss %xmm2, %xmm1 addss %xmm0, %xmm1 movss -12(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movss -12(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movd %xmm0, %eax xorl $2147483648, %eax # imm = 0x80000000 movd %eax, %xmm0 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 cvtss2sd %xmm0, %xmm1 movaps .LCPI0_1(%rip), %xmm0 # xmm0 = [NaN,NaN] pand %xmm0, %xmm1 movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero ucomisd %xmm1, %xmm0 ja .LBB0_3 # %bb.2: movss -12(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero movss -12(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movss -16(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero mulss -16(%rbp), %xmm0 mulss %xmm2, %xmm1 addss %xmm0, %xmm1 movss -8(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movss -8(%rbp), %xmm2 # xmm2 = mem[0],zero,zero,zero movd %xmm0, %eax xorl $2147483648, %eax # imm = 0x80000000 movd %eax, %xmm0 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 cvtss2sd %xmm0, %xmm1 movaps .LCPI0_1(%rip), %xmm0 # xmm0 = [NaN,NaN] pand %xmm0, %xmm1 movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero ucomisd %xmm1, %xmm0 jbe .LBB0_4 .LBB0_3: movl $1, -4(%rbp) jmp .LBB0_5 .LBB0_4: movl $0, -4(%rbp) .LBB0_5: 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
problem159/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, #368 .cfi_def_cfa_offset 368 stp x28, x27, [sp, #336] ; 16-byte Folded Spill stp x29, x30, [sp, #352] ; 16-byte Folded Spill add x29, sp, #352 .cfi_def_cfa w29, 16 .cfi_offset w30, -8 .cfi_offset w29, -16 .cfi_offset w27, -24 .cfi_offset w28, -32 adrp x8, ___stack_chk_guard@GOTPAGE ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF] ldr x8, [x8] stur x8, [x29, #-24] str x0, [sp, #64] str w1, [sp, #60] adrp x8, l_.str@PAGE add x8, x8, l_.str@PAGEOFF str x8, [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 ldr w8, [sp, #40] ldr w9, [sp, #60] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_14 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 add x0, sp, #72 mov w1, #0 mov x2, #256 bl _memset str wzr, [sp, #36] str wzr, [sp, #32] b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #64] ldrsw x9, [sp, #40] ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #32] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #64] ldrsw x9, [sp, #40] ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #32] ldrsb w1, [x8, x9] add x0, sp, #72 bl _strchr subs x8, x0, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 add x0, sp, #72 str x0, [sp, #16] ; 8-byte Folded Spill bl _strlen ldr x8, [sp, #16] ; 8-byte Folded Reload mov x9, x0 str w9, [sp, #28] ldr x9, [sp, #64] ldrsw x10, [sp, #40] ldr x9, [x9, x10, lsl #3] ldrsw x10, [sp, #32] add x9, x9, x10 ldrb w9, [x9] ldrsw x11, [sp, #28] mov x10, x8 add x10, x10, x11 strb w9, [x10] ldr w9, [sp, #28] add w9, w9, #1 add x8, x8, w9, sxtw strb wzr, [x8] ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] 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, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_3 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #36] ldr w9, [sp, #44] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_11 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #36] ldr w9, [sp, #44] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_12 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #64] ldrsw x9, [sp, #40] ldr x0, [x8, x9, lsl #3] ldr x1, [sp, #48] bl _strcmp subs w8, w0, #0 cset w8, ge tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #64] ldrsw x9, [sp, #40] ldr x8, [x8, x9, lsl #3] str x8, [sp, #48] ldr w8, [sp, #36] str w8, [sp, #44] b LBB0_12 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #40] add w8, w8, #1 str w8, [sp, #40] b LBB0_1 LBB0_14: ldr x8, [sp, #48] str x8, [sp, #8] ; 8-byte Folded Spill ldur x9, [x29, #-24] 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_16 b LBB0_15 LBB0_15: bl ___stack_chk_fail LBB0_16: ldr x0, [sp, #8] ; 8-byte Folded Reload ldp x29, x30, [sp, #352] ; 16-byte Folded Reload ldp x28, x27, [sp, #336] ; 16-byte Folded Reload add sp, sp, #368 ret .cfi_endproc ; -- End function .section __TEXT,__cstring,cstring_literals l_.str: ; @.str .space 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 $304, %rsp # imm = 0x130 movq %rdi, -8(%rbp) movl %esi, -12(%rbp) leaq .L.str(%rip), %rax movq %rax, -24(%rbp) movl $0, -28(%rbp) movl $0, -32(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -32(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_14 # %bb.2: # in Loop: Header=BB0_1 Depth=1 leaq -288(%rbp), %rdi xorl %esi, %esi movl $256, %edx # imm = 0x100 callq memset@PLT movl $0, -292(%rbp) movl $0, -296(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -296(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 leaq -288(%rbp), %rdi movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -296(%rbp), %rcx movsbl (%rax,%rcx), %esi callq strchr@PLT cmpq $0, %rax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=2 leaq -288(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -300(%rbp) movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movslq -296(%rbp), %rcx movb (%rax,%rcx), %cl movslq -300(%rbp), %rax movb %cl, -288(%rbp,%rax) movl -300(%rbp), %eax addl $1, %eax cltq movb $0, -288(%rbp,%rax) movl -292(%rbp), %eax addl $1, %eax movl %eax, -292(%rbp) .LBB0_6: # in Loop: Header=BB0_3 Depth=2 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movl -296(%rbp), %eax addl $1, %eax movl %eax, -296(%rbp) jmp .LBB0_3 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movl -292(%rbp), %eax cmpl -28(%rbp), %eax jg .LBB0_11 # %bb.9: # in Loop: Header=BB0_1 Depth=1 movl -292(%rbp), %eax cmpl -28(%rbp), %eax jne .LBB0_12 # %bb.10: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rdi movq -24(%rbp), %rsi callq strcmp@PLT cmpl $0, %eax jge .LBB0_12 .LBB0_11: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -24(%rbp) movl -292(%rbp), %eax movl %eax, -28(%rbp) .LBB0_12: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_13 .LBB0_13: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_1 .LBB0_14: movq -24(%rbp), %rax addq $304, %rsp # imm = 0x130 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 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strchr .addrsig_sym strlen .addrsig_sym strcmp
problem16/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 w0, [x29, #-12] mov w8, #2 stur w8, [x29, #-16] mov w8, #1 stur w8, [x29, #-20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldur w8, [x29, #-20] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur w9, [x29, #-20] ; implicit-def: $x8 mov x8, x9 mov x9, sp str x8, [x9] mov x0, #0 mov x1, #0 mov w2, #0 mov x3, #-1 adrp x4, l_.str@PAGE add x4, x4, l_.str@PAGEOFF bl ___snprintf_chk ldur w8, [x29, #-16] add w8, w8, w0 stur w8, [x29, #-16] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-20] add w8, w8, #1 stur w8, [x29, #-20] b LBB0_1 LBB0_4: ldursw x0, [x29, #-16] bl _malloc str x0, [sp, #32] ldr x8, [sp, #32] subs x8, x8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; kill: def $x8 killed $xzr stur xzr, [x29, #-8] b LBB0_11 LBB0_6: ldr x8, [sp, #32] str x8, [sp, #24] ldr x0, [sp, #24] mov w1, #0 mov x2, #-1 adrp x3, l_.str.1@PAGE add x3, x3, l_.str.1@PAGEOFF bl ___sprintf_chk ldr x8, [sp, #24] add x8, x8, w0, sxtw str x8, [sp, #24] mov w8, #1 str w8, [sp, #20] b LBB0_7 LBB0_7: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #20] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=1 ldr x0, [sp, #24] ldr w9, [sp, #20] ; implicit-def: $x8 mov x8, x9 mov x9, sp str x8, [x9] mov w1, #0 mov x2, #-1 adrp x3, l_.str@PAGE add x3, x3, l_.str@PAGEOFF bl ___sprintf_chk ldr x8, [sp, #24] add x8, x8, w0, sxtw str x8, [sp, #24] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_7 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_7 LBB0_10: ldr x8, [sp, #32] stur x8, [x29, #-8] b LBB0_11 LBB0_11: ldur x0, [x29, #-8] 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 " %d" l_.str.1: ; @.str.1 .asciz "0" .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 $2, -16(%rbp) movl $1, -20(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -20(%rbp), %eax cmpl -12(%rbp), %eax jg .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -20(%rbp), %ecx xorl %eax, %eax movl %eax, %esi leaq .L.str(%rip), %rdx movq %rsi, %rdi movb $0, %al callq snprintf@PLT addl -16(%rbp), %eax movl %eax, -16(%rbp) # %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: movslq -16(%rbp), %rdi callq malloc@PLT movq %rax, -32(%rbp) cmpq $0, -32(%rbp) jne .LBB0_6 # %bb.5: movq $0, -8(%rbp) jmp .LBB0_11 .LBB0_6: movq -32(%rbp), %rax movq %rax, -40(%rbp) movq -40(%rbp), %rdi leaq .L.str.1(%rip), %rsi movb $0, %al callq sprintf@PLT movl %eax, %ecx movq -40(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -40(%rbp) movl $1, -44(%rbp) .LBB0_7: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -12(%rbp), %eax jg .LBB0_10 # %bb.8: # in Loop: Header=BB0_7 Depth=1 movq -40(%rbp), %rdi movl -44(%rbp), %edx leaq .L.str(%rip), %rsi movb $0, %al callq sprintf@PLT movl %eax, %ecx movq -40(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -40(%rbp) # %bb.9: # in Loop: Header=BB0_7 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_7 .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 .type .L.str,@object # @.str .section .rodata.str1.1,"aMS",@progbits,1 .L.str: .asciz " %d" .size .L.str, 4 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "0" .size .L.str.1, 2 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym snprintf .addrsig_sym malloc .addrsig_sym sprintf
problem160/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 w0, [sp, #28] str w1, [sp, #24] str w2, [sp, #20] str x3, [sp, #8] ldr w8, [sp, #24] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr w8, [sp, #28] ldr w9, [sp, #20] add w8, w8, w9 ldr x9, [sp, #8] str w8, [x9] ldr x8, [sp, #8] str wzr, [x8, #4] b LBB0_3 LBB0_2: ldr w8, [sp, #28] ldr w9, [sp, #24] add w8, w8, w9 ldr x9, [sp, #8] str w8, [x9] ldr w8, [sp, #20] ldr w9, [sp, #24] subs w8, w8, w9 ldr x9, [sp, #8] str w8, [x9, #4] b LBB0_3 LBB0_3: 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 movl %edi, -4(%rbp) movl %esi, -8(%rbp) movl %edx, -12(%rbp) movq %rcx, -24(%rbp) movl -8(%rbp), %eax cmpl -12(%rbp), %eax jle .LBB0_2 # %bb.1: movl -4(%rbp), %ecx addl -12(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movq -24(%rbp), %rax movl $0, 4(%rax) jmp .LBB0_3 .LBB0_2: movl -4(%rbp), %ecx addl -8(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movl -12(%rbp), %ecx subl -8(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, 4(%rax) .LBB0_3: 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
problem161/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 x1, [x29, #-16] stur w2, [x29, #-20] stur w3, [x29, #-24] ldursw x8, [x29, #-24] lsl x0, x8, #2 bl _malloc str x0, [sp, #32] ldursw x8, [x29, #-24] lsl x0, x8, #2 bl _malloc str x0, [sp, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #20] ldur w9, [x29, #-24] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #20] str w8, [x9, x10, lsl #2] ldr w8, [sp, #20] ldr x9, [sp, #24] ldrsw x10, [sp, #20] str w8, [x9, x10, lsl #2] 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_1 LBB0_4: str wzr, [sp, #16] b LBB0_5 LBB0_5: ; =>This Loop Header: Depth=1 ; Child Loop BB0_8 Depth 2 ; Child Loop BB0_11 Depth 2 ldr w8, [sp, #16] ldur w9, [x29, #-20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #16] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str@PAGE add x1, x1, l_.str@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_14 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_5 Depth=1 b LBB0_8 LBB0_8: ; Parent Loop BB0_5 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #16] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #16] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_8 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #16] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #16] str w8, [x9, x10, lsl #2] b LBB0_8 LBB0_10: ; in Loop: Header=BB0_5 Depth=1 b LBB0_11 LBB0_11: ; Parent Loop BB0_5 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_13 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_11 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_11 LBB0_13: ; in Loop: Header=BB0_5 Depth=1 ldr x8, [sp, #32] ldr x9, [sp, #24] ldrsw x10, [sp, #16] ldrsw x9, [x9, x10, lsl #2] ldr s1, [x8, x9, lsl #2] ; implicit-def: $d0 fmov s0, s1 sshll.2d v0, v0, #0 ; kill: def $d0 killed $d0 killed $q0 scvtf d0, d0 ldr x8, [sp, #32] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr s2, [x8, x9, lsl #2] ; implicit-def: $d1 fmov s1, s2 sshll.2d v1, v1, #0 ; kill: def $d1 killed $d1 killed $q1 scvtf d1, d1 bl _pow fcvtzs w8, d0 ldr x9, [sp, #32] ldr x10, [sp, #24] ldrsw x11, [sp, #16] ldrsw x10, [x10, x11, lsl #2] str w8, [x9, x10, lsl #2] ldr x8, [sp, #24] ldrsw x9, [sp, #16] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #16] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_14 LBB0_14: ; in Loop: Header=BB0_5 Depth=1 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_5 LBB0_16: str wzr, [sp, #12] b LBB0_17 LBB0_17: ; =>This Loop Header: Depth=1 ; Child Loop BB0_21 Depth 2 ; Child Loop BB0_24 Depth 2 ldr w8, [sp, #12] ldur w9, [x29, #-20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_32 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_17 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.1@PAGE add x1, x1, l_.str.1@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_20 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_17 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.2@PAGE add x1, x1, l_.str.2@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_30 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_17 Depth=1 b LBB0_21 LBB0_21: ; Parent Loop BB0_17 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_23 b LBB0_22 LBB0_22: ; in Loop: Header=BB0_21 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #12] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #12] str w8, [x9, x10, lsl #2] b LBB0_21 LBB0_23: ; in Loop: Header=BB0_17 Depth=1 b LBB0_24 LBB0_24: ; Parent Loop BB0_17 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_26 b LBB0_25 LBB0_25: ; in Loop: Header=BB0_24 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_24 LBB0_26: ; in Loop: Header=BB0_17 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.1@PAGE add x1, x1, l_.str.1@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_28 b LBB0_27 LBB0_27: ; in Loop: Header=BB0_17 Depth=1 ldr x8, [sp, #32] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w10, [x8, x9, lsl #2] ldr x8, [sp, #32] ldr x9, [sp, #24] ldrsw x11, [sp, #12] ldrsw x9, [x9, x11, lsl #2] add x9, x8, x9, lsl #2 ldr w8, [x9] mul w8, w8, w10 str w8, [x9] b LBB0_29 LBB0_28: ; in Loop: Header=BB0_17 Depth=1 ldr x8, [sp, #32] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w10, [x8, x9, lsl #2] ldr x8, [sp, #32] ldr x9, [sp, #24] ldrsw x11, [sp, #12] ldrsw x9, [x9, x11, lsl #2] add x9, x8, x9, lsl #2 ldr w8, [x9] sdiv w8, w8, w10 str w8, [x9] b LBB0_29 LBB0_29: ; in Loop: Header=BB0_17 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #12] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_30 LBB0_30: ; in Loop: Header=BB0_17 Depth=1 b LBB0_31 LBB0_31: ; in Loop: Header=BB0_17 Depth=1 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_17 LBB0_32: str wzr, [sp, #8] b LBB0_33 LBB0_33: ; =>This Loop Header: Depth=1 ; Child Loop BB0_37 Depth 2 ; Child Loop BB0_40 Depth 2 ldr w8, [sp, #8] ldur w9, [x29, #-20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_48 b LBB0_34 LBB0_34: ; in Loop: Header=BB0_33 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #8] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.3@PAGE add x1, x1, l_.str.3@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_36 b LBB0_35 LBB0_35: ; in Loop: Header=BB0_33 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #8] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.4@PAGE add x1, x1, l_.str.4@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_46 b LBB0_36 LBB0_36: ; in Loop: Header=BB0_33 Depth=1 b LBB0_37 LBB0_37: ; Parent Loop BB0_33 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #8] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #8] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_39 b LBB0_38 LBB0_38: ; in Loop: Header=BB0_37 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldrsw x10, [sp, #8] ldrsw x9, [x9, x10, lsl #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldrsw x10, [sp, #8] str w8, [x9, x10, lsl #2] b LBB0_37 LBB0_39: ; in Loop: Header=BB0_33 Depth=1 b LBB0_40 LBB0_40: ; Parent Loop BB0_33 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 ldr w9, [x9, w10, sxtw #2] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_42 b LBB0_41 LBB0_41: ; in Loop: Header=BB0_40 Depth=2 ldr x8, [sp, #24] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_40 LBB0_42: ; in Loop: Header=BB0_33 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #8] ldr x0, [x8, x9, lsl #3] adrp x1, l_.str.3@PAGE add x1, x1, l_.str.3@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_44 b LBB0_43 LBB0_43: ; in Loop: Header=BB0_33 Depth=1 ldr x8, [sp, #32] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w10, [x8, x9, lsl #2] ldr x8, [sp, #32] ldr x9, [sp, #24] ldrsw x11, [sp, #8] ldrsw x9, [x9, x11, lsl #2] add x9, x8, x9, lsl #2 ldr w8, [x9] add w8, w8, w10 str w8, [x9] b LBB0_45 LBB0_44: ; in Loop: Header=BB0_33 Depth=1 ldr x8, [sp, #32] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 ldrsw x9, [x9, w10, sxtw #2] ldr w10, [x8, x9, lsl #2] ldr x8, [sp, #32] ldr x9, [sp, #24] ldrsw x11, [sp, #8] ldrsw x9, [x9, x11, lsl #2] add x9, x8, x9, lsl #2 ldr w8, [x9] subs w8, w8, w10 str w8, [x9] b LBB0_45 LBB0_45: ; in Loop: Header=BB0_33 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #8] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #24] ldr w10, [sp, #8] add w10, w10, #1 str w8, [x9, w10, sxtw #2] b LBB0_46 LBB0_46: ; in Loop: Header=BB0_33 Depth=1 b LBB0_47 LBB0_47: ; in Loop: Header=BB0_33 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_33 LBB0_48: ldr x8, [sp, #32] ldr w8, [x8] str w8, [sp, #4] ldr x0, [sp, #32] bl _free ldr x0, [sp, #24] bl _free ldr w0, [sp, #4] 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 "**" l_.str.1: ; @.str.1 .asciz "*" l_.str.2: ; @.str.2 .asciz "//" l_.str.3: ; @.str.3 .asciz "+" l_.str.4: ; @.str.4 .asciz "-" .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) movq %rsi, -16(%rbp) movl %edx, -20(%rbp) movl %ecx, -24(%rbp) movslq -24(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movslq -24(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -40(%rbp) movl $0, -44(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -24(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movslq -44(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -44(%rbp), %edx movq -40(%rbp), %rax movslq -44(%rbp), %rcx movl %edx, (%rax,%rcx,4) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_1 .LBB0_4: movl $0, -48(%rbp) .LBB0_5: # =>This Loop Header: Depth=1 # Child Loop BB0_8 Depth 2 # Child Loop BB0_11 Depth 2 movl -48(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_16 # %bb.6: # in Loop: Header=BB0_5 Depth=1 movq -8(%rbp), %rax movslq -48(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_14 # %bb.7: # in Loop: Header=BB0_5 Depth=1 jmp .LBB0_8 .LBB0_8: # Parent Loop BB0_5 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -48(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movslq -48(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_10 # %bb.9: # in Loop: Header=BB0_8 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -48(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movslq -48(%rbp), %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_8 .LBB0_10: # in Loop: Header=BB0_5 Depth=1 jmp .LBB0_11 .LBB0_11: # Parent Loop BB0_5 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -48(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movl -48(%rbp), %edx addl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_13 # %bb.12: # in Loop: Header=BB0_11 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -48(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -48(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_11 .LBB0_13: # in Loop: Header=BB0_5 Depth=1 movq -32(%rbp), %rax movq -40(%rbp), %rcx movslq -48(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx cvtsi2sdl (%rax,%rcx,4), %xmm0 movq -32(%rbp), %rax movq -40(%rbp), %rcx movl -48(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx cvtsi2sdl (%rax,%rcx,4), %xmm1 callq pow@PLT cvttsd2si %xmm0, %edx movq -32(%rbp), %rax movq -40(%rbp), %rcx movslq -48(%rbp), %rsi movslq (%rcx,%rsi,4), %rcx movl %edx, (%rax,%rcx,4) movq -40(%rbp), %rax movslq -48(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -48(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_14: # in Loop: Header=BB0_5 Depth=1 jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_5 Depth=1 movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_5 .LBB0_16: movl $0, -52(%rbp) .LBB0_17: # =>This Loop Header: Depth=1 # Child Loop BB0_21 Depth 2 # Child Loop BB0_24 Depth 2 movl -52(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_32 # %bb.18: # in Loop: Header=BB0_17 Depth=1 movq -8(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.1(%rip), %rsi callq strcmp@PLT cmpl $0, %eax je .LBB0_20 # %bb.19: # in Loop: Header=BB0_17 Depth=1 movq -8(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.2(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_30 .LBB0_20: # in Loop: Header=BB0_17 Depth=1 jmp .LBB0_21 .LBB0_21: # Parent Loop BB0_17 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -52(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movslq -52(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_23 # %bb.22: # in Loop: Header=BB0_21 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -52(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movslq -52(%rbp), %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_21 .LBB0_23: # in Loop: Header=BB0_17 Depth=1 jmp .LBB0_24 .LBB0_24: # Parent Loop BB0_17 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -52(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movl -52(%rbp), %edx addl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_26 # %bb.25: # in Loop: Header=BB0_24 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -52(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -52(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_24 .LBB0_26: # in Loop: Header=BB0_17 Depth=1 movq -8(%rbp), %rax movslq -52(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.1(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_28 # %bb.27: # in Loop: Header=BB0_17 Depth=1 movq -32(%rbp), %rax movq -40(%rbp), %rcx movl -52(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movq -40(%rbp), %rcx movslq -52(%rbp), %rsi movslq (%rcx,%rsi,4), %rcx imull (%rax,%rcx,4), %edx movl %edx, (%rax,%rcx,4) jmp .LBB0_29 .LBB0_28: # in Loop: Header=BB0_17 Depth=1 movq -32(%rbp), %rax movq -40(%rbp), %rcx movl -52(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %esi movq -32(%rbp), %rax movq %rax, -72(%rbp) # 8-byte Spill movq -40(%rbp), %rcx movslq -52(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax cltd idivl %esi movl %eax, %edx movq -72(%rbp), %rax # 8-byte Reload movl %edx, (%rax,%rcx,4) .LBB0_29: # in Loop: Header=BB0_17 Depth=1 movq -40(%rbp), %rax movslq -52(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -52(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_30: # in Loop: Header=BB0_17 Depth=1 jmp .LBB0_31 .LBB0_31: # in Loop: Header=BB0_17 Depth=1 movl -52(%rbp), %eax addl $1, %eax movl %eax, -52(%rbp) jmp .LBB0_17 .LBB0_32: movl $0, -56(%rbp) .LBB0_33: # =>This Loop Header: Depth=1 # Child Loop BB0_37 Depth 2 # Child Loop BB0_40 Depth 2 movl -56(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_48 # %bb.34: # in Loop: Header=BB0_33 Depth=1 movq -8(%rbp), %rax movslq -56(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.3(%rip), %rsi callq strcmp@PLT cmpl $0, %eax je .LBB0_36 # %bb.35: # in Loop: Header=BB0_33 Depth=1 movq -8(%rbp), %rax movslq -56(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.4(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_46 .LBB0_36: # in Loop: Header=BB0_33 Depth=1 jmp .LBB0_37 .LBB0_37: # Parent Loop BB0_33 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -56(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movslq -56(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_39 # %bb.38: # in Loop: Header=BB0_37 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movslq -56(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movslq -56(%rbp), %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_37 .LBB0_39: # in Loop: Header=BB0_33 Depth=1 jmp .LBB0_40 .LBB0_40: # Parent Loop BB0_33 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -56(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %eax movq -40(%rbp), %rcx movl -56(%rbp), %edx addl $1, %edx movslq %edx, %rdx cmpl (%rcx,%rdx,4), %eax je .LBB0_42 # %bb.41: # in Loop: Header=BB0_40 Depth=2 movq -40(%rbp), %rax movq -40(%rbp), %rcx movl -56(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -56(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_40 .LBB0_42: # in Loop: Header=BB0_33 Depth=1 movq -8(%rbp), %rax movslq -56(%rbp), %rcx movq (%rax,%rcx,8), %rdi leaq .L.str.3(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_44 # %bb.43: # in Loop: Header=BB0_33 Depth=1 movq -32(%rbp), %rax movq -40(%rbp), %rcx movl -56(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movq -40(%rbp), %rcx movslq -56(%rbp), %rsi movslq (%rcx,%rsi,4), %rcx addl (%rax,%rcx,4), %edx movl %edx, (%rax,%rcx,4) jmp .LBB0_45 .LBB0_44: # in Loop: Header=BB0_33 Depth=1 movq -32(%rbp), %rax movq -40(%rbp), %rcx movl -56(%rbp), %edx addl $1, %edx movslq %edx, %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %esi movq -32(%rbp), %rax movq -40(%rbp), %rcx movslq -56(%rbp), %rdx movslq (%rcx,%rdx,4), %rcx movl (%rax,%rcx,4), %edx subl %esi, %edx movl %edx, (%rax,%rcx,4) .LBB0_45: # in Loop: Header=BB0_33 Depth=1 movq -40(%rbp), %rax movslq -56(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -40(%rbp), %rax movl -56(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_46: # in Loop: Header=BB0_33 Depth=1 jmp .LBB0_47 .LBB0_47: # in Loop: Header=BB0_33 Depth=1 movl -56(%rbp), %eax addl $1, %eax movl %eax, -56(%rbp) jmp .LBB0_33 .LBB0_48: movq -32(%rbp), %rax movl (%rax), %eax movl %eax, -60(%rbp) movq -32(%rbp), %rdi callq free@PLT movq -40(%rbp), %rdi callq free@PLT movl -60(%rbp), %eax 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 "**" .size .L.str, 3 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "*" .size .L.str.1, 2 .type .L.str.2,@object # @.str.2 .L.str.2: .asciz "//" .size .L.str.2, 3 .type .L.str.3,@object # @.str.3 .L.str.3: .asciz "+" .size .L.str.3, 2 .type .L.str.4,@object # @.str.4 .L.str.4: .asciz "-" .size .L.str.4, 2 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym malloc .addrsig_sym strcmp .addrsig_sym pow .addrsig_sym free
problem162/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 wzr, [x29, #-12] ldur x0, [x29, #-8] bl _strlen mov x8, x0 str w8, [sp, #16] str wzr, [sp, #12] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #12] ldr w9, [sp, #16] 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] ldrb w0, [x8, x9] bl _isalpha subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_9 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrb w0, [x8, x9] bl _isupper subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrb w0, [x8, x9] bl _tolower ldur x8, [x29, #-8] ldrsw x9, [sp, #12] strb w0, [x8, x9] b LBB0_8 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrb w0, [x8, x9] bl _islower subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_7 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldrb w0, [x8, x9] bl _toupper ldur x8, [x29, #-8] ldrsw x9, [sp, #12] strb w0, [x8, x9] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 b LBB0_10 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-12] add w8, w8, #1 stur w8, [x29, #-12] 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: ldur w8, [x29, #-12] ldr w9, [sp, #16] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_18 b LBB0_13 LBB0_13: str wzr, [sp, #8] b LBB0_14 LBB0_14: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #16] mov w10, #2 sdiv w9, w9, w10 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_17 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_14 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #8] add x8, x8, x9 ldrb w8, [x8] strb w8, [sp, #7] ldur x8, [x29, #-8] ldr w9, [sp, #16] ldr w10, [sp, #8] subs w9, w9, w10 subs w9, w9, #1 add x8, x8, w9, sxtw ldrb w8, [x8] ldur x9, [x29, #-8] ldrsw x10, [sp, #8] add x9, x9, x10 strb w8, [x9] ldrb w8, [sp, #7] ldur x9, [x29, #-8] ldr w10, [sp, #16] ldr w11, [sp, #8] subs w10, w10, w11 subs w10, w10, #1 add x9, x9, w10, sxtw strb w8, [x9] b LBB0_16 LBB0_16: ; in Loop: Header=BB0_14 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_14 LBB0_17: b LBB0_18 LBB0_18: ldur x0, [x29, #-8] 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 $0, -12(%rbp) movq -8(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -16(%rbp) movl $0, -20(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -20(%rbp), %eax cmpl -16(%rbp), %eax jge .LBB0_12 # %bb.2: # in Loop: Header=BB0_1 Depth=1 callq __ctype_b_loc@PLT movq (%rax), %rax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx movzbl (%rcx,%rdx), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $1024, %eax # imm = 0x400 cmpl $0, %eax je .LBB0_9 # %bb.3: # in Loop: Header=BB0_1 Depth=1 callq __ctype_b_loc@PLT movq (%rax), %rax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx movzbl (%rcx,%rdx), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $256, %eax # imm = 0x100 cmpl $0, %eax je .LBB0_5 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movzbl (%rax,%rcx), %edi callq tolower@PLT movb %al, %dl movq -8(%rbp), %rax movslq -20(%rbp), %rcx movb %dl, (%rax,%rcx) jmp .LBB0_8 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 callq __ctype_b_loc@PLT movq (%rax), %rax movq -8(%rbp), %rcx movslq -20(%rbp), %rdx movzbl (%rcx,%rdx), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $512, %eax # imm = 0x200 cmpl $0, %eax je .LBB0_7 # %bb.6: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movzbl (%rax,%rcx), %edi callq toupper@PLT movb %al, %dl movq -8(%rbp), %rax movslq -20(%rbp), %rcx movb %dl, (%rax,%rcx) .LBB0_7: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_10 .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax addl $1, %eax movl %eax, -12(%rbp) .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 -12(%rbp), %eax cmpl -16(%rbp), %eax jne .LBB0_18 # %bb.13: movl $0, -24(%rbp) .LBB0_14: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax movl %eax, -32(%rbp) # 4-byte Spill movl -16(%rbp), %eax movl $2, %ecx cltd idivl %ecx movl %eax, %ecx movl -32(%rbp), %eax # 4-byte Reload cmpl %ecx, %eax jge .LBB0_17 # %bb.15: # in Loop: Header=BB0_14 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movb (%rax,%rcx), %al movb %al, -25(%rbp) movq -8(%rbp), %rax movl -16(%rbp), %ecx subl -24(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movb (%rax,%rcx), %dl movq -8(%rbp), %rax movslq -24(%rbp), %rcx movb %dl, (%rax,%rcx) movb -25(%rbp), %dl movq -8(%rbp), %rax movl -16(%rbp), %ecx subl -24(%rbp), %ecx subl $1, %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) # %bb.16: # in Loop: Header=BB0_14 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_14 .LBB0_17: jmp .LBB0_18 .LBB0_18: movq -8(%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 strlen .addrsig_sym __ctype_b_loc .addrsig_sym tolower .addrsig_sym toupper
problem163/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 w0, [sp, #28] str w1, [sp, #24] str x2, [sp, #16] str x3, [sp, #8] ldr x8, [sp, #8] str wzr, [x8] ldr w8, [sp, #24] ldr w9, [sp, #28] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr w8, [sp, #28] str w8, [sp, #4] ldr w8, [sp, #24] str w8, [sp, #28] ldr w8, [sp, #4] str w8, [sp, #24] b LBB0_2 LBB0_2: ldr w8, [sp, #28] str w8, [sp] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_9 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] subs w8, w8, #10 cset w8, ge tbnz w8, #0, LBB0_7 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] 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_7 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] ldr x9, [sp, #16] ldr x12, [sp, #8] ldrsw x10, [x12] mov x11, x10 add w11, w11, #1 str w11, [x12] str w8, [x9, x10, lsl #2] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] add w8, w8, #1 str w8, [sp] b LBB0_3 LBB0_9: 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 movl %edi, -4(%rbp) movl %esi, -8(%rbp) movq %rdx, -16(%rbp) movq %rcx, -24(%rbp) movq -24(%rbp), %rax movl $0, (%rax) movl -8(%rbp), %eax cmpl -4(%rbp), %eax jge .LBB0_2 # %bb.1: movl -4(%rbp), %eax movl %eax, -28(%rbp) movl -8(%rbp), %eax movl %eax, -4(%rbp) movl -28(%rbp), %eax movl %eax, -8(%rbp) .LBB0_2: movl -4(%rbp), %eax movl %eax, -32(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -32(%rbp), %eax cmpl -8(%rbp), %eax jg .LBB0_9 # %bb.4: # in Loop: Header=BB0_3 Depth=1 cmpl $10, -32(%rbp) jge .LBB0_7 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl -32(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_7 # %bb.6: # in Loop: Header=BB0_3 Depth=1 movl -32(%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) .LBB0_7: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_3 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_3 .LBB0_9: 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
problem164/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 w0, [sp, #28] str w1, [sp, #24] str x2, [sp, #16] str x3, [sp, #8] ldr x8, [sp, #8] str wzr, [x8] ldr w8, [sp, #24] ldr w9, [sp, #28] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr w8, [sp, #28] str w8, [sp, #4] ldr w8, [sp, #24] str w8, [sp, #28] ldr w8, [sp, #4] str w8, [sp, #24] b LBB0_2 LBB0_2: ldr w8, [sp, #28] str w8, [sp] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_9 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] subs w8, w8, #10 cset w8, ge tbnz w8, #0, LBB0_7 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] 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_7 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] ldr x9, [sp, #16] ldr x12, [sp, #8] ldrsw x10, [x12] mov x11, x10 add w11, w11, #1 str w11, [x12] str w8, [x9, x10, lsl #2] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp] add w8, w8, #1 str w8, [sp] b LBB0_3 LBB0_9: 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 movl %edi, -4(%rbp) movl %esi, -8(%rbp) movq %rdx, -16(%rbp) movq %rcx, -24(%rbp) movq -24(%rbp), %rax movl $0, (%rax) movl -8(%rbp), %eax cmpl -4(%rbp), %eax jge .LBB0_2 # %bb.1: movl -4(%rbp), %eax movl %eax, -28(%rbp) movl -8(%rbp), %eax movl %eax, -4(%rbp) movl -28(%rbp), %eax movl %eax, -8(%rbp) .LBB0_2: movl -4(%rbp), %eax movl %eax, -32(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -32(%rbp), %eax cmpl -8(%rbp), %eax jg .LBB0_9 # %bb.4: # in Loop: Header=BB0_3 Depth=1 cmpl $10, -32(%rbp) jge .LBB0_7 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl -32(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_7 # %bb.6: # in Loop: Header=BB0_3 Depth=1 movl -32(%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) .LBB0_7: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_3 Depth=1 movl -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_3 .LBB0_9: 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
problem17/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: stp x28, x27, [sp, #-32]! ; 16-byte Folded Spill .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29, sp, #16 .cfi_def_cfa w29, 16 .cfi_offset w30, -8 .cfi_offset w29, -16 .cfi_offset w27, -24 .cfi_offset w28, -32 sub sp, sp, #1056 adrp x8, ___stack_chk_guard@GOTPAGE ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF] ldr x8, [x8] stur x8, [x29, #-24] str x0, [sp, #16] str wzr, [sp, #12] add x0, sp, #24 mov x1, #1024 bl _bzero str wzr, [sp, #8] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #8] add x8, x8, x9 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] ldrsw x9, [sp, #8] ldrb w0, [x8, x9] bl _tolower strb w0, [sp, #7] ldrsb x9, [sp, #7] add x8, sp, #24 ldr w8, [x8, x9, lsl #2] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_5 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldrb w0, [sp, #7] bl _isalpha subs w8, w0, #0 cset w8, eq tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldrsb x10, [sp, #7] add x9, sp, #24 mov w8, #1 str w8, [x9, x10, lsl #2] ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] 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, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_1 LBB0_7: ldr w8, [sp, #12] str w8, [sp] ; 4-byte Folded Spill ldur x9, [x29, #-24] 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_9 b LBB0_8 LBB0_8: bl ___stack_chk_fail LBB0_9: ldr w0, [sp] ; 4-byte Folded Reload add sp, sp, #1056 ldp x29, x30, [sp, #16] ; 16-byte Folded Reload ldp x28, x27, [sp], #32 ; 16-byte Folded Reload 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 $1056, %rsp # imm = 0x420 movq %rdi, -8(%rbp) movl $0, -12(%rbp) leaq -1040(%rbp), %rdi xorl %esi, %esi movl $1024, %edx # imm = 0x400 callq memset@PLT movl $0, -1044(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movq -8(%rbp), %rax movslq -1044(%rbp), %rcx cmpb $0, (%rax,%rcx) je .LBB0_7 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -1044(%rbp), %rcx movzbl (%rax,%rcx), %edi callq tolower@PLT # kill: def $al killed $al killed $eax movb %al, -1045(%rbp) movsbq -1045(%rbp), %rax cmpl $0, -1040(%rbp,%rax,4) jne .LBB0_5 # %bb.3: # in Loop: Header=BB0_1 Depth=1 callq __ctype_b_loc@PLT movq (%rax), %rax movzbl -1045(%rbp), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %eax andl $1024, %eax # imm = 0x400 cmpl $0, %eax je .LBB0_5 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movsbq -1045(%rbp), %rax movl $1, -1040(%rbp,%rax,4) movl -12(%rbp), %eax addl $1, %eax movl %eax, -12(%rbp) .LBB0_5: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_6 .LBB0_6: # in Loop: Header=BB0_1 Depth=1 movl -1044(%rbp), %eax addl $1, %eax movl %eax, -1044(%rbp) jmp .LBB0_1 .LBB0_7: movl -12(%rbp), %eax addq $1056, %rsp # imm = 0x420 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 tolower .addrsig_sym __ctype_b_loc
problem18/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] ; kill: def $x8 killed $xzr stur xzr, [x29, #-24] stur wzr, [x29, #-28] stur wzr, [x29, #-32] sturh wzr, [x29, #-36] sturb wzr, [x29, #-34] ldur x0, [x29, #-8] bl _strlen add x8, x0, #1 ; kill: def $w8 killed $w8 killed $x8 stur w8, [x29, #-40] ldur w8, [x29, #-40] add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x0, w8 bl _malloc str x0, [sp, #48] ldr x0, [sp, #48] ldur x1, [x29, #-8] mov x2, #-1 str x2, [sp, #24] ; 8-byte Folded Spill bl ___strcpy_chk ldr x2, [sp, #24] ; 8-byte Folded Reload ldr x0, [sp, #48] adrp x1, l_.str@PAGE add x1, x1, l_.str@PAGEOFF bl ___strcat_chk str wzr, [sp, #44] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #44] ldur w9, [x29, #-40] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_30 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #44] ldrsb w8, [x8, x9] subs w8, w8, #32 cset w8, ne tbnz w8, #0, LBB0_25 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 sub x0, x29, #36 adrp x1, l_.str.1@PAGE add x1, x1, l_.str.1@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-28] ldur w9, [x29, #-32] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_9 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-32] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_7 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur w9, [x29, #-32] mov w8, #2 mul w8, w8, w9 str w8, [sp, #20] ; 4-byte Folded Spill b LBB0_8 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 mov w8, #4 str w8, [sp, #20] ; 4-byte Folded Spill b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] ; 4-byte Folded Reload stur w8, [x29, #-32] ldur x0, [x29, #-24] ldursw x8, [x29, #-32] lsl x1, x8, #2 bl _realloc stur x0, [x29, #-24] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur x9, [x29, #-24] ldursw x10, [x29, #-28] mov x8, x10 add w8, w8, #1 stur w8, [x29, #-28] mov w8, #4 str w8, [x9, x10, lsl #2] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 sub x0, x29, #36 adrp x1, l_.str.2@PAGE add x1, x1, l_.str.2@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_17 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-28] ldur w9, [x29, #-32] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_16 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-32] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldur w9, [x29, #-32] mov w8, #2 mul w8, w8, w9 str w8, [sp, #16] ; 4-byte Folded Spill b LBB0_15 LBB0_14: ; in Loop: Header=BB0_1 Depth=1 mov w8, #4 str w8, [sp, #16] ; 4-byte Folded Spill b LBB0_15 LBB0_15: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #16] ; 4-byte Folded Reload stur w8, [x29, #-32] ldur x0, [x29, #-24] ldursw x8, [x29, #-32] lsl x1, x8, #2 bl _realloc stur x0, [x29, #-24] b LBB0_16 LBB0_16: ; in Loop: Header=BB0_1 Depth=1 ldur x9, [x29, #-24] ldursw x10, [x29, #-28] mov x8, x10 add w8, w8, #1 stur w8, [x29, #-28] mov w8, #2 str w8, [x9, x10, lsl #2] b LBB0_17 LBB0_17: ; in Loop: Header=BB0_1 Depth=1 sub x0, x29, #36 adrp x1, l_.str.3@PAGE add x1, x1, l_.str.3@PAGEOFF bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_24 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-28] ldur w9, [x29, #-32] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_23 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-32] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_21 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_1 Depth=1 ldur w9, [x29, #-32] mov w8, #2 mul w8, w8, w9 str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_22 LBB0_21: ; in Loop: Header=BB0_1 Depth=1 mov w8, #4 str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_22 LBB0_22: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] ; 4-byte Folded Reload stur w8, [x29, #-32] ldur x0, [x29, #-24] ldursw x8, [x29, #-32] lsl x1, x8, #2 bl _realloc stur x0, [x29, #-24] b LBB0_23 LBB0_23: ; in Loop: Header=BB0_1 Depth=1 ldur x9, [x29, #-24] ldursw x10, [x29, #-28] mov x11, x10 mov w8, #1 add w11, w11, #1 stur w11, [x29, #-28] str w8, [x9, x10, lsl #2] b LBB0_24 LBB0_24: ; in Loop: Header=BB0_1 Depth=1 sub x0, x29, #36 adrp x1, l_.str.4@PAGE add x1, x1, l_.str.4@PAGEOFF mov x2, #3 bl ___strcpy_chk b LBB0_28 LBB0_25: ; in Loop: Header=BB0_1 Depth=1 sub x0, x29, #36 bl _strlen str x0, [sp, #32] ldr x8, [sp, #32] subs x8, x8, #2 cset w8, hs tbnz w8, #0, LBB0_27 b LBB0_26 LBB0_26: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #48] ldrsw x9, [sp, #44] add x8, x8, x9 ldrb w9, [x8] ldr x11, [sp, #32] sub x8, x29, #36 mov x10, x8 add x10, x10, x11 strb w9, [x10] ldr x9, [sp, #32] add x9, x9, #1 add x8, x8, x9 strb wzr, [x8] b LBB0_27 LBB0_27: ; in Loop: Header=BB0_1 Depth=1 b LBB0_28 LBB0_28: ; in Loop: Header=BB0_1 Depth=1 b LBB0_29 LBB0_29: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #44] add w8, w8, #1 str w8, [sp, #44] b LBB0_1 LBB0_30: ldr x0, [sp, #48] bl _free ldur w8, [x29, #-28] ldur x9, [x29, #-16] str w8, [x9] ldur x0, [x29, #-24] 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 " " l_.str.1: ; @.str.1 .asciz "o" l_.str.2: ; @.str.2 .asciz "o|" l_.str.3: ; @.str.3 .asciz ".|" l_.str.4: ; @.str.4 .space 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 $80, %rsp movq %rdi, -8(%rbp) movq %rsi, -16(%rbp) movq $0, -24(%rbp) movl $0, -28(%rbp) movl $0, -32(%rbp) leaq -35(%rbp), %rdi xorl %esi, %esi movl $3, %edx callq memset@PLT movq -8(%rbp), %rdi callq strlen@PLT addq $1, %rax # kill: def $eax killed $eax killed $rax movl %eax, -40(%rbp) movl -40(%rbp), %eax addl $1, %eax movslq %eax, %rdi callq malloc@PLT movq %rax, -48(%rbp) movq -48(%rbp), %rdi movq -8(%rbp), %rsi callq strcpy@PLT movq -48(%rbp), %rdi leaq .L.str(%rip), %rsi callq strcat@PLT movl $0, -52(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -52(%rbp), %eax cmpl -40(%rbp), %eax jge .LBB0_30 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -48(%rbp), %rax movslq -52(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $32, %eax jne .LBB0_25 # %bb.3: # in Loop: Header=BB0_1 Depth=1 leaq -35(%rbp), %rdi leaq .L.str.1(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_10 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax cmpl -32(%rbp), %eax jne .LBB0_9 # %bb.5: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -32(%rbp) jle .LBB0_7 # %bb.6: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax shll $1, %eax movl %eax, -68(%rbp) # 4-byte Spill jmp .LBB0_8 .LBB0_7: # in Loop: Header=BB0_1 Depth=1 movl $4, %eax movl %eax, -68(%rbp) # 4-byte Spill jmp .LBB0_8 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movl -68(%rbp), %eax # 4-byte Reload movl %eax, -32(%rbp) movq -24(%rbp), %rdi movslq -32(%rbp), %rsi shlq $2, %rsi callq realloc@PLT movq %rax, -24(%rbp) .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movq -24(%rbp), %rax movl -28(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -28(%rbp) movslq %ecx, %rcx movl $4, (%rax,%rcx,4) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 leaq -35(%rbp), %rdi leaq .L.str.2(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_17 # %bb.11: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax cmpl -32(%rbp), %eax jne .LBB0_16 # %bb.12: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -32(%rbp) jle .LBB0_14 # %bb.13: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax shll $1, %eax movl %eax, -72(%rbp) # 4-byte Spill jmp .LBB0_15 .LBB0_14: # in Loop: Header=BB0_1 Depth=1 movl $4, %eax movl %eax, -72(%rbp) # 4-byte Spill jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_1 Depth=1 movl -72(%rbp), %eax # 4-byte Reload movl %eax, -32(%rbp) movq -24(%rbp), %rdi movslq -32(%rbp), %rsi shlq $2, %rsi callq realloc@PLT movq %rax, -24(%rbp) .LBB0_16: # in Loop: Header=BB0_1 Depth=1 movq -24(%rbp), %rax movl -28(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -28(%rbp) movslq %ecx, %rcx movl $2, (%rax,%rcx,4) .LBB0_17: # in Loop: Header=BB0_1 Depth=1 leaq -35(%rbp), %rdi leaq .L.str.3(%rip), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_24 # %bb.18: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax cmpl -32(%rbp), %eax jne .LBB0_23 # %bb.19: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -32(%rbp) jle .LBB0_21 # %bb.20: # in Loop: Header=BB0_1 Depth=1 movl -32(%rbp), %eax shll $1, %eax movl %eax, -76(%rbp) # 4-byte Spill jmp .LBB0_22 .LBB0_21: # in Loop: Header=BB0_1 Depth=1 movl $4, %eax movl %eax, -76(%rbp) # 4-byte Spill jmp .LBB0_22 .LBB0_22: # in Loop: Header=BB0_1 Depth=1 movl -76(%rbp), %eax # 4-byte Reload movl %eax, -32(%rbp) movq -24(%rbp), %rdi movslq -32(%rbp), %rsi shlq $2, %rsi callq realloc@PLT movq %rax, -24(%rbp) .LBB0_23: # in Loop: Header=BB0_1 Depth=1 movq -24(%rbp), %rax movl -28(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -28(%rbp) movslq %ecx, %rcx movl $1, (%rax,%rcx,4) .LBB0_24: # in Loop: Header=BB0_1 Depth=1 leaq -35(%rbp), %rdi leaq .L.str.4(%rip), %rsi callq strcpy@PLT jmp .LBB0_28 .LBB0_25: # in Loop: Header=BB0_1 Depth=1 leaq -35(%rbp), %rdi callq strlen@PLT movq %rax, -64(%rbp) cmpq $2, -64(%rbp) jae .LBB0_27 # %bb.26: # in Loop: Header=BB0_1 Depth=1 movq -48(%rbp), %rax movslq -52(%rbp), %rcx movb (%rax,%rcx), %cl movq -64(%rbp), %rax movb %cl, -35(%rbp,%rax) movq -64(%rbp), %rax movb $0, -34(%rbp,%rax) .LBB0_27: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_28 .LBB0_28: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_29 .LBB0_29: # in Loop: Header=BB0_1 Depth=1 movl -52(%rbp), %eax addl $1, %eax movl %eax, -52(%rbp) jmp .LBB0_1 .LBB0_30: movq -48(%rbp), %rdi callq free@PLT movl -28(%rbp), %ecx movq -16(%rbp), %rax movl %ecx, (%rax) movq -24(%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 " " .size .L.str, 2 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "o" .size .L.str.1, 2 .type .L.str.2,@object # @.str.2 .L.str.2: .asciz "o|" .size .L.str.2, 3 .type .L.str.3,@object # @.str.3 .L.str.3: .asciz ".|" .size .L.str.3, 3 .type .L.str.4,@object # @.str.4 .L.str.4: .zero 1 .size .L.str.4, 1 .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 strcat .addrsig_sym strcmp .addrsig_sym realloc .addrsig_sym free
problem19/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] ldr w8, [sp, #16] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: stur wzr, [x29, #-4] b LBB0_9 LBB0_2: str wzr, [sp, #8] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #16] ldr w10, [sp, #12] subs w9, w9, w10 subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #8] add x0, x8, x9 ldr x1, [sp, #24] ldrsw x2, [sp, #12] bl _strncmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] 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, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_3 LBB0_8: ldr w8, [sp, #20] stur w8, [x29, #-4] b LBB0_9 LBB0_9: ldur w0, [x29, #-4] 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 %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) cmpl $0, -32(%rbp) jne .LBB0_2 # %bb.1: movl $0, -4(%rbp) jmp .LBB0_9 .LBB0_2: movl $0, -40(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movl -40(%rbp), %eax movl -32(%rbp), %ecx subl -36(%rbp), %ecx cmpl %ecx, %eax jg .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rdi movslq -40(%rbp), %rax addq %rax, %rdi movq -24(%rbp), %rsi movslq -36(%rbp), %rdx callq strncmp@PLT cmpl $0, %eax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) .LBB0_6: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=1 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_3 .LBB0_8: movl -28(%rbp), %eax movl %eax, -4(%rbp) .LBB0_9: 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 strncmp
problem2/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 s0, [sp, #12] ldr s0, [sp, #12] ldr s1, [sp, #12] fcvtzs s1, s1 scvtf s1, s1 fsub s0, s0, s1 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 movss %xmm0, -4(%rbp) movss -4(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero cvttss2si -4(%rbp), %eax cvtsi2ss %eax, %xmm1 subss %xmm1, %xmm0 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
problem20/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, #40] sub x0, x29, #48 mov w1, #0 mov x2, #40 bl _memset add x0, sp, #48 adrp x1, l___const.func0.numto@PAGE add x1, x1, l___const.func0.numto@PAGEOFF mov x2, #80 bl _memcpy str wzr, [sp, #36] ldr x8, [sp, #40] ldrb w8, [x8] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_17 b LBB0_1 LBB0_1: b LBB0_2 LBB0_2: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ; Child Loop BB0_9 Depth 2 str wzr, [sp, #32] b LBB0_3 LBB0_3: ; Parent Loop BB0_2 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #40] ldrsw x9, [sp, #32] ldrsb w8, [x8, x9] subs w8, w8, #32 cset w8, eq mov w9, #0 str w9, [sp, #12] ; 4-byte Folded Spill tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #40] ldrsw x9, [sp, #32] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, ne str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #12] ; 4-byte Folded Reload tbz w8, #0, LBB0_8 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #40] ldrsw x9, [sp, #32] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #32] add x9, sp, #18 add x9, x9, x10 strb w8, [x9] 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_3 LBB0_8: ; in Loop: Header=BB0_2 Depth=1 ldrsw x9, [sp, #32] add x8, sp, #18 add x8, x8, x9 strb wzr, [x8] str wzr, [sp, #28] b LBB0_9 LBB0_9: ; Parent Loop BB0_2 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #28] subs w8, w8, #10 cset w8, ge tbnz w8, #0, LBB0_14 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_9 Depth=2 ldrsw x9, [sp, #28] add x8, sp, #48 ldr x1, [x8, x9, lsl #3] add x0, sp, #18 bl _strcmp subs w8, w0, #0 cset w8, ne tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_2 Depth=1 ldrsw x9, [sp, #28] sub x8, x29, #48 add x9, x8, x9, lsl #2 ldr w8, [x9] add w8, w8, #1 str w8, [x9] b LBB0_14 LBB0_12: ; in Loop: Header=BB0_9 Depth=2 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_9 Depth=2 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_9 LBB0_14: ; in Loop: Header=BB0_2 Depth=1 ldr w8, [sp, #32] add w9, w8, #1 ldr x8, [sp, #40] add x8, x8, w9, sxtw str x8, [sp, #40] b LBB0_15 LBB0_15: ; in Loop: Header=BB0_2 Depth=1 ldr x8, [sp, #40] subs x8, x8, #1 ldrb w8, [x8] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_16 LBB0_16: b LBB0_17 LBB0_17: str wzr, [sp, #32] b LBB0_18 LBB0_18: ; =>This Loop Header: Depth=1 ; Child Loop BB0_20 Depth 2 ; Child Loop BB0_22 Depth 3 ldr w8, [sp, #32] subs w8, w8, #10 cset w8, ge tbnz w8, #0, LBB0_29 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_18 Depth=1 str wzr, [sp, #28] b LBB0_20 LBB0_20: ; Parent Loop BB0_18 Depth=1 ; => This Loop Header: Depth=2 ; Child Loop BB0_22 Depth 3 ldr w8, [sp, #28] ldrsw x10, [sp, #32] sub x9, x29, #48 ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_27 b LBB0_21 LBB0_21: ; in Loop: Header=BB0_20 Depth=2 str wzr, [sp, #24] b LBB0_22 LBB0_22: ; Parent Loop BB0_18 Depth=1 ; Parent Loop BB0_20 Depth=2 ; => This Inner Loop Header: Depth=3 ldrsw x9, [sp, #32] add x8, sp, #48 ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #24] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_25 b LBB0_23 LBB0_23: ; in Loop: Header=BB0_22 Depth=3 ldrsw x9, [sp, #32] add x8, sp, #48 ldr x8, [x8, x9, lsl #3] ldrsw x9, [sp, #24] add x8, x8, x9 ldrb w8, [x8] ldrsw x10, [sp, #36] adrp x9, _func0.out@PAGE add x9, x9, _func0.out@PAGEOFF add x9, x9, x10 strb w8, [x9] b LBB0_24 LBB0_24: ; in Loop: Header=BB0_22 Depth=3 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_22 LBB0_25: ; in Loop: Header=BB0_20 Depth=2 ldrsw x9, [sp, #36] mov x8, x9 add w8, w8, #1 str w8, [sp, #36] adrp x8, _func0.out@PAGE add x8, x8, _func0.out@PAGEOFF add x9, x8, x9 mov w8, #32 strb w8, [x9] b LBB0_26 LBB0_26: ; in Loop: Header=BB0_20 Depth=2 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_20 LBB0_27: ; in Loop: Header=BB0_18 Depth=1 b LBB0_28 LBB0_28: ; in Loop: Header=BB0_18 Depth=1 ldr w8, [sp, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_18 LBB0_29: ldr w8, [sp, #36] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_31 b LBB0_30 LBB0_30: ldr w8, [sp, #36] subs w9, w8, #1 adrp x8, _func0.out@PAGE add x8, x8, _func0.out@PAGEOFF add x8, x8, w9, sxtw strb wzr, [x8] b LBB0_32 LBB0_31: adrp x8, _func0.out@PAGE strb wzr, [x8, _func0.out@PAGEOFF] b LBB0_32 LBB0_32: 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_34 b LBB0_33 LBB0_33: bl ___stack_chk_fail LBB0_34: adrp x0, _func0.out@PAGE add x0, x0, _func0.out@PAGEOFF ldp x29, x30, [sp, #176] ; 16-byte Folded Reload add sp, sp, #192 ret .cfi_endproc ; -- End function .section __TEXT,__cstring,cstring_literals l_.str: ; @.str .asciz "zero" 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.numto l___const.func0.numto: .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 .zerofill __DATA,__bss,_func0.out,1000,0 ; @func0.out .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 $160, %rsp movq %rdi, -8(%rbp) leaq -48(%rbp), %rdi xorl %esi, %esi movl $40, %edx callq memset@PLT leaq -128(%rbp), %rdi leaq .L__const.func0.numto(%rip), %rsi movl $80, %edx callq memcpy@PLT movl $0, -132(%rbp) movq -8(%rbp), %rax cmpb $0, (%rax) je .LBB0_17 # %bb.1: jmp .LBB0_2 .LBB0_2: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 # Child Loop BB0_9 Depth 2 movl $0, -136(%rbp) .LBB0_3: # Parent Loop BB0_2 Depth=1 # => This Inner Loop Header: Depth=2 movq -8(%rbp), %rax movslq -136(%rbp), %rcx movsbl (%rax,%rcx), %ecx xorl %eax, %eax # kill: def $al killed $al killed $eax cmpl $32, %ecx movb %al, -151(%rbp) # 1-byte Spill je .LBB0_5 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -8(%rbp), %rax movslq -136(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax setne %al movb %al, -151(%rbp) # 1-byte Spill .LBB0_5: # in Loop: Header=BB0_3 Depth=2 movb -151(%rbp), %al # 1-byte Reload testb $1, %al jne .LBB0_6 jmp .LBB0_8 .LBB0_6: # in Loop: Header=BB0_3 Depth=2 movq -8(%rbp), %rax movslq -136(%rbp), %rcx movb (%rax,%rcx), %cl movslq -136(%rbp), %rax movb %cl, -150(%rbp,%rax) # %bb.7: # in Loop: Header=BB0_3 Depth=2 movl -136(%rbp), %eax addl $1, %eax movl %eax, -136(%rbp) jmp .LBB0_3 .LBB0_8: # in Loop: Header=BB0_2 Depth=1 movslq -136(%rbp), %rax movb $0, -150(%rbp,%rax) movl $0, -140(%rbp) .LBB0_9: # Parent Loop BB0_2 Depth=1 # => This Inner Loop Header: Depth=2 cmpl $10, -140(%rbp) jge .LBB0_14 # %bb.10: # in Loop: Header=BB0_9 Depth=2 leaq -150(%rbp), %rdi movslq -140(%rbp), %rax movq -128(%rbp,%rax,8), %rsi callq strcmp@PLT cmpl $0, %eax jne .LBB0_12 # %bb.11: # in Loop: Header=BB0_2 Depth=1 movslq -140(%rbp), %rax movl -48(%rbp,%rax,4), %ecx addl $1, %ecx movl %ecx, -48(%rbp,%rax,4) jmp .LBB0_14 .LBB0_12: # in Loop: Header=BB0_9 Depth=2 jmp .LBB0_13 .LBB0_13: # in Loop: Header=BB0_9 Depth=2 movl -140(%rbp), %eax addl $1, %eax movl %eax, -140(%rbp) jmp .LBB0_9 .LBB0_14: # in Loop: Header=BB0_2 Depth=1 movl -136(%rbp), %ecx addl $1, %ecx movq -8(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -8(%rbp) # %bb.15: # in Loop: Header=BB0_2 Depth=1 movq -8(%rbp), %rax cmpb $0, -1(%rax) jne .LBB0_2 # %bb.16: jmp .LBB0_17 .LBB0_17: movl $0, -136(%rbp) .LBB0_18: # =>This Loop Header: Depth=1 # Child Loop BB0_20 Depth 2 # Child Loop BB0_22 Depth 3 cmpl $10, -136(%rbp) jge .LBB0_29 # %bb.19: # in Loop: Header=BB0_18 Depth=1 movl $0, -140(%rbp) .LBB0_20: # Parent Loop BB0_18 Depth=1 # => This Loop Header: Depth=2 # Child Loop BB0_22 Depth 3 movl -140(%rbp), %eax movslq -136(%rbp), %rcx cmpl -48(%rbp,%rcx,4), %eax jge .LBB0_27 # %bb.21: # in Loop: Header=BB0_20 Depth=2 movl $0, -144(%rbp) .LBB0_22: # Parent Loop BB0_18 Depth=1 # Parent Loop BB0_20 Depth=2 # => This Inner Loop Header: Depth=3 movslq -136(%rbp), %rax movq -128(%rbp,%rax,8), %rax movslq -144(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_25 # %bb.23: # in Loop: Header=BB0_22 Depth=3 movslq -136(%rbp), %rax movq -128(%rbp,%rax,8), %rax movslq -144(%rbp), %rcx movb (%rax,%rcx), %dl movslq -132(%rbp), %rcx leaq func0.out(%rip), %rax movb %dl, (%rax,%rcx) # %bb.24: # in Loop: Header=BB0_22 Depth=3 movl -144(%rbp), %eax addl $1, %eax movl %eax, -144(%rbp) movl -132(%rbp), %eax addl $1, %eax movl %eax, -132(%rbp) jmp .LBB0_22 .LBB0_25: # in Loop: Header=BB0_20 Depth=2 movl -132(%rbp), %eax movl %eax, %ecx addl $1, %ecx movl %ecx, -132(%rbp) movslq %eax, %rcx leaq func0.out(%rip), %rax movb $32, (%rax,%rcx) # %bb.26: # in Loop: Header=BB0_20 Depth=2 movl -140(%rbp), %eax addl $1, %eax movl %eax, -140(%rbp) jmp .LBB0_20 .LBB0_27: # in Loop: Header=BB0_18 Depth=1 jmp .LBB0_28 .LBB0_28: # in Loop: Header=BB0_18 Depth=1 movl -136(%rbp), %eax addl $1, %eax movl %eax, -136(%rbp) jmp .LBB0_18 .LBB0_29: cmpl $0, -132(%rbp) jle .LBB0_31 # %bb.30: movl -132(%rbp), %eax subl $1, %eax movslq %eax, %rcx leaq func0.out(%rip), %rax movb $0, (%rax,%rcx) jmp .LBB0_32 .LBB0_31: movb $0, func0.out(%rip) .LBB0_32: leaq func0.out(%rip), %rax addq $160, %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 "zero" .size .L.str, 5 .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.numto,@object # @__const.func0.numto .section .data.rel.ro,"aw",@progbits .p2align 4 .L__const.func0.numto: .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.numto, 80 .type func0.out,@object # @func0.out .local func0.out .comm func0.out,1000,16 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym strcmp .addrsig_sym func0.out
problem21/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 x2, [sp, #24] mov w8, #2139095039 fmov s0, w8 str s0, [sp, #20] ldr x8, [sp, #40] ldr s0, [x8] ldr x8, [sp, #24] str s0, [x8] ldr x8, [sp, #40] ldr s0, [x8, #4] ldr x8, [sp, #24] str s0, [x8, #4] str wzr, [sp, #16] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ldr w8, [sp, #16] 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 ldr w8, [sp, #16] add w8, w8, #1 str w8, [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, #36] 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 s0, [x8, x9, lsl #2] ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr s1, [x8, x9, lsl #2] fsub s0, s0, s1 fcvt d0, s0 fabs d0, d0 fcvt s0, d0 str s0, [sp, #8] ldr s0, [sp, #8] ldr s1, [sp, #20] fcmp s0, s1 cset w8, pl tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldr s0, [sp, #8] str s0, [sp, #20] ldr x8, [sp, #40] ldrsw x9, [sp, #16] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #24] str s0, [x8] ldr x8, [sp, #40] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #24] str s0, [x8, #4] 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, #12] add w8, w8, #1 str w8, [sp, #12] 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, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_1 LBB0_10: ldr x8, [sp, #24] ldr s0, [x8] ldr x8, [sp, #24] ldr s1, [x8, #4] fcmp s0, s1 cset w8, le tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: ldr x8, [sp, #24] ldr s0, [x8] str s0, [sp, #4] ldr x8, [sp, #24] ldr s0, [x8, #4] ldr x8, [sp, #24] str s0, [x8] ldr s0, [sp, #4] ldr x8, [sp, #24] str s0, [x8, #4] b LBB0_12 LBB0_12: add sp, sp, #48 ret .cfi_endproc ; -- End function .subsections_via_symbols
.text .file "code.c" .section .rodata.cst4,"aM",@progbits,4 .p2align 2 # -- Begin function func0 .LCPI0_0: .long 0x7f7fffff # float 3.40282347E+38 .section .rodata.cst16,"aM",@progbits,16 .p2align 4 .LCPI0_1: .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, -8(%rbp) movl %esi, -12(%rbp) movq %rdx, -24(%rbp) movss .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -28(%rbp) movq -8(%rbp), %rax movss (%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, (%rax) movq -8(%rbp), %rax movss 4(%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, 4(%rax) movl $0, -32(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -32(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_10 # %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 Inner Loop Header: Depth=2 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -8(%rbp), %rax movslq -32(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -8(%rbp), %rax movslq -36(%rbp), %rcx subss (%rax,%rcx,4), %xmm0 cvtss2sd %xmm0, %xmm0 movaps .LCPI0_1(%rip), %xmm1 # xmm1 = [NaN,NaN] pand %xmm1, %xmm0 cvtsd2ss %xmm0, %xmm0 movss %xmm0, -40(%rbp) movss -40(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero movss -28(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero ucomiss %xmm1, %xmm0 jbe .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=2 movss -40(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -28(%rbp) movq -8(%rbp), %rax movslq -32(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, (%rax) movq -8(%rbp), %rax movslq -36(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, 4(%rax) .LBB0_6: # in Loop: Header=BB0_3 Depth=2 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%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 -32(%rbp), %eax addl $1, %eax movl %eax, -32(%rbp) jmp .LBB0_1 .LBB0_10: movq -24(%rbp), %rax movss (%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax ucomiss 4(%rax), %xmm0 jbe .LBB0_12 # %bb.11: movq -24(%rbp), %rax movss (%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -44(%rbp) movq -24(%rbp), %rax movss 4(%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, (%rax) movss -44(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movss %xmm0, 4(%rax) .LBB0_12: 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
problem22/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] ldr x8, [sp, #24] ldr s0, [x8] str s0, [sp, #16] ldr x8, [sp, #24] ldr s0, [x8] str s0, [sp, #12] mov w8, #1 str w8, [sp, #8] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] ldr s1, [sp, #16] fcmp s0, s1 cset w8, pl tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] str s0, [sp, #16] b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] ldr s1, [sp, #12] fcmp s0, s1 cset w8, le tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] str s0, [sp, #12] b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_1 LBB0_8: str wzr, [sp, #4] b LBB0_9 LBB0_9: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_12 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_9 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #4] ldr s0, [x8, x9, lsl #2] ldr s1, [sp, #16] fsub s0, s0, s1 ldr s1, [sp, #12] ldr s2, [sp, #16] fsub s1, s1, s2 fdiv s0, s0, s1 ldr x8, [sp, #24] ldrsw x9, [sp, #4] str s0, [x8, x9, lsl #2] b LBB0_11 LBB0_11: ; in Loop: Header=BB0_9 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_9 LBB0_12: 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) movq -8(%rbp), %rax movss (%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -16(%rbp) movq -8(%rbp), %rax movss (%rax), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -20(%rbp) movl $1, -24(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_8 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movss (%rax,%rcx,4), %xmm1 # xmm1 = mem[0],zero,zero,zero movss -16(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero ucomiss %xmm1, %xmm0 jbe .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -16(%rbp) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero ucomiss -20(%rbp), %xmm0 jbe .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -20(%rbp) .LBB0_6: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_1 .LBB0_8: movl $0, -28(%rbp) .LBB0_9: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_12 # %bb.10: # in Loop: Header=BB0_9 Depth=1 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero subss -16(%rbp), %xmm0 movss -20(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero subss -16(%rbp), %xmm1 divss %xmm1, %xmm0 movq -8(%rbp), %rax movslq -28(%rbp), %rcx movss %xmm0, (%rax,%rcx,4) # %bb.11: # in Loop: Header=BB0_9 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_9 .LBB0_12: 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
problem23/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 x1, [x29, #-16] stur wzr, [x29, #-20] ldur x8, [x29, #-8] str x8, [sp, #32] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ; Child Loop BB0_15 Depth 2 ldr x8, [sp, #32] ldrb w8, [x8] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_21 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 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 mov w9, #0 str w9, [sp, #16] ; 4-byte Folded Spill tbnz w8, #0, LBB0_6 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #32] ldrsb w0, [x8] bl _isdigit subs w8, w0, #0 cset w8, ne mov w9, #0 str w9, [sp, #16] ; 4-byte Folded Spill tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #32] ldrsb w8, [x8] subs w8, w8, #45 cset w8, ne str w8, [sp, #16] ; 4-byte Folded Spill b LBB0_6 LBB0_6: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #16] ; 4-byte Folded Reload tbz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=2 ldr x8, [sp, #32] add x8, x8, #1 str x8, [sp, #32] b LBB0_3 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #32] ldrb w8, [x8] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: b LBB0_21 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldr x0, [sp, #32] add x1, sp, #24 mov w2, #10 bl _strtol mov x8, x0 str w8, [sp, #20] ldr x8, [sp, #32] ldr x9, [sp, #24] subs x8, x8, x9 cset w8, eq tbnz w8, #0, LBB0_14 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsb w8, [x8] subs w8, w8, #44 cset w8, eq tbnz w8, #0, LBB0_13 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsb w8, [x8] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] ldursw x10, [x29, #-20] mov x9, x10 add w9, w9, #1 stur w9, [x29, #-20] adrp x9, _func0.out@PAGE add x9, x9, _func0.out@PAGEOFF str w8, [x9, x10, lsl #2] b LBB0_20 LBB0_14: ; in Loop: Header=BB0_1 Depth=1 b LBB0_15 LBB0_15: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr x8, [sp, #24] ldrsb w8, [x8] subs w8, w8, #0 cset w8, eq mov w9, #0 str w9, [sp, #12] ; 4-byte Folded Spill tbnz w8, #0, LBB0_17 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_15 Depth=2 ldr x8, [sp, #24] ldrsb w8, [x8] subs w8, w8, #44 cset w8, ne str w8, [sp, #12] ; 4-byte Folded Spill b LBB0_17 LBB0_17: ; in Loop: Header=BB0_15 Depth=2 ldr w8, [sp, #12] ; 4-byte Folded Reload tbz w8, #0, LBB0_19 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_15 Depth=2 ldr x8, [sp, #24] add x8, x8, #1 str x8, [sp, #24] b LBB0_15 LBB0_19: ; in Loop: Header=BB0_1 Depth=1 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] str x8, [sp, #32] b LBB0_1 LBB0_21: ldur w8, [x29, #-20] ldur x9, [x29, #-16] str w8, [x9] adrp x0, _func0.out@PAGE add x0, x0, _func0.out@PAGEOFF ldp x29, x30, [sp, #64] ; 16-byte Folded Reload add sp, sp, #80 ret .cfi_endproc ; -- End function .zerofill __DATA,__bss,_func0.out,1024,2 ; @func0.out .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) movq %rsi, -16(%rbp) movl $0, -20(%rbp) movq -8(%rbp), %rax movq %rax, -32(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 # Child Loop BB0_15 Depth 2 movq -32(%rbp), %rax cmpb $0, (%rax) je .LBB0_21 # %bb.2: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_3 .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movq -32(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax # kill: def $al killed $al killed $eax cmpl $0, %ecx movb %al, -45(%rbp) # 1-byte Spill je .LBB0_6 # %bb.4: # in Loop: Header=BB0_3 Depth=2 callq __ctype_b_loc@PLT movq (%rax), %rax movq -32(%rbp), %rcx movsbl (%rcx), %ecx movslq %ecx, %rcx movzwl (%rax,%rcx,2), %ecx andl $2048, %ecx # imm = 0x800 xorl %eax, %eax # kill: def $al killed $al killed $eax cmpl $0, %ecx movb %al, -45(%rbp) # 1-byte Spill jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_3 Depth=2 movq -32(%rbp), %rax movsbl (%rax), %eax cmpl $45, %eax setne %al movb %al, -45(%rbp) # 1-byte Spill .LBB0_6: # in Loop: Header=BB0_3 Depth=2 movb -45(%rbp), %al # 1-byte Reload testb $1, %al jne .LBB0_7 jmp .LBB0_8 .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movq -32(%rbp), %rax addq $1, %rax movq %rax, -32(%rbp) jmp .LBB0_3 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movq -32(%rbp), %rax cmpb $0, (%rax) jne .LBB0_10 # %bb.9: jmp .LBB0_21 .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movq -32(%rbp), %rdi leaq -40(%rbp), %rsi movl $10, %edx callq strtol@PLT # kill: def $eax killed $eax killed $rax movl %eax, -44(%rbp) movq -32(%rbp), %rax cmpq -40(%rbp), %rax je .LBB0_14 # %bb.11: # in Loop: Header=BB0_1 Depth=1 movq -40(%rbp), %rax movsbl (%rax), %eax cmpl $44, %eax je .LBB0_13 # %bb.12: # in Loop: Header=BB0_1 Depth=1 movq -40(%rbp), %rax movsbl (%rax), %eax cmpl $0, %eax jne .LBB0_14 .LBB0_13: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %edx movl -20(%rbp), %eax movl %eax, %ecx addl $1, %ecx movl %ecx, -20(%rbp) movslq %eax, %rcx leaq func0.out(%rip), %rax movl %edx, (%rax,%rcx,4) jmp .LBB0_20 .LBB0_14: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_15 .LBB0_15: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movq -40(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax # kill: def $al killed $al killed $eax cmpl $0, %ecx movb %al, -46(%rbp) # 1-byte Spill je .LBB0_17 # %bb.16: # in Loop: Header=BB0_15 Depth=2 movq -40(%rbp), %rax movsbl (%rax), %eax cmpl $44, %eax setne %al movb %al, -46(%rbp) # 1-byte Spill .LBB0_17: # in Loop: Header=BB0_15 Depth=2 movb -46(%rbp), %al # 1-byte Reload testb $1, %al jne .LBB0_18 jmp .LBB0_19 .LBB0_18: # in Loop: Header=BB0_15 Depth=2 movq -40(%rbp), %rax addq $1, %rax movq %rax, -40(%rbp) jmp .LBB0_15 .LBB0_19: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_20 .LBB0_20: # in Loop: Header=BB0_1 Depth=1 movq -40(%rbp), %rax movq %rax, -32(%rbp) jmp .LBB0_1 .LBB0_21: movl -20(%rbp), %ecx movq -16(%rbp), %rax movl %ecx, (%rax) leaq func0.out(%rip), %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,1024,16 .ident "Ubuntu clang version 14.0.0-1ubuntu1.1" .section ".note.GNU-stack","",@progbits .addrsig .addrsig_sym __ctype_b_loc .addrsig_sym strtol .addrsig_sym func0.out
problem24/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 x0, [sp, #8] str wzr, [sp, #4] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #8] ldrsw x9, [sp, #4] ldrsb w8, [x8, x9] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_3 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_1 LBB0_3: ldr w0, [sp, #4] 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 movq %rdi, -8(%rbp) movl $0, -12(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movq -8(%rbp), %rax movslq -12(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0, %eax je .LBB0_3 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax addl $1, %eax movl %eax, -12(%rbp) jmp .LBB0_1 .LBB0_3: movl -12(%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
problem25/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] mov w8, #2 str w8, [sp, #4] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldr w9, [sp, #4] mul w8, w8, w9 ldr w9, [sp, #8] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #8] ldr w10, [sp, #4] 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: ldr w8, [sp, #8] ldr w9, [sp, #4] sdiv w8, w8, w9 str w8, [sp, #12] b LBB0_7 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: mov w8, #1 str w8, [sp, #12] b LBB0_7 LBB0_7: 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 $2, -12(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -12(%rbp), %eax imull -12(%rbp), %eax cmpl -8(%rbp), %eax jg .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -8(%rbp), %eax cltd idivl -12(%rbp) cmpl $0, %edx jne .LBB0_4 # %bb.3: movl -8(%rbp), %eax cltd idivl -12(%rbp) movl %eax, -4(%rbp) jmp .LBB0_7 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_5 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax addl $1, %eax movl %eax, -12(%rbp) jmp .LBB0_1 .LBB0_6: movl $1, -4(%rbp) .LBB0_7: 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
problem26/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] str x1, [sp, #16] mov x0, #256 bl _malloc str x0, [sp, #8] ldr x8, [sp, #16] str wzr, [x8] mov w8, #2 str w8, [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, #4] mul w8, w8, w9 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 b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldur w8, [x29, #-4] ldr w10, [sp, #4] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldur w8, [x29, #-4] ldr w9, [sp, #4] sdiv w8, w8, w9 stur w8, [x29, #-4] ldr w8, [sp, #4] ldr x9, [sp, #8] ldr x12, [sp, #16] ldrsw x10, [x12] mov x11, x10 add w11, w11, #1 str w11, [x12] str w8, [x9, x10, lsl #2] b LBB0_3 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: ldur w8, [x29, #-4] subs w8, w8, #1 cset w8, le tbnz w8, #0, LBB0_9 b LBB0_8 LBB0_8: ldur w8, [x29, #-4] ldr x9, [sp, #8] ldr x12, [sp, #16] ldrsw x10, [x12] mov x11, x10 add w11, w11, #1 str w11, [x12] str w8, [x9, x10, lsl #2] b LBB0_9 LBB0_9: ldr x0, [sp, #8] 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) movq %rsi, -16(%rbp) movl $256, %edi # imm = 0x100 callq malloc@PLT movq %rax, -24(%rbp) movq -16(%rbp), %rax movl $0, (%rax) movl $2, -28(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -28(%rbp), %eax imull -28(%rbp), %eax cmpl -4(%rbp), %eax jg .LBB0_7 # %bb.2: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_3 .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -4(%rbp), %eax cltd idivl -28(%rbp) cmpl $0, %edx jne .LBB0_5 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movl -4(%rbp), %eax cltd idivl -28(%rbp) movl %eax, -4(%rbp) movl -28(%rbp), %edx movq -24(%rbp), %rax movq -16(%rbp), %rsi movl (%rsi), %ecx movl %ecx, %edi addl $1, %edi movl %edi, (%rsi) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_3 .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: cmpl $1, -4(%rbp) jle .LBB0_9 # %bb.8: movl -4(%rbp), %edx movq -24(%rbp), %rax movq -16(%rbp), %rsi movl (%rsi), %ecx movl %ecx, %edi addl $1, %edi movl %edi, (%rsi) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_9: movq -24(%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
problem27/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, #128 .cfi_def_cfa_offset 128 stp x29, x30, [sp, #112] ; 16-byte Folded Spill add x29, sp, #112 .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] ldursw x8, [x29, #-12] lsl x0, x8, #2 bl _malloc stur x0, [x29, #-32] ldursw x0, [x29, #-12] mov x1, #4 str x1, [sp] ; 8-byte Folded Spill bl _calloc ldr x1, [sp] ; 8-byte Folded Reload stur x0, [x29, #-40] ldursw x0, [x29, #-12] bl _calloc stur x0, [x29, #-48] stur wzr, [x29, #-52] str wzr, [sp, #56] str wzr, [sp, #52] str wzr, [sp, #48] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ; Child Loop BB0_11 Depth 2 ldr w8, [sp, #48] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_21 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #48] ldr w8, [x8, x9, lsl #2] str w8, [sp, #44] str wzr, [sp, #40] str wzr, [sp, #36] b LBB0_3 LBB0_3: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #36] ldr w9, [sp, #56] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldur x8, [x29, #-48] ldrsw x9, [sp, #36] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #44] 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 str w8, [sp, #40] b LBB0_8 LBB0_6: ; in Loop: Header=BB0_3 Depth=2 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_3 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #40] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 b LBB0_20 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 str wzr, [sp, #32] str wzr, [sp, #28] b LBB0_11 LBB0_11: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #28] ldur w9, [x29, #-52] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_11 Depth=2 ldur x8, [x29, #-40] ldrsw x9, [sp, #28] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #44] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_1 Depth=1 mov w8, #1 str w8, [sp, #32] b LBB0_16 LBB0_14: ; in Loop: Header=BB0_11 Depth=2 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_11 Depth=2 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_11 LBB0_16: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #32] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_18 b LBB0_17 LBB0_17: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #44] ldur x9, [x29, #-48] ldrsw x10, [sp, #56] mov x11, x10 add w11, w11, #1 str w11, [sp, #56] str w8, [x9, x10, lsl #2] b LBB0_19 LBB0_18: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #44] ldur x9, [x29, #-40] ldursw x10, [x29, #-52] mov x11, x10 add w11, w11, #1 stur w11, [x29, #-52] str w8, [x9, x10, lsl #2] b LBB0_19 LBB0_19: ; in Loop: Header=BB0_1 Depth=1 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #48] add w8, w8, #1 str w8, [sp, #48] b LBB0_1 LBB0_21: str wzr, [sp, #24] b LBB0_22 LBB0_22: ; =>This Loop Header: Depth=1 ; Child Loop BB0_24 Depth 2 ldr w8, [sp, #24] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_33 b LBB0_23 LBB0_23: ; in Loop: Header=BB0_22 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] str w8, [sp, #20] str wzr, [sp, #16] str wzr, [sp, #12] b LBB0_24 LBB0_24: ; Parent Loop BB0_22 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #12] ldr w9, [sp, #56] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_29 b LBB0_25 LBB0_25: ; in Loop: Header=BB0_24 Depth=2 ldur x8, [x29, #-48] ldrsw x9, [sp, #12] ldr w8, [x8, x9, lsl #2] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_27 b LBB0_26 LBB0_26: ; in Loop: Header=BB0_22 Depth=1 mov w8, #1 str w8, [sp, #16] b LBB0_29 LBB0_27: ; in Loop: Header=BB0_24 Depth=2 b LBB0_28 LBB0_28: ; in Loop: Header=BB0_24 Depth=2 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_24 LBB0_29: ; in Loop: Header=BB0_22 Depth=1 ldr w8, [sp, #16] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_31 b LBB0_30 LBB0_30: ; in Loop: Header=BB0_22 Depth=1 ldr w8, [sp, #20] ldur x9, [x29, #-32] ldrsw x10, [sp, #52] mov x11, x10 add w11, w11, #1 str w11, [sp, #52] str w8, [x9, x10, lsl #2] b LBB0_31 LBB0_31: ; in Loop: Header=BB0_22 Depth=1 b LBB0_32 LBB0_32: ; in Loop: Header=BB0_22 Depth=1 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_22 LBB0_33: ldr w8, [sp, #52] ldur x9, [x29, #-24] str w8, [x9] ldur x0, [x29, #-40] bl _free ldur x0, [x29, #-48] bl _free ldur x0, [x29, #-32] ldp x29, x30, [sp, #112] ; 16-byte Folded Reload add sp, sp, #128 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 $112, %rsp movq %rdi, -8(%rbp) movl %esi, -12(%rbp) movq %rdx, -24(%rbp) movslq -12(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movslq -12(%rbp), %rdi movl $4, %esi callq calloc@PLT movq %rax, -40(%rbp) movslq -12(%rbp), %rdi movl $4, %esi callq calloc@PLT movq %rax, -48(%rbp) movl $0, -52(%rbp) movl $0, -56(%rbp) movl $0, -60(%rbp) movl $0, -64(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 # Child Loop BB0_11 Depth 2 movl -64(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_21 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -64(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -68(%rbp) movl $0, -72(%rbp) movl $0, -76(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -76(%rbp), %eax cmpl -56(%rbp), %eax jge .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -48(%rbp), %rax movslq -76(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -68(%rbp), %eax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movl $1, -72(%rbp) jmp .LBB0_8 .LBB0_6: # in Loop: Header=BB0_3 Depth=2 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movl -76(%rbp), %eax addl $1, %eax movl %eax, -76(%rbp) jmp .LBB0_3 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -72(%rbp) je .LBB0_10 # %bb.9: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_20 .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movl $0, -80(%rbp) movl $0, -84(%rbp) .LBB0_11: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -84(%rbp), %eax cmpl -52(%rbp), %eax jge .LBB0_16 # %bb.12: # in Loop: Header=BB0_11 Depth=2 movq -40(%rbp), %rax movslq -84(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -68(%rbp), %eax jne .LBB0_14 # %bb.13: # in Loop: Header=BB0_1 Depth=1 movl $1, -80(%rbp) jmp .LBB0_16 .LBB0_14: # in Loop: Header=BB0_11 Depth=2 jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_11 Depth=2 movl -84(%rbp), %eax addl $1, %eax movl %eax, -84(%rbp) jmp .LBB0_11 .LBB0_16: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -80(%rbp) je .LBB0_18 # %bb.17: # in Loop: Header=BB0_1 Depth=1 movl -68(%rbp), %edx movq -48(%rbp), %rax movl -56(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -56(%rbp) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_19 .LBB0_18: # in Loop: Header=BB0_1 Depth=1 movl -68(%rbp), %edx movq -40(%rbp), %rax movl -52(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -52(%rbp) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_19: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_20 .LBB0_20: # in Loop: Header=BB0_1 Depth=1 movl -64(%rbp), %eax addl $1, %eax movl %eax, -64(%rbp) jmp .LBB0_1 .LBB0_21: movl $0, -88(%rbp) .LBB0_22: # =>This Loop Header: Depth=1 # Child Loop BB0_24 Depth 2 movl -88(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_33 # %bb.23: # in Loop: Header=BB0_22 Depth=1 movq -8(%rbp), %rax movslq -88(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -92(%rbp) movl $0, -96(%rbp) movl $0, -100(%rbp) .LBB0_24: # Parent Loop BB0_22 Depth=1 # => This Inner Loop Header: Depth=2 movl -100(%rbp), %eax cmpl -56(%rbp), %eax jge .LBB0_29 # %bb.25: # in Loop: Header=BB0_24 Depth=2 movq -48(%rbp), %rax movslq -100(%rbp), %rcx movl (%rax,%rcx,4), %eax cmpl -92(%rbp), %eax jne .LBB0_27 # %bb.26: # in Loop: Header=BB0_22 Depth=1 movl $1, -96(%rbp) jmp .LBB0_29 .LBB0_27: # in Loop: Header=BB0_24 Depth=2 jmp .LBB0_28 .LBB0_28: # in Loop: Header=BB0_24 Depth=2 movl -100(%rbp), %eax addl $1, %eax movl %eax, -100(%rbp) jmp .LBB0_24 .LBB0_29: # in Loop: Header=BB0_22 Depth=1 cmpl $0, -96(%rbp) jne .LBB0_31 # %bb.30: # in Loop: Header=BB0_22 Depth=1 movl -92(%rbp), %edx movq -32(%rbp), %rax movl -60(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -60(%rbp) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_31: # in Loop: Header=BB0_22 Depth=1 jmp .LBB0_32 .LBB0_32: # in Loop: Header=BB0_22 Depth=1 movl -88(%rbp), %eax addl $1, %eax movl %eax, -88(%rbp) jmp .LBB0_22 .LBB0_33: movl -60(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movq -40(%rbp), %rdi callq free@PLT movq -48(%rbp), %rdi callq free@PLT movq -32(%rbp), %rax addq $112, %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 .addrsig_sym calloc .addrsig_sym free
problem28/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] str x1, [sp, #16] ldur x0, [x29, #-8] bl _strlen mov x8, x0 str w8, [sp, #12] str wzr, [sp, #8] b LBB0_1 LBB0_1: ; =>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_11 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #8] add x8, x8, x9 ldrb w8, [x8] strb w8, [sp, #7] ldrsb w8, [sp, #7] subs w8, w8, #97 cset w8, lt tbnz w8, #0, LBB0_5 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldrsb w8, [sp, #7] subs w8, w8, #122 cset w8, gt tbnz w8, #0, LBB0_5 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldrsb w8, [sp, #7] subs w8, w8, #32 strb w8, [sp, #7] b LBB0_9 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldrsb w8, [sp, #7] subs w8, w8, #65 cset w8, lt tbnz w8, #0, LBB0_8 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldrsb w8, [sp, #7] subs w8, w8, #90 cset w8, gt tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldrsb w8, [sp, #7] add w8, w8, #32 strb w8, [sp, #7] b LBB0_8 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldrb w8, [sp, #7] ldr x9, [sp, #16] ldrsw x10, [sp, #8] add x9, x9, x10 strb w8, [x9] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_1 LBB0_11: ldr x8, [sp, #16] ldrsw x9, [sp, #12] add x8, x8, x9 strb wzr, [x8] 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) movq %rsi, -16(%rbp) movq -8(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -20(%rbp) movl $0, -24(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -24(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_11 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -24(%rbp), %rcx movb (%rax,%rcx), %al movb %al, -25(%rbp) movsbl -25(%rbp), %eax cmpl $97, %eax jl .LBB0_5 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movsbl -25(%rbp), %eax cmpl $122, %eax jg .LBB0_5 # %bb.4: # in Loop: Header=BB0_1 Depth=1 movsbl -25(%rbp), %eax subl $32, %eax # kill: def $al killed $al killed $eax movb %al, -25(%rbp) jmp .LBB0_9 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movsbl -25(%rbp), %eax cmpl $65, %eax jl .LBB0_8 # %bb.6: # in Loop: Header=BB0_1 Depth=1 movsbl -25(%rbp), %eax cmpl $90, %eax jg .LBB0_8 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movsbl -25(%rbp), %eax addl $32, %eax # kill: def $al killed $al killed $eax movb %al, -25(%rbp) .LBB0_8: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_9 .LBB0_9: # in Loop: Header=BB0_1 Depth=1 movb -25(%rbp), %dl movq -16(%rbp), %rax movslq -24(%rbp), %rcx movb %dl, (%rax,%rcx) # %bb.10: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) jmp .LBB0_1 .LBB0_11: movq -16(%rbp), %rax movslq -20(%rbp), %rcx movb $0, (%rax,%rcx) 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 strlen
problem29/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] str wzr, [sp, #24] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>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_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-16] ldrsw x9, [sp, #20] ldr x0, [x8, x9, lsl #3] bl _strlen ldrsw x8, [sp, #24] add x8, x8, x0 ; kill: def $w8 killed $w8 killed $x8 str w8, [sp, #24] 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_1 LBB0_4: ldr w8, [sp, #24] 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_6 b LBB0_5 LBB0_5: ; kill: def $x8 killed $xzr stur xzr, [x29, #-8] b LBB0_11 LBB0_6: ldr x8, [sp, #8] strb wzr, [x8] str wzr, [sp, #4] b LBB0_7 LBB0_7: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldur w9, [x29, #-20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=1 ldr x0, [sp, #8] ldur x8, [x29, #-16] ldrsw x9, [sp, #4] ldr x1, [x8, x9, lsl #3] mov x2, #-1 bl ___strcat_chk b LBB0_9 LBB0_9: ; in Loop: Header=BB0_7 Depth=1 ldr w8, [sp, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_7 LBB0_10: ldr x8, [sp, #8] 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) movl $0, -24(%rbp) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -28(%rbp), %rcx movq (%rax,%rcx,8), %rdi callq strlen@PLT movq %rax, %rcx movslq -24(%rbp), %rax addq %rcx, %rax # kill: def $eax killed $eax killed $rax movl %eax, -24(%rbp) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_4: movl -24(%rbp), %eax addl $1, %eax movslq %eax, %rdi callq malloc@PLT movq %rax, -40(%rbp) cmpq $0, -40(%rbp) jne .LBB0_6 # %bb.5: movq $0, -8(%rbp) jmp .LBB0_11 .LBB0_6: movq -40(%rbp), %rax movb $0, (%rax) movl $0, -44(%rbp) .LBB0_7: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_10 # %bb.8: # in Loop: Header=BB0_7 Depth=1 movq -40(%rbp), %rdi movq -16(%rbp), %rax movslq -44(%rbp), %rcx movq (%rax,%rcx,8), %rsi callq strcat@PLT # %bb.9: # in Loop: Header=BB0_7 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_7 .LBB0_10: movq -40(%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 strlen .addrsig_sym malloc .addrsig_sym strcat
problem3/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 s0, [sp, #12] ldr s0, [sp, #12] ldr s1, [sp, #12] fcvtzs s1, s1 scvtf s1, s1 fsub s0, s0, s1 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 movss %xmm0, -4(%rbp) movss -4(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero cvttss2si -4(%rbp), %eax cvtsi2ss %eax, %xmm1 subss %xmm1, %xmm0 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
problem30/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, #-8] stur w1, [x29, #-12] str x2, [sp, #24] str x3, [sp, #16] ldr x0, [sp, #24] bl _strlen mov x8, x0 str w8, [sp, #12] ldursw x8, [x29, #-12] lsl x0, x8, #3 bl _malloc ldr x8, [sp, #16] str x0, [x8] str wzr, [sp, #8] str wzr, [sp, #4] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #4] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #4] ldr x0, [x8, x9, lsl #3] ldr x1, [sp, #24] ldrsw x2, [sp, #12] bl _strncmp 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] ldr x8, [x8, x9, lsl #3] ldr x9, [sp, #16] ldr x9, [x9] ldrsw x10, [sp, #8] mov x11, x10 add w11, w11, #1 str w11, [sp, #8] str x8, [x9, x10, lsl #3] 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: ldr w0, [sp, #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, -8(%rbp) movl %esi, -12(%rbp) movq %rdx, -24(%rbp) movq %rcx, -32(%rbp) movq -24(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -36(%rbp) movslq -12(%rbp), %rdi shlq $3, %rdi callq malloc@PLT movq %rax, %rcx movq -32(%rbp), %rax movq %rcx, (%rax) movl $0, -40(%rbp) movl $0, -44(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -44(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -44(%rbp), %rcx movq (%rax,%rcx,8), %rdi movq -24(%rbp), %rsi movslq -36(%rbp), %rdx callq strncmp@PLT cmpl $0, %eax jne .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -44(%rbp), %rcx movq (%rax,%rcx,8), %rdx movq -32(%rbp), %rax movq (%rax), %rax movl -40(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -40(%rbp) movslq %ecx, %rcx movq %rdx, (%rax,%rcx,8) .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 -40(%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 malloc .addrsig_sym strncmp
problem31/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, #-8] stur w1, [x29, #-12] str x2, [sp, #24] ldursw x8, [x29, #-12] lsl x0, x8, #2 bl _malloc str x0, [sp, #16] ldr x8, [sp, #24] str wzr, [x8] str wzr, [sp, #12] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #12] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] fcmp s0, #0.0 cset w8, le tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #16] ldr x11, [sp, #24] ldrsw x9, [x11] mov x10, x9 add w10, w10, #1 str w10, [x11] str s0, [x8, x9, lsl #2] 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 x0, [sp, #16] 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, -8(%rbp) movl %esi, -12(%rbp) movq %rdx, -24(%rbp) movslq -12(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movq -24(%rbp), %rax movl $0, (%rax) movl $0, -36(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jbe .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -32(%rbp), %rax movq -24(%rbp), %rdx movl (%rdx), %ecx movl %ecx, %esi addl $1, %esi movl %esi, (%rdx) movslq %ecx, %rcx movss %xmm0, (%rax,%rcx,4) .LBB0_4: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_5 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_6: movq -32(%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
problem32/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] ldr x8, [sp, #16] subs x8, x8, #2 cset w8, ge tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_9 LBB0_2: mov x8, #2 str x8, [sp, #8] b LBB0_3 LBB0_3: ; =>This Inner Loop Header: Depth=1 ldr x8, [sp, #8] ldr x9, [sp, #8] mul x8, x8, x9 ldr x9, [sp, #16] subs x8, x8, x9 cset w8, gt tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #16] ldr x10, [sp, #8] sdiv x9, x8, x10 mul x9, x9, x10 subs x8, x8, x9 subs x8, x8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: mov w8, #0 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_9 LBB0_6: ; in Loop: Header=BB0_3 Depth=1 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #8] add x8, x8, #1 str x8, [sp, #8] b LBB0_3 LBB0_8: mov w8, #1 and w8, w8, #0x1 and w8, w8, #0x1 strb w8, [sp, #31] b LBB0_9 LBB0_9: 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) cmpq $2, -16(%rbp) jge .LBB0_2 # %bb.1: movb $0, -1(%rbp) jmp .LBB0_9 .LBB0_2: movq $2, -24(%rbp) .LBB0_3: # =>This Inner Loop Header: Depth=1 movq -24(%rbp), %rax imulq -24(%rbp), %rax cmpq -16(%rbp), %rax jg .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax cqto idivq -24(%rbp) cmpq $0, %rdx jne .LBB0_6 # %bb.5: movb $0, -1(%rbp) jmp .LBB0_9 .LBB0_6: # in Loop: Header=BB0_3 Depth=1 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=1 movq -24(%rbp), %rax addq $1, %rax movq %rax, -24(%rbp) jmp .LBB0_3 .LBB0_8: movb $1, -1(%rbp) .LBB0_9: 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
problem33/code.c
.section __TEXT,__text,regular,pure_instructions .build_version macos, 13, 0 sdk_version 13, 3 .section __TEXT,__literal8,8byte_literals .p2align 3 ; -- Begin function func0 lCPI0_0: .quad 0x7ff8000000000000 ; double NaN lCPI0_1: .quad 0x3eb0c6f7a0b5ed8d ; double 9.9999999999999995E-7 .section __TEXT,__text,regular,pure_instructions .globl _func0 .p2align 2 _func0: ; @func0 .cfi_startproc ; %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 str x0, [sp, #80] str w1, [sp, #76] movi d0, #0000000000000000 str d0, [sp, #64] str wzr, [sp, #32] ldr w8, [sp, #76] subs w8, w8, #1 cset w8, ne tbnz w8, #0, LBB0_2 b LBB0_1 LBB0_1: ldr x8, [sp, #80] ldr d0, [x8] fabs d0, d0 adrp x8, lCPI0_1@PAGE ldr d1, [x8, lCPI0_1@PAGEOFF] fcmp d0, d1 cset w8, mi and w8, w8, #0x1 adrp x9, lCPI0_0@PAGE ldr d1, [x9, lCPI0_0@PAGEOFF] movi d0, #0000000000000000 ands w8, w8, #0x1 fcsel d0, d0, d1, ne str d0, [sp, #88] b LBB0_37 LBB0_2: ldr x8, [sp, #80] ldr d0, [x8] str d0, [sp, #56] mov w8, #1 str w8, [sp, #36] b LBB0_3 LBB0_3: ; =>This Loop Header: Depth=1 ; Child Loop BB0_5 Depth 2 ldr w8, [sp, #36] ldr w9, [sp, #76] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=1 fmov d0, #1.00000000 str d0, [sp, #40] str wzr, [sp, #28] b LBB0_5 LBB0_5: ; Parent Loop BB0_3 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #28] ldr w9, [sp, #36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=2 ldr d1, [sp, #64] ldr d0, [sp, #40] fmul d0, d0, d1 str d0, [sp, #40] b LBB0_7 LBB0_7: ; in Loop: Header=BB0_5 Depth=2 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_5 LBB0_8: ; in Loop: Header=BB0_3 Depth=1 ldr x8, [sp, #80] ldrsw x9, [sp, #36] ldr d0, [x8, x9, lsl #3] ldr d1, [sp, #40] ldr d2, [sp, #56] fmadd d0, d0, d1, d2 str d0, [sp, #56] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_3 Depth=1 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_3 LBB0_10: b LBB0_11 LBB0_11: ; =>This Loop Header: Depth=1 ; Child Loop BB0_15 Depth 2 ; Child Loop BB0_17 Depth 3 ; Child Loop BB0_25 Depth 2 ; Child Loop BB0_27 Depth 3 ldr d0, [sp, #56] fabs d0, d0 adrp x8, lCPI0_1@PAGE ldr d1, [x8, lCPI0_1@PAGEOFF] fcmp d0, d1 cset w8, le mov w9, #0 str w9, [sp, #16] ; 4-byte Folded Spill tbnz w8, #0, LBB0_13 b LBB0_12 LBB0_12: ; in Loop: Header=BB0_11 Depth=1 ldr w8, [sp, #32] subs w8, w8, #1000 cset w8, lt str w8, [sp, #16] ; 4-byte Folded Spill b LBB0_13 LBB0_13: ; in Loop: Header=BB0_11 Depth=1 ldr w8, [sp, #16] ; 4-byte Folded Reload tbz w8, #0, LBB0_33 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_11 Depth=1 movi d0, #0000000000000000 str d0, [sp, #48] mov w8, #1 str w8, [sp, #36] b LBB0_15 LBB0_15: ; Parent Loop BB0_11 Depth=1 ; => This Loop Header: Depth=2 ; Child Loop BB0_17 Depth 3 ldr w8, [sp, #36] ldr w9, [sp, #76] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_22 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_15 Depth=2 fmov d0, #1.00000000 str d0, [sp, #40] mov w8, #1 str w8, [sp, #24] b LBB0_17 LBB0_17: ; Parent Loop BB0_11 Depth=1 ; Parent Loop BB0_15 Depth=2 ; => This Inner Loop Header: Depth=3 ldr w8, [sp, #24] ldr w9, [sp, #36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_20 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_17 Depth=3 ldr d1, [sp, #64] ldr d0, [sp, #40] fmul d0, d0, d1 str d0, [sp, #40] b LBB0_19 LBB0_19: ; in Loop: Header=BB0_17 Depth=3 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_17 LBB0_20: ; in Loop: Header=BB0_15 Depth=2 ldr s1, [sp, #36] ; implicit-def: $d0 fmov s0, s1 sshll.2d v0, v0, #0 ; kill: def $d0 killed $d0 killed $q0 scvtf d0, d0 ldr x8, [sp, #80] ldrsw x9, [sp, #36] ldr d1, [x8, x9, lsl #3] fmul d0, d0, d1 ldr d1, [sp, #40] ldr d2, [sp, #48] fmadd d0, d0, d1, d2 str d0, [sp, #48] b LBB0_21 LBB0_21: ; in Loop: Header=BB0_15 Depth=2 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_15 LBB0_22: ; in Loop: Header=BB0_11 Depth=1 ldr d0, [sp, #48] fabs d0, d0 adrp x8, lCPI0_1@PAGE ldr d1, [x8, lCPI0_1@PAGEOFF] fcmp d0, d1 cset w8, pl tbnz w8, #0, LBB0_24 b LBB0_23 LBB0_23: adrp x8, lCPI0_0@PAGE ldr d0, [x8, lCPI0_0@PAGEOFF] str d0, [sp, #88] b LBB0_37 LBB0_24: ; in Loop: Header=BB0_11 Depth=1 ldr d0, [sp, #64] ldr d1, [sp, #56] ldr d2, [sp, #48] fdiv d1, d1, d2 fsub d0, d0, d1 str d0, [sp, #64] ldr x8, [sp, #80] ldr d0, [x8] str d0, [sp, #56] mov w8, #1 str w8, [sp, #36] b LBB0_25 LBB0_25: ; Parent Loop BB0_11 Depth=1 ; => This Loop Header: Depth=2 ; Child Loop BB0_27 Depth 3 ldr w8, [sp, #36] ldr w9, [sp, #76] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_32 b LBB0_26 LBB0_26: ; in Loop: Header=BB0_25 Depth=2 fmov d0, #1.00000000 str d0, [sp, #40] str wzr, [sp, #20] b LBB0_27 LBB0_27: ; Parent Loop BB0_11 Depth=1 ; Parent Loop BB0_25 Depth=2 ; => This Inner Loop Header: Depth=3 ldr w8, [sp, #20] ldr w9, [sp, #36] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_30 b LBB0_28 LBB0_28: ; in Loop: Header=BB0_27 Depth=3 ldr d1, [sp, #64] ldr d0, [sp, #40] fmul d0, d0, d1 str d0, [sp, #40] b LBB0_29 LBB0_29: ; in Loop: Header=BB0_27 Depth=3 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_27 LBB0_30: ; in Loop: Header=BB0_25 Depth=2 ldr x8, [sp, #80] ldrsw x9, [sp, #36] ldr d0, [x8, x9, lsl #3] ldr d1, [sp, #40] ldr d2, [sp, #56] fmadd d0, d0, d1, d2 str d0, [sp, #56] b LBB0_31 LBB0_31: ; in Loop: Header=BB0_25 Depth=2 ldr w8, [sp, #36] add w8, w8, #1 str w8, [sp, #36] b LBB0_25 LBB0_32: ; in Loop: Header=BB0_11 Depth=1 ldr w8, [sp, #32] add w8, w8, #1 str w8, [sp, #32] b LBB0_11 LBB0_33: ldr w8, [sp, #32] subs w8, w8, #1000 cset w8, ne tbnz w8, #0, LBB0_35 b LBB0_34 LBB0_34: adrp x8, lCPI0_0@PAGE ldr d0, [x8, lCPI0_0@PAGEOFF] str d0, [sp, #8] ; 8-byte Folded Spill b LBB0_36 LBB0_35: ldr d0, [sp, #64] str d0, [sp, #8] ; 8-byte Folded Spill b LBB0_36 LBB0_36: ldr d0, [sp, #8] ; 8-byte Folded Reload str d0, [sp, #88] b LBB0_37 LBB0_37: ldr d0, [sp, #88] add sp, sp, #96 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 0x3eb0c6f7a0b5ed8d # double 9.9999999999999995E-7 .LCPI0_2: .quad 0x7ff8000000000000 # double NaN .LCPI0_3: .quad 0x3ff0000000000000 # double 1 .section .rodata.cst16,"aM",@progbits,16 .p2align 4 .LCPI0_1: .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) xorps %xmm0, %xmm0 movsd %xmm0, -32(%rbp) movl $0, -64(%rbp) cmpl $1, -20(%rbp) jne .LBB0_2 # %bb.1: movq -16(%rbp), %rax movsd (%rax), %xmm0 # xmm0 = mem[0],zero movaps .LCPI0_1(%rip), %xmm1 # xmm1 = [NaN,NaN] pand %xmm1, %xmm0 xorps %xmm3, %xmm3 movsd .LCPI0_2(%rip), %xmm2 # xmm2 = mem[0],zero movsd .LCPI0_0(%rip), %xmm1 # xmm1 = mem[0],zero cmpltsd %xmm1, %xmm0 movaps %xmm0, %xmm1 andpd %xmm3, %xmm1 andnpd %xmm2, %xmm0 orpd %xmm1, %xmm0 movsd %xmm0, -8(%rbp) jmp .LBB0_37 .LBB0_2: movq -16(%rbp), %rax movsd (%rax), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -40(%rbp) movl $1, -60(%rbp) .LBB0_3: # =>This Loop Header: Depth=1 # Child Loop BB0_5 Depth 2 movl -60(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_10 # %bb.4: # in Loop: Header=BB0_3 Depth=1 movsd .LCPI0_3(%rip), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -56(%rbp) movl $0, -68(%rbp) .LBB0_5: # Parent Loop BB0_3 Depth=1 # => This Inner Loop Header: Depth=2 movl -68(%rbp), %eax cmpl -60(%rbp), %eax jge .LBB0_8 # %bb.6: # in Loop: Header=BB0_5 Depth=2 movsd -32(%rbp), %xmm0 # xmm0 = mem[0],zero mulsd -56(%rbp), %xmm0 movsd %xmm0, -56(%rbp) # %bb.7: # in Loop: Header=BB0_5 Depth=2 movl -68(%rbp), %eax addl $1, %eax movl %eax, -68(%rbp) jmp .LBB0_5 .LBB0_8: # in Loop: Header=BB0_3 Depth=1 movq -16(%rbp), %rax movslq -60(%rbp), %rcx movsd (%rax,%rcx,8), %xmm0 # xmm0 = mem[0],zero movsd -56(%rbp), %xmm2 # xmm2 = mem[0],zero movsd -40(%rbp), %xmm1 # xmm1 = mem[0],zero mulsd %xmm2, %xmm0 addsd %xmm1, %xmm0 movsd %xmm0, -40(%rbp) # %bb.9: # in Loop: Header=BB0_3 Depth=1 movl -60(%rbp), %eax addl $1, %eax movl %eax, -60(%rbp) jmp .LBB0_3 .LBB0_10: jmp .LBB0_11 .LBB0_11: # =>This Loop Header: Depth=1 # Child Loop BB0_15 Depth 2 # Child Loop BB0_17 Depth 3 # Child Loop BB0_25 Depth 2 # Child Loop BB0_27 Depth 3 movsd -40(%rbp), %xmm0 # xmm0 = mem[0],zero movaps .LCPI0_1(%rip), %xmm1 # xmm1 = [NaN,NaN] pand %xmm1, %xmm0 xorl %eax, %eax # kill: def $al killed $al killed $eax movsd .LCPI0_0(%rip), %xmm1 # xmm1 = mem[0],zero ucomisd %xmm1, %xmm0 movb %al, -77(%rbp) # 1-byte Spill jbe .LBB0_13 # %bb.12: # in Loop: Header=BB0_11 Depth=1 cmpl $1000, -64(%rbp) # imm = 0x3E8 setl %al movb %al, -77(%rbp) # 1-byte Spill .LBB0_13: # in Loop: Header=BB0_11 Depth=1 movb -77(%rbp), %al # 1-byte Reload testb $1, %al jne .LBB0_14 jmp .LBB0_33 .LBB0_14: # in Loop: Header=BB0_11 Depth=1 xorps %xmm0, %xmm0 movsd %xmm0, -48(%rbp) movl $1, -60(%rbp) .LBB0_15: # Parent Loop BB0_11 Depth=1 # => This Loop Header: Depth=2 # Child Loop BB0_17 Depth 3 movl -60(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_22 # %bb.16: # in Loop: Header=BB0_15 Depth=2 movsd .LCPI0_3(%rip), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -56(%rbp) movl $1, -72(%rbp) .LBB0_17: # Parent Loop BB0_11 Depth=1 # Parent Loop BB0_15 Depth=2 # => This Inner Loop Header: Depth=3 movl -72(%rbp), %eax cmpl -60(%rbp), %eax jge .LBB0_20 # %bb.18: # in Loop: Header=BB0_17 Depth=3 movsd -32(%rbp), %xmm0 # xmm0 = mem[0],zero mulsd -56(%rbp), %xmm0 movsd %xmm0, -56(%rbp) # %bb.19: # in Loop: Header=BB0_17 Depth=3 movl -72(%rbp), %eax addl $1, %eax movl %eax, -72(%rbp) jmp .LBB0_17 .LBB0_20: # in Loop: Header=BB0_15 Depth=2 cvtsi2sdl -60(%rbp), %xmm0 movq -16(%rbp), %rax movslq -60(%rbp), %rcx mulsd (%rax,%rcx,8), %xmm0 movsd -56(%rbp), %xmm2 # xmm2 = mem[0],zero movsd -48(%rbp), %xmm1 # xmm1 = mem[0],zero mulsd %xmm2, %xmm0 addsd %xmm1, %xmm0 movsd %xmm0, -48(%rbp) # %bb.21: # in Loop: Header=BB0_15 Depth=2 movl -60(%rbp), %eax addl $1, %eax movl %eax, -60(%rbp) jmp .LBB0_15 .LBB0_22: # in Loop: Header=BB0_11 Depth=1 movsd -48(%rbp), %xmm1 # xmm1 = mem[0],zero movaps .LCPI0_1(%rip), %xmm0 # xmm0 = [NaN,NaN] pand %xmm0, %xmm1 movsd .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero ucomisd %xmm1, %xmm0 jbe .LBB0_24 # %bb.23: movsd .LCPI0_2(%rip), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -8(%rbp) jmp .LBB0_37 .LBB0_24: # in Loop: Header=BB0_11 Depth=1 movsd -32(%rbp), %xmm0 # xmm0 = mem[0],zero movsd -40(%rbp), %xmm1 # xmm1 = mem[0],zero divsd -48(%rbp), %xmm1 subsd %xmm1, %xmm0 movsd %xmm0, -32(%rbp) movq -16(%rbp), %rax movsd (%rax), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -40(%rbp) movl $1, -60(%rbp) .LBB0_25: # Parent Loop BB0_11 Depth=1 # => This Loop Header: Depth=2 # Child Loop BB0_27 Depth 3 movl -60(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_32 # %bb.26: # in Loop: Header=BB0_25 Depth=2 movsd .LCPI0_3(%rip), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -56(%rbp) movl $0, -76(%rbp) .LBB0_27: # Parent Loop BB0_11 Depth=1 # Parent Loop BB0_25 Depth=2 # => This Inner Loop Header: Depth=3 movl -76(%rbp), %eax cmpl -60(%rbp), %eax jge .LBB0_30 # %bb.28: # in Loop: Header=BB0_27 Depth=3 movsd -32(%rbp), %xmm0 # xmm0 = mem[0],zero mulsd -56(%rbp), %xmm0 movsd %xmm0, -56(%rbp) # %bb.29: # in Loop: Header=BB0_27 Depth=3 movl -76(%rbp), %eax addl $1, %eax movl %eax, -76(%rbp) jmp .LBB0_27 .LBB0_30: # in Loop: Header=BB0_25 Depth=2 movq -16(%rbp), %rax movslq -60(%rbp), %rcx movsd (%rax,%rcx,8), %xmm0 # xmm0 = mem[0],zero movsd -56(%rbp), %xmm2 # xmm2 = mem[0],zero movsd -40(%rbp), %xmm1 # xmm1 = mem[0],zero mulsd %xmm2, %xmm0 addsd %xmm1, %xmm0 movsd %xmm0, -40(%rbp) # %bb.31: # in Loop: Header=BB0_25 Depth=2 movl -60(%rbp), %eax addl $1, %eax movl %eax, -60(%rbp) jmp .LBB0_25 .LBB0_32: # in Loop: Header=BB0_11 Depth=1 movl -64(%rbp), %eax addl $1, %eax movl %eax, -64(%rbp) jmp .LBB0_11 .LBB0_33: cmpl $1000, -64(%rbp) # imm = 0x3E8 jne .LBB0_35 # %bb.34: movsd .LCPI0_2(%rip), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -88(%rbp) # 8-byte Spill jmp .LBB0_36 .LBB0_35: movsd -32(%rbp), %xmm0 # xmm0 = mem[0],zero movsd %xmm0, -88(%rbp) # 8-byte Spill .LBB0_36: movsd -88(%rbp), %xmm0 # 8-byte Reload # xmm0 = mem[0],zero movsd %xmm0, -8(%rbp) .LBB0_37: movsd -8(%rbp), %xmm0 # xmm0 = mem[0],zero 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
problem34/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] ldur w8, [x29, #-12] mov w9, #3 sdiv w8, w8, w9 add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x8, w8 lsl x0, x8, #2 bl _malloc str x0, [sp, #32] str wzr, [sp, #24] str wzr, [sp, #20] str wzr, [sp, #28] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #28] mov w9, #3 mul w8, w8, w9 ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldr w9, [sp, #28] mov w10, #3 mul w9, w9, w10 ldr w8, [x8, w9, sxtw #2] ldr x9, [sp, #32] ldrsw x10, [sp, #28] str w8, [x9, x10, lsl #2] ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_1 LBB0_4: str wzr, [sp, #28] b LBB0_5 LBB0_5: ; =>This Loop Header: Depth=1 ; Child Loop BB0_7 Depth 2 ldr w8, [sp, #28] ldr w9, [sp, #20] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_16 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #28] str w8, [sp, #16] ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #24] b LBB0_7 LBB0_7: ; Parent Loop BB0_5 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #24] ldr w9, [sp, #20] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_12 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=2 ldr x8, [sp, #32] ldrsw x9, [sp, #24] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #16] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_7 Depth=2 ldr w8, [sp, #24] str w8, [sp, #16] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_7 Depth=2 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_7 Depth=2 ldr w8, [sp, #24] add w8, w8, #1 str w8, [sp, #24] b LBB0_7 LBB0_12: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #16] ldr w9, [sp, #28] subs w8, w8, w9 cset w8, eq tbnz w8, #0, LBB0_14 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_5 Depth=1 ldr x8, [sp, #32] ldrsw x9, [sp, #28] ldr w8, [x8, x9, lsl #2] str w8, [sp, #12] ldr x8, [sp, #32] ldrsw x9, [sp, #16] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #28] str w8, [x9, x10, lsl #2] ldr w8, [sp, #12] ldr x9, [sp, #32] ldrsw x10, [sp, #16] str w8, [x9, x10, lsl #2] b LBB0_14 LBB0_14: ; in Loop: Header=BB0_5 Depth=1 b LBB0_15 LBB0_15: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_5 LBB0_16: str wzr, [sp, #28] b LBB0_17 LBB0_17: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #28] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_23 b LBB0_18 LBB0_18: ; in Loop: Header=BB0_17 Depth=1 ldr w8, [sp, #28] mov w10, #3 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_20 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_17 Depth=1 ldr x8, [sp, #32] ldr w9, [sp, #28] mov w10, #3 sdiv w9, w9, w10 ldr w8, [x8, w9, sxtw #2] ldur x9, [x29, #-24] ldrsw x10, [sp, #28] str w8, [x9, x10, lsl #2] b LBB0_21 LBB0_20: ; in Loop: Header=BB0_17 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #28] ldr w8, [x8, x9, lsl #2] ldur x9, [x29, #-24] ldrsw x10, [sp, #28] str w8, [x9, x10, lsl #2] b LBB0_21 LBB0_21: ; in Loop: Header=BB0_17 Depth=1 b LBB0_22 LBB0_22: ; in Loop: Header=BB0_17 Depth=1 ldr w8, [sp, #28] add w8, w8, #1 str w8, [sp, #28] b LBB0_17 LBB0_23: ldr x0, [sp, #32] bl _free 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) movl -12(%rbp), %eax movl $3, %ecx cltd idivl %ecx addl $1, %eax movslq %eax, %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movl $0, -40(%rbp) movl $0, -44(%rbp) movl $0, -36(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 imull $3, -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax imull $3, -36(%rbp), %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movslq -36(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_4: movl $0, -36(%rbp) .LBB0_5: # =>This Loop Header: Depth=1 # Child Loop BB0_7 Depth 2 movl -36(%rbp), %eax movl -44(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_16 # %bb.6: # in Loop: Header=BB0_5 Depth=1 movl -36(%rbp), %eax movl %eax, -48(%rbp) movl -36(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) .LBB0_7: # Parent Loop BB0_5 Depth=1 # => This Inner Loop Header: Depth=2 movl -40(%rbp), %eax cmpl -44(%rbp), %eax jge .LBB0_12 # %bb.8: # in Loop: Header=BB0_7 Depth=2 movq -32(%rbp), %rax movslq -40(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -32(%rbp), %rcx movslq -48(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax jge .LBB0_10 # %bb.9: # in Loop: Header=BB0_7 Depth=2 movl -40(%rbp), %eax movl %eax, -48(%rbp) .LBB0_10: # in Loop: Header=BB0_7 Depth=2 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_7 Depth=2 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_7 .LBB0_12: # in Loop: Header=BB0_5 Depth=1 movl -48(%rbp), %eax cmpl -36(%rbp), %eax je .LBB0_14 # %bb.13: # in Loop: Header=BB0_5 Depth=1 movq -32(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -52(%rbp) movq -32(%rbp), %rax movslq -48(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movslq -36(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -52(%rbp), %edx movq -32(%rbp), %rax movslq -48(%rbp), %rcx movl %edx, (%rax,%rcx,4) .LBB0_14: # in Loop: Header=BB0_5 Depth=1 jmp .LBB0_15 .LBB0_15: # in Loop: Header=BB0_5 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_5 .LBB0_16: movl $0, -36(%rbp) .LBB0_17: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_23 # %bb.18: # in Loop: Header=BB0_17 Depth=1 movl -36(%rbp), %eax movl $3, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_20 # %bb.19: # in Loop: Header=BB0_17 Depth=1 movq -32(%rbp), %rax movq %rax, -64(%rbp) # 8-byte Spill movl -36(%rbp), %eax movl $3, %ecx cltd idivl %ecx movl %eax, %ecx movq -64(%rbp), %rax # 8-byte Reload movslq %ecx, %rcx movl (%rax,%rcx,4), %edx movq -24(%rbp), %rax movslq -36(%rbp), %rcx movl %edx, (%rax,%rcx,4) jmp .LBB0_21 .LBB0_20: # in Loop: Header=BB0_17 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -24(%rbp), %rax movslq -36(%rbp), %rcx movl %edx, (%rax,%rcx,4) .LBB0_21: # in Loop: Header=BB0_17 Depth=1 jmp .LBB0_22 .LBB0_22: # in Loop: Header=BB0_17 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_17 .LBB0_23: movq -32(%rbp), %rdi callq free@PLT 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 .addrsig_sym free
problem35/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] ldursw x8, [x29, #-12] lsl x0, x8, #2 bl _malloc str x0, [sp, #32] 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] 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, #28] 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, #24] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldur x8, [x29, #-8] ldrsw x9, [sp, #20] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #16] ldr w9, [x9, x10, lsl #2] 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 str w8, [sp, #28] b LBB0_8 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 ldr w8, [sp, #28] subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #20] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #24] mov x11, x10 add w11, w11, #1 str w11, [sp, #24] str w8, [x9, x10, lsl #2] 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, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_1 LBB0_12: str wzr, [sp, #20] b LBB0_13 LBB0_13: ; =>This Loop Header: Depth=1 ; Child Loop BB0_15 Depth 2 ldr w8, [sp, #20] ldr w9, [sp, #24] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_22 b LBB0_14 LBB0_14: ; in Loop: Header=BB0_13 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #16] b LBB0_15 LBB0_15: ; Parent Loop BB0_13 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #16] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_20 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_15 Depth=2 ldr x8, [sp, #32] ldrsw x9, [sp, #20] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #16] ldr w9, [x9, x10, lsl #2] subs w8, w8, w9 cset w8, le tbnz w8, #0, LBB0_18 b LBB0_17 LBB0_17: ; in Loop: Header=BB0_15 Depth=2 ldr x8, [sp, #32] ldrsw x9, [sp, #20] ldr w8, [x8, x9, lsl #2] str w8, [sp, #12] ldr x8, [sp, #32] ldrsw x9, [sp, #16] ldr w8, [x8, x9, lsl #2] ldr x9, [sp, #32] ldrsw x10, [sp, #20] str w8, [x9, x10, lsl #2] ldr w8, [sp, #12] ldr x9, [sp, #32] ldrsw x10, [sp, #16] str w8, [x9, x10, lsl #2] b LBB0_18 LBB0_18: ; in Loop: Header=BB0_15 Depth=2 b LBB0_19 LBB0_19: ; in Loop: Header=BB0_15 Depth=2 ldr w8, [sp, #16] add w8, w8, #1 str w8, [sp, #16] b LBB0_15 LBB0_20: ; in Loop: Header=BB0_13 Depth=1 b LBB0_21 LBB0_21: ; in Loop: Header=BB0_13 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_13 LBB0_22: ldr w8, [sp, #24] ldur x9, [x29, #-24] str w8, [x9] ldr x0, [sp, #32] 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) movslq -12(%rbp), %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movl $0, -40(%rbp) movl $0, -44(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -44(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_12 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl $0, -36(%rbp) movl $0, -48(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -48(%rbp), %eax cmpl -40(%rbp), %eax jge .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movq -8(%rbp), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -32(%rbp), %rcx movslq -48(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movl $1, -36(%rbp) jmp .LBB0_8 .LBB0_6: # in Loop: Header=BB0_3 Depth=2 jmp .LBB0_7 .LBB0_7: # in Loop: Header=BB0_3 Depth=2 movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_3 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -36(%rbp) jne .LBB0_10 # %bb.9: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movl -40(%rbp), %ecx movl %ecx, %esi addl $1, %esi movl %esi, -40(%rbp) movslq %ecx, %rcx movl %edx, (%rax,%rcx,4) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_1 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_1 .LBB0_12: movl $0, -44(%rbp) .LBB0_13: # =>This Loop Header: Depth=1 # Child Loop BB0_15 Depth 2 movl -44(%rbp), %eax movl -40(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_22 # %bb.14: # in Loop: Header=BB0_13 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) .LBB0_15: # Parent Loop BB0_13 Depth=1 # => This Inner Loop Header: Depth=2 movl -48(%rbp), %eax cmpl -40(%rbp), %eax jge .LBB0_20 # %bb.16: # in Loop: Header=BB0_15 Depth=2 movq -32(%rbp), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %eax movq -32(%rbp), %rcx movslq -48(%rbp), %rdx cmpl (%rcx,%rdx,4), %eax jle .LBB0_18 # %bb.17: # in Loop: Header=BB0_15 Depth=2 movq -32(%rbp), %rax movslq -44(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -52(%rbp) movq -32(%rbp), %rax movslq -48(%rbp), %rcx movl (%rax,%rcx,4), %edx movq -32(%rbp), %rax movslq -44(%rbp), %rcx movl %edx, (%rax,%rcx,4) movl -52(%rbp), %edx movq -32(%rbp), %rax movslq -48(%rbp), %rcx movl %edx, (%rax,%rcx,4) .LBB0_18: # in Loop: Header=BB0_15 Depth=2 jmp .LBB0_19 .LBB0_19: # in Loop: Header=BB0_15 Depth=2 movl -48(%rbp), %eax addl $1, %eax movl %eax, -48(%rbp) jmp .LBB0_15 .LBB0_20: # in Loop: Header=BB0_13 Depth=1 jmp .LBB0_21 .LBB0_21: # in Loop: Header=BB0_13 Depth=1 movl -44(%rbp), %eax addl $1, %eax movl %eax, -44(%rbp) jmp .LBB0_13 .LBB0_22: movl -40(%rbp), %ecx movq -24(%rbp), %rax movl %ecx, (%rax) movq -32(%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 malloc
problem36/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] mov w8, #16384 movk w8, #50716, lsl #16 fmov s0, w8 str s0, [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_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr s0, [sp, #16] ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr s1, [x8, x9, lsl #2] fcmp s0, s1 cset w8, pl tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #24] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] str s0, [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 s0, [sp, #16] add sp, sp, #32 ret .cfi_endproc ; -- End function .subsections_via_symbols
.text .file "code.c" .section .rodata.cst4,"aM",@progbits,4 .p2align 2 # -- Begin function func0 .LCPI0_0: .long 0xc61c4000 # float -1.0E+4 .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, -8(%rbp) movl %esi, -12(%rbp) movss .LCPI0_0(%rip), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -16(%rbp) movl $0, -20(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -20(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movss -16(%rbp), %xmm1 # xmm1 = mem[0],zero,zero,zero movq -8(%rbp), %rax movslq -20(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero ucomiss %xmm1, %xmm0 jbe .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -20(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -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: movss -16(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero 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
problem37/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, #12] str wzr, [sp, #8] str wzr, [sp, #4] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_5 Depth 2 ldr w8, [sp, #4] ldr w9, [sp, #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 ldr w8, [sp, #4] mov w10, #11 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #4] mov w10, #13 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_4 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #4] str w8, [sp] b LBB0_5 LBB0_5: ; Parent Loop BB0_1 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp] subs w8, w8, #0 cset w8, le tbnz w8, #0, LBB0_9 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=2 ldr w8, [sp] mov w10, #10 sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #7 cset w8, ne tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_5 Depth=2 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_8 LBB0_8: ; in Loop: Header=BB0_5 Depth=2 ldr w8, [sp] mov w9, #10 sdiv w8, w8, w9 str w8, [sp] b LBB0_5 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, #4] add w8, w8, #1 str w8, [sp, #4] b LBB0_1 LBB0_12: ldr w0, [sp, #8] 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, -4(%rbp) movl $0, -8(%rbp) movl $0, -12(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_5 Depth 2 movl -12(%rbp), %eax cmpl -4(%rbp), %eax jge .LBB0_12 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax movl $11, %ecx cltd idivl %ecx cmpl $0, %edx je .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax movl $13, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_10 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax movl %eax, -16(%rbp) .LBB0_5: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 cmpl $0, -16(%rbp) jle .LBB0_9 # %bb.6: # in Loop: Header=BB0_5 Depth=2 movl -16(%rbp), %eax movl $10, %ecx cltd idivl %ecx cmpl $7, %edx jne .LBB0_8 # %bb.7: # in Loop: Header=BB0_5 Depth=2 movl -8(%rbp), %eax addl $1, %eax movl %eax, -8(%rbp) .LBB0_8: # in Loop: Header=BB0_5 Depth=2 movl -16(%rbp), %eax movl $10, %ecx cltd idivl %ecx movl %eax, -16(%rbp) jmp .LBB0_5 .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 -12(%rbp), %eax addl $1, %eax movl %eax, -12(%rbp) jmp .LBB0_1 .LBB0_12: movl -8(%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
problem38/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, #-8] stur w1, [x29, #-12] str x2, [sp, #24] ldur w8, [x29, #-12] mov w9, #2 sdiv w8, w8, w9 add w9, w8, #1 ; implicit-def: $x8 mov x8, x9 sxtw x8, w8 lsl x0, x8, #2 bl _malloc str x0, [sp, #16] str wzr, [sp, #4] str wzr, [sp, #12] b LBB0_1 LBB0_1: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #12] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_4 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #16] ldrsw x9, [sp, #4] mov x10, x9 add w10, w10, #1 str w10, [sp, #4] str s0, [x8, x9, lsl #2] b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #12] add w8, w8, #2 str w8, [sp, #12] b LBB0_1 LBB0_4: str wzr, [sp, #12] b LBB0_5 LBB0_5: ; =>This Loop Header: Depth=1 ; Child Loop BB0_7 Depth 2 ldr w8, [sp, #12] ldr w9, [sp, #4] subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_14 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_5 Depth=1 str wzr, [sp, #8] b LBB0_7 LBB0_7: ; Parent Loop BB0_5 Depth=1 ; => This Inner Loop Header: Depth=2 ldr w8, [sp, #8] ldr w9, [sp, #4] ldr w10, [sp, #12] subs w9, w9, w10 subs w9, w9, #1 subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_12 b LBB0_8 LBB0_8: ; in Loop: Header=BB0_7 Depth=2 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #16] ldr w9, [sp, #8] add w9, w9, #1 ldr s1, [x8, w9, sxtw #2] fcmp s0, s1 cset w8, le tbnz w8, #0, LBB0_10 b LBB0_9 LBB0_9: ; in Loop: Header=BB0_7 Depth=2 ldr x8, [sp, #16] ldrsw x9, [sp, #8] ldr s0, [x8, x9, lsl #2] str s0, [sp] ldr x8, [sp, #16] ldr w9, [sp, #8] add w9, w9, #1 ldr s0, [x8, w9, sxtw #2] ldr x8, [sp, #16] ldrsw x9, [sp, #8] str s0, [x8, x9, lsl #2] ldr s0, [sp] ldr x8, [sp, #16] ldr w9, [sp, #8] add w9, w9, #1 str s0, [x8, w9, sxtw #2] b LBB0_10 LBB0_10: ; in Loop: Header=BB0_7 Depth=2 b LBB0_11 LBB0_11: ; in Loop: Header=BB0_7 Depth=2 ldr w8, [sp, #8] add w8, w8, #1 str w8, [sp, #8] b LBB0_7 LBB0_12: ; in Loop: Header=BB0_5 Depth=1 b LBB0_13 LBB0_13: ; in Loop: Header=BB0_5 Depth=1 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_5 LBB0_14: str wzr, [sp, #12] b LBB0_15 LBB0_15: ; =>This Inner Loop Header: Depth=1 ldr w8, [sp, #12] ldur w9, [x29, #-12] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_21 b LBB0_16 LBB0_16: ; in Loop: Header=BB0_15 Depth=1 ldr w8, [sp, #12] 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_18 b LBB0_17 LBB0_17: ; in Loop: Header=BB0_15 Depth=1 ldr x8, [sp, #16] ldr w9, [sp, #12] mov w10, #2 sdiv w9, w9, w10 ldr s0, [x8, w9, sxtw #2] ldr x8, [sp, #24] ldrsw x9, [sp, #12] str s0, [x8, x9, lsl #2] b LBB0_19 LBB0_18: ; in Loop: Header=BB0_15 Depth=1 ldur x8, [x29, #-8] ldrsw x9, [sp, #12] ldr s0, [x8, x9, lsl #2] ldr x8, [sp, #24] ldrsw x9, [sp, #12] str s0, [x8, x9, lsl #2] b LBB0_19 LBB0_19: ; in Loop: Header=BB0_15 Depth=1 b LBB0_20 LBB0_20: ; in Loop: Header=BB0_15 Depth=1 ldr w8, [sp, #12] add w8, w8, #1 str w8, [sp, #12] b LBB0_15 LBB0_21: ldr x0, [sp, #16] bl _free 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 $64, %rsp movq %rdi, -8(%rbp) movl %esi, -12(%rbp) movq %rdx, -24(%rbp) movl -12(%rbp), %eax movl $2, %ecx cltd idivl %ecx addl $1, %eax movslq %eax, %rdi shlq $2, %rdi callq malloc@PLT movq %rax, -32(%rbp) movl $0, -44(%rbp) movl $0, -36(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -32(%rbp), %rax movl -44(%rbp), %ecx movl %ecx, %edx addl $1, %edx movl %edx, -44(%rbp) movslq %ecx, %rcx movss %xmm0, (%rax,%rcx,4) # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -36(%rbp), %eax addl $2, %eax movl %eax, -36(%rbp) jmp .LBB0_1 .LBB0_4: movl $0, -36(%rbp) .LBB0_5: # =>This Loop Header: Depth=1 # Child Loop BB0_7 Depth 2 movl -36(%rbp), %eax movl -44(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_14 # %bb.6: # in Loop: Header=BB0_5 Depth=1 movl $0, -40(%rbp) .LBB0_7: # Parent Loop BB0_5 Depth=1 # => This Inner Loop Header: Depth=2 movl -40(%rbp), %eax movl -44(%rbp), %ecx subl -36(%rbp), %ecx subl $1, %ecx cmpl %ecx, %eax jge .LBB0_12 # %bb.8: # in Loop: Header=BB0_7 Depth=2 movq -32(%rbp), %rax movslq -40(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -32(%rbp), %rax movl -40(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx ucomiss (%rax,%rcx,4), %xmm0 jbe .LBB0_10 # %bb.9: # in Loop: Header=BB0_7 Depth=2 movq -32(%rbp), %rax movslq -40(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movss %xmm0, -48(%rbp) movq -32(%rbp), %rax movl -40(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -32(%rbp), %rax movslq -40(%rbp), %rcx movss %xmm0, (%rax,%rcx,4) movss -48(%rbp), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -32(%rbp), %rax movl -40(%rbp), %ecx addl $1, %ecx movslq %ecx, %rcx movss %xmm0, (%rax,%rcx,4) .LBB0_10: # in Loop: Header=BB0_7 Depth=2 jmp .LBB0_11 .LBB0_11: # in Loop: Header=BB0_7 Depth=2 movl -40(%rbp), %eax addl $1, %eax movl %eax, -40(%rbp) jmp .LBB0_7 .LBB0_12: # in Loop: Header=BB0_5 Depth=1 jmp .LBB0_13 .LBB0_13: # in Loop: Header=BB0_5 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_5 .LBB0_14: movl $0, -36(%rbp) .LBB0_15: # =>This Inner Loop Header: Depth=1 movl -36(%rbp), %eax cmpl -12(%rbp), %eax jge .LBB0_21 # %bb.16: # in Loop: Header=BB0_15 Depth=1 movl -36(%rbp), %eax movl $2, %ecx cltd idivl %ecx cmpl $0, %edx jne .LBB0_18 # %bb.17: # in Loop: Header=BB0_15 Depth=1 movq -32(%rbp), %rax movq %rax, -56(%rbp) # 8-byte Spill movl -36(%rbp), %eax movl $2, %ecx cltd idivl %ecx movl %eax, %ecx movq -56(%rbp), %rax # 8-byte Reload movslq %ecx, %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movslq -36(%rbp), %rcx movss %xmm0, (%rax,%rcx,4) jmp .LBB0_19 .LBB0_18: # in Loop: Header=BB0_15 Depth=1 movq -8(%rbp), %rax movslq -36(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero movq -24(%rbp), %rax movslq -36(%rbp), %rcx movss %xmm0, (%rax,%rcx,4) .LBB0_19: # in Loop: Header=BB0_15 Depth=1 jmp .LBB0_20 .LBB0_20: # in Loop: Header=BB0_15 Depth=1 movl -36(%rbp), %eax addl $1, %eax movl %eax, -36(%rbp) jmp .LBB0_15 .LBB0_21: movq -32(%rbp), %rdi callq free@PLT 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 .addrsig_sym free
problem39/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, #-8] stur w1, [x29, #-12] ldur x0, [x29, #-8] bl _strlen mov x8, x0 stur w8, [x29, #-16] ldur w8, [x29, #-16] add w8, w8, #2 mov w9, #3 sdiv w8, w8, w9 stur w8, [x29, #-20] str wzr, [sp, #20] b LBB0_1 LBB0_1: ; =>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_12 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] mov w9, #3 mul w8, w8, w9 add w8, w8, #3 ldur w9, [x29, #-16] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: ; in Loop: Header=BB0_1 Depth=1 mov w8, #3 str w8, [sp, #8] ; 4-byte Folded Spill b LBB0_5 LBB0_4: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-16] ldr w9, [sp, #20] mov w10, #3 mul w9, w9, w10 subs w8, w8, w9 str w8, [sp, #8] ; 4-byte Folded Spill b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #8] ; 4-byte Folded Reload str w8, [sp, #16] ldur x8, [x29, #-8] ldr w9, [sp, #20] mov w10, #3 mul w9, w9, w10 add x1, x8, w9, sxtw ldrsw x2, [sp, #16] add x0, sp, #24 str x0, [sp] ; 8-byte Folded Spill mov x3, #4 bl ___strncpy_chk ldr x8, [sp] ; 8-byte Folded Reload ldrsw x9, [sp, #16] add x8, x8, x9 strb wzr, [x8] ldr w8, [sp, #16] subs w8, w8, #3 cset w8, ne tbnz w8, #0, LBB0_10 b LBB0_6 LBB0_6: ; in Loop: Header=BB0_1 Depth=1 ldur w8, [x29, #-12] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_8 b LBB0_7 LBB0_7: ; in Loop: Header=BB0_1 Depth=1 ldrb w8, [sp, #26] strb w8, [sp, #15] ldrb w8, [sp, #25] strb w8, [sp, #26] ldrb w8, [sp, #24] strb w8, [sp, #25] ldrb w8, [sp, #15] strb w8, [sp, #24] b LBB0_9 LBB0_8: ; in Loop: Header=BB0_1 Depth=1 ldrb w8, [sp, #24] strb w8, [sp, #14] ldrb w8, [sp, #25] strb w8, [sp, #24] ldrb w8, [sp, #26] strb w8, [sp, #25] ldrb w8, [sp, #14] strb w8, [sp, #26] b LBB0_9 LBB0_9: ; in Loop: Header=BB0_1 Depth=1 b LBB0_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldur x8, [x29, #-8] ldr w9, [sp, #20] mov w10, #3 mul w9, w9, w10 add x0, x8, w9, sxtw ldrsw x2, [sp, #16] add x1, sp, #24 mov x3, #-1 bl ___strncpy_chk b LBB0_11 LBB0_11: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] add w8, w8, #1 str w8, [sp, #20] b LBB0_1 LBB0_12: 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, -8(%rbp) movl %esi, -12(%rbp) movq -8(%rbp), %rdi callq strlen@PLT # kill: def $eax killed $eax killed $rax movl %eax, -16(%rbp) movl -16(%rbp), %eax addl $2, %eax movl $3, %ecx cltd idivl %ecx movl %eax, -20(%rbp) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_12 # %bb.2: # in Loop: Header=BB0_1 Depth=1 imull $3, -28(%rbp), %eax addl $3, %eax cmpl -16(%rbp), %eax jg .LBB0_4 # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl $3, %eax movl %eax, -40(%rbp) # 4-byte Spill jmp .LBB0_5 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 movl -16(%rbp), %eax imull $3, -28(%rbp), %ecx subl %ecx, %eax movl %eax, -40(%rbp) # 4-byte Spill .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -40(%rbp), %eax # 4-byte Reload movl %eax, -32(%rbp) leaq -24(%rbp), %rdi movq -8(%rbp), %rsi imull $3, -28(%rbp), %eax cltq addq %rax, %rsi movslq -32(%rbp), %rdx callq strncpy@PLT movslq -32(%rbp), %rax movb $0, -24(%rbp,%rax) cmpl $3, -32(%rbp) jne .LBB0_10 # %bb.6: # in Loop: Header=BB0_1 Depth=1 cmpl $0, -12(%rbp) je .LBB0_8 # %bb.7: # in Loop: Header=BB0_1 Depth=1 movb -22(%rbp), %al movb %al, -33(%rbp) movb -23(%rbp), %al movb %al, -22(%rbp) movb -24(%rbp), %al movb %al, -23(%rbp) movb -33(%rbp), %al movb %al, -24(%rbp) jmp .LBB0_9 .LBB0_8: # in Loop: Header=BB0_1 Depth=1 movb -24(%rbp), %al movb %al, -34(%rbp) movb -23(%rbp), %al movb %al, -24(%rbp) movb -22(%rbp), %al movb %al, -23(%rbp) movb -34(%rbp), %al movb %al, -22(%rbp) .LBB0_9: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_10 .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movq -8(%rbp), %rdi imull $3, -28(%rbp), %eax cltq addq %rax, %rdi leaq -24(%rbp), %rsi movslq -32(%rbp), %rdx callq strncpy@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: 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 strncpy
problem4/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] str wzr, [sp, #4] b LBB0_1 LBB0_1: ; =>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_6 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr x8, [sp, #16] ldrsw x9, [sp, #4] ldr w9, [x8, x9, lsl #2] ldr w8, [sp, #8] add w8, w8, w9 str w8, [sp, #8] ldr w8, [sp, #8] subs w8, w8, #0 cset w8, ge tbnz w8, #0, LBB0_4 b LBB0_3 LBB0_3: mov w8, #1 str w8, [sp, #28] b LBB0_7 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, #28] b LBB0_7 LBB0_7: ldr w0, [sp, #28] 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) movl $0, -28(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 movl -28(%rbp), %eax cmpl -20(%rbp), %eax jge .LBB0_6 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movq -16(%rbp), %rax movslq -28(%rbp), %rcx movl (%rax,%rcx,4), %eax addl -24(%rbp), %eax movl %eax, -24(%rbp) cmpl $0, -24(%rbp) jge .LBB0_4 # %bb.3: movl $1, -4(%rbp) jmp .LBB0_7 .LBB0_4: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_5 .LBB0_5: # in Loop: Header=BB0_1 Depth=1 movl -28(%rbp), %eax addl $1, %eax movl %eax, -28(%rbp) jmp .LBB0_1 .LBB0_6: movl $0, -4(%rbp) .LBB0_7: 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
problem40/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 w0, [sp, #24] mov w8, #1 str w8, [sp, #20] mov w8, #2 str w8, [sp, #16] str wzr, [sp, #8] b LBB0_1 LBB0_1: ; =>This Loop Header: Depth=1 ; Child Loop BB0_3 Depth 2 ldr w8, [sp, #8] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, ge tbnz w8, #0, LBB0_13 b LBB0_2 LBB0_2: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #20] ldr w9, [sp, #16] add w8, w8, w9 str w8, [sp, #20] ldr w8, [sp, #20] str w8, [sp, #12] ldr w8, [sp, #16] str w8, [sp, #20] ldr w8, [sp, #12] str w8, [sp, #16] mov w8, #1 str w8, [sp, #4] mov w8, #2 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] mul w8, w8, w9 ldr w9, [sp, #20] subs w8, w8, w9 cset w8, gt tbnz w8, #0, LBB0_8 b LBB0_4 LBB0_4: ; in Loop: Header=BB0_3 Depth=2 ldr w8, [sp, #20] ldr w10, [sp] sdiv w9, w8, w10 mul w9, w9, w10 subs w8, w8, w9 subs w8, w8, #0 cset w8, ne tbnz w8, #0, LBB0_6 b LBB0_5 LBB0_5: ; in Loop: Header=BB0_1 Depth=1 str wzr, [sp, #4] b LBB0_8 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 ldr w8, [sp, #4] subs w8, w8, #0 cset w8, eq tbnz w8, #0, LBB0_10 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_10 LBB0_10: ; in Loop: Header=BB0_1 Depth=1 ldr w8, [sp, #8] ldr w9, [sp, #24] subs w8, w8, w9 cset w8, ne tbnz w8, #0, LBB0_12 b LBB0_11 LBB0_11: ldr w8, [sp, #20] str w8, [sp, #28] b LBB0_14 LBB0_12: ; in Loop: Header=BB0_1 Depth=1 b LBB0_1 LBB0_13: str wzr, [sp, #28] b LBB0_14 LBB0_14: ldr w0, [sp, #28] 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 movl %edi, -8(%rbp) movl $1, -12(%rbp) movl $2, -16(%rbp) movl $0, -24(%rbp) .LBB0_1: # =>This Loop Header: Depth=1 # Child Loop BB0_3 Depth 2 movl -24(%rbp), %eax cmpl -8(%rbp), %eax jge .LBB0_13 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movl -12(%rbp), %eax addl -16(%rbp), %eax movl %eax, -12(%rbp) movl -12(%rbp), %eax movl %eax, -20(%rbp) movl -16(%rbp), %eax movl %eax, -12(%rbp) movl -20(%rbp), %eax movl %eax, -16(%rbp) movl $1, -28(%rbp) movl $2, -32(%rbp) .LBB0_3: # Parent Loop BB0_1 Depth=1 # => This Inner Loop Header: Depth=2 movl -32(%rbp), %eax imull -32(%rbp), %eax cmpl -12(%rbp), %eax jg .LBB0_8 # %bb.4: # in Loop: Header=BB0_3 Depth=2 movl -12(%rbp), %eax cltd idivl -32(%rbp) cmpl $0, %edx jne .LBB0_6 # %bb.5: # in Loop: Header=BB0_1 Depth=1 movl $0, -28(%rbp) jmp .LBB0_8 .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 cmpl $0, -28(%rbp) je .LBB0_10 # %bb.9: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax addl $1, %eax movl %eax, -24(%rbp) .LBB0_10: # in Loop: Header=BB0_1 Depth=1 movl -24(%rbp), %eax cmpl -8(%rbp), %eax jne .LBB0_12 # %bb.11: movl -12(%rbp), %eax movl %eax, -4(%rbp) jmp .LBB0_14 .LBB0_12: # in Loop: Header=BB0_1 Depth=1 jmp .LBB0_1 .LBB0_13: movl $0, -4(%rbp) .LBB0_14: 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