// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Table.cpp
// Function: Table::updateRecord(int, std::vector<std::pair<int, Any>, std::allocator<std::pair<int, Any>>>&)
int Table::updateRecord(const int record_id, vector<Pia> &set) {
    Anys before = queryRecord(record_id);
    Anys after = before;
    for (auto it: set) after[it.first] = it.second;

    int index;
    BufType buf = bpm->getPage(main_file, record_id / record_onepg, index);
    buf += (record_onepg - 1) / 8 + 1;
    buf += record_size * (record_id % record_onepg);
    for (uint i = 0; i < col_num; i++) {
        insert(after[i], col_ty[i].ty, col_ty[i].size(), buf);
    }
    bpm->markDirty(index);

    for (uint i = 0; i < index_num; i++) {
        Anys _b = chooseData(before, this->index[i].key);
        Anys _a = chooseData(after, this->index[i].key);
        if (_b != _a) {
            this->index[i].removeRecord(&_b, record_id);
            this->index[i].insertRecord(&_a, record_id);
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movl %esi, %edx
movq %rdi, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl %edx, 0x8(%rsp)
callq 0x1cc4e
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x9158
movq (%rbx), %r12
movq 0x8(%rbx), %rbx
cmpq %rbx, %r12
je 0x1ce5f
movl (%r12), %r13d
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x1ce4f
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
movq 0x10(%rsp), %rbp
andq $0x0, (%rbp,%r13,8)
testq %rax, %rax
je 0x1ce59
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rax, (%rbp,%r13,8)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x1ce59
movq 0x10(%rsp), %rax
andq $0x0, (%rax,%r13,8)
addq $0x10, %r12
jmp 0x1ce0a
movq 0x48(%r14), %rdi
movl 0x9fa4(%r14), %esi
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl 0x9fac(%r14)
leaq 0xc(%rsp), %rcx
movl %eax, %edx
callq 0x5d50
movq %rax, %rcx
movl 0x9fac(%r14), %esi
leal -0x1(%rsi), %eax
shrl $0x3, %eax
addq %rax, %rcx
xorl %r13d, %r13d
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl %esi
imull 0x9fa8(%r14), %edx
leaq (%rdx,%rcx), %rax
incq %rax
leaq 0x28(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x58(%r14), %r15
xorl %ebx, %ebx
movl 0x54(%r14), %eax
cmpq %rax, %rbx
jae 0x1cefc
movq 0x10(%rsp), %r12
addq %r13, %r12
movl 0x24(%r15), %ebp
movq %r15, %rdi
callq 0x17ffa
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %eax, %ecx
leaq 0x28(%rsp), %r8
callq 0x1bed4
incq %rbx
addq $0x8, %r13
addq $0x38, %r15
jmp 0x1cebe
movq 0x48(%r14), %rdi
movl 0xc(%rsp), %esi
callq 0x5e0a
leaq 0x7d0(%r14), %r15
xorl %ebx, %ebx
leaq 0x60(%rsp), %r12
leaq 0x48(%rsp), %rbp
movl 0x798(%r14), %eax
cmpq %rax, %rbx
jae 0x1cf95
movq %r12, %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rcx
callq 0x1d010
movq %rbp, %rdi
leaq 0x10(%rsp), %rdx
movq %r15, %rcx
callq 0x1d010
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8650
testb %al, %al
je 0x1cf79
leaq -0x30(%r15), %r13
movq %r13, %rdi
movq %r12, %rsi
movl 0x8(%rsp), %edx
callq 0x168cc
movq %r13, %rdi
movq %rbp, %rsi
movl 0x8(%rsp), %edx
callq 0x16790
movq %rbp, %rdi
callq 0x9268
movq %r12, %rdi
callq 0x9268
incq %rbx
addq $0x98, %r15
jmp 0x1cf1c
leaq 0x10(%rsp), %rdi
callq 0x9268
leaq 0x30(%rsp), %rdi
callq 0x9268
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1cffe
jmp 0x1cfd8
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x1cff4
jmp 0x1cfd8
jmp 0x1cfd8
movq %rax, %rbx
jmp 0x1cfea
movq %rax, %rbx
jmp 0x1cff4
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x9268
leaq 0x60(%rsp), %rdi
callq 0x9268
leaq 0x10(%rsp), %rdi
callq 0x9268
leaq 0x30(%rsp), %rdi
callq 0x9268
movq %rbx, %rdi
callq 0x56f0