// File: Konano[P]UselessDatabase/Database.cpp
// Function: Database::storeData(unsigned int)
void Database::storeData(uint idx) {
    Anys data;
    if (sel[idx].select.size() == 0) {
        if (sel[idx].aggr.size() == 0) {
            for (auto it: sel[idx].from) {
                data.concatenate(filterTable(it.first)->getPointerData());
            }
        } else {
            for (auto it: sel[idx].aggr) if (it.ty != AG_COUNT) {
                data.push_back(filterTable(it.col.first)->getPointerColData(it.col.second));
            }
        }
    } else {
        for (auto it: sel[idx].select) {
            data.push_back(filterTable(it.first)->getPointerColData(it.second));
        }
    }
    if (data.size()) sel_table[idx]->data.push_back(data);
    sel_table[idx]->record_num += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xc310
movq -0x110(%rbp), %rdi
addq $0x848, %rdi            # imm = 0x848
movl -0xc(%rbp), %eax
shlq $0x7, %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0xc8d0
cmpq $0x0, %rax
jne 0x93e5
movq -0x110(%rbp), %rdi
addq $0x848, %rdi            # imm = 0x848
movl -0xc(%rbp), %eax
shlq $0x7, %rax
addq %rax, %rdi
addq $0x20, %rdi
callq 0xca70
cmpq $0x0, %rax
jne 0x9276
movq -0x110(%rbp), %rax
addq $0x848, %rax            # imm = 0x848
movl -0xc(%rbp), %ecx
shlq $0x7, %rcx
addq %rcx, %rax
addq $0x38, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xcaa0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xcad0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xcb00
testb $0x1, %al
jne 0x918b
jmp 0x9271
leaq -0x38(%rbp), %rdi
callq 0xcb40
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xcb60
jmp 0x91a2
cmpl $0x0, -0x68(%rbp)
jge 0x91cb
movq -0x110(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl -0x68(%rbp), %ecx
movslq %ecx, %rcx
movq 0x8848(%rax,%rcx,8), %rax
movq %rax, -0x118(%rbp)
jmp 0x91e2
movq -0x110(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x4f130
jmp 0x91f7
leaq -0x28(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xcba0
jmp 0x9209
leaq -0x90(%rbp), %rdi
callq 0xc430
leaq -0x68(%rbp), %rdi
callq 0xcc10
leaq -0x38(%rbp), %rdi
callq 0xcc30
jmp 0x9175
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x9583
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x9263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xc430
leaq -0x68(%rbp), %rdi
callq 0xcc10
jmp 0x9583
jmp 0x93e0
movq -0x110(%rbp), %rax
addq $0x848, %rax            # imm = 0x848
movl -0xc(%rbp), %ecx
shlq $0x7, %rcx
addq %rcx, %rax
addq $0x20, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0xcc50
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0xcc80
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xccb0
testb $0x1, %al
jne 0x92da
jmp 0x93de
leaq -0xa0(%rbp), %rdi
callq 0xccf0
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0xcd10
jmp 0x92f7
cmpl $0x0, -0xd8(%rbp)
je 0x93b0
cmpl $0x0, -0xd4(%rbp)
jge 0x9333
movq -0x110(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl -0xd4(%rbp), %ecx
movslq %ecx, %rcx
movq 0x8848(%rax,%rcx,8), %rax
movq %rax, -0x120(%rbp)
jmp 0x934d
movq -0x110(%rbp), %rax
movslq -0xd4(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rsi
movl -0xd0(%rbp), %edx
leaq -0xe0(%rbp), %rdi
callq 0x4f0a0
jmp 0x9368
leaq -0x28(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xc330
jmp 0x937a
leaq -0xe0(%rbp), %rdi
callq 0xc3c0
jmp 0x93b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x93cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xc3c0
jmp 0x93cd
leaq -0xd8(%rbp), %rdi
callq 0xcd50
leaq -0xa0(%rbp), %rdi
callq 0xcd70
jmp 0x92be
leaq -0xd8(%rbp), %rdi
callq 0xcd50
jmp 0x9583
jmp 0x93e0
jmp 0x950e
movq -0x110(%rbp), %rax
addq $0x848, %rax            # imm = 0x848
movl -0xc(%rbp), %ecx
shlq $0x7, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
callq 0xc7f0
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rdi
callq 0xc820
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xc850
testb $0x1, %al
jne 0x9449
jmp 0x950c
leaq -0xf0(%rbp), %rdi
callq 0xc890
movq (%rax), %rax
movq %rax, -0x100(%rbp)
cmpl $0x0, -0x100(%rbp)
jge 0x948e
movq -0x110(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl -0x100(%rbp), %ecx
movslq %ecx, %rcx
movq 0x8848(%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
jmp 0x94a8
movq -0x110(%rbp), %rax
movslq -0x100(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rsi
movl -0xfc(%rbp), %edx
leaq -0x108(%rbp), %rdi
callq 0x4f0a0
jmp 0x94c3
leaq -0x28(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xc330
jmp 0x94d5
leaq -0x108(%rbp), %rdi
callq 0xc3c0
leaq -0xf0(%rbp), %rdi
callq 0xc8b0
jmp 0x942d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xc3c0
jmp 0x9583
jmp 0x950e
leaq -0x28(%rbp), %rdi
callq 0xcd90
movl %eax, -0x12c(%rbp)
jmp 0x951f
movl -0x12c(%rbp), %eax
cmpl $0x0, %eax
je 0x9550
movq -0x110(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0x8848(%rax,%rcx,8), %rdi
addq $0x9fb8, %rdi           # imm = 0x9FB8
leaq -0x28(%rbp), %rsi
callq 0xcdb0
jmp 0x954e
jmp 0x9550
movq -0x110(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0x8848(%rax,%rcx,8), %rax
movl 0x9fa0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x9fa0(%rax)
leaq -0x28(%rbp), %rdi
callq 0xc430
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0xc430
movq -0x70(%rbp), %rdi
callq 0x6890
nopw %cs:(%rax,%rax)