// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movl %r8d, %r15d
movss %xmm2, 0x1c(%rsp)
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x10(%rsp)
testq %rdi, %rdi
jne 0x2baf2
movq 0x5c537(%rip), %rbx     # 0x87ff0
movq (%rbx), %rdi
leaq 0x462c9(%rip), %rsi     # 0x71d8c
leaq 0x462e0(%rip), %rdx     # 0x71daa
movl $0x298b, %ecx           # imm = 0x298B
xorl %eax, %eax
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
callq 0x12d80
movq (%rbx), %rdi
callq 0x13780
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm0
testq %r12, %r12
je 0x2bc9a
testq %r14, %r14
je 0x2bc9a
testl %ebp, %ebp
je 0x2bc9a
movss (%r12), %xmm2
movaps %xmm0, %xmm3
addss %xmm1, %xmm3
ucomiss %xmm2, %xmm3
jbe 0x2bc9a
addss 0x8(%r12), %xmm2
ucomiss %xmm0, %xmm2
jbe 0x2bc9a
movss 0x4(%r12), %xmm2
addps %xmm0, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm2, %xmm1
jbe 0x2bc9a
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
addss 0xc(%r12), %xmm2
ucomiss %xmm1, %xmm2
jbe 0x2bc9a
movq 0x20(%r13), %rsi
movq %r12, %rdi
movaps %xmm0, 0x30(%rsp)
callq 0x2a76c
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x12ef0
movaps 0x30(%rsp), %xmm1
testl %eax, %eax
je 0x2bc9a
movl %r15d, %ecx
shrl $0x18, %ecx
movzbl %cl, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
mulss 0x70(%r12), %xmm0
cvttss2si %xmm0, %ecx
shll $0x18, %ecx
andl $0xffffff, %r15d        # imm = 0xFFFFFF
orl %ecx, %r15d
xorl %ecx, %ecx
movaps %xmm1, 0x40(%rsp)
movl %ebp, %edx
subl %ecx, %edx
jle 0x2bc9a
testl %eax, %eax
je 0x2bc9a
movq %r13, %rbx
movl %r15d, %r13d
movl 0xc(%rsp), %r15d
cmpl $0xfffd, %r15d          # imm = 0xFFFD
je 0x2bc87
movl %ecx, 0x20(%rsp)
movslq 0x20(%rsp), %rcx
addq %r14, %rcx
movslq %eax, %rdi
addq %rcx, %rdi
leaq 0x10(%rsp), %rsi
movl %eax, 0x14(%rsp)
callq 0x12ef0
movl %eax, 0x18(%rsp)
movl 0xc(%rsp), %edx
movl 0x10(%rsp), %ecx
cmpl $0xfffd, %ecx           # imm = 0xFFFD
movl $0x0, %eax
cmovel %eax, %ecx
movq (%rbx), %rdi
movss 0x1c(%rsp), %xmm0
leaq 0x50(%rsp), %rsi
callq *0x18(%rbx)
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm4
movss %xmm4, %xmm1            # xmm1 = xmm4[0],xmm1[1,2,3]
movsd 0x50(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movsd 0x60(%rsp), %xmm0
addps %xmm1, %xmm0
movsd 0x68(%rsp), %xmm1
addps %xmm0, %xmm1
addss 0x70(%rsp), %xmm4
movaps %xmm4, 0x40(%rsp)
movq %r12, %rdi
movl %r13d, %esi
callq 0x2b8c2
movl 0x20(%rsp), %ecx
addl 0x14(%rsp), %ecx
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x18(%rsp), %eax
cmpl $0xfffd, %r15d          # imm = 0xFFFD
movl %r13d, %r15d
movq %rbx, %r13
jne 0x2bbbc
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq