// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Table.cpp
// Function: Table::insertRecord(Any*)
int Table::insertRecord(Any* data) {
    int x = this->constraintRow(data, record_num, true);
    if (x) return x;
    int index;
    BufType buf = bpm->getPage(main_file, record_num / record_onepg, index);
    exist_set(buf, record_num % record_onepg);
    buf += (record_onepg - 1) / 8 + 1;
    buf += record_size * (record_num % record_onepg);
    for (uint i = 0; i < col_num; i++) {
        insert(data[i], col_ty[i].ty, col_ty[i].size(), buf);
    }
    for (uint i = 0; i < index_num; i++) {
        Anys a;
        for (uint j = 0; j < this->index[i].key_num; j++) {
            a.push_back(data[this->index[i].key[j]]);
        }
        this->index[i].insertRecord(&a, record_num);
    }
    bpm->markDirty(index);
    record_num++;
    /*
    printf("check index_num:%d record_num:%d\n",index_num,record_num);
    for(uint i = 0;i < record_num;i ++){
        Anys temp = queryRecord(i);
        if (temp[0].isNull()) printf("null ");
        else printf("%d ", *temp[0].anyCast<int>());
        if (temp[1].isNull()) printf("null ");
        else printf("%d ", *temp[1].anyCast<int>());
        printf("\n");
    }*/
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %ecx, %ecx
callq 0x22278
testl %eax, %eax
jne 0x2223c
movq 0x48(%rbx), %rdi
movl 0x9fa4(%rbx), %esi
movl 0x9fa0(%rbx), %eax
xorl %edx, %edx
divl 0x9fac(%rbx)
leaq 0x1c(%rsp), %rcx
movl %eax, %edx
callq 0x6834
movq %rax, %rsi
movq %rax, 0x10(%rsp)
movl 0x9fa0(%rbx), %eax
xorl %edx, %edx
divl 0x9fac(%rbx)
movl %edx, %ecx
andb $0x7, %cl
movl $0x1, %eax
shll %cl, %eax
shrl $0x3, %edx
orb %al, (%rsi,%rdx)
movl 0x9fac(%rbx), %ecx
leal -0x1(%rcx), %eax
shrl $0x3, %eax
leaq (%rsi,%rax), %rdi
addq %rsi, %rax
incq %rax
movq %rax, 0x10(%rsp)
movl 0x9fa0(%rbx), %eax
xorl %edx, %edx
divl %ecx
imull 0x9fa8(%rbx), %edx
leaq (%rdx,%rdi), %rax
incq %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x54(%rbx)
je 0x2215d
leaq 0x80(%rbx), %r13
xorl %ebp, %ebp
leaq 0x1f8ed(%rip), %r15     # 0x419f0
movq %r14, %r12
movl -0x4(%r13), %edx
cmpq $0x4, %rdx
ja 0x22135
movslq (%r15,%rdx,4), %rax
addq %r15, %rax
jmpq *%rax
movl $0x4, %ecx
jmp 0x2213a
movl $0x10, %ecx
jmp 0x2213a
movzbl (%r13), %ecx
jmp 0x2213a
movl $0x8, %ecx
jmp 0x2213a
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x10(%rsp), %r8
callq 0x21df2
incq %rbp
movl 0x54(%rbx), %eax
addq $0x8, %r12
addq $0x38, %r13
cmpq %rax, %rbp
jb 0x22106
cmpl $0x0, 0x798(%rbx)
je 0x22227
leaq 0x7a0(%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rbx, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
imulq $0x98, %rbp, %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax), %r13
cmpl $0x0, 0x28(%rcx,%rax)
je 0x221f7
xorl %ebx, %ebx
movq 0x30(%r13), %rax
movl (%rax,%rbx,4), %eax
movq (%r14,%rax,8), %rdi
testq %rdi, %rdi
je 0x221c9
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x221cb
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa1bc
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x221eb
movq (%rdi), %rax
callq *0x8(%rax)
incq %rbx
movl 0x28(%r13), %eax
cmpq %rax, %rbx
jb 0x221b1
movq 0x20(%rsp), %rbx
movl 0x9fa0(%rbx), %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1ae86
movq %r15, %rdi
callq 0xa564
incq %rbp
movl 0x798(%rbx), %eax
cmpq %rax, %rbp
jb 0x22187
movq 0x48(%rbx), %rdi
movl 0x1c(%rsp), %esi
callq 0x68ee
incl 0x9fa0(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2224d
movq %rax, %rbx
jmp 0x22265
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x22265
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0xa564
movq %rbx, %rdi
callq 0x56e0
nop