// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::constraintRowKey(Any*, Key*)
int Table::constraintRowKey(Any* data, Key* key) {
    if (key->ty() == 1) {
        for (auto i: key->v) if (data[i].isNull()) return -1;
        Anys val;
        for (auto i: key->v) val.push_back(data[i]);
        vector<int> ans;
        if(this->index[p_key_index].fileID == -1){
            this->index[p_key_index].open();
            ans = this->index[p_key_index].queryRecord(&val);
            this->index[p_key_index].close();
        }
        else ans = this->index[p_key_index].queryRecord(&val);
        if (ans.size() != 0) return -2;
    } else {
        Anys val;
        for (auto i: key->v) val.push_back(data[i]);
        vector <int> ans;
        //if(key->v.size() == 2)printf("%d %d\n",*val[0].anyCast<int>(),*val[1].anyCast<int>());
        Table* p_table = dynamic_cast<ForeignKey*>(key)->p->table;
        if(p_table->index[p_table->p_key_index].fileID == -1){
            p_table->index[p_table->p_key_index].open();
            ans = p_table->index[p_table->p_key_index].queryRecord(&val);
            p_table->index[p_table->p_key_index].close();
        }
        else {ans = p_table->index[p_table->p_key_index].queryRecord(&val);}
        if (ans.size() == 0){
            return -3;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdx), %rax
movq %rdx, %rdi
callq *(%rax)
cmpl $0x1, %eax
jne 0x25dfc
movq %r14, 0x50(%rsp)
movq 0x30(%r15), %r13
movq 0x38(%r15), %r14
cmpq %r14, %r13
sete %al
je 0x25d54
movl (%r13), %ecx
cmpq $0x0, (%rbx,%rcx,8)
je 0x25d47
leaq 0x4(%r13), %rcx
cmpq %r14, %rcx
sete %al
je 0x25d54
movl (%rcx), %edx
addq $0x4, %rcx
cmpq $0x0, (%rbx,%rdx,8)
jne 0x25d32
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %al, %al
je 0x25fd8
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
cmpq %r14, %r13
je 0x25db4
leaq 0x20(%rsp), %r15
leaq 0x48(%rsp), %r12
movl (%r13), %eax
movq (%rbx,%rax,8), %rdi
testq %rdi, %rdi
je 0x25d89
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x25d8b
xorl %eax, %eax
movq %rax, 0x48(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa1bc
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x25dab
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x4, %r13
cmpq %r14, %r13
jne 0x25d74
movq 0x50(%rsp), %r13
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rax
leaq (%rax,%r13), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
cmpl $-0x1, 0x74(%rsi)
je 0x25f4a
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1a1fe
movq (%rsp), %r15
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r12
jmp 0x25fa4
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%r15), %r13
movq 0x38(%r15), %rbp
cmpq %rbp, %r13
je 0x25e64
leaq 0x20(%rsp), %r14
leaq 0x40(%rsp), %r12
movl (%r13), %eax
movq (%rbx,%rax,8), %rdi
testq %rdi, %rdi
je 0x25e39
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x25e3b
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0xa1bc
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x25e5b
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x4, %r13
cmpq %rbp, %r13
jne 0x25e24
leaq 0x2dd05(%rip), %rsi     # 0x53b70
leaq 0x2dd0e(%rip), %rdx     # 0x53b80
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x5430
movq 0x50(%rax), %rax
movq 0x48(%rax), %r13
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rax
leaq (%rax,%r13), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
cmpl $-0x1, 0x74(%rsi)
je 0x25ec0
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1a1fe
movq (%rsp), %r14
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r15
jmp 0x25f1a
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rsi, %rdi
callq 0x19846
leaq 0x7a0(%r13), %rbx
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rsi
addq %rbx, %rsi
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1a1fe
movq (%rsp), %r14
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r15
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rax
addq %rax, %rbx
movq %rbx, %rdi
callq 0x19886
testq %r14, %r14
je 0x25f2d
subq %r14, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x53a0
leaq 0x20(%rsp), %rdi
callq 0xa564
cmpq %r14, %r12
jne 0x25fd6
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
jmp 0x25fd8
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rsi, %rdi
callq 0x19846
leaq 0x7a0(%r13), %rbx
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rsi
addq %rbx, %rsi
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1a1fe
movq (%rsp), %r15
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r12
movslq 0x778(%r13), %rax
imulq $0x98, %rax, %rax
addq %rax, %rbx
movq %rbx, %rdi
callq 0x19886
xorl %ebp, %ebp
cmpq %r15, %r14
sete %bl
testq %r15, %r15
je 0x25fbf
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x53a0
leaq 0x20(%rsp), %rdi
callq 0xa564
cmpq %r15, %r14
je 0x25fd6
movb %bl, %bpl
orl $-0x2, %ebp
jmp 0x25fd8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x25fed
jmp 0x2600b
movq %rax, %rbx
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x25ffb
movq %rax, %rbx
testq %r15, %r15
je 0x26052
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
jmp 0x26027
movq %rax, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x26019
movq %rax, %rbx
testq %r14, %r14
je 0x26052
subq %r14, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x53a0
jmp 0x26052
jmp 0x26030
movq %rax, %rbx
jmp 0x26052
movq %rax, %rbx
movq 0x48(%rsp), %rdi
jmp 0x26047
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x26052
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x20(%rsp), %rdi
callq 0xa564
movq %rbx, %rdi
callq 0x56e0