// File: /workspace/github_cpp_makefile_star2_O3/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 0x21d7a
testl %eax, %eax
jne 0x21d3f
movq 0x48(%rbx), %rdi
movl 0x9fa4(%rbx), %esi
movl 0x9fa0(%rbx), %eax
xorl %edx, %edx
divl 0x9fac(%rbx)
leaq 0x14(%rsp), %rcx
movl %eax, %edx
callq 0x67e4
movq %rax, %rsi
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 0x9fa0(%rbx), %eax
movl 0x9fac(%rbx), %ecx
leal -0x1(%rcx), %edi
shrl $0x3, %edi
addq %rsi, %rdi
xorl %edx, %edx
divl %ecx
imull 0x9fa8(%rbx), %edx
leaq (%rdx,%rdi), %rax
incq %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x54(%rbx)
je 0x21c60
leaq 0x80(%rbx), %r13
xorl %ebp, %ebp
leaq 0x1edda(%rip), %r15     # 0x409e0
movq %r14, %r12
movl -0x4(%r13), %edx
cmpq $0x4, %rdx
ja 0x21c38
movslq (%r15,%rdx,4), %rax
addq %r15, %rax
jmpq *%rax
movl $0x4, %ecx
jmp 0x21c3d
movl $0x10, %ecx
jmp 0x21c3d
movzbl (%r13), %ecx
jmp 0x21c3d
movl $0x8, %ecx
jmp 0x21c3d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x28(%rsp), %r8
callq 0x218fe
incq %rbp
movl 0x54(%rbx), %eax
addq $0x8, %r12
addq $0x38, %r13
cmpq %rax, %rbp
jb 0x21c09
cmpl $0x0, 0x798(%rbx)
je 0x21d2a
leaq 0x7a0(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rbx, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
imulq $0x98, %rbp, %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax), %r13
cmpl $0x0, 0x28(%rcx,%rax)
je 0x21cfa
xorl %ebx, %ebx
movq 0x30(%r13), %rax
movl (%rax,%rbx,4), %eax
movq (%r14,%rax,8), %rdi
testq %rdi, %rdi
je 0x21ccc
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x21cce
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x9f9a
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x21cee
movq (%rdi), %rax
callq *0x8(%rax)
incq %rbx
movl 0x28(%r13), %eax
cmpq %rax, %rbx
jb 0x21cb4
movq 0x18(%rsp), %rbx
movl 0x9fa0(%rbx), %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1a6ca
movq %r15, %rdi
callq 0xa37e
incq %rbp
movl 0x798(%rbx), %eax
cmpq %rax, %rbp
jb 0x21c8a
movq 0x48(%rbx), %rdi
movl 0x14(%rsp), %esi
callq 0x689e
incl 0x9fa0(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21d50
movq %rax, %rbx
jmp 0x21d68
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x21d68
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0xa37e
movq %rbx, %rdi
callq 0x56e0