// File: /workspace/github_cpp_makefile_star2_O2/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 0x1c224
testl %eax, %eax
jne 0x1c1e8
movq 0x48(%rbx), %rdi
movl 0x9fa4(%rbx), %esi
movl 0x9fa0(%rbx), %eax
xorl %r15d, %r15d
xorl %edx, %edx
divl 0x9fac(%rbx)
leaq 0x14(%rsp), %rcx
movl %eax, %edx
callq 0x5d50
movq %rax, %rsi
movl 0x9fa0(%rbx), %eax
xorl %edx, %edx
divl 0x9fac(%rbx)
movl %edx, %ecx
andb $0x7, %cl
pushq $0x1
popq %rax
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
leaq 0x28(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x58(%rbx), %r12
movq %r14, %r13
movl 0x54(%rbx), %eax
cmpq %rax, %r15
jae 0x1c11d
movl 0x24(%r12), %ebp
movq %r12, %rdi
callq 0x17ffa
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %eax, %ecx
leaq 0x28(%rsp), %r8
callq 0x1bed4
incq %r15
addq $0x8, %r13
addq $0x38, %r12
jmp 0x1c0e7
leaq 0x7a0(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rbx, 0x18(%rsp)
movl 0x798(%rbx), %eax
cmpq %rax, %rbp
jae 0x1c1d3
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
imulq $0x98, %rbp, %r13
addq 0x20(%rsp), %r13
xorl %ebx, %ebx
movl 0x28(%r13), %eax
cmpq %rax, %rbx
jae 0x1c1ad
movq 0x30(%r13), %rax
movl (%rax,%rbx,4), %eax
movq (%r14,%rax,8), %rdi
testq %rdi, %rdi
je 0x1c186
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x1c188
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x8ea0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c1a8
movq (%rdi), %rax
callq *0x8(%rax)
incq %rbx
jmp 0x1c165
movq 0x18(%rsp), %rbx
movl 0x9fa0(%rbx), %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x16790
movq %r15, %rdi
callq 0x9268
incq %rbp
jmp 0x1c13a
movq 0x48(%rbx), %rdi
movl 0x14(%rsp), %esi
callq 0x5e0a
incl 0x9fa0(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c1f9
movq %rax, %rbx
jmp 0x1c211
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c211
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x9268
movq %rbx, %rdi
callq 0x56f0
nop