// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pStatement()
static void pStatement()
{
    std::string id;
    switch (g_sym) {
        case SEMICOLON: pEmptyStatement(); break;
        case LBRACE:    readSymbol(); pStatementsList(); break;
        case IFSY:      pIfElseStatement(); break;
        case DOSY:      pDoWhileStatement(); break;
        case SWITCHSY:  pSwitchCaseStatement(); break;
        case PRINTFSY:  pPrintfStatement(); break;
        case SCANFSY:   pScanfStatement(); break;
        case RETURNSY:  pReturnStatement(); break;
        case IDENTSY:
            // must be function call statement or assignment statement
            // should be determined from symbol table
            id = g_id;
            readSymbol();
            switch (g_sym) {
                case LBRACK:    pArrayAssignmentStatement(id); break;
                case BECOMES:   pAssignmentStatement(id); break;
                case LPARENT:   
                case SEMICOLON: pFunctionCallStatement(id); break;
                default:        error(ERR_WRONG_STATEMENT); break;
            }
            break;
        default:
            test(Symset({SEMICOLON, LBRACE, IFSY, DOSY, SWITCHSY,
                PRINTFSY, SCANFSY, RETURNSY, IDENTSY}), Symset({}));
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
leaq -0x20(%rbp), %rdi
callq 0x3450
leaq 0x2f3c5(%rip), %rax     # 0x4b6b0
movl (%rax), %eax
movq %rax, -0xc0(%rbp)
subq $0x26, %rax
ja 0x1c482
movq -0xc0(%rbp), %rax
leaq 0x18f88(%rip), %rcx     # 0x35294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x1c530
jmp 0x1c31c
jmp 0x1c507
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1c519
callq 0x2e050
jmp 0x1c339
callq 0x1c2b0
jmp 0x1c340
jmp 0x1c507
callq 0x1c570
jmp 0x1c34c
jmp 0x1c507
callq 0x1ca70
jmp 0x1c358
jmp 0x1c507
callq 0x1ce60
jmp 0x1c364
jmp 0x1c507
callq 0x1d2c0
jmp 0x1c370
jmp 0x1c507
callq 0x1d9f0
jmp 0x1c37c
jmp 0x1c507
callq 0x1e110
jmp 0x1c388
jmp 0x1c507
leaq 0x2f324(%rip), %rsi     # 0x4b6b8
leaq -0x20(%rbp), %rdi
callq 0x3040
jmp 0x1c39f
callq 0x2e050
jmp 0x1c3a6
leaq 0x2f303(%rip), %rax     # 0x4b6b0
movl (%rax), %eax
addl $-0x1d, %eax
movl %eax, %ecx
movq %rcx, -0xc8(%rbp)
subl $0x9, %eax
ja 0x1c404
movq -0xc8(%rbp), %rax
leaq 0x18f62(%rip), %rcx     # 0x35330
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x20(%rbp), %rdi
callq 0x1e5e0
jmp 0x1c3e2
jmp 0x1c47d
leaq -0x20(%rbp), %rdi
callq 0x1ec60
jmp 0x1c3f2
jmp 0x1c47d
leaq -0x20(%rbp), %rdi
callq 0x1f010
jmp 0x1c402
jmp 0x1c47d
leaq -0x51(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3570
movq -0xd0(%rbp), %rdx
leaq 0x19085(%rip), %rsi     # 0x354a7
leaq -0x50(%rbp), %rdi
callq 0x3440
jmp 0x1c42d
leaq -0x50(%rbp), %rdi
callq 0x18620
jmp 0x1c438
leaq -0x50(%rbp), %rdi
callq 0x35e8
leaq -0x51(%rbp), %rdi
callq 0x3370
jmp 0x1c47d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1c46f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x35e8
leaq -0x51(%rbp), %rdi
callq 0x3370
jmp 0x1c519
jmp 0x1c507
movups 0x18ef3(%rip), %xmm0    # 0x3537c
movaps %xmm0, -0x90(%rbp)
movups 0x18ed5(%rip), %xmm0    # 0x3536c
movaps %xmm0, -0xa0(%rbp)
movl $0x0, -0x80(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x9, -0x68(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x227f0
jmp 0x1c4cb
leaq -0xb8(%rbp), %rdi
callq 0x228b0
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x227f0
jmp 0x1c4f3
movq -0x60(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x18170
jmp 0x1c505
jmp 0x1c507
leaq -0x20(%rbp), %rdi
callq 0x35e8
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x35e8
movq -0x28(%rbp), %rdi
callq 0x3560
nopl (%rax,%rax)