// File: zhengwangsun[P]pas2c/semantics.cpp
// Function: getIdTuple(int)
Tuple getIdTuple(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)
            {
                return *it;
            }
        }
    }
    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)
                    {
                        return *it0;
                    }
                }
            }
        }
    }
    
    Tuple errorTuple;
    errorTuple.name = "error!";
    return errorTuple;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0xabcc4(%rip), %rdi     # 0xbf978
leaq 0xa7ff(%rip), %rsi      # 0x1e4ba
callq 0xc770
testb $0x1, %al
jne 0x13cc9
jmp 0x13d68
leaq 0xabc60(%rip), %rdi     # 0xbf930
callq 0x14c50
movq %rax, -0x18(%rbp)
leaq 0xabc50(%rip), %rdi     # 0xbf930
callq 0x14cc0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x14c80
testb $0x1, %al
jne 0x13cfc
jmp 0x13d63
leaq -0x18(%rbp), %rdi
callq 0x14cf0
movq %rax, %rdi
movslq -0xc(%rbp), %rax
leaq 0xb2425(%rip), %rsi     # 0xc6138
addq $0x8, %rsi
imulq $0xa8, %rax, %rax
addq %rax, %rsi
addq $0x80, %rsi
callq 0xc840
testb $0x1, %al
jne 0x13d33
jmp 0x13d4d
leaq -0x18(%rbp), %rdi
callq 0x150c0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x150e0
jmp 0x13ecb
jmp 0x13d4f
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x14d30
movq %rax, -0x28(%rbp)
jmp 0x13cd9
jmp 0x13e7e
leaq 0xabbd9(%rip), %rdi     # 0xbf948
callq 0x14b00
movq %rax, -0x30(%rbp)
leaq 0xabbc9(%rip), %rdi     # 0xbf948
callq 0x14b70
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x14b30
testb $0x1, %al
jne 0x13d9e
jmp 0x13e7c
leaq -0x30(%rbp), %rdi
callq 0x14ba0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0xabbc3(%rip), %rsi     # 0xbf978
callq 0xc840
testb $0x1, %al
jne 0x13dc3
jmp 0x13e66
leaq -0x30(%rbp), %rdi
callq 0x14ba0
movq %rax, %rdi
callq 0x14c50
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x14ba0
movq %rax, %rdi
callq 0x14cc0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x14c80
testb $0x1, %al
jne 0x13e00
jmp 0x13e64
leaq -0x40(%rbp), %rdi
callq 0x14cf0
movq %rax, %rdi
movslq -0xc(%rbp), %rax
leaq 0xb2321(%rip), %rsi     # 0xc6138
addq $0x8, %rsi
imulq $0xa8, %rax, %rax
addq %rax, %rsi
addq $0x80, %rsi
callq 0xc840
testb $0x1, %al
jne 0x13e37
jmp 0x13e4e
leaq -0x40(%rbp), %rdi
callq 0x150c0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x150e0
jmp 0x13ecb
jmp 0x13e50
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x14d30
movq %rax, -0x50(%rbp)
jmp 0x13dd8
jmp 0x13e66
jmp 0x13e68
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x14bc0
movq %rax, -0x58(%rbp)
jmp 0x13d78
jmp 0x13e7e
movq -0x80(%rbp), %rdi
movb $0x0, -0x59(%rbp)
callq 0x14ef0
movq -0x80(%rbp), %rdi
leaq 0xaa1b(%rip), %rsi      # 0x1e8b1
callq 0x3380
jmp 0x13e9d
movb $0x1, -0x59(%rbp)
testb $0x1, -0x59(%rbp)
jne 0x13ec9
jmp 0x13ec0
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x14f90
jmp 0x13ed8
movq -0x80(%rbp), %rdi
callq 0x14f90
jmp 0x13ecb
movq -0x78(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3450
nopw %cs:(%rax,%rax)