# Puzzle 5
#
# NOTE: CA and CB are labels we added by hand to support this homework.
# The compiler created the .L1-.L5 and function1 labels.
#
# C structures used: TODO
#
# Possible order of labels (#1): TODO
# Possible order of labels (#2): TODO
# Possible order of labels (#3): TODO
#
# Registers and sizes for function1's parameters: TODO

function1:
    testl %edi, %edi
    jle .L5                     # Next: TODO
CA:
    movl $1, %edx
    movl $1, %eax
    movl $0, %ecx
    jmp .L3                     # Next: TODO
.L4:
    leal (%rcx,%rax), %esi
    addl $1, %edx
    movl %eax, %ecx
    movl %esi, %eax
.L3:
    cmpl %edi, %edx
    jl .L4                      # Next: TODO
CB:
    ret
.L5:
    movl $0, %eax
    ret