// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9470
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq 0x20(%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpq $0x0, 0x20(%rax,%rcx,8)
je 0x9617
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x60(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, 0x60(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpq $0x0, 0x60(%rax,%rcx,8)
je 0x95eb
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq 0x60(%rax,%rdx,8), %rax
movq %rcx, 0xa8(%rax)
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq 0x20(%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9565
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x60(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, 0x60(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpq $0x0, 0x60(%rax,%rcx,8)
je 0x9659
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rdx
movq 0x60(%rax,%rdx,8), %rax
movq %rcx, 0xa8(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9440
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x7, -0x28(%rbp)
jge 0x970c
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl -0x28(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq 0x60(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, 0x60(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x966c
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x58(%rax)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x975f
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x9440
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0xa8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop