// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/../dasynq/include/dasynq/btree_set.h
// Function: dasynq::btree_set<void*, int, std::less<int>, 8>::merge(dasynq::btree_set<void*, int, std::less<int>, 8>::septnode*, dasynq::btree_set<void*, int, std::less<int>, 8>::septnode*, int)
void merge(septnode *lsibling, septnode *rsibling, int index) noexcept
    {
        int lchildren = lsibling->num_vals();
        lsibling->hn_p[lchildren] = lsibling->parent->hn_p[index];
        lsibling->prio[lchildren] = lsibling->parent->prio[index];
        lsibling->hn_p[lchildren]->parent = lsibling;
        lchildren++;

        // bool leaf = lsibling->is_leaf();

        int ri = 0;
        for (ri = 0; rsibling->hn_p[ri] != nullptr; ri++) {
            lsibling->hn_p[lchildren] = rsibling->hn_p[ri];
            lsibling->prio[lchildren] = rsibling->prio[ri];
            lsibling->children[lchildren] = rsibling->children[ri];
            if (lsibling->children[lchildren]) lsibling->children[lchildren]->parent = lsibling;
            lsibling->hn_p[lchildren]->parent = lsibling;
            lchildren++;
        }
        lsibling->children[lchildren] = rsibling->children[ri];
        if (lsibling->children[lchildren]) lsibling->children[lchildren]->parent = lsibling;
        release_sept(rsibling);

        // Now delete in the parent:
        for (int i = index; i < (N-1); i++) {
            lsibling->parent->hn_p[i] = lsibling->parent->hn_p[i + 1];
            lsibling->parent->prio[i] = lsibling->parent->prio[i + 1];
            lsibling->parent->children[i + 1] = lsibling->parent->children[i + 2];
        }
        lsibling->parent->hn_p[N-1] = nullptr;

        if (lsibling->parent->hn_p[0] == nullptr) {
            // parent is now empty; it must be root. Make us the new root.
            release_sept(lsibling->parent);
            root_sept = lsibling;
            lsibling->parent = nullptr;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x100000000, %r12      # imm = 0x100000000
movq %rsi, %rdi
callq 0x58f4
movq 0xa8(%rbx), %rdx
movslq %ebp, %rcx
movq 0x20(%rdx,%rcx,8), %rdi
cltq
leaq (%rbx,%rax,8), %rdx
movq %rdi, 0x20(%rdx)
movq 0xa8(%rbx), %rsi
movl (%rsi,%rcx,4), %r8d
leaq (%rbx,%rax,4), %rsi
movl %r8d, (%rsi)
movq %rbx, 0x8(%rdi)
shlq $0x20, %rax
addq %r12, %rax
pushq $0x30
popq %rdi
movq -0x40(%r15,%rdi,2), %r8
testq %r8, %r8
je 0x59ac
movq %r8, -0x38(%rdx,%rdi,2)
movl -0x30(%r15,%rdi), %r9d
movl %r9d, -0x2c(%rsi,%rdi)
movq (%r15,%rdi,2), %r9
movq %r9, 0x8(%rdx,%rdi,2)
testq %r9, %r9
je 0x599f
movq %rbx, 0xa8(%r9)
movq -0x38(%rdx,%rdi,2), %r8
movq %rbx, 0x8(%r8)
addq $0x4, %rdi
addq %r12, %rax
jmp 0x596c
movq (%r15,%rdi,2), %rdx
sarq $0x1d, %rax
movq %rdx, 0x60(%rbx,%rax)
testq %rdx, %rdx
je 0x59c5
movq %rbx, 0xa8(%rdx)
movq 0x10(%r14), %rax
movq %rax, 0xa8(%r15)
movq %r15, 0x10(%r14)
movq 0xa8(%rbx), %rax
cmpq $0x7, %rcx
jge 0x5a08
movq 0x28(%rax,%rcx,8), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movq 0xa8(%rbx), %rax
movl 0x4(%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq 0x70(%rax,%rcx,8), %rdx
movq %rdx, 0x68(%rax,%rcx,8)
incq %rcx
jmp 0x59d4
andq $0x0, 0x58(%rax)
movq 0xa8(%rbx), %rax
cmpq $0x0, 0x20(%rax)
jne 0x5a35
movq 0x10(%r14), %rcx
movq %rcx, 0xa8(%rax)
movq %rax, 0x10(%r14)
movq %rbx, (%r14)
andq $0x0, 0xa8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq