// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pFunctionDefinition(DataType const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static void pFunctionDefinition(const DataType &dtype, const std::string &id)
{
    TabEntry entry = { GLOBAL, IT_FUNCTION, dtype, -1, -1 };
    tabInsert(id, entry);
    current_function_tabEntry = entry;
    std::string t = (dtype == DT_INT ? "int" :
            dtype == DT_CHAR ? "char" : "void");
    genMidCode(FUNC, t, id, NONE);

    if (g_sym == LPARENT) {
        pParametersList(id);
    }
    test(Symset({LBRACE}), Symset({}));
    readSymbol();
    pConstDefinitions(LOCAL);
    pLocalVariableDefinitions();
    pStatementsList();
    genMidCode(END, NONE, NONE, NONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x2, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x2f430
movq -0x24(%rbp), %rax
movq %rax, 0x2bbc0(%rip)     # 0x47020
movq -0x1c(%rbp), %rax
movq %rax, 0x2bbbd(%rip)     # 0x47028
movl -0x14(%rbp), %eax
movl %eax, 0x2bbbc(%rip)     # 0x47030
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x1b48d
leaq 0x1a325(%rip), %rax     # 0x357a9
movq %rax, -0xa8(%rbp)
jmp 0x1b4c4
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1b4a6
leaq 0x19c16(%rip), %rax     # 0x350b3
movq %rax, -0xb0(%rbp)
jmp 0x1b4b6
leaq 0x1a5e8(%rip), %rax     # 0x35a95
movq %rax, -0xb0(%rbp)
jmp 0x1b4b6
movq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x3570
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x3440
jmp 0x1b4fb
leaq -0x49(%rbp), %rdi
callq 0x3370
movl $0x5, -0x60(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x2baea(%rip), %rcx     # 0x47000
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x26340
jmp 0x1b525
leaq 0x30184(%rip), %rax     # 0x4b6b0
cmpl $0x1d, (%rax)
jne 0x1b572
movq -0x10(%rbp), %rdi
callq 0x1b640
jmp 0x1b53c
jmp 0x1b572
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x3370
jmp 0x1b62e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x35e8
jmp 0x1b62e
movl $0x21, -0x7c(%rbp)
leaq -0x7c(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x1, -0x70(%rbp)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x227f0
jmp 0x1b59c
leaq -0x98(%rbp), %rdi
callq 0x228b0
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x227f0
jmp 0x1b5c4
movq -0x68(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x18170
jmp 0x1b5d6
callq 0x2e050
jmp 0x1b5dd
movl $0x1, %edi
callq 0x1a690
jmp 0x1b5e9
callq 0x1bb80
jmp 0x1b5f0
callq 0x1c2b0
jmp 0x1b5f7
movl $0x12, -0x9c(%rbp)
leaq 0x2b9f8(%rip), %rcx     # 0x47000
leaq -0x9c(%rbp), %rdi
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1b61c
leaq -0x48(%rbp), %rdi
callq 0x35e8
addq $0xc0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3560
nopw (%rax,%rax)