// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_edit_draw_text
NK_LIB void
nk_edit_draw_text(struct nk_command_buffer *out,
    const struct nk_style_edit *style, float pos_x, float pos_y,
    float x_offset, const char *text, int byte_len, float row_height,
    const struct nk_user_font *font, struct nk_color background,
    struct nk_color foreground, nk_bool is_selected)
{
    NK_ASSERT(out);
    NK_ASSERT(font);
    NK_ASSERT(style);
    if (!text || !byte_len || !out || !style) return;

    {int glyph_len = 0;
    nk_rune unicode = 0;
    int text_len = 0;
    float line_width = 0;
    float glyph_width;
    const char *line = text;
    float line_offset = 0;
    int line_count = 0;

    struct nk_text txt;
    txt.padding = nk_vec2(0,0);
    txt.background = background;
    txt.text = foreground;

    foreground = nk_rgb_factor(foreground, style->color_factor);
    background = nk_rgb_factor(background, style->color_factor);

    glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
    if (!glyph_len) return;
    while ((text_len < byte_len) && glyph_len)
    {
        if (unicode == '\n') {
            /* new line separator so draw previous line */
            struct nk_rect label;
            label.y = pos_y + line_offset;
            label.h = row_height;
            label.w = line_width;
            label.x = pos_x;
            if (!line_count)
                label.x += x_offset;

            if (is_selected) /* selection needs to draw different background color */
                nk_fill_rect(out, label, 0, background);
            nk_widget_text(out, label, line, (int)((text + text_len) - line),
                &txt, NK_TEXT_CENTERED, font);

            text_len++;
            line_count++;
            line_width = 0;
            line = text + text_len;
            line_offset += row_height;
            glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
            continue;
        }
        if (unicode == '\r') {
            text_len++;
            glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
            continue;
        }
        glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
        line_width += (float)glyph_width;
        text_len += glyph_len;
        glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
        continue;
    }
    if (line_width > 0) {
        /* draw last line */
        struct nk_rect label;
        label.y = pos_y + line_offset;
        label.h = row_height;
        label.w = line_width;
        label.x = pos_x;
        if (!line_count)
            label.x += x_offset;

        if (is_selected)
            nk_fill_rect(out, label, 0, background);
        nk_widget_text(out, label, line, (int)((text + text_len) - line),
            &txt, NK_TEXT_LEFT, font);
    }}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r9d, %ebx
movq %r8, %rbp
movaps %xmm3, 0xa0(%rsp)
movl %ecx, %r14d
movq %rdx, %r13
movaps %xmm2, 0x80(%rsp)
movss %xmm1, 0x1c(%rsp)
movaps %xmm0, 0x60(%rsp)
movq %rsi, %r15
movq %rdi, %r12
testq %r8, %r8
jne 0x58e53
movq 0x2e1c9(%rip), %rax     # 0x86ff0
movq (%rax), %rdi
leaq 0x17f6b(%rip), %rsi     # 0x70d9c
leaq 0x17f82(%rip), %rdx     # 0x70dba
movl $0x6ab9, %ecx           # imm = 0x6AB9
xorl %eax, %eax
callq 0x12d80
movq 0x2e1a5(%rip), %rax     # 0x86ff0
movq (%rax), %rdi
callq 0x13780
testq %r13, %r13
sete %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
jne 0x5920f
movq %r12, 0x40(%rsp)
movl 0x110(%rsp), %eax
leaq 0x8(%rsp), %r12
movl $0x0, (%r12)
movq $0x0, 0x90(%rsp)
movl %ebx, 0x98(%rsp)
movl %eax, 0x9c(%rsp)
movss 0x3bc(%r15), %xmm0
movl %ebx, %edi
callq 0x13e60
movl %eax, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movq %r13, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x12ef0
movaps 0x60(%rsp), %xmm0
movl %eax, %r13d
testl %eax, %eax
sete %al
testl %r14d, %r14d
setle %cl
orb %al, %cl
jne 0x5920f
movaps 0x80(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x80(%rsp)
movl %r14d, %eax
movq %rax, 0xd0(%rsp)
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xc8(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq $0x0, 0x38(%rsp)
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq %rbp, 0x48(%rsp)
movl %r14d, 0xc(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq %r12, 0x50(%rsp)
movslq %r12d, %rbp
movq %rbp, %rbx
shlq $0x20, %rbx
movl 0xc(%rsp), %eax
subl %ebp, %eax
movq %rax, 0x58(%rsp)
movq 0xc8(%rsp), %rax
addq %rbp, %rax
movq %rax, 0xb0(%rsp)
incq %rbp
movq $-0x1, %r12
xorl %r14d, %r14d
movl 0x8(%rsp), %eax
cmpl $0xd, %eax
jne 0x58fd0
leaq (%r14,%rbp), %r15
movq 0xb0(%rsp), %rax
leaq (%rax,%r14), %rdi
movq 0x58(%rsp), %rax
leal (%rax,%r12), %edx
leaq 0x8(%rsp), %rsi
callq 0x12ef0
movaps 0x60(%rsp), %xmm0
incq %r14
cmpq 0xd0(%rsp), %r15
jge 0x59162
movl %eax, %r13d
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
decq %r12
testl %r13d, %r13d
jne 0x58f71
jmp 0x59162
cmpl $0xa, %eax
je 0x59051
movq 0x48(%rsp), %rbp
movss 0x8(%rbp), %xmm0
sarq $0x20, %rbx
movq 0x10(%rsp), %r12
addq %r12, %rbx
movq (%rbp), %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq *0x10(%rbp)
movaps 0x20(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x50(%rsp), %rbx
addl %r13d, %ebx
leal (%rbx,%r14), %eax
movslq %eax, %r15
leaq (%r12,%r15), %rdi
movq %rax, %r12
movq 0x58(%rsp), %rdx
subl %r13d, %edx
subl %r14d, %edx
leaq 0x8(%rsp), %rsi
callq 0x12ef0
movaps 0x60(%rsp), %xmm0
cmpl 0xc(%rsp), %r15d
jge 0x59221
movl %eax, %r13d
testl %eax, %eax
jne 0x58f37
jmp 0x59221
movaps 0x70(%rsp), %xmm3
addss 0x1c(%rsp), %xmm3
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
cmpl $0x0, 0x38(%rsp)
movq 0x48(%rsp), %rbp
jne 0x5907b
movaps 0x80(%rsp), %xmm0
movss %xmm0, %xmm3            # xmm3 = xmm0[0],xmm3[1,2,3]
movq 0x10(%rsp), %r15
movaps 0x20(%rsp), %xmm1
unpcklps 0xa0(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
cmpl $0x0, 0x118(%rsp)
movq 0x40(%rsp), %r13
je 0x590c8
xorps %xmm2, %xmm2
movq %r13, %rdi
movaps %xmm3, %xmm0
movl 0x18(%rsp), %esi
movaps %xmm1, 0x20(%rsp)
movaps %xmm3, 0xb0(%rsp)
callq 0x12de0
movaps 0xb0(%rsp), %xmm3
movaps 0x20(%rsp), %xmm1
shrq $0x20, %rbx
addl %r15d, %ebx
movq 0x30(%rsp), %rsi
subl %esi, %ebx
movq %r13, %rdi
movaps %xmm3, %xmm0
movl %ebx, %edx
leaq 0x90(%rsp), %rcx
movl $0x12, %r8d
movq %rbp, %r9
callq 0x451c6
movq 0x50(%rsp), %rax
addl %r14d, %eax
incl %eax
movslq %eax, %rbx
leaq (%r15,%rbx), %rdi
movq 0x58(%rsp), %rdx
addl %r12d, %edx
movq %rax, %r12
movq %rdi, 0x30(%rsp)
leaq 0x8(%rsp), %rsi
callq 0x12ef0
movl 0xc(%rsp), %r14d
cmpl %r14d, %ebx
movaps 0x60(%rsp), %xmm0
jge 0x5920f
movl %eax, %r13d
movq 0x38(%rsp), %rax
incl %eax
movq %rax, 0x38(%rsp)
movaps 0x70(%rsp), %xmm1
addss 0xa0(%rsp), %xmm1
movaps %xmm1, 0x70(%rsp)
testl %r13d, %r13d
jne 0x58f2f
jmp 0x5920f
movq 0x50(%rsp), %r12
addl %r14d, %r12d
movq 0x48(%rsp), %rbp
xorps %xmm1, %xmm1
movaps 0x20(%rsp), %xmm3
ucomiss %xmm1, %xmm3
jbe 0x5920f
movaps 0x70(%rsp), %xmm1
addss 0x1c(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cmpl $0x0, 0x38(%rsp)
jne 0x591a1
movaps 0x80(%rsp), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movq 0x10(%rsp), %rbx
movq 0x40(%rsp), %r14
movq 0x30(%rsp), %r15
unpcklps 0xa0(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0],xmm3[1],mem[1]
cmpl $0x0, 0x118(%rsp)
je 0x591e8
xorps %xmm2, %xmm2
movq %r14, %rdi
movaps %xmm0, 0x60(%rsp)
movaps %xmm3, %xmm1
movl 0x18(%rsp), %esi
movaps %xmm3, 0x20(%rsp)
callq 0x12de0
movaps 0x20(%rsp), %xmm3
movaps 0x60(%rsp), %xmm0
addl %r12d, %ebx
subl %r15d, %ebx
leaq 0x90(%rsp), %rcx
movq %r14, %rdi
movaps %xmm3, %xmm1
movq %r15, %rsi
movl %ebx, %edx
movl $0x11, %r8d
movq %rbp, %r9
callq 0x451c6
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r14d, %ebx
movl %ebx, %r12d
jmp 0x5916f