// File: /workspace/github_cpp_makefile_star2_O2/fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pLocalVariableDefinitions()
static void pLocalVariableDefinitions()
{
    while (g_sym == INTSY || g_sym == CHARSY) {
        DataType dtype = (g_sym == INTSY ? DT_INT : DT_CHAR);
        std::string type_str = (dtype == DT_INT ? "int" : "char");
        while (true) {
            // g_sym always points to the one before idnetifier
            readSymbol(); // skip comma or INTSY or CHARSY
            test3(Symset({IDENTSY}));
            std::string id = g_id;
            readSymbol(); // skip identifier
            if (g_sym == LBRACK) {      // array definition
                readSymbol(); // skip left bracket
                test3(Symset({INTVALUE}));
                int array_size = g_num;
                TabEntry entry = { LOCAL, IT_ARRAY, dtype, array_size, -1 };
                tabInsert(id, entry);
                genMidCode(VAR, type_str, id, std::to_string(array_size));
                readSymbol(); // skip size number
                test3(Symset({RBRACK}));
                readSymbol();
            } else {                    // normal variable definition
                TabEntry entry = { LOCAL, IT_VARIABLE, dtype, -1, -1 };
                tabInsert(id, entry);
                genMidCode(VAR, type_str, id, NONE);
            }
            if (g_sym != COMMA) {
                break;
            }
        }
        test3(Symset({SEMICOLON}));
        readSymbol();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0x18c2f(%rip), %r15     # 0x24610
leaq -0xc8(%rbp), %r14
leaq -0x68(%rbp), %r12
pushq $0x1
popq %r13
movl (%r15), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0xbd26
xorl %ecx, %ecx
cmpl $0x2, %eax
setne %cl
leaq 0xa6d5(%rip), %rsi      # 0x160e5
leaq 0xac3e(%rip), %rax      # 0x16655
cmoveq %rax, %rsi
incl %ecx
movl %ecx, -0x30(%rbp)
leaq -0xe8(%rbp), %rdi
movq %r14, %rdx
callq 0x30f0
callq 0x13808
andl $0x0, -0x68(%rbp)
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xef20
movabsq $0x2600000022, %rax     # imm = 0x2600000022
movq %rax, -0xc8(%rbp)
leaq -0xa0(%rbp), %rdi
movq %r14, %rsi
pushq $0x2
popq %rdx
callq 0xef20
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x9f5f
andl $0x0, -0x68(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xef20
movq -0xc8(%rbp), %rax
movl (%r15), %ecx
btq %rcx, %rax
jae 0xbcf1
movq %r14, %rdi
leaq 0x18b68(%rip), %rsi     # 0x24618
callq 0x3350
callq 0x13808
cmpl $0x1f, (%r15)
jne 0xbc22
callq 0x13808
movl $0x11, -0x44(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x44(%rbp), %rsi
movq %r13, %rdx
callq 0xef20
movabsq $0x2600000022, %rax     # imm = 0x2600000022
movq %rax, -0x68(%rbp)
leaq -0x90(%rbp), %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
callq 0xef20
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x9f5f
movl $0x11, -0x44(%rbp)
movq %r12, %rdi
leaq -0x44(%rbp), %rsi
movq %r13, %rdx
callq 0xef20
movq -0x68(%rbp), %rax
movl (%r15), %ecx
btq %rcx, %rax
jae 0xbcfb
leaq 0x18af8(%rip), %rax     # 0x2463c
movl (%rax), %ebx
movabsq $0x300000001, %rax      # imm = 0x300000001
movq %rax, -0x44(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl %ebx, -0x38(%rbp)
orl $-0x1, -0x34(%rbp)
movq %r14, %rdi
leaq -0x44(%rbp), %rsi
callq 0x14287
movl $0x8, -0x2c(%rbp)
movq %r12, %rdi
movl %ebx, %esi
callq 0xef70
leaq -0x2c(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x100d0
movq %r12, %rdi
callq 0x3498
callq 0x13808
movl $0x20, -0x2c(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
movq %r13, %rdx
callq 0xef20
movabsq $0x2600000022, %rax     # imm = 0x2600000022
movq %rax, -0x68(%rbp)
leaq -0x80(%rbp), %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
callq 0xef20
leaq 0x18a31(%rip), %rbx     # 0x24610
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x9f5f
movl $0x20, -0x2c(%rbp)
movq %r12, %rdi
leaq -0x2c(%rbp), %rsi
movq %r13, %rdx
callq 0xef20
movl (%rbx), %ebx
movq -0x68(%rbp), %r15
callq 0x13808
btq %rbx, %r15
leaq 0x189f5(%rip), %r15     # 0x24610
jb 0xbc67
jmp 0xbd00
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0x68(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x60(%rbp)
orq $-0x1, -0x5c(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x14287
movl $0x8, -0x44(%rbp)
leaq -0x44(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movq %r14, %rdx
leaq 0x142fe(%rip), %rcx     # 0x1ff60
callq 0x100d0
movl (%r15), %ebx
movq %r14, %rdi
callq 0x3498
cmpl $0x24, %ebx
je 0xba2f
movl $0x26, -0x68(%rbp)
leaq -0x78(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xef20
movabsq $0x2600000022, %rax     # imm = 0x2600000022
movq %rax, -0xc8(%rbp)
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
pushq $0x2
popq %rdx
callq 0xef20
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x9f5f
movl $0x26, -0x68(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xef20
movq -0xc8(%rbp), %rax
movl (%r15), %ecx
xorl %ebx, %ebx
btq %rcx, %rax
setae %r15b
callq 0x13808
movb %r15b, %bl
jmp 0xbd0b
callq 0x13808
pushq $0x1
popq %rbx
jmp 0xbd0b
callq 0x13808
movq %r14, %rdi
callq 0x3498
pushq $0x1
popq %rbx
leaq -0xe8(%rbp), %rdi
callq 0x3498
testl %ebx, %ebx
leaq 0x188f0(%rip), %r15     # 0x24610
je 0xb9f0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbd6c
jmp 0xbd7d
jmp 0xbd7d
jmp 0xbd7d
jmp 0xbd7d
jmp 0xbd6c
jmp 0xbd6c
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3498
jmp 0xbd6f
jmp 0xbd6c
jmp 0xbd6c
jmp 0xbd6c
jmp 0xbd6c
jmp 0xbd6c
jmp 0xbd6c
jmp 0xbd7d
jmp 0xbd6c
jmp 0xbd7d
jmp 0xbd7d
jmp 0xbd7d
jmp 0xbd6c
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x3498
jmp 0xbd80
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x3498
movq %rbx, %rdi
callq 0x3430