// File: /workspace/github_cpp_makefile_star2_O3/zhengwangsun[P]pas2c/semantics.cpp
// Function: isTheArray(int)
bool isTheArray(int id_position)
{
    if(currentTable == "main")//若当前符号表为主表
    {
        for(vector<Tuple>::iterator it = mainTable.begin(); it != mainTable.end();it++)//遍历查重
        {
            if(it->name == tree.node[id_position].value)
            {
                if (it->isArray == 1)
                {
                    return true;
                }
                else
                    return false;
            }
        }
        cout<<"the id("<<tree.node[id_position].value<<")is not defined where isTheArray1!"<<endl;
        exit(1);
        return false;
    }
    else//若当前符号表是子表
    {
        //先遍历子表序列
        for(vector<subTableItem>::iterator it = subTable.begin(); it != subTable.end();it++)
        {
            if(it->name == currentTable)//找到当前子表
            {
                for(vector<Tuple>::iterator it0 = it->item.begin(); it0 != it->item.end();it0++)//遍历子表中的item
                {
                    if(it0->name == tree.node[id_position].value)
                    {
                        if (it0->isArray == 1)
                        {
                            return true;
                        }
                        else
                            return false;
                    }
                }
                
                for(vector<Tuple>::iterator it1 = it->argument.begin(); it1 != it->argument.end();it1++)//遍历子表中的argument
                {
                    if(it1->name == tree.node[id_position].value)
                    {
                        if (it1->isArray == 1)
                        {
                            return true;
                        }
                        else
                            return false;
                    }
                }
            }
        }
        cout<<"the id("<<tree.node[id_position].value<<")is not defined where isTheArray2!"<<endl;
        exit(1);
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
leaq 0xa3c94(%rip), %rdi     # 0xb2908
leaq 0x48d5(%rip), %rsi      # 0x13550
callq 0x2090
testl %eax, %eax
je 0xedd3
movq 0xa3c49(%rip), %r13     # 0xb28d8
movq 0xa3c4a(%rip), %rax     # 0xb28e0
movq %rax, 0x10(%rsp)
cmpq %rax, %r13
je 0xee9c
movq 0xa3c65(%rip), %rbx     # 0xb2910
movq 0xa3c56(%rip), %rax     # 0xb2908
movq %rax, 0x8(%rsp)
movslq %ebp, %rax
movq %rax, (%rsp)
imulq $0xa8, %rax, %rax
leaq 0xaa3fc(%rip), %rcx     # 0xb90c8
leaq (%rcx,%rax), %rbp
addq $0x88, %rbp
cmpq %rbx, 0x38(%r13)
jne 0xed83
testq %rbx, %rbx
je 0xecff
movq 0x30(%r13), %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x2240
testl %eax, %eax
jne 0xed83
movq (%r13), %r12
movq 0x8(%r13), %r14
cmpq %r14, %r12
je 0xed41
movq 0x8(%rbp), %r15
cmpq %r15, 0x8(%r12)
jne 0xed38
testq %r15, %r15
je 0xee84
movq (%rbp), %rsi
movq (%r12), %rdi
movq %r15, %rdx
callq 0x2240
testl %eax, %eax
je 0xee84
addq $0x50, %r12
cmpq %r14, %r12
jne 0xed10
movq 0x18(%r13), %r12
movq 0x20(%r13), %r14
cmpq %r14, %r12
je 0xed83
movq 0x8(%rbp), %r15
cmpq %r15, 0x8(%r12)
jne 0xed7a
testq %r15, %r15
je 0xee84
movq (%rbp), %rsi
movq (%r12), %rdi
movq %r15, %rdx
callq 0x2240
testl %eax, %eax
je 0xee84
addq $0x50, %r12
cmpq %r14, %r12
jne 0xed52
addq $0x60, %r13
cmpq 0x10(%rsp), %r13
jne 0xecd7
movq 0xa237(%rip), %rdi      # 0x18fd0
leaq 0x4f99(%rip), %rsi      # 0x13d39
callq 0x2210
imulq $0xa8, (%rsp), %rcx
leaq 0xaa314(%rip), %rdx     # 0xb90c8
leaq (%rdx,%rcx), %rsi
addq $0x88, %rsi
movq %rax, %rdi
callq 0x21f0
leaq 0x4f96(%rip), %rsi      # 0x13d64
jmp 0xee6a
movq 0xa3ae6(%rip), %r12     # 0xb28c0
movq 0xa3ae7(%rip), %r15     # 0xb28c8
movslq %ebp, %r14
cmpq %r15, %r12
je 0xee2f
imulq $0xa8, %r14, %rax
leaq 0xaa2d1(%rip), %rcx     # 0xb90c8
leaq (%rcx,%rax), %r13
addq $0x88, %r13
movq 0x8(%r13), %rbx
cmpq %rbx, 0x8(%r12)
jne 0xee26
testq %rbx, %rbx
je 0xee84
movq (%r13), %rsi
movq (%r12), %rdi
movq %rbx, %rdx
callq 0x2240
testl %eax, %eax
je 0xee84
addq $0x50, %r12
cmpq %r15, %r12
jne 0xee06
movq 0xa19a(%rip), %rdi      # 0x18fd0
leaq 0x4efc(%rip), %rsi      # 0x13d39
callq 0x2210
imulq $0xa8, %r14, %rcx
leaq 0xaa278(%rip), %rdx     # 0xb90c8
leaq (%rdx,%rcx), %rsi
addq $0x88, %rsi
movq %rax, %rdi
callq 0x21f0
leaq 0x4ed7(%rip), %rsi      # 0x13d41
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2290
cmpl $0x1, 0x48(%r12)
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %ebp, %rax
movq %rax, (%rsp)
jmp 0xed92