// File: /workspace/github_cpp_makefile_star2_O3/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:
movl $0x8, %r8d
leal -0x1(%r8), %eax
cmpq $0x0, 0x20(%rsi,%rax,8)
jne 0x5ca4
decl %r8d
jne 0x5c90
xorl %r8d, %r8d
pushq %rbp
pushq %r14
pushq %rbx
movq 0xa8(%rsi), %r9
movslq %ecx, %rax
movq 0x20(%r9,%rax,8), %r9
movslq %r8d, %r10
movq %r9, 0x20(%rsi,%r10,8)
movq 0xa8(%rsi), %r11
movl (%r11,%rax,4), %r11d
movl %r11d, (%rsi,%r10,4)
movq %rsi, 0x8(%r9)
movq 0x20(%rdx), %r10
testq %r10, %r10
je 0x5d31
movl %r8d, %r9d
leaq 0x1(%r9), %r8
leaq (%rsi,%r9,8), %r11
addq $0x28, %r11
leaq (%rsi,%r9,4), %rbx
addq $0x4, %rbx
xorl %r9d, %r9d
movq %r10, (%r11,%r9,8)
movl (%rdx,%r9,4), %ebp
movl %ebp, (%rbx,%r9,4)
movq 0x60(%rdx,%r9,8), %r14
movq %r14, 0x40(%r11,%r9,8)
testq %r14, %r14
je 0x5d1b
movq %rsi, 0xa8(%r14)
movq (%r11,%r9,8), %r10
movq %rsi, 0x8(%r10)
movq 0x28(%rdx,%r9,8), %r10
incq %r9
testq %r10, %r10
jne 0x5cf5
addl %r9d, %r8d
jmp 0x5d37
incl %r8d
xorl %r9d, %r9d
movq 0x60(%rdx,%r9,8), %r9
movslq %r8d, %r8
movq %r9, 0x60(%rsi,%r8,8)
testq %r9, %r9
je 0x5d50
movq %rsi, 0xa8(%r9)
movq 0x10(%rdi), %r8
movq %r8, 0xa8(%rdx)
movq %rdx, 0x10(%rdi)
cmpl $0x6, %ecx
jg 0x5d9a
addq $0xe, %rax
movq 0xa8(%rsi), %rcx
movq -0x48(%rcx,%rax,8), %rdx
movq %rdx, -0x50(%rcx,%rax,8)
movq 0xa8(%rsi), %rcx
movl -0x34(%rcx,%rax,4), %edx
movl %edx, -0x38(%rcx,%rax,4)
movq (%rcx,%rax,8), %rdx
movq %rdx, -0x8(%rcx,%rax,8)
incq %rax
cmpq $0x15, %rax
jne 0x5d68
movq 0xa8(%rsi), %rax
movq $0x0, 0x58(%rax)
movq 0xa8(%rsi), %rax
cmpq $0x0, 0x20(%rax)
jne 0x5dd4
movq 0x10(%rdi), %rcx
movq %rcx, 0xa8(%rax)
movq %rax, 0x10(%rdi)
movq %rsi, (%rdi)
movq $0x0, 0xa8(%rsi)
popq %rbx
popq %r14
popq %rbp
retq
nop