// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_widget_text
NK_LIB void
nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
    const char *string, int len, const struct nk_text *t,
    nk_flags a, const struct nk_user_font *f)
{
    struct nk_rect label;
    float text_width;

    NK_ASSERT(o);
    NK_ASSERT(t);
    if (!o || !t) return;

    b.h = NK_MAX(b.h, 2 * t->padding.y);
    label.x = 0; label.w = 0;
    label.y = b.y + t->padding.y;
    label.h = NK_MIN(f->height, b.h - 2 * t->padding.y);

    text_width = f->width(f->userdata, f->height, (const char*)string, len);
    text_width += (2.0f * t->padding.x);

    /* align in x-axis */
    if (a & NK_TEXT_ALIGN_LEFT) {
        label.x = b.x + t->padding.x;
        label.w = NK_MAX(0, b.w - 2 * t->padding.x);
    } else if (a & NK_TEXT_ALIGN_CENTERED) {
        label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width);
        label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2);
        label.x = NK_MAX(b.x + t->padding.x, label.x);
        label.w = NK_MIN(b.x + b.w, label.x + label.w);
        if (label.w >= label.x) label.w -= label.x;
    } else if (a & NK_TEXT_ALIGN_RIGHT) {
        label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width));
        label.w = (float)text_width + 2 * t->padding.x;
    } else return;

    /* align in y-axis */
    if (a & NK_TEXT_ALIGN_MIDDLE) {
        label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
        label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
    } else if (a & NK_TEXT_ALIGN_BOTTOM) {
        label.y = b.y + b.h - f->height;
        label.h = f->height;
    }
    nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movl %r8d, %r13d
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movaps %xmm0, %xmm6
movq %rdi, %r12
testq %rdi, %rdi
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
jne 0x45de5
movq 0x42240(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
leaq 0x2bfd2(%rip), %rsi     # 0x71d8c
leaq 0x2bfe9(%rip), %rdx     # 0x71daa
movl $0x5bcf, %ecx           # imm = 0x5BCF
xorl %eax, %eax
callq 0x12d80
movq 0x4221c(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
movaps (%rsp), %xmm6
movaps 0x10(%rsp), %xmm1
testq %r15, %r15
jne 0x45e26
movq 0x421ff(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
leaq 0x2bf91(%rip), %rsi     # 0x71d8c
leaq 0x2bfa8(%rip), %rdx     # 0x71daa
movl $0x5bd0, %ecx           # imm = 0x5BD0
xorl %eax, %eax
callq 0x12d80
movq 0x421db(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
movaps (%rsp), %xmm6
movaps 0x10(%rsp), %xmm1
testq %r15, %r15
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x45ee2
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movss 0x4(%r15), %xmm3
movaps %xmm3, %xmm2
addss %xmm3, %xmm2
movaps %xmm2, %xmm5
maxss %xmm0, %xmm5
movaps %xmm6, %xmm0
shufps $0x55, %xmm6, %xmm0     # xmm0 = xmm0[1,1],xmm6[1,1]
movaps %xmm0, 0x30(%rsp)
addss %xmm0, %xmm3
movq %xmm3, %xmm0            # xmm0 = xmm3[0],zero
xorps %xmm4, %xmm4
shufps $0xe2, %xmm4, %xmm0     # xmm0 = xmm0[2,0],xmm4[2,3]
movaps %xmm0, 0x50(%rsp)
movss 0x8(%rbx), %xmm0
movaps %xmm5, 0x20(%rsp)
movaps %xmm5, %xmm3
subss %xmm2, %xmm3
movaps %xmm0, %xmm2
minss %xmm3, %xmm2
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
shufps $0xe2, %xmm4, %xmm2     # xmm2 = xmm2[2,0],xmm4[2,3]
movaps %xmm2, 0x40(%rsp)
movq (%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq *0x10(%rbx)
movss (%r15), %xmm3
movaps %xmm3, %xmm2
addss %xmm3, %xmm2
testb $0x1, %r13b
jne 0x45ef1
movaps (%rsp), %xmm6
movaps 0x50(%rsp), %xmm5
movaps 0x10(%rsp), %xmm4
movaps 0x40(%rsp), %xmm1
addss %xmm2, %xmm0
testb $0x2, %r13b
jne 0x45fba
testb $0x4, %r13b
jne 0x4600c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addss (%rsp), %xmm3
movaps 0x50(%rsp), %xmm5
movss %xmm3, %xmm5            # xmm5 = xmm3[0],xmm5[1,2,3]
movaps 0x10(%rsp), %xmm3
subss %xmm2, %xmm3
xorps %xmm0, %xmm0
maxss %xmm0, %xmm3
movaps 0x40(%rsp), %xmm1
movss %xmm3, %xmm1            # xmm1 = xmm3[0],xmm1[1,2,3]
testb $0x10, %r13b
jne 0x45f4b
testb $0x20, %r13b
je 0x45f91
movaps 0x30(%rsp), %xmm2
addss 0x20(%rsp), %xmm2
movss 0x8(%rbx), %xmm0
subss %xmm0, %xmm2
movlhps %xmm5, %xmm2            # xmm2 = xmm2[0],xmm5[0]
shufps $0xe2, %xmm5, %xmm2     # xmm2 = xmm2[2,0],xmm5[2,3]
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, %xmm1
jmp 0x45f8e
movss 0x2895d(%rip), %xmm0    # 0x6e8b0
movaps 0x20(%rsp), %xmm4
movaps %xmm4, %xmm3
mulss %xmm0, %xmm3
movaps 0x30(%rsp), %xmm2
addss %xmm3, %xmm2
mulss 0x8(%rbx), %xmm0
subss %xmm0, %xmm2
movlhps %xmm5, %xmm2            # xmm2 = xmm2[0],xmm5[0]
shufps $0xe2, %xmm5, %xmm2     # xmm2 = xmm2[2,0],xmm5[2,3]
addss %xmm3, %xmm0
subss %xmm0, %xmm4
maxss %xmm3, %xmm4
movlhps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm4     # xmm4 = xmm4[2,0],xmm1[2,3]
movaps %xmm4, %xmm1
movaps %xmm2, %xmm5
movl 0x8(%r15), %r8d
movl 0xc(%r15), %r9d
movq %r12, %rdi
movaps %xmm5, %xmm0
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13ca0
addss %xmm2, %xmm0
maxss 0x288ee(%rip), %xmm0    # 0x6e8b4
addss %xmm6, %xmm3
addss %xmm4, %xmm6
subss %xmm2, %xmm4
subss %xmm0, %xmm4
mulss 0x288d2(%rip), %xmm4    # 0x6e8b0
addss %xmm3, %xmm4
maxss %xmm3, %xmm4
movss %xmm4, %xmm5            # xmm5 = xmm4[0],xmm5[1,2,3]
addss %xmm4, %xmm0
minss %xmm0, %xmm6
movss %xmm6, %xmm1            # xmm1 = xmm6[0],xmm1[1,2,3]
ucomiss %xmm4, %xmm6
jb 0x45f18
subss %xmm4, %xmm6
movss %xmm6, %xmm1            # xmm1 = xmm6[0],xmm1[1,2,3]
jmp 0x45f18
addss %xmm6, %xmm3
addss %xmm6, %xmm4
addss %xmm0, %xmm2
subss %xmm2, %xmm4
maxss %xmm3, %xmm4
movss %xmm4, %xmm5            # xmm5 = xmm4[0],xmm5[1,2,3]
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
jmp 0x45f18