// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_list_add_text
NK_API void
nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font,
    struct nk_rect rect, const char *text, int len, float font_height,
    struct nk_color fg)
{
    float x = 0;
    int text_len = 0;
    nk_rune unicode = 0;
    nk_rune next = 0;
    int glyph_len = 0;
    int next_glyph_len = 0;
    struct nk_user_font_glyph g;

    NK_ASSERT(list);
    if (!list || !len || !text) return;
    if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
        list->clip_rect.x, list->clip_rect.y, list->clip_rect.w, list->clip_rect.h)) return;

    nk_draw_list_push_image(list, font->texture);
    x = rect.x;
    glyph_len = nk_utf_decode(text, &unicode, len);
    if (!glyph_len) return;

    /* draw every glyph image */
    fg.a = (nk_byte)((float)fg.a * list->config.global_alpha);
    while (text_len < len && glyph_len) {
        float gx, gy, gh, gw;
        float char_width = 0;
        if (unicode == NK_UTF_INVALID) break;

        /* query currently drawn glyph information */
        next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len);
        font->query(font->userdata, font_height, &g, unicode,
                    (next == NK_UTF_INVALID) ? '\0' : next);

        /* calculate and draw glyph drawing rectangle and image */
        gx = x + g.offset.x;
        gy = rect.y + g.offset.y;
        gw = g.width; gh = g.height;
        char_width = g.xadvance;
        nk_draw_list_push_rect_uv(list, nk_vec2(gx,gy), nk_vec2(gx + gw, gy+ gh),
            g.uv[0], g.uv[1], fg);

        /* offset next glyph */
        text_len += glyph_len;
        x += char_width;
        glyph_len = next_glyph_len;
        unicode = next;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
xorl %eax, %eax
movl %eax, 0x8(%rsp)
movl %eax, 0xc(%rsp)
testq %rdi, %rdi
je 0x2bba5
movl %ecx, %ebp
movq %rdx, %r14
testl %ecx, %ecx
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x2bb96
movq %rdi, %r12
movss (%rdi), %xmm4
movaps %xmm0, %xmm3
addss %xmm1, %xmm3
ucomiss %xmm4, %xmm3
jbe 0x2bb96
addss 0x8(%r12), %xmm4
ucomiss %xmm0, %xmm4
jbe 0x2bb96
movss 0x4(%r12), %xmm3
addps %xmm0, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm3, %xmm1
jbe 0x2bb96
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
addss 0xc(%r12), %xmm3
ucomiss %xmm1, %xmm3
jbe 0x2bb96
movl %r8d, %r15d
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rsi
movq %r12, %rdi
movss %xmm2, 0x1c(%rsp)
movaps %xmm0, 0x20(%rsp)
callq 0x2a798
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x12ef0
movaps 0x20(%rsp), %xmm1
testl %eax, %eax
je 0x2bb96
testl %ebp, %ebp
jle 0x2bb96
cmpl $0xfffd, 0x8(%rsp)      # imm = 0xFFFD
je 0x2bb96
movl %eax, %r13d
movl %r15d, %eax
shrl $0x18, %eax
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
mulss 0x70(%r12), %xmm0
cvttss2si %xmm0, %eax
shll $0x18, %eax
andl $0xffffff, %r15d        # imm = 0xFFFFFF
orl %eax, %r15d
movaps %xmm1, 0x30(%rsp)
xorl %ebx, %ebx
movl %r15d, 0x18(%rsp)
movslq %ebx, %r15
leaq (%r14,%r15), %rdi
movslq %r13d, %rbx
addq %rbx, %rdi
movl %ebp, %edx
subl %r15d, %edx
leaq 0xc(%rsp), %rsi
callq 0x12ef0
movl %eax, %r13d
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
cmpl $0xfffd, %ecx           # imm = 0xFFFD
movl $0x0, %eax
cmovel %eax, %ecx
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movss 0x1c(%rsp), %xmm0
leaq 0x40(%rsp), %rsi
movq 0x10(%rsp), %rax
callq *0x18(%rax)
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm4
movss %xmm4, %xmm1            # xmm1 = xmm4[0],xmm1[1,2,3]
movsd 0x40(%rsp), %xmm2
movsd 0x48(%rsp), %xmm3
movsd 0x50(%rsp), %xmm0
addps %xmm1, %xmm0
movsd 0x58(%rsp), %xmm1
addps %xmm0, %xmm1
addss 0x60(%rsp), %xmm4
movaps %xmm4, 0x30(%rsp)
movq %r12, %rdi
movl 0x18(%rsp), %esi
callq 0x2b7d6
addl %r15d, %ebx
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
cmpl %ebp, %ebx
jge 0x2bb96
testl %r13d, %r13d
je 0x2bb96
cmpl $0xfffd, %eax           # imm = 0xFFFD
jne 0x2bae4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5b444(%rip), %rbx     # 0x86ff0
movq (%rbx), %rdi
leaq 0x451e6(%rip), %rsi     # 0x70d9c
leaq 0x451fd(%rip), %rdx     # 0x70dba
movl $0x298b, %ecx           # imm = 0x298B
xorl %eax, %eax
callq 0x12d80
movq (%rbx), %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13780