// File: /workspace/github_cpp_makefile_star2_O1/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 0xd49b
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movl %r14d, %edx
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xd582
leaq 0xe4cb(%rip), %rsi      # 0x1b950
leaq 0xe85c(%rip), %rdx      # 0x1bce8
xorl %ecx, %ecx
callq 0x4250
movq %rax, %rdi
jmp 0xd584
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 0xd262
movups 0x72b4(%rip), %xmm0     # 0x1477c
leaq -0x7c(%rbp), %rdx
movaps %xmm0, -0x14(%rdx)
movups 0x7295(%rip), %xmm0     # 0x1476c
movaps %xmm0, -0x24(%rdx)
movups 0x727a(%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 0x11f30
leaq 0x8(%rbx), %r13
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x12038
testq %rax, %rax
jne 0xd546
leaq 0x28(%rbx), %r12
movq %r15, %rsi
movl %r14d, %edx
movq %r12, %rcx
callq 0xd262
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 0xd604
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xd5cb
leaq 0xe3e5(%rip), %rsi      # 0x1b950
leaq 0xe776(%rip), %rdx      # 0x1bce8
xorl %ecx, %ecx
callq 0x4250
testq %rax, %rax
sete %r14b
jmp 0xd5ce
xorl %edi, %edi
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
je 0xd5a2
movq 0xea2c(%rip), %rax      # 0x1bfc0
cmpb $0x0, (%rax)
je 0xd59e
incl 0x8(%rbx)
jmp 0xd5a2
lock
incl 0x8(%rbx)
movq %r15, %rsi
movl %r14d, %edx
callq 0xd678
testq %rbx, %rbx
je 0xd60d
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x896e
movb $0x1, %r14b
testb %r14b, %r14b
je 0xd5d7
xorl %edi, %edi
jmp 0xd5f5
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xd5f5
movq 0xe9d9(%rip), %rax      # 0x1bfc0
cmpb $0x0, (%rax)
je 0xd5f1
incl 0x8(%rdi)
jmp 0xd5f5
lock
incl 0x8(%rdi)
testq %rdi, %rdi
je 0xd5ff
callq 0x896e
testb %r14b, %r14b
jne 0xd61f
leaq -0x70(%rbp), %rdi
callq 0xb170
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe9ca(%rip), %rdi      # 0x1bff0
leaq 0x71fa(%rip), %rsi      # 0x14827
movl $0x25, %edx
callq 0x4260
movq 0xe9b2(%rip), %rdi      # 0x1bff0
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42a0
movq %rax, %r14
testq %rbx, %rbx
je 0xd670
movq %rbx, %rdi
callq 0x896e
jmp 0xd670
movq %rax, %r14
jmp 0xd670
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0xb170
movq %r14, %rdi
callq 0x43b0