// File: /workspace/github_cpp_makefile_star2_O1/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), %r12
testq %r12, %r12
je 0x7846
leaq 0x18(%rsp), %r13
leaq 0x119b3(%rip), %rsi     # 0x1901c
movq %r12, 0x30(%rsp)
movq %rbx, %rdi
callq 0x54b0
movq 0x18(%r12), %r12
movl 0x10(%r12), %eax
cmpl $0xc, %eax
ja 0x775d
movl $0x1220, %ecx           # imm = 0x1220
btl %eax, %ecx
jae 0x775d
movq %rbx, %r15
movl 0x10(%r12), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x76f7
movl $0x4, %r14d
movl %ebp, %eax
movl $0xd1b71759, %esi       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x76ee
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x76f4
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x76f7
movl %eax, %ecx
imulq %rsi, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x76be
addl $-0x3, %r14d
jmp 0x76f7
addl $-0x2, %r14d
jmp 0x76f7
decl %r14d
shrl $0x1f, %ebx
movl %ebx, %esi
addl %r14d, %esi
movq %r13, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x5310
movq 0x8(%rsp), %rdi
addq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x7d81
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rbx
movq %r15, %rdi
callq 0x50f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7751
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52a0
leaq 0x11b1f(%rip), %rsi     # 0x19277
jmp 0x766e
movl 0x10(%r12), %r12d
movl %r12d, %ebp
negl %ebp
cmovsl %r12d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x77bc
movl $0x4, %r14d
movl %ebp, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x77b3
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x77b9
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x77bc
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x7783
addl $-0x3, %r14d
jmp 0x77bc
addl $-0x2, %r14d
jmp 0x77bc
decl %r14d
shrl $0x1f, %r12d
movl %r12d, %esi
addl %r14d, %esi
movq %r13, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x5310
movq 0x8(%rsp), %rdi
addq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x7d81
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x50f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
movq 0x30(%rsp), %r12
je 0x781a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %rbx, %rdi
leaq 0x13503(%rip), %rsi     # 0x1ad27
callq 0x54b0
movq %rbx, %rdi
leaq 0x11a44(%rip), %rsi     # 0x19277
callq 0x54b0
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x7662
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r14
leaq 0x117c4(%rip), %rsi     # 0x1901e
movq %rbx, %rdi
callq 0x54b0
leaq 0x18(%rsp), %r13
movl 0x10(%r14), %eax
cmpl $0xc, %eax
ja 0x7951
movl $0x1220, %ecx           # imm = 0x1220
btl %eax, %ecx
jae 0x7951
movl 0x10(%r14), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x78e0
movl $0x4, %r12d
movl %ebp, %eax
movl $0xd1b71759, %esi       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x78d7
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x78dd
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x78e0
movl %eax, %ecx
imulq %rsi, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x78a7
addl $-0x3, %r12d
jmp 0x78e0
addl $-0x2, %r12d
jmp 0x78e0
decl %r12d
shrl $0x1f, %r15d
movl %r15d, %esi
addl %r12d, %esi
movq %r13, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x5310
movq 0x8(%rsp), %rdi
addq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x7d81
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x50f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7939
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %rbx, %rdi
leaq 0x11934(%rip), %rsi     # 0x19277
callq 0x54b0
movq 0x18(%r14), %r14
jmp 0x7867
movl 0x10(%r14), %r12d
movl %r12d, %ebp
negl %ebp
cmovsl %r12d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x79b2
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x79a9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x79af
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x79b2
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x7976
addl $-0x3, %r14d
jmp 0x79b2
addl $-0x2, %r14d
jmp 0x79b2
decl %r14d
shrl $0x1f, %r12d
movl %r12d, %esi
addl %r14d, %esi
leaq 0x8(%rsp), %r15
movq %r13, (%r15)
movq %r15, %rdi
movl $0x2d, %edx
callq 0x5310
movq (%r15), %rdi
addq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x7d81
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x50f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7a07
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52a0
leaq 0x11612(%rip), %rsi     # 0x19020
movq %rbx, %rdi
callq 0x54b0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7a2e
jmp 0x7a2e
jmp 0x7a2e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7a48
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470