// File: /workspace/github_cpp_makefile_star2_O3/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 $0xb8, %rsp
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq (%rsi), %r13
movq %rsi, 0x28(%rsp)
movq 0x8(%rsi), %rbx
cmpq %rbx, %r13
je 0x79c2
movq 0x8(%rsp), %rax
leaq 0x8848(%rax), %r14
leaq 0x20(%rax), %r12
movslq (%r13), %rax
testq %rax, %rax
movl 0x4(%r13), %ebp
leaq (%r12,%rax,8), %r15
notl %eax
leaq (%r14,%rax,8), %rax
cmovsq %rax, %r15
movq (%r15), %rdi
callq 0x25a74
testb %al, %al
je 0x7af7
movq (%r15), %rsi
leaq 0x20(%rsp), %rdi
movl %ebp, %edx
callq 0x25a82
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x9f9a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x79b9
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r13
cmpq %rbx, %r13
jne 0x7962
movq 0x28(%rsp), %rbx
movl 0x20(%rbx), %eax
cmpl $0x3, %eax
je 0x7afb
cmpl $0x2, %eax
je 0x7a63
cmpl $0x1, %eax
jne 0x7b13
movq 0x28(%rbx), %r13
movq 0x30(%rbx), %rbp
cmpq %rbp, %r13
je 0x7adc
leaq 0x50(%rsp), %r15
leaq 0x18(%rsp), %r12
movq (%r13), %rdi
movb $0x1, %bl
testq %rdi, %rdi
je 0x7a26
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r14
testq %rax, %rax
je 0x7a26
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
xorl %ebx, %ebx
jmp 0x7a2b
xorl %r14d, %r14d
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x9f9a
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7a4b
movq (%rdi), %rax
callq *0x8(%rax)
testb %bl, %bl
jne 0x7a58
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x7a00
jmp 0x7adc
movq 0x40(%rbx), %r13
movq 0x48(%rbx), %r12
cmpq %r12, %r13
je 0x7adc
movq 0x8(%rsp), %r15
leaq 0x8848(%r15), %rbx
addq $0x20, %r15
movslq (%r13), %rax
testq %rax, %rax
movl 0x4(%r13), %ebp
leaq (%r15,%rax,8), %r14
notl %eax
leaq (%rbx,%rax,8), %rax
cmovsq %rax, %r14
movq (%r14), %rdi
callq 0x25a74
testb %al, %al
je 0x7af7
movq (%r14), %rsi
leaq 0x10(%rsp), %rdi
movl %ebp, %edx
callq 0x25a82
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x9f9a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7ad3
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r13
cmpq %r12, %r13
jne 0x7a80
movq 0x28(%rsp), %rax
movl 0x18(%rax), %edi
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x78a9
movl %eax, %ebx
jmp 0x7b76
movb $0x1, %bl
jmp 0x7b76
cmpl $0x8, 0x18(%rbx)
movq 0x8(%rsp), %r14
jne 0x7b17
movb $0x1, 0x1c(%rbx)
movl $0x0, 0x18(%rbx)
jmp 0x7b23
xorl %ebx, %ebx
jmp 0x7b76
testb $0x1, 0x1c(%rbx)
jne 0x7b23
cmpb $0x1, 0x1d(%rbx)
jne 0x7b9e
movslq 0x58(%rbx), %rax
testq %rax, %rax
leaq 0x20(%r14,%rax,8), %rcx
notl %eax
leaq 0x8848(%r14,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %r15
leaq 0xa0(%rsp), %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0xa26a
movl 0x18(%rbx), %edx
movzbl 0x1c(%rbx), %ecx
movzbl 0x1d(%rbx), %r8d
movq %r15, %rdi
movq %r14, %rsi
callq 0x25b5a
movl %eax, %ebx
movq %r14, %rdi
callq 0xa37e
leaq 0x50(%rsp), %rdi
callq 0xa37e
leaq 0x30(%rsp), %rdi
callq 0xa37e
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq 0x58(%rbx), %rax
testq %rax, %rax
leaq 0x20(%r14,%rax,8), %rcx
notl %eax
leaq 0x8848(%r14,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %r15
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa26a
leaq 0x8848(%r14), %rax
addq $0x20, %r14
movslq 0x58(%rbx), %rcx
testq %rcx, %rcx
leaq (%r14,%rcx,8), %rdx
notl %ecx
leaq (%rax,%rcx,8), %rax
cmovsq %rax, %rdx
movl $0x9fd0, %esi           # imm = 0x9FD0
addq (%rdx), %rsi
leaq 0x70(%rsp), %rdi
callq 0xa26a
movl 0x18(%rbx), %ecx
leaq 0x88(%rsp), %r14
leaq 0x70(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x25af0
movl %eax, %ebx
leaq 0x70(%rsp), %rdi
callq 0xa37e
jmp 0x7b6e
movq %rax, %r15
leaq 0x70(%rsp), %rdi
callq 0xa37e
jmp 0x7c3d
movq %rax, %r15
leaq 0x88(%rsp), %rdi
jmp 0x7c52
movq %rax, %r15
leaq 0xa0(%rsp), %rdi
callq 0xa37e
jmp 0x7ca5
jmp 0x7ca2
movq %rax, %r15
jmp 0x7c83
movq %rax, %r15
movq 0x10(%rsp), %rdi
jmp 0x7c95
jmp 0x7ca2
movq %rax, %r15
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7c7f
movq (%rdi), %rax
callq *0x8(%rax)
testb %bl, %bl
jne 0x7ca5
movq (%r14), %rax
movq %r14, %rdi
jmp 0x7c9d
jmp 0x7ca2
movq %rax, %r15
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7ca5
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x7ca5
movq %rax, %r15
leaq 0x50(%rsp), %rdi
callq 0xa37e
leaq 0x30(%rsp), %rdi
callq 0xa37e
movq %r15, %rdi
callq 0x56e0
nop