// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_layout_row_template_end
NK_API void
nk_layout_row_template_end(struct nk_context *ctx)
{
    struct nk_window *win;
    struct nk_panel *layout;

    int i = 0;
    int variable_count = 0;
    int min_variable_count = 0;
    float min_fixed_width = 0.0f;
    float total_fixed_width = 0.0f;
    float max_variable_width = 0.0f;

    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout)
        return;

    win = ctx->current;
    layout = win->layout;
    NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
    if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
    for (i = 0; i < layout->row.columns; ++i) {
        float width = layout->row.templates[i];
        if (width >= 0.0f) {
            total_fixed_width += width;
            min_fixed_width += width;
        } else if (width < -1.0f) {
            width = -width;
            total_fixed_width += width;
            max_variable_width = NK_MAX(max_variable_width, width);
            variable_count++;
        } else {
            min_variable_count++;
            variable_count++;
        }
    }
    if (variable_count) {
        float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
                            layout->bounds.w, layout->row.columns);
        float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count;
        int enough_space = var_width >= max_variable_width;
        if (!enough_space)
            var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count;
        for (i = 0; i < layout->row.columns; ++i) {
            float *width = &layout->row.templates[i];
            *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x4163a
movq 0x459db(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x2f77d(%rip), %rsi     # 0x70d9c
leaq 0x2f794(%rip), %rdx     # 0x70dba
movl $0x5626, %ecx           # imm = 0x5626
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x41679
movq 0x459a3(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x2f745(%rip), %rsi     # 0x70d9c
leaq 0x2f75c(%rip), %rdx     # 0x70dba
movl $0x5627, %ecx           # imm = 0x5627
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x416bf
movq 0x45966(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x2f708(%rip), %rsi     # 0x70d9c
leaq 0x2f71f(%rip), %rdx     # 0x70dba
movl $0x5628, %ecx           # imm = 0x5628
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x41822
movq 0xa8(%rax), %r14
testq %r14, %r14
je 0x41822
cmpl $0x8, 0x70(%r14)
je 0x4170d
movq 0x45913(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x2f6b5(%rip), %rsi     # 0x70d9c
leaq 0x2f6cc(%rip), %rdx     # 0x70dba
movl $0x562e, %ecx           # imm = 0x562E
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpl $0x8, 0x70(%r14)
jne 0x41822
movslq 0x80(%r14), %rax
testq %rax, %rax
jle 0x41822
xorps %xmm5, %xmm5
xorl %esi, %esi
movss 0x2c18a(%rip), %xmm0    # 0x6d8b4
movaps 0x2be3f(%rip), %xmm1    # 0x6d570
xorl %edx, %edx
xorl %ecx, %ecx
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
xorps %xmm4, %xmm4
movss 0xb4(%r14,%rsi,4), %xmm6
ucomiss %xmm5, %xmm6
jae 0x41764
ucomiss %xmm6, %xmm0
jbe 0x4176e
subss %xmm6, %xmm3
xorps %xmm1, %xmm6
maxss %xmm2, %xmm6
incl %edx
movaps %xmm6, %xmm2
jmp 0x41772
addss %xmm6, %xmm3
addss %xmm6, %xmm4
jmp 0x41772
incl %ecx
incl %edx
incq %rsi
cmpq %rsi, %rax
jne 0x4173e
testl %edx, %edx
je 0x41822
cmpl $0x2, %eax
movl $0x1, %esi
cmovgel %eax, %esi
decl %esi
xorps %xmm5, %xmm5
cvtsi2ss %esi, %xmm5
movss 0x10(%r14), %xmm6
mulss 0x24b4(%rbx), %xmm5
subss %xmm5, %xmm6
movaps %xmm6, %xmm5
subss %xmm4, %xmm5
xorps %xmm7, %xmm7
xorps %xmm4, %xmm4
maxss %xmm5, %xmm4
xorps %xmm5, %xmm5
cvtsi2ss %edx, %xmm5
divss %xmm5, %xmm4
ucomiss %xmm2, %xmm4
movaps %xmm4, %xmm5
jae 0x417e2
xorps %xmm5, %xmm5
cvtsi2ss %ecx, %xmm5
subss %xmm3, %xmm6
maxss %xmm6, %xmm7
divss %xmm5, %xmm7
movaps %xmm7, %xmm5
testl %eax, %eax
jle 0x41822
xorl %ecx, %ecx
xorps %xmm3, %xmm3
movss 0xb4(%r14,%rcx,4), %xmm6
ucomiss %xmm3, %xmm6
jae 0x4180d
ucomiss %xmm2, %xmm4
movaps %xmm5, %xmm7
jae 0x41810
ucomiss %xmm6, %xmm0
movaps %xmm5, %xmm7
jbe 0x41810
xorps %xmm1, %xmm6
movaps %xmm6, %xmm7
movss %xmm7, 0xb4(%r14,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x417eb
popq %rbx
popq %r14
popq %r15
retq