// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0xa8(%r15), %rax
testq %rax, %rax
je 0x5c13
cmpq %r15, 0x60(%rax)
je 0x5c3d
movl $0xd, %ecx
cmpq %r15, (%rax,%rcx,8)
je 0x5cb4
incq %rcx
cmpq $0x14, %rcx
jne 0x5bf6
movl $0x8, %ecx
jmp 0x5cb7
movl $0x1, %ebp
cmpq $0x0, 0x20(%r15)
jne 0x5e65
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rbx), %rax
movq %rax, 0xa8(%r15)
movq %r15, 0x10(%rbx)
jmp 0x5e65
movq 0x68(%rax), %rdx
movl $0x8, %ecx
leal -0x1(%rcx), %esi
cmpq $0x0, 0x20(%rdx,%rsi,8)
jne 0x5c57
decl %ecx
jne 0x5c46
xorl %ecx, %ecx
addl %r14d, %ecx
cmpl $0x7, %ecx
jg 0x5dd5
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x5e78
movq 0xa8(%r15), %rax
movb $0x1, %cl
testq %rax, %rax
je 0x5e56
movl $0x8, %r14d
leal -0x1(%r14), %edx
cmpq $0x0, 0x20(%rax,%rdx,8)
jne 0x5c9e
decl %r14d
jne 0x5c8a
xorl %r14d, %r14d
cmpl $0x3, %r14d
jg 0x5e56
movl $0x2, %ebp
xorl %ecx, %ecx
jmp 0x5e59
addl $-0xc, %ecx
movslq %ecx, %rcx
movq 0x58(%rax,%rcx,8), %r12
decq %rcx
movl $0x8, %edx
leal -0x1(%rdx), %esi
cmpq $0x0, 0x20(%r12,%rsi,8)
jne 0x5cd8
decl %edx
jne 0x5cc7
xorl %edx, %edx
leal (%rdx,%r14), %esi
cmpl $0x7, %esi
jg 0x5d37
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5e78
movq 0xa8(%r12), %rax
xorl %ebp, %ebp
movb $0x1, %cl
testq %rax, %rax
je 0x5dcd
movl $0x8, %r14d
leal -0x1(%r14), %edx
cmpq $0x0, 0x20(%rax,%rdx,8)
jne 0x5d1e
decl %r14d
jne 0x5d0a
xorl %r14d, %r14d
cmpl $0x3, %r14d
jg 0x5dcd
movl $0x2, %ebp
xorl %ecx, %ecx
movq %rax, %r15
jmp 0x5dcd
movslq %r14d, %rsi
movq 0x60(%r15,%rsi,8), %rdi
leal 0x1(%rsi), %r8d
movslq %r8d, %r8
movq %rdi, 0x60(%r15,%r8,8)
testl %esi, %esi
jle 0x5d7c
movl %r14d, %esi
movl -0x4(%r15,%rsi,4), %edi
movl %edi, (%r15,%rsi,4)
movq 0x18(%r15,%rsi,8), %rdi
movq 0x58(%r15,%rsi,8), %r8
movq %rdi, 0x20(%r15,%rsi,8)
movq %r8, 0x60(%r15,%rsi,8)
leaq -0x1(%rsi), %rdi
cmpq $0x1, %rsi
movq %rdi, %rsi
jg 0x5d52
movq 0x20(%rax,%rcx,8), %rsi
movq %rsi, 0x20(%r15)
movl (%rax,%rcx,4), %edi
movl %edi, (%r15)
movq %r15, 0x8(%rsi)
movslq %edx, %rdx
movq 0x60(%r12,%rdx,8), %rsi
movq %rsi, 0x60(%r15)
testq %rsi, %rsi
je 0x5da7
movq %r15, 0xa8(%rsi)
movq 0x18(%r12,%rdx,8), %rsi
movq %rsi, 0x20(%rax,%rcx,8)
movl -0x4(%r12,%rdx,4), %edi
movl %edi, (%rax,%rcx,4)
movq %rax, 0x8(%rsi)
movq $0x0, 0x18(%r12,%rdx,8)
movl $0x1, %ebp
xorl %ecx, %ecx
movq %r15, %rax
jmp 0x5e5c
movq 0x20(%rax), %rcx
movslq %r14d, %rsi
movq %rcx, 0x20(%r15,%rsi,8)
movl (%rax), %edi
movl %edi, (%r15,%rsi,4)
movq %r15, 0x8(%rcx)
movq 0x60(%rdx), %rcx
movq %rcx, 0x68(%r15,%rsi,8)
testq %rcx, %rcx
je 0x5e00
movq %r15, 0xa8(%rcx)
movq 0x20(%rdx), %rcx
movq %rcx, 0x20(%rax)
movl (%rdx), %esi
movl %esi, (%rax)
movq %rax, 0x8(%rcx)
movl $0x4, %eax
movl -0xc(%rdx,%rax,4), %ecx
movl %ecx, -0x10(%rdx,%rax,4)
movq 0x8(%rdx,%rax,8), %rcx
movq 0x48(%rdx,%rax,8), %rsi
movq %rcx, (%rdx,%rax,8)
movq %rsi, 0x40(%rdx,%rax,8)
incq %rax
cmpq $0xb, %rax
jne 0x5e15
movq 0xa0(%rdx), %rax
movq %rax, 0x98(%rdx)
movq $0x0, 0x58(%rdx)
movl $0x1, %ebp
xorl %ecx, %ecx
movq %r15, %rax
movq %rax, %r15
testb %cl, %cl
je 0x5e65
xorl %ebp, %ebp
movq %rax, %r15
cmpl $0x1, %ebp
ja 0x5bdf
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop