// File: /workspace/github_cpp_makefile_star2_O1/zimpha[P]MiniSQL/indexManager.cc
// Function: BT::insert(element const&, long)
void insert(const element &e, long offset) {
        auto go = [&] (long off) { return blockToNode(*(bfm->BufferManagerRead(name, off))); };
        BTNode c;//s
        map <long, long> parent;
        while (!c.isLeaf) {
            int i = 0;
            while (i < c.n && c.value[i] <= e) i++;
            parent[c.ch[i]] = c.offset;
            c = go(c.ch[i]);
        }
        if (c.n < SZ - 1) {
            //BT::insert_in_leaf(c, e, offset);
        } else { // split
            BTNode p = BT::newNode();
            vector < pair <element, long> > v;
            for (int i = 0; i < c.n; i++) v.push_back(make_pair(c.value[i], c.ch[i]));
            auto it = v.begin();
            while (it != v.end() && e < it->first) it++;
            v.insert(it, make_pair(e, offset));
            int m = (SZ + 1) / 2;
            p.ch[SZ] = c.ch[SZ];
            c.ch[SZ] = p.offset;
            c.n = m;
            p.n = v.size() - m;
            for (size_t i = 0; i < v.size(); i++) {
                (i < m ? c.value[i] : p.value[i - m]) = v[i].first;
                (i < m ? c.ch[i]    : p.ch[i - m]   ) = v[i].second;
            }
            BT::insertParent(parent, c, p.value[0], p);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3fd8, %rsp           # imm = 0x3FD8
movq %rsi, %rbx
movq %rdi, %r14
leaq -0xe50(%rbp), %r15
xorl %r12d, %r12d
leaq 0x18(%r15), %rdi
callq 0x13164
addq $-0x30, %r12
addq $0x30, %r15
cmpq $-0xd80, %r12           # imm = 0xF280
jne 0xb1b0
movq %rbx, -0x48(%rbp)
leaq -0xb0(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
cmpb $0x0, -0x1088(%rbp)
jne 0xb32e
leaq -0x10a0(%rbp), %rbx
movl $0x258, %r12d           # imm = 0x258
movq %r14, -0x50(%rbp)
cmpl $0x0, -0x1084(%rbp)
jle 0xb245
leaq -0xe38(%rbp), %r15
xorl %r13d, %r13d
movq %r15, %rdi
movq %r14, %rsi
callq 0x1344e
testb %al, %al
je 0xb240
incq %r13
movslq -0x1084(%rbp), %rax
addq $0x30, %r15
cmpq %rax, %r13
jl 0xb21e
movl %r13d, %eax
jmp 0xb247
xorl %eax, %eax
movq -0x1080(%rbp), %r13
leaq -0xe38(%rbp), %rcx
leaq (%rcx,%rax,8), %r15
addq $-0x240, %r15           # imm = 0xFDC0
leaq -0xb8(%rbp), %rdi
movq %r15, %rsi
callq 0xc928
movq %r13, (%rax)
movq (%r15), %rdx
movq 0x100ac(%rip), %rdi     # 0x1b328
leaq 0x100ad(%rip), %rsi     # 0x1b330
callq 0x9384
leaq -0x2058(%rbp), %r14
movq %r14, %rdi
callq 0xa621
movl $0x250, %edx            # imm = 0x250
leaq -0x1088(%rbp), %rdi
movq %r14, %rsi
callq 0x3210
xorl %r15d, %r15d
leaq (%r15,%rbp), %r13
addq $-0x1088, %r13          # imm = 0xEF78
leaq -0x2058(%rbp,%r15), %r14
movq 0x250(%r14), %rax
movq %rax, 0x250(%r13)
leaq (%r12,%r13), %rdi
leaq (%r14,%r12), %rsi
callq 0x3340
movl 0x278(%r14), %eax
movl %eax, 0x278(%r13)
addq $0x30, %r15
cmpq $0xd80, %r15            # imm = 0xD80
jne 0xb2ae
xorl %r15d, %r15d
movq -0x50(%rbp), %r14
movq -0x10b0(%rbp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0xb314
callq 0x3270
addq $-0x30, %r15
cmpq $-0xd80, %r15           # imm = 0xF280
jne 0xb2fe
cmpb $0x0, -0x1088(%rbp)
je 0xb20b
cmpl $0x46, -0x1084(%rbp)
jl 0xb6e8
leaq -0x2058(%rbp), %rdi
callq 0xa772
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x0, -0x1084(%rbp)
jle 0xb3dc
leaq -0xe38(%rbp), %rbx
xorl %r13d, %r13d
leaq -0x40(%rbp), %r15
leaq -0x88(%rbp), %r12
movq (%rbx), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x8766
movl 0x28(%rbx), %eax
movl %eax, -0x60(%rbp)
movq -0x1078(%rbp,%r13,8), %rax
movq %rax, -0x58(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xccf2
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xb3c9
callq 0x3270
incq %r13
movslq -0x1084(%rbp), %rax
addq $0x30, %rbx
cmpq %rax, %r13
jl 0xb374
movq -0x40(%rbp), %rbx
cmpq -0x38(%rbp), %rbx
je 0xb3fb
movq %r14, %rdi
movq %rbx, %rsi
callq 0x132bc
testb %al, %al
je 0xb3fb
addq $0x38, %rbx
jmp 0xb3e0
movq (%r14), %rax
leaq -0x80(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0x70(%rbp), %rax
movq %rax, (%rdi)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
callq 0x8766
movl 0x28(%r14), %eax
leaq -0x88(%rbp), %rdx
movl %eax, 0x28(%rdx)
movq -0x48(%rbp), %rax
movq %rax, 0x30(%rdx)
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xda08
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xb451
callq 0x3270
movq -0x40(%rbp), %r12
movq -0x38(%rbp), %rax
movq -0xe40(%rbp), %rcx
movq %rcx, -0x1e10(%rbp)
movq -0x2050(%rbp), %rcx
movq %rcx, -0xe40(%rbp)
movq %rax, %rcx
subq %r12, %rcx
shrq $0x3, %rcx
imull $0xb6db6db7, %ecx, %ecx # imm = 0xB6DB6DB7
addl $-0x24, %ecx
movl $0x24, -0x1084(%rbp)
movl %ecx, -0x2054(%rbp)
cmpq %r12, %rax
je 0xb558
leaq -0x1078(%rbp), %rsi
leaq -0xe38(%rbp), %r15
leaq -0x2168(%rbp), %rdi
leaq -0x24c8(%rbp), %r13
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %rdi, -0x48(%rbp)
movq %rsi, -0x50(%rbp)
cmpq $0x24, %r14
movq %r13, %rdi
cmovbq %r15, %rdi
leaq (%r12,%rbx), %rsi
addq $0x8, %rsi
movq -0x8(%rsi), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x3150
cmpq $0x24, %r14
movq %r13, %rax
cmovbq %r15, %rax
movl 0x28(%r12,%rbx), %ecx
movl %ecx, 0x28(%rax)
movq -0x40(%rbp), %rax
movq 0x30(%rax,%rbx), %rax
movq -0x48(%rbp), %rdi
movq %rdi, %rcx
movq -0x50(%rbp), %rsi
cmovbq %rsi, %rcx
movq %rax, (%rcx)
incq %r14
movq -0x40(%rbp), %r12
movq -0x38(%rbp), %rax
subq %r12, %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
addq $0x8, %rsi
addq $0x30, %r15
addq $0x8, %rdi
addq $0x30, %r13
addq $0x38, %rbx
cmpq %rax, %r14
jb 0xb4c2
leaq -0x3ff8(%rbp), %rdi
leaq -0x1088(%rbp), %rsi
movl $0x250, %edx            # imm = 0x250
callq 0x3210
xorl %r14d, %r14d
movq -0xe38(%rbp,%r14), %rax
movq -0xe30(%rbp,%r14), %rsi
leaq (%r14,%rbp), %rdi
addq $-0x3da0, %rdi          # imm = 0xC260
movq %rax, -0x8(%rdi)
leaq (%r14,%rbp), %rax
addq $-0x3d90, %rax          # imm = 0xC270
movq %rax, -0x10(%rax)
movq -0xe28(%rbp,%r14), %rdx
addq %rsi, %rdx
callq 0x8766
movl -0xe10(%rbp,%r14), %eax
movl %eax, -0x3d80(%rbp,%r14)
addq $0x30, %r14
cmpq $0xd80, %r14            # imm = 0xD80
jne 0xb573
leaq -0x3028(%rbp), %rdi
leaq -0x2058(%rbp), %rsi
movl $0x250, %edx            # imm = 0x250
callq 0x3210
leaq -0x1e08(%rbp), %rbx
xorl %r14d, %r14d
movq -0x1e08(%rbp,%r14), %rax
movq -0x1e00(%rbp,%r14), %rsi
leaq (%r14,%rbp), %rdi
addq $-0x2dd0, %rdi          # imm = 0xD230
movq %rax, -0x8(%rdi)
leaq (%r14,%rbp), %rax
addq $-0x2dc0, %rax          # imm = 0xD240
movq %rax, -0x10(%rax)
movq -0x1df8(%rbp,%r14), %rdx
addq %rsi, %rdx
callq 0x8766
movl -0x1de0(%rbp,%r14), %eax
movl %eax, -0x2db0(%rbp,%r14)
addq $0x30, %r14
cmpq $0xd80, %r14            # imm = 0xD80
jne 0xb5ef
leaq -0xb8(%rbp), %rdi
leaq -0x3ff8(%rbp), %rsi
leaq -0x3028(%rbp), %rcx
movq %rbx, %rdx
callq 0xa964
movq $-0xd80, %rbx           # imm = 0xF280
leaq -0x2070(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0xb682
callq 0x3270
addq $-0x30, %r14
addq $0x30, %rbx
jne 0xb674
movq $-0xd80, %rbx           # imm = 0xF280
leaq -0x3040(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0xb6a8
callq 0x3270
addq $-0x30, %r14
addq $0x30, %rbx
jne 0xb69a
leaq -0x40(%rbp), %rdi
callq 0xc844
leaq -0x10a0(%rbp), %rbx
xorl %r14d, %r14d
movq -0x10b0(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0xb6db
callq 0x3270
addq $-0x30, %r14
cmpq $-0xd80, %r14           # imm = 0xF280
jne 0xb6c5
leaq -0xb8(%rbp), %rdi
callq 0xcc62
leaq -0xd0(%rbp), %rbx
xorl %r14d, %r14d
movq -0xe0(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0xb714
callq 0x3270
addq $-0x30, %r14
cmpq $-0xd80, %r14           # imm = 0xF280
jne 0xb6fe
addq $0x3fd8, %rsp           # imm = 0x3FD8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x3028(%rbp), %rdi
callq 0x35d8
jmp 0xb7aa
jmp 0xb759
jmp 0xb751
jmp 0xb855
jmp 0xb751
jmp 0xb751
movq %rax, %rbx
jmp 0xb800
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xb800
callq 0x3270
jmp 0xb800
jmp 0xb855
movq %rax, %rbx
testq %r14, %r14
je 0xb7aa
leaq (%r14,%rbp), %r15
addq $-0x2df0, %r15          # imm = 0xD210
negq %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xb7a0
callq 0x3270
addq $-0x30, %r15
addq $0x30, %r14
jne 0xb792
movq $-0xd80, %r14           # imm = 0xF280
leaq -0x3040(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xb7c6
callq 0x3270
addq $-0x30, %r15
addq $0x30, %r14
jne 0xb7b8
jmp 0xb800
movq %rax, %rbx
testq %r14, %r14
je 0xb800
leaq (%r14,%rbp), %r15
addq $-0x3dc0, %r15          # imm = 0xC240
negq %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xb7f6
callq 0x3270
addq $-0x30, %r15
addq $0x30, %r14
jne 0xb7e8
leaq -0x40(%rbp), %rdi
callq 0xc844
movq $-0xd80, %r14           # imm = 0xF280
leaq -0x10a0(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xb825
callq 0x3270
addq $-0x30, %r15
addq $0x30, %r14
jne 0xb817
jmp 0xb858
jmp 0xb855
movq %rax, %rbx
testq %r12, %r12
je 0xb891
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xb849
callq 0x3270
addq $-0x30, %r15
addq $0x30, %r12
jne 0xb83b
jmp 0xb891
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0xcc62
leaq -0xd0(%rbp), %r14
xorl %r15d, %r15d
movq -0xe0(%rbp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0xb884
callq 0x3270
addq $-0x30, %r15
cmpq $-0xd80, %r15           # imm = 0xF280
jne 0xb86e
movq %rbx, %rdi
callq 0x3480
nop