// File: Konano[P]UselessDatabase/Table.cpp
// Function: Table::queryRecord(int)
Anys Table::queryRecord(const int record_id) {
    if (sel) return this->data[record_id];
    Anys data;
    BufType buf = bpm->getPage(main_file, record_id / record_onepg);
    if (exist(buf, record_id % record_onepg)) {
        buf += (record_onepg - 1) / 8 + 1;
        buf += record_size * (record_id % record_onepg);
        Any any;
        for (uint i = 0; i < col_num; i++) {
            fetch(buf, col_ty[i].ty, col_ty[i].size(), any);
            data.push_back(any);
        }
    }
    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, 0x9fb0(%rax)
je 0x4b047
movq -0x50(%rbp), %rdi
addq $0x9fb8, %rdi           # imm = 0x9FB8
movslq -0x14(%rbp), %rsi
callq 0x52170
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0xc400
jmp 0x4b206
movq -0x60(%rbp), %rdi
movb $0x0, -0x15(%rbp)
callq 0xc310
movq -0x50(%rbp), %rcx
movq 0x48(%rcx), %rdi
movl 0x9fa4(%rcx), %esi
movl -0x14(%rbp), %eax
movl 0x9fac(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %edx
callq 0x70b0
movq %rax, -0x68(%rbp)
jmp 0x4b07c
movq -0x50(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x14(%rbp), %eax
xorl %edx, %edx
divl 0x9fac(%rcx)
movq -0x78(%rbp), %rax
shrl $0x3, %edx
movl %edx, %edx
movzbl (%rax,%rdx), %eax
movl %eax, -0x6c(%rbp)
movl -0x14(%rbp), %eax
xorl %edx, %edx
divl 0x9fac(%rcx)
movl -0x6c(%rbp), %eax
movl %edx, %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x4b1e6
movq -0x50(%rbp), %rdx
movl 0x9fac(%rdx), %eax
decl %eax
shrl $0x3, %eax
movq -0x20(%rbp), %rcx
leaq 0x1(%rax,%rcx), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl 0x9fa8(%rdx), %ecx
movl 0x9fac(%rdx), %esi
xorl %edx, %edx
divl %esi
imull %edx, %ecx
movq -0x20(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xd240
jmp 0x4b11a
movl $0x0, -0x3c(%rbp)
movq -0x50(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x54(%rcx), %eax
jae 0x4b1d0
movq -0x50(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
leaq 0x58(%rax,%rcx), %rdi
movl 0x7c(%rax,%rcx), %eax
movl %eax, -0x80(%rbp)
callq 0x3d3d0
movl %eax, -0x7c(%rbp)
jmp 0x4b152
movl -0x7c(%rbp), %ecx
movl -0x80(%rbp), %edx
movq -0x50(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %r8
callq 0x47380
jmp 0x4b16b
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xca00
jmp 0x4b17a
movq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xc330
jmp 0x4b189
leaq -0x48(%rbp), %rdi
callq 0xc3c0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x4b121
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4b1fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4b1db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xc3c0
jmp 0x4b1db
leaq -0x38(%rbp), %rdi
callq 0xc3c0
jmp 0x4b1e6
leaq -0x38(%rbp), %rdi
callq 0xc3c0
jmp 0x4b1fb
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x4b1f9
movq -0x60(%rbp), %rdi
callq 0xc430
jmp 0x4b206
movq -0x60(%rbp), %rdi
callq 0xc430
jmp 0x4b213
movq -0x58(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x6890
nopl (%rax)