# Puzzle 4
#
# NOTE: CA, CB, CC, and CD are labels we added by hand to support this homework.
# The compiler created the .L1-.L4 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 .L3                   # Next: TODO
CA:
    pushq %r14
    pushq %rbx
    subq $8, %rsp
    movl %edi, %ebx
    cmpl $1, %edi
    je .L4                    # Next: TODO
CB:
    leal -1(%rdi), %edi
    call function1            # Next: TODO
CC:
    movl %eax, %r14d
    leal -2(%rbx), %edi
    call function1            # Next: TODO
CD:
    addl %eax, %r14d
    movl %r14d, %eax
.L1:
    addq $8, %rsp
    popq %rbx
    popq %r14
    ret
.L3:
    movl $0, %eax
    ret
.L4:
    movl %edi, %eax
    jmp .L1                   # Next: TODO