// File: /workspace/github_cpp_makefile_star2_O3/Davidc2525[P]Leaf/main.cpp
// Function: label_of_function[abi:cxx11](Obj*)
string *label_of_function(Obj *f)
{

    string *label = new string();

    label->append(f->name->c_str());
    label->append("_");

    Obj *last = f->locals;

    while (last != NULL)
    {
        label->append("@");
        Struct *last_type = last->type;
        while (last_type->kind == Struct::Pointer || last_type->kind == Struct::Arr || last_type->kind == Struct::Func)
        {
            label->append(to_string(last_type->kind));
            label->append("_");
            last_type = last_type->elemType;
        }

        label->append(to_string(last_type->kind));
        label->append("");
        label->append("_");
        last = last->next;
    }

    Struct *last_type = f->type->elemType;
    label->append("#");
    while (last_type->kind == Struct::Pointer || last_type->kind == Struct::Arr || last_type->kind == Struct::Func)
    {
        label->append(to_string(last_type->kind));
        label->append("_");
        last_type = last_type->elemType;
    }
    label->append(to_string(last_type->kind));
    label->append(":");

    return label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movl $0x20, %edi
callq 0x5290
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x8(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x54b0
leaq 0x11c34(%rip), %rsi     # 0x19277
movq %rbx, %rdi
callq 0x54b0
movq %r14, 0x28(%rsp)
movq 0x40(%r14), %r13
movq %rbx, %r14
testq %r13, %r13
movq %rbx, 0x20(%rsp)
je 0x783a
leaq 0x10(%rsp), %rbx
movl $0xd1b71759, %r12d      # imm = 0xD1B71759
leaq 0x119a5(%rip), %rsi     # 0x1901c
movq %r13, 0x30(%rsp)
movq %r14, %rdi
callq 0x54b0
movq 0x18(%r13), %r13
movl 0x10(%r13), %r15d
cmpq $0xc, %r15
ja 0x7759
movl $0x1220, %eax           # imm = 0x1220
btl %r15d, %eax
jae 0x7759
movl $0x1, %r14d
cmpl $0xa, %r15d
jb 0x76f3
movl $0x4, %r14d
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0x76ea
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x76f0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x76f3
movl %eax, %ecx
imulq %r12, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x76ba
addl $-0x3, %r14d
jmp 0x76f3
addl $-0x2, %r14d
jmp 0x76f3
decl %r14d
movl %r15d, %ebp
shrl $0x1f, %ebp
movl %ebp, %esi
addl %r14d, %esi
movq %rbx, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x5310
movq (%rsp), %rdi
addq %rbp, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x7d64
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x50f0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x774d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52a0
leaq 0x11b23(%rip), %rsi     # 0x19277
jmp 0x767c
movl %r15d, %r14d
negl %r14d
cmovsl %r15d, %r14d
movl $0x1, %r13d
cmpl $0xa, %r14d
jb 0x77b1
movl $0x4, %r13d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x77a8
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x77ae
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x77b1
movl %eax, %ecx
imulq %r12, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x7778
addl $-0x3, %r13d
jmp 0x77b1
addl $-0x2, %r13d
jmp 0x77b1
decl %r13d
shrl $0x1f, %r15d
movl %r15d, %esi
addl %r13d, %esi
movq %rbx, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x5310
movq (%rsp), %rdi
addq %r15, %rdi
movl %r13d, %esi
movl %r14d, %edx
callq 0x7d64
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x50f0
movq (%rsp), %rdi
cmpq %rbx, %rdi
movq 0x30(%rsp), %r13
je 0x780f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %r14, %rdi
leaq 0x13572(%rip), %rsi     # 0x1ad8b
callq 0x54b0
movq %r14, %rdi
leaq 0x11a4f(%rip), %rsi     # 0x19277
callq 0x54b0
movq 0x20(%r13), %r13
testq %r13, %r13
jne 0x7670
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r15
leaq 0x117d0(%rip), %rsi     # 0x1901e
movq %r14, %rdi
callq 0x54b0
leaq 0x10(%rsp), %rbx
movl $0xd1b71759, %r12d      # imm = 0xD1B71759
movl 0x10(%r15), %r13d
cmpq $0xc, %r13
ja 0x7938
movl $0x1220, %eax           # imm = 0x1220
btl %r13d, %eax
jae 0x7938
movl $0x1, %ebp
cmpl $0xa, %r13d
jb 0x78c6
movl $0x4, %ebp
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x78bf
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x78c4
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x78c6
movl %eax, %ecx
imulq %r12, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x7891
addl $-0x3, %ebp
jmp 0x78c6
addl $-0x2, %ebp
jmp 0x78c6
decl %ebp
movl %r13d, %r14d
shrl $0x1f, %r14d
movl %r14d, %esi
addl %ebp, %esi
movq %rbx, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x5310
movq (%rsp), %rdi
addq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0x7d64
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x50f0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x7920
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %r14, %rdi
leaq 0x1194d(%rip), %rsi     # 0x19277
callq 0x54b0
movq 0x18(%r15), %r15
jmp 0x7861
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x7995
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x798c
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x7992
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x7995
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x7959
addl $-0x3, %r15d
jmp 0x7995
addl $-0x2, %r15d
jmp 0x7995
decl %r15d
shrl $0x1f, %r13d
movl %r13d, %esi
addl %r15d, %esi
movq %rsp, %r12
movq %rbx, (%r12)
movq %r12, %rdi
movl $0x2d, %edx
callq 0x5310
movq (%r12), %rdi
addq %r13, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x7d64
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x50f0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x79eb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52a0
leaq 0x1162e(%rip), %rsi     # 0x19020
movq %r14, %rdi
callq 0x54b0
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7a12
jmp 0x7a12
jmp 0x7a12
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x7a2b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %r14, %rdi
callq 0x5470