// File: /workspace/github_cpp_makefile_star2_O3/CHEN-Zhihan[P]Compiler/Node.cpp
// Function: ExprNode::check(std::vector<int, std::allocator<int>>&, int)
void ExprNode::check(vector<int>& sList, int functionID) {
    if (oper != '=') {
        op[0]->check(sList, functionID);
    } else {
        op[1]->check(sList, functionID);
        dynamic_pointer_cast<VarNode>(op[0])->assign(sList, functionID);
        return;
    }
    checkArray(sList, functionID, op[0]);
    unordered_set<int> uniOp{NOT, INTEGER, STRING, CHARACTER, BOOL, VAR, UMINUS, CALL, POSINC, POSDEC, PREINC, PREDEC, CALL};
    if (uniOp.count(oper) == 0) {
        checkArray(sList, functionID, op[1]);
        op[1]->check(sList, functionID);
    }
    if (oper == POSINC or oper == POSDEC or oper == PREINC or oper == PREDEC) {
        if (dynamic_pointer_cast<VarNode>(op[0]) == nullptr) {
            cerr << "Invalid increment/decrement operation" << endl;
            exit(-1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x3d, 0x8(%rdi)
jne 0xcf4d
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
leaq 0xea2e(%rip), %rsi      # 0x1b948
leaq 0xedbf(%rip), %rdx      # 0x1bce0
xorl %ecx, %ecx
callq 0x4250
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
je 0xd04e
movq 0xf07c(%rip), %rcx      # 0x1bfb8
cmpb $0x0, (%rcx)
je 0xd04a
incl 0x8(%rbx)
jmp 0xd04e
leaq 0x18(%rbx), %r12
movq (%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movq %r15, %rsi
movl %r14d, %edx
movq %r12, -0x38(%rbp)
movq %r12, %rcx
callq 0xcd08
movups 0x7802(%rip), %xmm0     # 0x1477c
leaq -0x7c(%rbp), %rdx
movaps %xmm0, -0x14(%rdx)
movups 0x77e3(%rip), %xmm0     # 0x1476c
movaps %xmm0, -0x24(%rdx)
movups 0x77c8(%rip), %xmm0     # 0x1475c
movaps %xmm0, -0x34(%rdx)
movl $0xfffffffd, -0x4(%rdx) # imm = 0xFFFFFFFD
leaq -0x29(%rbp), %rax
movq %rax, (%rsp)
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x2b(%rbp), %r8
leaq -0x2a(%rbp), %r9
xorl %ecx, %ecx
callq 0x1195c
leaq 0x8(%rbx), %r13
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x11a64
testq %rax, %rax
jne 0xcff8
leaq 0x28(%rbx), %r12
movq %r15, %rsi
movl %r14d, %edx
movq %r12, %rcx
callq 0xcd08
movq (%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movl $0xfffffeee, %eax       # imm = 0xFFFFFEEE
addl (%r13), %eax
cmpl $0x3, %eax
ja 0xd083
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xd09e
leaq 0xe92b(%rip), %rsi      # 0x1b948
leaq 0xecbc(%rip), %rdx      # 0x1bce0
xorl %ecx, %ecx
callq 0x4250
testq %rax, %rax
je 0xd09e
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xd083
movq 0xef78(%rip), %rax      # 0x1bfb8
cmpb $0x0, (%rax)
je 0xd07a
incl 0x8(%rdi)
jmp 0xd07e
lock
incl 0x8(%rbx)
movq %rax, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xd0f8
testq %rbx, %rbx
je 0xd08c
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x864c
lock
incl 0x8(%rdi)
callq 0x864c
leaq -0x70(%rbp), %rdi
callq 0xad94
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xef43(%rip), %rdi      # 0x1bfe8
leaq 0x777b(%rip), %rsi      # 0x14827
movl $0x25, %edx
callq 0x4260
movq 0xef2b(%rip), %rdi      # 0x1bfe8
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42a0
movq %rax, %r14
testq %rbx, %rbx
je 0xd0ef
movq %rbx, %rdi
callq 0x864c
jmp 0xd0ef
movq %rax, %r14
jmp 0xd0ef
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0xad94
movq %r14, %rdi
callq 0x43b0
nop