// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pScanfStatement()
static void pScanfStatement()
{
    TabEntry entry;

    assert(g_sym == SCANFSY);
    readSymbol();
    test3(Symset({LPARENT}));
    readSymbol();
    int count = 0;
    while (true) {
        count++;
        test3(Symset({IDENTSY}));
        readSymbol();
        if (!tabFind(g_id, entry)) {
            error(ERR_UNDEFINED_IDENTIFIER);
        } 
        else if (entry.itype != IT_VARIABLE || (
                 entry.dtype != DT_INT &&
                 entry.dtype != DT_CHAR)) {
            error(ERR_WRONG_TYPE_OF_SCANF);
        }
        genMidCode(READ, entry.dtype == DT_INT ? "int" : "char", g_id, NONE);
        if (g_sym != COMMA) {
            break;
        }
        readSymbol();
    }
    if (count == 0) {
        error(ERR_SCANF_NO_ARGUMENTS);
    }
    test3(Symset({RPARENT}));
    readSymbol();
    test3(Symset({SEMICOLON}));
    readSymbol();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
leaq 0x2dcae(%rip), %rax     # 0x4b6b0
cmpl $0xc, (%rax)
jne 0x1da09
jmp 0x1da28
leaq 0x17e7b(%rip), %rdi     # 0x3588b
leaq 0x17a11(%rip), %rsi     # 0x35428
movl $0x18d, %edx            # imm = 0x18D
leaq 0x17e79(%rip), %rcx     # 0x3589c
callq 0x3230
callq 0x2e050
movl $0x1d, -0x34(%rbp)
leaq -0x34(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x1, -0x28(%rbp)
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0x227f0
movl $0x22, -0x58(%rbp)
movl $0x26, -0x54(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x2, -0x48(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x227f0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x18170
movl $0x1d, -0x74(%rbp)
leaq -0x74(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x1, -0x68(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x227f0
leaq 0x2dbf0(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x60(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1dad3
jmp 0x1dadd
callq 0x2e050
jmp 0x1e0f0
jmp 0x1dadf
callq 0x2e050
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl $0x0, -0x94(%rbp)
leaq -0x94(%rbp), %rax
movq %rax, -0x90(%rbp)
movq $0x1, -0x88(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x227f0
movl $0x22, -0xb8(%rbp)
movl $0x26, -0xb4(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0x2, -0xa8(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x227f0
movq -0x80(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x18170
movl $0x0, -0xd4(%rbp)
leaq -0xd4(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq $0x1, -0xc8(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x227f0
leaq 0x2dae7(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0xc0(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1dbdf
jmp 0x1dbe9
callq 0x2e050
jmp 0x1e0f0
jmp 0x1dbeb
callq 0x2e050
leaq 0x2dac1(%rip), %rdi     # 0x4b6b8
leaq -0x14(%rbp), %rsi
callq 0x2f100
testb $0x1, %al
jne 0x1dca5
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x3570
movq -0x250(%rbp), %rdx
leaq 0x17927(%rip), %rsi     # 0x35550
leaq -0xf8(%rbp), %rdi
callq 0x3440
jmp 0x1dc37
leaq -0xf8(%rbp), %rdi
callq 0x18620
jmp 0x1dc45
leaq -0xf8(%rbp), %rdi
callq 0x35e8
leaq -0xf9(%rbp), %rdi
callq 0x3370
jmp 0x1dd5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x1dc94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x35e8
leaq -0xf9(%rbp), %rdi
callq 0x3370
jmp 0x1e0f9
cmpl $0x1, -0x10(%rbp)
jne 0x1dcbf
cmpl $0x1, -0xc(%rbp)
je 0x1dd59
cmpl $0x2, -0xc(%rbp)
je 0x1dd59
leaq -0x131(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x3570
movq -0x258(%rbp), %rdx
leaq 0x17bd3(%rip), %rsi     # 0x358b3
leaq -0x130(%rbp), %rdi
callq 0x3440
jmp 0x1dcee
leaq -0x130(%rbp), %rdi
callq 0x18620
jmp 0x1dcfc
leaq -0x130(%rbp), %rdi
callq 0x35e8
leaq -0x131(%rbp), %rdi
callq 0x3370
jmp 0x1dd59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x1dd48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x35e8
leaq -0x131(%rbp), %rdi
callq 0x3370
jmp 0x1e0f9
jmp 0x1dd5b
movl $0x10, -0x138(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
leaq 0x17a37(%rip), %rcx     # 0x357a9
leaq 0x1733a(%rip), %rax     # 0x350b3
cmoveq %rcx, %rax
movq %rax, -0x268(%rbp)
leaq -0x159(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x3570
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
leaq -0x158(%rbp), %rdi
callq 0x3440
jmp 0x1ddb3
leaq 0x2d8fe(%rip), %rdx     # 0x4b6b8
leaq 0x2923f(%rip), %rcx     # 0x47000
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x26340
jmp 0x1ddd6
leaq -0x158(%rbp), %rdi
callq 0x35e8
leaq -0x159(%rbp), %rdi
callq 0x3370
leaq 0x2d8bb(%rip), %rax     # 0x4b6b0
cmpl $0x24, (%rax)
je 0x1de3f
jmp 0x1de49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x1de2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x35e8
leaq -0x159(%rbp), %rdi
callq 0x3370
jmp 0x1e0f9
callq 0x2e050
jmp 0x1daeb
cmpl $0x0, -0x78(%rbp)
jne 0x1deed
leaq -0x181(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x3570
movq -0x270(%rbp), %rdx
leaq 0x17a6e(%rip), %rsi     # 0x358e2
leaq -0x180(%rbp), %rdi
callq 0x3440
jmp 0x1de82
leaq -0x180(%rbp), %rdi
callq 0x18620
jmp 0x1de90
leaq -0x180(%rbp), %rdi
callq 0x35e8
leaq -0x181(%rbp), %rdi
callq 0x3370
jmp 0x1deed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x1dedc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x35e8
leaq -0x181(%rbp), %rdi
callq 0x3370
jmp 0x1e0f9
jmp 0x1deef
movl $0x1e, -0x1a4(%rbp)
leaq -0x1a4(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq $0x1, -0x198(%rbp)
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0x190(%rbp), %rdi
callq 0x227f0
movl $0x22, -0x1c8(%rbp)
movl $0x26, -0x1c4(%rbp)
leaq -0x1c8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq $0x2, -0x1b8(%rbp)
movq -0x1c0(%rbp), %rsi
movq -0x1b8(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x227f0
movq -0x190(%rbp), %rdi
movq -0x1b0(%rbp), %rsi
callq 0x18170
movl $0x1e, -0x1e4(%rbp)
leaq -0x1e4(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq $0x1, -0x1d8(%rbp)
movq -0x1e0(%rbp), %rsi
movq -0x1d8(%rbp), %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x227f0
leaq 0x2d6e6(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x1d0(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1dfe0
jmp 0x1dfea
callq 0x2e050
jmp 0x1e0f0
jmp 0x1dfec
callq 0x2e050
movl $0x26, -0x204(%rbp)
leaq -0x204(%rbp), %rax
movq %rax, -0x200(%rbp)
movq $0x1, -0x1f8(%rbp)
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x227f0
movl $0x22, -0x228(%rbp)
movl $0x26, -0x224(%rbp)
leaq -0x228(%rbp), %rax
movq %rax, -0x220(%rbp)
movq $0x2, -0x218(%rbp)
movq -0x220(%rbp), %rsi
movq -0x218(%rbp), %rdx
leaq -0x210(%rbp), %rdi
callq 0x227f0
movq -0x1f0(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x18170
movl $0x26, -0x244(%rbp)
leaq -0x244(%rbp), %rax
movq %rax, -0x240(%rbp)
movq $0x1, -0x238(%rbp)
movq -0x240(%rbp), %rsi
movq -0x238(%rbp), %rdx
leaq -0x230(%rbp), %rdi
callq 0x227f0
leaq 0x2d5e4(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x230(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e0e2
jmp 0x1e0e9
callq 0x2e050
jmp 0x1e0f0
jmp 0x1e0eb
callq 0x2e050
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x108(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)