// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %rbx
testq %rdi, %rdi
je 0x41951
testq %rbx, %rbx
je 0x41991
movq %r9, %r14
movl %r8d, %r13d
movl %edx, %ebp
movq %rsi, %r15
movaps %xmm0, %xmm5
movq %rdi, %r12
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movss 0x4(%rbx), %xmm4
movaps %xmm4, %xmm2
addss %xmm4, %xmm2
movaps %xmm2, %xmm3
maxss %xmm0, %xmm3
movaps %xmm5, %xmm0
shufps $0x55, %xmm5, %xmm0     # xmm0 = xmm0[1,1],xmm5[1,1]
movaps %xmm0, 0x10(%rsp)
addss %xmm0, %xmm4
movq %xmm4, %xmm0            # xmm0 = xmm4[0],zero
xorps %xmm4, %xmm4
shufps $0xe2, %xmm4, %xmm0     # xmm0 = xmm0[2,0],xmm4[2,3]
movaps %xmm0, 0x50(%rsp)
movss 0x8(%r9), %xmm0
movaps %xmm3, (%rsp)
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 (%r9), %rdi
movaps %xmm1, 0x30(%rsp)
movaps %xmm5, 0x20(%rsp)
callq *0x10(%r9)
movss (%rbx), %xmm3
movaps %xmm3, %xmm2
addss %xmm3, %xmm2
testb $0x1, %r13b
jne 0x419cb
movaps 0x20(%rsp), %xmm6
movaps 0x30(%rsp), %xmm5
movaps 0x50(%rsp), %xmm4
movaps 0x40(%rsp), %xmm1
addss %xmm2, %xmm0
testb $0x2, %r13b
jne 0x41a95
testb $0x4, %r13b
je 0x41982
addss %xmm6, %xmm3
addss %xmm6, %xmm5
addss %xmm0, %xmm2
subss %xmm2, %xmm5
maxss %xmm3, %xmm5
movss %xmm5, %xmm4            # xmm4 = xmm5[0],xmm4[1,2,3]
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
jmp 0x419f3
movq 0x43698(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x283aa(%rip), %rsi     # 0x69d0c
leaq 0x283c1(%rip), %rdx     # 0x69d2a
movl $0x5bcf, %ecx           # imm = 0x5BCF
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
testq %rbx, %rbx
je 0x41991
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x43658(%rip), %rbx     # 0x84ff0
movq (%rbx), %rdi
leaq 0x2836a(%rip), %rsi     # 0x69d0c
leaq 0x28381(%rip), %rdx     # 0x69d2a
movl $0x5bd0, %ecx           # imm = 0x5BD0
xorl %eax, %eax
callq 0x12ea0
movq (%rbx), %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13960
addss 0x20(%rsp), %xmm3
movaps 0x50(%rsp), %xmm4
movss %xmm3, %xmm4            # xmm4 = xmm3[0],xmm4[1,2,3]
movaps 0x30(%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 0x41a26
testb $0x20, %r13b
je 0x41a6c
movaps 0x10(%rsp), %xmm2
addss (%rsp), %xmm2
movss 0x8(%r14), %xmm0
subss %xmm0, %xmm2
movlhps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm2     # xmm2 = xmm2[2,0],xmm4[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 0x41a69
movss 0x24e02(%rip), %xmm0    # 0x66830
movaps (%rsp), %xmm5
movaps %xmm5, %xmm3
mulss %xmm0, %xmm3
movaps 0x10(%rsp), %xmm2
addss %xmm3, %xmm2
mulss 0x8(%r14), %xmm0
subss %xmm0, %xmm2
movlhps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm2     # xmm2 = xmm2[2,0],xmm4[2,3]
addss %xmm3, %xmm0
subss %xmm0, %xmm5
maxss %xmm3, %xmm5
movlhps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm5     # xmm5 = xmm5[2,0],xmm1[2,3]
movaps %xmm5, %xmm1
movaps %xmm2, %xmm4
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
movq %r12, %rdi
movaps %xmm4, %xmm0
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13ea0
addss %xmm2, %xmm0
maxss 0x24d93(%rip), %xmm0    # 0x66834
addss %xmm6, %xmm3
addss %xmm5, %xmm6
subss %xmm2, %xmm5
subss %xmm0, %xmm5
mulss 0x24d77(%rip), %xmm5    # 0x66830
addss %xmm3, %xmm5
maxss %xmm3, %xmm5
movss %xmm5, %xmm4            # xmm4 = xmm5[0],xmm4[1,2,3]
addss %xmm5, %xmm0
minss %xmm0, %xmm6
movss %xmm6, %xmm1            # xmm1 = xmm6[0],xmm1[1,2,3]
ucomiss %xmm5, %xmm6
jb 0x419f3
subss %xmm5, %xmm6
movss %xmm6, %xmm1            # xmm1 = xmm6[0],xmm1[1,2,3]
jmp 0x419f3