// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pAssignmentStatement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static void pAssignmentStatement(const std::string &id)
{
    TabEntry entry;

    assert(g_sym == BECOMES);
    readSymbol();
    if (!tabFind(id, entry)) {
        error(ERR_UNDEFINED_IDENTIFIER);
        return;
    }
    if (entry.itype != IT_VARIABLE) {
        // entry.itype might be IT_ARRAY
        error(ERR_LEFT_VALUE_NOT_VARIABLE);
        return;
    }
    std::string rvalue;     // right value
    DataType rvalue_dtype;  // right value's data type
    pExpression(rvalue, rvalue_dtype);
    if (rvalue_dtype != entry.dtype) {
        error(ERR_TYPE_NOT_MATCH);
        return;
    }
    genMidCode(ASSIGN, rvalue, NONE, id);
    test3(Symset({ SEMICOLON }));
    readSymbol();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
leaq 0x2ca3a(%rip), %rax     # 0x4b6b0
cmpl $0x23, (%rax)
jne 0x1ec7d
jmp 0x1ec9c
leaq 0x16d3e(%rip), %rdi     # 0x359c2
leaq 0x1679d(%rip), %rsi     # 0x35428
movl $0x1d0, %edx            # imm = 0x1D0
leaq 0x16d3c(%rip), %rcx     # 0x359d3
callq 0x3230
callq 0x2e050
movq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x2f100
testb $0x1, %al
jne 0x1ed2e
leaq -0x41(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x3570
movq -0x140(%rbp), %rdx
leaq 0x16880(%rip), %rsi     # 0x35550
leaq -0x40(%rbp), %rdi
callq 0x3440
jmp 0x1ecdb
leaq -0x40(%rbp), %rdi
callq 0x18620
jmp 0x1ece6
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x41(%rbp), %rdi
callq 0x3370
jmp 0x1efec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1ed20
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 0x1f001
cmpl $0x1, -0x18(%rbp)
je 0x1edb0
leaq -0x79(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x3570
movq -0x148(%rbp), %rdx
leaq 0x16cb0(%rip), %rsi     # 0x35a02
leaq -0x78(%rbp), %rdi
callq 0x3440
jmp 0x1ed5d
leaq -0x78(%rbp), %rdi
callq 0x18620
jmp 0x1ed68
leaq -0x78(%rbp), %rdi
callq 0x35e8
leaq -0x79(%rbp), %rdi
callq 0x3370
jmp 0x1efec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1eda2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x35e8
leaq -0x79(%rbp), %rdi
callq 0x3370
jmp 0x1f001
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x3450
movq -0x150(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
callq 0x1f630
jmp 0x1edd8
movl -0xa4(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x1ee93
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x3570
movq -0x158(%rbp), %rdx
leaq 0x1670a(%rip), %rsi     # 0x35512
leaq -0xc8(%rbp), %rdi
callq 0x3440
jmp 0x1ee16
leaq -0xc8(%rbp), %rdi
callq 0x18620
jmp 0x1ee24
leaq -0xc8(%rbp), %rdi
callq 0x35e8
leaq -0xc9(%rbp), %rdi
callq 0x3370
movl $0x1, -0xd0(%rbp)
jmp 0x1efe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1eff5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1ee82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x35e8
leaq -0xc9(%rbp), %rdi
callq 0x3370
jmp 0x1eff5
movl $0x0, -0xd4(%rbp)
movq -0x8(%rbp), %rcx
leaq 0x28158(%rip), %rdx     # 0x47000
leaq -0xd4(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x26340
jmp 0x1eebd
jmp 0x1eebf
movl $0x26, -0xf4(%rbp)
leaq -0xf4(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq $0x1, -0xe8(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
callq 0x227f0
jmp 0x1eefe
movl $0x22, -0x118(%rbp)
movl $0x26, -0x114(%rbp)
leaq -0x118(%rbp), %rax
movq %rax, -0x110(%rbp)
movq $0x2, -0x108(%rbp)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x100(%rbp), %rdi
callq 0x227f0
jmp 0x1ef47
movq -0xe0(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x18170
jmp 0x1ef5c
movl $0x26, -0x134(%rbp)
leaq -0x134(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $0x1, -0x128(%rbp)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0x227f0
jmp 0x1ef9b
leaq 0x2c70e(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x120(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1efb8
jmp 0x1efcb
callq 0x2e050
jmp 0x1efbf
movl $0x1, -0xd0(%rbp)
jmp 0x1efe0
jmp 0x1efcd
jmp 0x1efcf
callq 0x2e050
jmp 0x1efd6
movl $0x0, -0xd0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x35e8
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
leaq -0xa0(%rbp), %rdi
callq 0x35e8
movq -0x50(%rbp), %rdi
callq 0x3560
nopw (%rax,%rax)