// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pMainFunctionDefinition()
static void pMainFunctionDefinition()
{
    assert(g_sym == MAINSY);
    TabEntry entry = { GLOBAL, IT_FUNCTION, DT_VOID, -1, -1 };
    tabInsert("main", entry);
    genMidCode(FUNC, "void", "main", NONE);

    readSymbol();
    test3(Symset({LPARENT}));
    readSymbol();
    test3(Symset({RPARENT}));
    readSymbol();
    test3(Symset({LBRACE}));
    readSymbol();
    pConstDefinitions(LOCAL);
    pLocalVariableDefinitions();
    // process statements list
    while (g_sym != RBRACE) {
        pStatement();
    }
    assert(g_sym == RBRACE);
    // NOTE: don't call readSymbol() here because 
    // source program might have no more words
    genMidCode(END, NONE, NONE, NONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
leaq 0x30fde(%rip), %rax     # 0x4b6b0
cmpl $0xf, (%rax)
jne 0x1a6d9
jmp 0x1a6f8
leaq 0x1b35d(%rip), %rdi     # 0x35a3d
leaq 0x1ad41(%rip), %rsi     # 0x35428
movl $0x79, %edx
leaq 0x1b35a(%rip), %rcx     # 0x35a4d
callq 0x3230
movups 0x1acc1(%rip), %xmm0    # 0x353c0
movaps %xmm0, -0x20(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
leaq -0x41(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x3570
movq -0x1d0(%rbp), %rdx
leaq 0x1a9c9(%rip), %rsi     # 0x350f1
leaq -0x40(%rbp), %rdi
callq 0x3440
jmp 0x1a733
leaq -0x40(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2f430
jmp 0x1a742
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x41(%rbp), %rdi
callq 0x3370
movl $0x5, -0x58(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x3570
movq -0x1d8(%rbp), %rdx
leaq 0x1b31c(%rip), %rsi     # 0x35a95
leaq -0x78(%rbp), %rdi
callq 0x3440
jmp 0x1a784
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x3570
movq -0x1e0(%rbp), %rdx
leaq 0x1a94c(%rip), %rsi     # 0x350f1
leaq -0xa0(%rbp), %rdi
callq 0x3440
jmp 0x1a7b3
leaq 0x2c846(%rip), %rcx     # 0x47000
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x26340
jmp 0x1a7d0
leaq -0xa0(%rbp), %rdi
callq 0x35e8
leaq -0xa1(%rbp), %rdi
callq 0x3370
leaq -0x78(%rbp), %rdi
callq 0x35e8
leaq -0x79(%rbp), %rdi
callq 0x3370
callq 0x2e050
movl $0x1d, -0xc4(%rbp)
leaq -0xc4(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq $0x1, -0xb8(%rbp)
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0x227f0
movl $0x22, -0xe8(%rbp)
movl $0x26, -0xe4(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq $0x2, -0xd8(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
callq 0x227f0
movq -0xb0(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x18170
movl $0x1d, -0x104(%rbp)
leaq -0x104(%rbp), %rax
movq %rax, -0x100(%rbp)
movq $0x1, -0xf8(%rbp)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x227f0
leaq 0x30dd6(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0xf0(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1a8f3
jmp 0x1a985
callq 0x2e050
jmp 0x1abff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1a920
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x41(%rbp), %rdi
callq 0x3370
jmp 0x1ac08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1a977
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1a962
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x35e8
leaq -0xa1(%rbp), %rdi
callq 0x3370
leaq -0x78(%rbp), %rdi
callq 0x35e8
leaq -0x79(%rbp), %rdi
callq 0x3370
jmp 0x1ac08
jmp 0x1a987
callq 0x2e050
movl $0x1e, -0x124(%rbp)
leaq -0x124(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x1, -0x118(%rbp)
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x227f0
movl $0x22, -0x148(%rbp)
movl $0x26, -0x144(%rbp)
leaq -0x148(%rbp), %rax
movq %rax, -0x140(%rbp)
movq $0x2, -0x138(%rbp)
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x130(%rbp), %rdi
callq 0x227f0
movq -0x110(%rbp), %rdi
movq -0x130(%rbp), %rsi
callq 0x18170
movl $0x1e, -0x164(%rbp)
leaq -0x164(%rbp), %rax
movq %rax, -0x160(%rbp)
movq $0x1, -0x158(%rbp)
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0x150(%rbp), %rdi
callq 0x227f0
leaq 0x30c49(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x150(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1aa7d
jmp 0x1aa87
callq 0x2e050
jmp 0x1abff
jmp 0x1aa89
callq 0x2e050
movl $0x21, -0x184(%rbp)
leaq -0x184(%rbp), %rax
movq %rax, -0x180(%rbp)
movq $0x1, -0x178(%rbp)
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
leaq -0x170(%rbp), %rdi
callq 0x227f0
movl $0x22, -0x1a8(%rbp)
movl $0x26, -0x1a4(%rbp)
leaq -0x1a8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq $0x2, -0x198(%rbp)
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0x190(%rbp), %rdi
callq 0x227f0
movq -0x170(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0x18170
movl $0x21, -0x1c4(%rbp)
leaq -0x1c4(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq $0x1, -0x1b8(%rbp)
movq -0x1c0(%rbp), %rsi
movq -0x1b8(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x227f0
leaq 0x30b47(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x1b0(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1ab7f
jmp 0x1ab86
callq 0x2e050
jmp 0x1abff
jmp 0x1ab88
callq 0x2e050
movl $0x1, %edi
callq 0x1a690
callq 0x1bb80
leaq 0x30b0d(%rip), %rax     # 0x4b6b0
cmpl $0x22, (%rax)
je 0x1abaf
callq 0x1c2d0
jmp 0x1ab9c
leaq 0x30afa(%rip), %rax     # 0x4b6b0
cmpl $0x22, (%rax)
jne 0x1abbd
jmp 0x1abdc
leaq 0x1aea8(%rip), %rdi     # 0x35a6c
leaq 0x1a85d(%rip), %rsi     # 0x35428
movl $0x8b, %edx
leaq 0x1ae76(%rip), %rcx     # 0x35a4d
callq 0x3230
movl $0x12, -0x1c8(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq 0x2c40c(%rip), %rcx     # 0x47000
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x26340
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)