// 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>::repop_node(dasynq::btree_set<void*, int, std::less<int>, 8>::septnode*, int)
void repop_node(septnode *sept, int children) noexcept
    {
        start:
        septnode *parent = sept->parent;
        if (parent == nullptr) {
            // It's the root node, so don't worry about it, unless empty
            if (sept->hn_p[0] == nullptr) {
                root_sept = nullptr;
                left_sept = nullptr;
                release_sept(sept);
            }
            return;
        }

        // Find a suitable sibling to the left or right:
        if (parent->children[0] == sept) {
            // take right sibling
            septnode *rsibling = parent->children[1];
            if (rsibling->num_vals() + children + 1 <= N) {
                // We can merge
                merge(sept, rsibling, 0);
                if (sept->parent != nullptr) {
                    children = sept->parent->num_vals();
                    if (children < N/2) {
                        sept = sept->parent;
                        goto start;
                    }
                }
            }
            else {
                sept->hn_p[children] = parent->hn_p[0];
                sept->prio[children] = parent->prio[0];
                sept->hn_p[children]->parent = sept;
                sept->children[children + 1] = rsibling->children[0];
                if (sept->children[children + 1]) sept->children[children + 1]->parent = sept;

                parent->hn_p[0] = rsibling->hn_p[0];
                parent->prio[0] = rsibling->prio[0];
                parent->hn_p[0]->parent = parent;

                rsibling->shift_elems_left(1, 0, N-1);
                rsibling->hn_p[N-1] = nullptr;
                return;
            }
        }
        else {
            // find left sibling
            int i;
            for (i = 1; i < N; i++) {
                if (parent->children[i] == sept) {
                    break;
                }
            }

            septnode *lsibling = parent->children[i-1];
            int lchildren = lsibling->num_vals();
            if (lchildren + children + 1 <= N) {
                // merge
                merge(lsibling, sept, i - 1);
                if (lsibling->parent != nullptr) {
                    children = lsibling->parent->num_vals();
                    if (children < N/2) {
                        sept = lsibling->parent;
                        goto start;
                    }
                }
            }
            else {
                sept->shift_elems_right(0, 1, children);

                sept->hn_p[0] = parent->hn_p[i - 1];
                sept->prio[0] = parent->prio[i - 1];
                sept->hn_p[0]->parent = sept;
                sept->children[0] = lsibling->children[lchildren];
                if (sept->children[0]) sept->children[0]->parent = sept;

                parent->hn_p[i - 1] = lsibling->hn_p[lchildren - 1];
                parent->prio[i - 1] = lsibling->prio[lchildren - 1];
                parent->hn_p[i - 1]->parent = parent;
                lsibling->hn_p[lchildren - 1] = nullptr;

                return;
            }
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %eax
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0xa8(%rsi), %r14
movq 0xa8(%rsi), %rsi
testq %rsi, %rsi
je 0x5b59
cmpq %rdx, 0x60(%rsi)
je 0x5ae3
xorl %ecx, %ecx
cmpq %rdx, 0x68(%rsi,%rcx,8)
je 0x5a82
incq %rcx
cmpq $0x7, %rcx
jne 0x5a6d
movl $0x7, %ecx
movslq %ecx, %rdi
movq 0x60(%rsi,%rdi,8), %r14
movl $0x8, %r8d
leal -0x1(%r8), %r9d
cmpq $0x0, 0x20(%r14,%r9,8)
jne 0x5aa4
decl %r8d
jne 0x5a90
xorl %r8d, %r8d
leal (%r8,%rax), %r9d
cmpl $0x7, %r9d
jg 0x5b7a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5c8a
movq 0xa8(%r14), %rdx
testq %rdx, %rdx
je 0x5c81
movl $0x8, %eax
leal -0x1(%rax), %ecx
cmpq $0x0, 0x20(%rdx,%rcx,8)
jne 0x5b3d
decl %eax
jne 0x5ad2
jmp 0x5b39
movq 0x68(%rsi), %rcx
movl $0x8, %edi
leal -0x1(%rdi), %r8d
cmpq $0x0, 0x20(%rcx,%r8,8)
jne 0x5afe
decl %edi
jne 0x5aec
xorl %edi, %edi
addl %eax, %edi
cmpl $0x7, %edi
jg 0x5c07
movq %rbx, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0x5c8a
movq (%r14), %rdx
testq %rdx, %rdx
je 0x5c81
movl $0x8, %eax
leal -0x1(%rax), %ecx
cmpq $0x0, 0x20(%rdx,%rcx,8)
jne 0x5b3d
decl %eax
jne 0x5b2a
xorl %eax, %eax
jmp 0x5b46
cmpl $0x3, %ecx
jge 0x5c81
leaq 0xa8(%rdx), %r14
movq 0xa8(%rdx), %rsi
jmp 0x5a5c
cmpq $0x0, 0x20(%rdx)
jne 0x5c81
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rbx), %rax
movq %rax, (%r14)
movq %rdx, 0x10(%rbx)
jmp 0x5c81
movslq %eax, %rcx
movq 0x60(%rdx,%rcx,8), %r9
leal 0x1(%rcx), %r10d
movslq %r10d, %r10
movq %r9, 0x60(%rdx,%r10,8)
testl %ecx, %ecx
jle 0x5bbc
movl %eax, %eax
movq %rax, %rcx
movl -0x4(%rdx,%rax,4), %r9d
movl %r9d, (%rdx,%rax,4)
movq 0x18(%rdx,%rax,8), %r9
movq 0x58(%rdx,%rax,8), %r10
movq %r9, 0x20(%rdx,%rax,8)
movq %r10, 0x60(%rdx,%rax,8)
decq %rcx
movq %rcx, %rax
jne 0x5b97
movq 0x20(%rsi,%rdi,8), %rax
movq %rax, 0x20(%rdx)
movl (%rsi,%rdi,4), %ecx
movl %ecx, (%rdx)
movq %rdx, 0x8(%rax)
movslq %r8d, %rax
movq 0x60(%r14,%rax,8), %rcx
movq %rcx, 0x60(%rdx)
testq %rcx, %rcx
je 0x5be6
movq %rdx, 0xa8(%rcx)
movq 0x18(%r14,%rax,8), %rcx
movq %rcx, 0x20(%rsi,%rdi,8)
movl -0x4(%r14,%rax,4), %edx
movl %edx, (%rsi,%rdi,4)
movq %rsi, 0x8(%rcx)
movq $0x0, 0x18(%r14,%rax,8)
jmp 0x5c81
movq 0x20(%rsi), %rdi
movslq %eax, %r8
movq %rdi, 0x20(%rdx,%r8,8)
movl (%rsi), %eax
movl %eax, (%rdx,%r8,4)
movq %rdx, 0x8(%rdi)
movq 0x60(%rcx), %rax
movq %rax, 0x68(%rdx,%r8,8)
testq %rax, %rax
je 0x5c32
movq %rdx, 0xa8(%rax)
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsi)
movl (%rcx), %edx
movl %edx, (%rsi)
movq %rsi, 0x8(%rax)
movl $0x4, %eax
movl -0xc(%rcx,%rax,4), %edx
movl %edx, -0x10(%rcx,%rax,4)
movq 0x8(%rcx,%rax,8), %rdx
movq 0x48(%rcx,%rax,8), %rsi
movq %rdx, (%rcx,%rax,8)
movq %rsi, 0x40(%rcx,%rax,8)
incq %rax
cmpq $0xb, %rax
jne 0x5c47
movq 0xa0(%rcx), %rax
movq %rax, 0x98(%rcx)
movq $0x0, 0x58(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop