// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Database.cpp
// Function: Database::dfsCross(unsigned int, unsigned int, bool)
void Database::dfsCross(uint idx, uint f_idx, bool print = false) {
    for (auto it: sel[idx].where) {
        if (checkWhere(it) == false) return;
    }
    if (f_idx == sel[idx].from.size()) {
        storeData(idx);
        if (print && sel_table[idx]->record_num % MAX_RESULT_LINES == 0 && sel_table[idx]->printBack(MAX_RESULT_LINES)) {
            puts("====== Press c to continue, q to quit ======");
            while (true) {
                char ch = getch();
                if (ch == 'c') {
                    puts("================= Continue =================");
                    break;
                }
                if (ch == 'q') { 
                    selStop = true;
                    puts("=================== Quit ===================");
                    return; 
                }
            }
        }
    } else {
        filterTable(sel[idx].from[f_idx].first)->initPointer();
        while (filterTable(sel[idx].from[f_idx].first)->movePointer()) {
            dfsCross(idx, f_idx + 1, print);
            if (selStop) {
                filterTable(sel[idx].from[f_idx].first)->removePointer();
                return;
            }
        }
        filterTable(sel[idx].from[f_idx].first)->removePointer();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, 0xc(%rsp)
movl %edx, 0x14(%rsp)
movq %rdi, %rbx
movl %esi, 0x10(%rsp)
movl %esi, %eax
movq %rax, (%rsp)
shlq $0x7, %rax
leaq (%rdi,%rax), %r14
addq $0x848, %r14            # imm = 0x848
movq 0x50(%r14), %r12
movq 0x58(%r14), %rbp
leaq 0x18(%rsp), %r13
cmpq %rbp, %r12
je 0x7163
movq %r13, %rdi
movq %r12, %rsi
callq 0x8834
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6ad4
movl %eax, %r15d
movq %r13, %rdi
callq 0x889e
addq $0x60, %r12
testb %r15b, %r15b
jne 0x712f
jmp 0x72a1
movl 0x14(%rsp), %r12d
movl %r12d, %ecx
movq 0x38(%r14), %rsi
movq 0x40(%r14), %rax
subq %rsi, %rax
pushq $0x28
popq %rdi
cqto
idivq %rdi
cmpq %rcx, %rax
jne 0x71f8
movq %rbx, %rdi
movl 0x10(%rsp), %esi
callq 0x6e7e
cmpb $0x0, 0xc(%rsp)
je 0x72a1
movq (%rsp), %rax
movq 0x8848(%rbx,%rax,8), %rdi
movl 0x9fa0(%rdi), %eax
pushq $0x32
popq %rcx
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0x72a1
pushq $0x32
popq %rsi
callq 0x1eb88
testb %al, %al
je 0x72a1
leaq 0x2c527(%rip), %rdi     # 0x336f9
callq 0x55f0
callq 0x88bd
cmpb $0x71, %al
je 0x72b0
movzbl %al, %eax
cmpl $0x63, %eax
jne 0x71d7
leaq 0x2c533(%rip), %rdi     # 0x33726
jmp 0x72be
imulq $0x28, %rcx, %rbp
movslq (%rsi,%rbp), %rax
leaq 0x8848(%rbx), %rcx
movq %rcx, (%rsp)
leaq 0x20(%rbx), %r13
testq %rax, %rax
leaq 0x20(%rbx,%rax,8), %rcx
notl %eax
leaq 0x8848(%rbx,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %rdi
callq 0x1f0ce
incl %r12d
movzbl 0xc(%rsp), %r15d
movq 0x38(%r14), %rax
movslq (%rax,%rbp), %rax
testq %rax, %rax
leaq (%r13,%rax,8), %rcx
notl %eax
movq (%rsp), %rdx
leaq (%rdx,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %rdi
callq 0x1f0e2
testb %al, %al
je 0x727b
movq %rbx, %rdi
movl 0x10(%rsp), %esi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x70f0
cmpb $0x1, 0x491d9(%rip)     # 0x50452
jne 0x7236
movq 0x38(%r14), %rax
movslq (%rax,%rbp), %rax
testq %rax, %rax
leaq (%r13,%rax,8), %rcx
notl %eax
movq (%rsp), %rdx
leaq (%rdx,%rax,8), %rax
cmovsq %rax, %rcx
movq (%rcx), %rdi
callq 0x1f0d4
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x4919b(%rip)     # 0x50452
leaq 0x2c495(%rip), %rdi     # 0x33753
callq 0x55f0
jmp 0x72a1
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x889e
movq %rbx, %rdi
callq 0x56f0