// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movl %edi, %ebx
leaq 0xa48e9(%rip), %rdi     # 0xb3908
leaq 0x54fa(%rip), %rsi      # 0x14520
callq 0x2090
testl %eax, %eax
je 0xf187
movq 0xa489e(%rip), %r15     # 0xb38d8
movq 0xa489f(%rip), %r12     # 0xb38e0
cmpq %r12, %r15
sete %bpl
movl %ebx, 0xc(%rsp)
je 0xf1ee
movq 0xa48b7(%rip), %rcx     # 0xb3910
movq 0xa48a8(%rip), %rax     # 0xb3908
movq %rax, 0x20(%rsp)
movslq %ebx, %rax
movq %rcx, %rbx
imulq $0xa8, %rax, %rax
leaq 0xab04f(%rip), %rcx     # 0xba0c8
leaq (%rcx,%rax), %r14
addq $0x88, %r14
movq %r12, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
movq 0x38(%r15), %rdx
cmpq %rbx, %rdx
jne 0xf171
testq %rdx, %rdx
je 0xf0b6
movq 0x30(%r15), %rdi
movq 0x20(%rsp), %rsi
callq 0x2240
testl %eax, %eax
jne 0xf171
movb %bpl, 0xb(%rsp)
movq (%r15), %rbx
movq 0x8(%r15), %r12
cmpq %r12, %rbx
sete %bpl
je 0xf104
movq 0x8(%r14), %r13
movq 0x8(%rbx), %rdx
cmpq %r13, %rdx
jne 0xf0ec
testq %rdx, %rdx
je 0xf0fb
movq (%r14), %rsi
movq (%rbx), %rdi
callq 0x2240
testl %eax, %eax
je 0xf0fb
addq $0x50, %rbx
cmpq %r12, %rbx
sete %bpl
jne 0xf0cf
jmp 0xf104
cmpl $0x1, 0x48(%rbx)
sete 0xa(%rsp)
testb $0x1, %bpl
je 0xf241
movq 0x18(%r15), %rbx
movq 0x20(%r15), %r12
cmpq %r12, %rbx
sete %bpl
je 0xf158
movq 0x8(%r14), %r13
movq 0x8(%rbx), %rdx
cmpq %r13, %rdx
jne 0xf140
testq %rdx, %rdx
je 0xf14f
movq (%r14), %rsi
movq (%rbx), %rdi
callq 0x2240
testl %eax, %eax
je 0xf14f
addq $0x50, %rbx
cmpq %r12, %rbx
sete %bpl
jne 0xf123
jmp 0xf158
cmpl $0x1, 0x48(%rbx)
sete 0xa(%rsp)
testb $0x1, %bpl
movq 0x18(%rsp), %r12
movb 0xb(%rsp), %bpl
movq 0x10(%rsp), %rbx
je 0xf246
addq $0x60, %r15
cmpq %r12, %r15
sete %bpl
jne 0xf08e
jmp 0xf246
movl %ebx, %ebp
movq 0xa4730(%rip), %rbx     # 0xb38c0
movq 0xa4731(%rip), %r15     # 0xb38c8
cmpq %r15, %rbx
sete %r14b
je 0xf1f0
movslq %ebp, %rax
imulq $0xa8, %rax, %rax
leaq 0xaaf17(%rip), %rcx     # 0xba0c8
leaq (%rcx,%rax), %r12
addq $0x88, %r12
movq 0x8(%r12), %r13
movq 0x8(%rbx), %rdx
cmpq %r13, %rdx
jne 0xf1df
testq %rdx, %rdx
je 0xf1f2
movq (%r12), %rsi
movq (%rbx), %rdi
callq 0x2240
testl %eax, %eax
je 0xf1f2
addq $0x50, %rbx
cmpq %r15, %rbx
sete %r14b
jne 0xf1c1
jmp 0xf1fb
jmp 0xf246
jmp 0xf1fb
cmpl $0x1, 0x48(%rbx)
sete 0xa(%rsp)
testb $0x1, %r14b
je 0xf24c
movq 0xadc8(%rip), %rdi      # 0x19fd0
leaq 0x5afa(%rip), %rsi      # 0x14d09
callq 0x2210
movslq %ebp, %rcx
imulq $0xa8, %rcx, %rcx
leaq 0xaaea3(%rip), %rdx     # 0xba0c8
leaq (%rdx,%rcx), %rsi
addq $0x88, %rsi
movq %rax, %rdi
callq 0x21f0
leaq 0x5ad2(%rip), %rsi      # 0x14d11
jmp 0xf2a1
movb 0xb(%rsp), %bpl
testb $0x1, %bpl
jne 0xf261
movb 0xa(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xad68(%rip), %rdi      # 0x19fd0
leaq 0x5a9a(%rip), %rsi      # 0x14d09
callq 0x2210
movslq 0xc(%rsp), %rcx
imulq $0xa8, %rcx, %rcx
leaq 0xaae41(%rip), %rdx     # 0xba0c8
leaq (%rdx,%rcx), %rsi
addq $0x88, %rsi
movq %rax, %rdi
callq 0x21f0
leaq 0x5a93(%rip), %rsi      # 0x14d34
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2290