// File: /workspace/github_c_makefile_star2_O2/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
movl %r8d, %ebp
movss %xmm2, 0xc(%rsp)
movl %ecx, %r15d
movq %rdx, %r14
movaps %xmm0, 0x10(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, %r12
andl $0x0, (%rsp)
andl $0x0, 0x4(%rsp)
testq %rdi, %rdi
jne 0x29e86
movq 0x5b199(%rip), %rbx     # 0x84ff0
movq (%rbx), %rdi
leaq 0x3feab(%rip), %rsi     # 0x69d0c
leaq 0x3fec2(%rip), %rdx     # 0x69d2a
movl $0x298b, %ecx           # imm = 0x298B
xorl %eax, %eax
movaps %xmm1, 0x30(%rsp)
callq 0x12ea0
movq (%rbx), %rdi
callq 0x13960
movaps 0x30(%rsp), %xmm1
testq %r12, %r12
je 0x2a013
testq %r14, %r14
je 0x2a013
testl %r15d, %r15d
je 0x2a013
movss (%r12), %xmm0
movaps 0x10(%rsp), %xmm2
addss %xmm1, %xmm2
ucomiss %xmm0, %xmm2
jbe 0x2a013
addss 0x8(%r12), %xmm0
ucomiss 0x10(%rsp), %xmm0
jbe 0x2a013
movss 0x4(%r12), %xmm0
addps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm0, %xmm1
jbe 0x2a013
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss 0xc(%r12), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2a013
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rsi
movq %r12, %rdi
callq 0x28e35
movq %rsp, %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x13020
testl %eax, %eax
je 0x2a013
movl %eax, %r13d
movl %ebp, %eax
shrl $0x18, %eax
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
mulss 0x70(%r12), %xmm0
cvttss2si %xmm0, %eax
shll $0x18, %eax
andl $0xffffff, %ebp         # imm = 0xFFFFFF
orl %eax, %ebp
movl %ebp, 0x8(%rsp)
movl (%rsp), %eax
xorl %ebp, %ebp
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movl %r15d, %edx
subl %ebp, %edx
jle 0x2a013
testl %r13d, %r13d
je 0x2a013
cmpl $0xfffd, %eax           # imm = 0xFFFD
je 0x2a013
movslq %ebp, %rax
addq %r14, %rax
movslq %r13d, %rdi
addq %rax, %rdi
leaq 0x4(%rsp), %rsi
callq 0x13020
movl %eax, %ebx
movl (%rsp), %edx
movl 0x4(%rsp), %ecx
cmpl $0xfffd, %ecx           # imm = 0xFFFD
movl $0x0, %eax
cmovel %eax, %ecx
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movss 0xc(%rsp), %xmm0
leaq 0x40(%rsp), %rsi
callq *0x18(%rax)
movaps 0x10(%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 0x8(%rsp), %esi
callq 0x29c91
addl %r13d, %ebp
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
movl %ebx, %r13d
jmp 0x29f5c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq