// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Database.cpp
// Function: Database::checkWhere(WhereStmt&)
bool Database::checkWhere(WhereStmt &w) { // Table::checkWhere
    Anys data, _data;
    for (auto it: w.cols) {
        if (filterTable(it.first)->checkPointer() == false) return true;
        data.push_back(filterTable(it.first)->getPointerColData(it.second));
    }
    switch (w.rvalue_ty) {
    case 0: {
        bool nl = true, nnl = true;
        for (uint i = 0; i < w.cols.size(); i++) {
            nl &= data[i].isNull();
            nnl &= !data[i].isNull();
        }
        return (w.op == OP_NL && nl) && (w.op == OP_NNL && nnl);
    }
    case 1: {
        for (auto it: w.rvalue) {
            _data.push_back(it);
        }
        return cmpCol(w.op, data, _data);
    }
    case 2: {
        for (auto it: w.rvalue_cols) {
            if (filterTable(it.first)->checkPointer() == false) return true;
            _data.push_back(filterTable(it.first)->getPointerColData(it.second));
        }
        return cmpCol(w.op, data, _data);
    }
    case 3:
        if (w.op == OP_IN) w.any = true, w.op = OP_EQ;
        if (w.any || w.all) {
            return filterTable(w.rvalue_table)->cmpRecords(data, w.op, w.any, w.all);
        } else {
            return filterTable(w.rvalue_table)->cmpRecord(data, filterTable(w.rvalue_table)->val, w.op);
        }
    default:
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq (%rsi), %r14
movq %rsi, 0x38(%rsp)
movq 0x8(%rsi), %r12
cmpq %r12, %r14
je 0x7a04
movq 0x8(%rsp), %rax
leaq 0x8848(%rax), %rcx
movq %rcx, 0x18(%rsp)
addq $0x20, %rax
movq %rax, 0x10(%rsp)
movslq (%r14), %rax
testq %rax, %rax
movl 0x4(%r14), %ebx
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %r15
notl %eax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmovsq %rax, %r15
movq (%r15), %rdi
callq 0x26074
movl %eax, %r13d
movb $0x1, %bpl
testb %al, %al
je 0x7c8c
movq (%r15), %rsi
leaq 0x30(%rsp), %rdi
movl %ebx, %edx
callq 0x26082
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa1bc
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x79f2
movq (%rdi), %rax
callq *0x8(%rax)
testb %r13b, %r13b
je 0x7c8c
addq $0x8, %r14
cmpq %r12, %r14
jne 0x798c
movq 0x38(%rsp), %r13
movl 0x20(%r13), %eax
cmpl $0x3, %eax
je 0x7b6d
cmpl $0x2, %eax
je 0x7aa7
cmpl $0x1, %eax
jne 0x7be6
movq 0x28(%r13), %rbx
movq 0x30(%r13), %r13
cmpq %r13, %rbx
je 0x7b4f
leaq 0x60(%rsp), %r15
leaq 0x28(%rsp), %r12
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x7a56
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r14
jmp 0x7a59
xorl %r14d, %r14d
testq %r14, %r14
je 0x7a69
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
jmp 0x7a6b
xorl %eax, %eax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa1bc
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7a8b
movq (%rdi), %rax
callq *0x8(%rax)
testq %r14, %r14
je 0x7a99
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
addq $0x8, %rbx
cmpq %r13, %rbx
jne 0x7a43
jmp 0x7b4f
movq 0x40(%r13), %r12
movq 0x48(%r13), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r12
movq 0x8(%rsp), %rcx
je 0x7b4f
leaq 0x8848(%rcx), %rax
movq %rax, 0x18(%rsp)
addq $0x20, %rcx
movslq (%r12), %rax
testq %rax, %rax
movl 0x4(%r12), %ebx
movq %rcx, %r14
leaq (%rcx,%rax,8), %r15
notl %eax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmovsq %rax, %r15
movq (%r15), %rdi
callq 0x26074
movl %eax, %r13d
movb $0x1, %bpl
testb %al, %al
je 0x7c8c
movq (%r15), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x26082
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xa1bc
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7b38
movq (%rdi), %rax
callq *0x8(%rax)
testb %r13b, %r13b
je 0x7c8c
addq $0x8, %r12
cmpq 0x10(%rsp), %r12
movq %r14, %rcx
jne 0x7ad2
movq 0x38(%rsp), %rax
movl 0x18(%rax), %edi
leaq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x78c5
movl %eax, %ebp
jmp 0x7c8c
cmpl $0x8, 0x18(%r13)
jne 0x7b81
movb $0x1, 0x1c(%r13)
movl $0x0, 0x18(%r13)
cmpb $0x0, 0x1c(%r13)
jne 0x7b8f
cmpb $0x1, 0x1d(%r13)
jne 0x7bed
movslq 0x58(%r13), %rax
testq %rax, %rax
movq 0x8(%rsp), %rdx
leaq 0x20(%rdx,%rax,8), %rcx
notl %eax
leaq 0x8848(%rdx,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %rbx
leaq 0xb0(%rsp), %r14
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0xa450
movl 0x18(%r13), %edx
movzbl 0x1c(%r13), %ecx
movzbl 0x1d(%r13), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2615a
movl %eax, %ebp
jmp 0x7c84
xorl %ebp, %ebp
jmp 0x7c8c
movslq 0x58(%r13), %rax
testq %rax, %rax
movq 0x8(%rsp), %rbx
leaq 0x20(%rbx,%rax,8), %rcx
notl %eax
leaq 0x8848(%rbx,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %r15
leaq 0x98(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xa450
leaq 0x8848(%rbx), %rax
addq $0x20, %rbx
movslq 0x58(%r13), %rcx
testq %rcx, %rcx
leaq (%rbx,%rcx,8), %rdx
notl %ecx
leaq (%rax,%rcx,8), %rax
cmovsq %rax, %rdx
movl $0x9fd0, %esi           # imm = 0x9FD0
addq (%rdx), %rsi
leaq 0x80(%rsp), %rdi
callq 0xa450
movl 0x18(%r13), %ecx
leaq 0x98(%rsp), %r14
leaq 0x80(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x260f0
movl %eax, %ebp
leaq 0x80(%rsp), %rdi
callq 0xa564
movq %r14, %rdi
callq 0xa564
leaq 0x60(%rsp), %rdi
callq 0xa564
leaq 0x40(%rsp), %rdi
callq 0xa564
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xa564
jmp 0x7cc9
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x7cde
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xa564
jmp 0x7d32
jmp 0x7d2f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
jmp 0x7d22
jmp 0x7d2f
movq %rax, %rbx
jmp 0x7d0d
jmp 0x7d2f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7d0d
movq (%rdi), %rax
callq *0x8(%rax)
testq %r14, %r14
je 0x7d32
movq (%r14), %rax
movq %r14, %rdi
jmp 0x7d2a
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7d32
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x7d32
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xa564
leaq 0x40(%rsp), %rdi
callq 0xa564
movq %rbx, %rdi
callq 0x56e0