// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xa3798(%rip), %rdi     # 0xad8d8
leaq 0x4439(%rip), %rsi      # 0xe580
callq 0x5f92
movslq %ebx, %rcx
imulq $0xa8, %rcx, %rcx
leaq 0xa9f3b(%rip), %rdx     # 0xb4098
leaq (%rdx,%rcx), %rbx
addq $0x88, %rbx
testb %al, %al
je 0xa195
movq 0xa371d(%rip), %r14     # 0xad890
cmpq 0xa371e(%rip), %r14     # 0xad898
je 0xa21c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5f9f
testb %al, %al
jne 0xa208
addq $0x50, %r14
jmp 0xa173
movq 0xa370c(%rip), %r12     # 0xad8a8
leaq 0xa3735(%rip), %r15     # 0xad8d8
cmpq 0xa3706(%rip), %r12     # 0xad8b0
je 0xa259
leaq 0x30(%r12), %rdi
movq %r15, %rsi
callq 0x5f9f
testb %al, %al
je 0xa202
movq (%r12), %r14
cmpq 0x8(%r12), %r14
je 0xa1e1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5f9f
testb %al, %al
jne 0xa208
addq $0x50, %r14
jmp 0xa1c5
movq 0x18(%r12), %r14
cmpq 0x20(%r12), %r14
je 0xa202
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5f9f
testb %al, %al
jne 0xa208
addq $0x50, %r14
jmp 0xa1e6
addq $0x60, %r12
jmp 0xa1a3
cmpl $0x1, 0x48(%r14)
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x9dad(%rip), %rdi      # 0x13fd0
leaq 0x4b3f(%rip), %rsi      # 0xed69
callq 0x21d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
leaq 0x4b30(%rip), %rsi      # 0xed71
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
pushq $0x1
popq %rdi
callq 0x2220
movq 0x9d70(%rip), %rdi      # 0x13fd0
leaq 0x4b02(%rip), %rsi      # 0xed69
callq 0x21d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
leaq 0x4b16(%rip), %rsi      # 0xed94
jmp 0xa241