// File: /workspace/github_c_makefile_star2_O2/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 0x3ded2
movq 0x47143(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x2be55(%rip), %rsi     # 0x69d0c
leaq 0x2be6c(%rip), %rdx     # 0x69d2a
movl $0x5626, %ecx           # imm = 0x5626
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x3df11
movq 0x4710b(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x2be1d(%rip), %rsi     # 0x69d0c
leaq 0x2be34(%rip), %rdx     # 0x69d2a
movl $0x5627, %ecx           # imm = 0x5627
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x3df57
movq 0x470ce(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x2bde0(%rip), %rsi     # 0x69d0c
leaq 0x2bdf7(%rip), %rdx     # 0x69d2a
movl $0x5628, %ecx           # imm = 0x5628
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x3e0ad
movq 0xa8(%rax), %r14
testq %r14, %r14
je 0x3e0ad
cmpl $0x8, 0x70(%r14)
je 0x3dfa5
movq 0x4707b(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x2bd8d(%rip), %rsi     # 0x69d0c
leaq 0x2bda4(%rip), %rdx     # 0x69d2a
movl $0x562e, %ecx           # imm = 0x562E
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
cmpl $0x8, 0x70(%r14)
jne 0x3e0ad
movl 0x80(%r14), %edx
xorl %edi, %edi
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
xorps %xmm5, %xmm5
movss 0x28881(%rip), %xmm0    # 0x66844
movaps 0x285a6(%rip), %xmm1    # 0x66570
xorps %xmm4, %xmm4
xorps %xmm3, %xmm3
xorps %xmm2, %xmm2
xorl %ecx, %ecx
xorl %esi, %esi
cmpq %rdi, %rax
je 0x3e015
movss 0xb4(%r14,%rdi,4), %xmm6
ucomiss %xmm5, %xmm6
jae 0x3e002
ucomiss %xmm6, %xmm0
jbe 0x3e00c
subss %xmm6, %xmm3
xorps %xmm1, %xmm6
maxss %xmm2, %xmm6
incl %esi
movaps %xmm6, %xmm2
jmp 0x3e010
addss %xmm6, %xmm3
addss %xmm6, %xmm4
jmp 0x3e010
incl %ecx
incl %esi
incq %rdi
jmp 0x3dfd7
testl %esi, %esi
je 0x3e0ad
cmpl $0x2, %edx
pushq $0x1
popq %rdi
cmovgel %edx, %edi
decl %edi
cvtsi2ss %edi, %xmm5
movss 0x10(%r14), %xmm7
mulss 0x24b4(%rbx), %xmm5
subss %xmm5, %xmm7
movaps %xmm7, %xmm6
subss %xmm4, %xmm6
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
maxss %xmm6, %xmm5
cvtsi2ss %esi, %xmm6
divss %xmm6, %xmm5
ucomiss %xmm2, %xmm5
movaps %xmm5, %xmm6
jae 0x3e072
subss %xmm3, %xmm7
xorps %xmm6, %xmm6
maxss %xmm7, %xmm6
cvtsi2ss %ecx, %xmm3
divss %xmm3, %xmm6
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x3e0ad
movss 0xb4(%r14,%rcx,4), %xmm3
ucomiss %xmm4, %xmm3
jae 0x3e09b
ucomiss %xmm2, %xmm5
movaps %xmm6, %xmm7
jae 0x3e09e
ucomiss %xmm3, %xmm0
movaps %xmm6, %xmm7
jbe 0x3e09e
xorps %xmm1, %xmm3
movaps %xmm3, %xmm7
movss %xmm7, 0xb4(%r14,%rcx,4)
incq %rcx
jmp 0x3e074
popq %rbx
popq %r14
popq %r15
retq