// File: /workspace/github_c_makefile_star2_O1/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, %r12
movaps %xmm3, 0xa0(%rsp)
movl %ecx, %r14d
movq %rdx, %rbp
movaps %xmm2, 0x80(%rsp)
movss %xmm1, 0x2c(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %rsi, %r15
movq %rdi, %r13
testq %r8, %r8
jne 0x59b30
movq 0x2e4ec(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
leaq 0x1827e(%rip), %rsi     # 0x71d8c
leaq 0x18295(%rip), %rdx     # 0x71daa
movl $0x6ab9, %ecx           # imm = 0x6AB9
xorl %eax, %eax
callq 0x12d80
movq 0x2e4c8(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
testq %rbp, %rbp
sete %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
jne 0x59f37
movq %r13, 0x40(%rsp)
movl 0x110(%rsp), %eax
leaq 0xc(%rsp), %r13
movl $0x0, (%r13)
movq $0x0, 0x90(%rsp)
movl %ebx, 0x98(%rsp)
movl %eax, 0x9c(%rsp)
movss 0x3bc(%r15), %xmm0
movl %ebx, %edi
callq 0x13e60
movl %r14d, %r15d
movl %eax, %r14d
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x12ef0
movaps 0x50(%rsp), %xmm0
testl %eax, %eax
je 0x59f37
xorps %xmm2, %xmm2
movaps 0x80(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x80(%rsp)
testl %r15d, %r15d
jle 0x59e8a
movl %eax, %r13d
movl %r14d, 0x8(%rsp)
movq %r12, 0x20(%rsp)
movl %r15d, %eax
movq %rax, 0xd0(%rsp)
leaq 0x1(%rbp), %rax
movq %rax, 0xc8(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq $0x0, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
xorl %ebx, %ebx
movq %rbp, 0x60(%rsp)
movl %r15d, 0x28(%rsp)
movl %ebx, %eax
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq %rax, 0x48(%rsp)
movslq %eax, %r14
movq %r14, %rbx
shlq $0x20, %rbx
movl %r15d, %eax
subl %r14d, %eax
movq %rax, 0x68(%rsp)
movq 0xc8(%rsp), %rax
addq %r14, %rax
movq %rax, 0xb0(%rsp)
incq %r14
movq $-0x1, %rbp
xorl %r12d, %r12d
movl 0xc(%rsp), %eax
cmpl $0xd, %eax
jne 0x59cb0
leaq (%r14,%r12), %r15
movq 0xb0(%rsp), %rax
leaq (%rax,%r12), %rdi
movq 0x68(%rsp), %rax
leal (%rax,%rbp), %edx
leaq 0xc(%rsp), %rsi
callq 0x12ef0
movaps 0x50(%rsp), %xmm0
incq %r12
cmpq 0xd0(%rsp), %r15
jge 0x59e64
movl %eax, %r13d
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
decq %rbp
testl %r13d, %r13d
jne 0x59c52
jmp 0x59e64
cmpl $0xa, %eax
je 0x59d34
movq 0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
sarq $0x20, %rbx
movq 0x60(%rsp), %rbp
addq %rbp, %rbx
movq (%rax), %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq *0x10(%rax)
movaps 0x30(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x48(%rsp), %rbx
addl %r13d, %ebx
leal (%rbx,%r12), %r15d
movslq %r15d, %r14
leaq (%r14,%rbp), %rdi
movq 0x68(%rsp), %rdx
subl %r13d, %edx
subl %r12d, %edx
leaq 0xc(%rsp), %rsi
callq 0x12ef0
movaps 0x50(%rsp), %xmm0
movl %eax, %r13d
movq %r15, %rax
movl 0x28(%rsp), %r15d
cmpl %r15d, %r14d
jge 0x59f49
testl %r13d, %r13d
jne 0x59c18
jmp 0x59f49
movaps 0x70(%rsp), %xmm3
addss 0x2c(%rsp), %xmm3
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
cmpl $0x0, 0x10(%rsp)
jne 0x59d59
movaps 0x80(%rsp), %xmm0
movss %xmm0, %xmm3            # xmm3 = xmm0[0],xmm3[1,2,3]
movq 0x40(%rsp), %r14
movaps 0x30(%rsp), %xmm1
unpcklps 0xa0(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
cmpl $0x0, 0x118(%rsp)
je 0x59da1
xorps %xmm2, %xmm2
movq %r14, %rdi
movaps %xmm3, %xmm0
movl 0x8(%rsp), %esi
movaps %xmm1, 0x30(%rsp)
movaps %xmm3, 0xb0(%rsp)
callq 0x12de0
movaps 0xb0(%rsp), %xmm3
movaps 0x30(%rsp), %xmm1
shrq $0x20, %rbx
movq 0x60(%rsp), %r15
addl %r15d, %ebx
movq 0x18(%rsp), %rsi
subl %esi, %ebx
movq %r14, %rdi
movaps %xmm3, %xmm0
movl %ebx, %edx
leaq 0x90(%rsp), %rcx
movl $0x12, %r8d
movq 0x20(%rsp), %r9
callq 0x45d79
movq 0x48(%rsp), %rax
leal (%rax,%r12), %ebx
incl %ebx
movslq %ebx, %r14
leaq (%r15,%r14), %rdi
movaps 0x70(%rsp), %xmm0
addss 0xa0(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x68(%rsp), %rdx
addl %ebp, %edx
movq %r15, %rbp
movq %rdi, 0x18(%rsp)
leaq 0xc(%rsp), %rsi
callq 0x12ef0
movl 0x28(%rsp), %r15d
cmpl %r15d, %r14d
movaps 0x50(%rsp), %xmm0
jge 0x59e39
movl %eax, %r13d
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
testl %r13d, %r13d
jne 0x59c0e
movq 0x48(%rsp), %rax
addl %r12d, %eax
incl %eax
xorps %xmm3, %xmm3
movl $0x1, %ecx
movq %rcx, 0x10(%rsp)
movq 0x20(%rsp), %r12
movl 0x8(%rsp), %r14d
movq 0x18(%rsp), %r15
xorps %xmm2, %xmm2
jmp 0x59ea3
movq 0x48(%rsp), %rax
addl %r12d, %eax
movq 0x20(%rsp), %r12
movq 0x60(%rsp), %rbp
movl 0x8(%rsp), %r14d
movq 0x18(%rsp), %r15
xorps %xmm2, %xmm2
movaps 0x30(%rsp), %xmm3
jmp 0x59ea3
movq $0x0, 0x10(%rsp)
movq %rbp, %r15
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
xorps %xmm3, %xmm3
xorl %eax, %eax
ucomiss %xmm2, %xmm3
jbe 0x59f37
movaps 0x70(%rsp), %xmm1
addss 0x2c(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cmpl $0x0, 0x10(%rsp)
jne 0x59ecd
movaps 0x80(%rsp), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movq 0x40(%rsp), %rbx
unpcklps 0xa0(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0],xmm3[1],mem[1]
cmpl $0x0, 0x118(%rsp)
je 0x59f11
movq %rbx, %rdi
movaps %xmm0, 0x50(%rsp)
movaps 0x50(%rsp), %xmm0
movaps %xmm3, %xmm1
movl %r14d, %esi
movq %rax, %r14
movaps %xmm3, 0x30(%rsp)
callq 0x12de0
movaps 0x30(%rsp), %xmm3
movq %r14, %rax
movaps 0x50(%rsp), %xmm0
addl %eax, %ebp
subl %r15d, %ebp
leaq 0x90(%rsp), %rcx
movq %rbx, %rdi
movaps %xmm3, %xmm1
movq %r15, %rsi
movl %ebp, %edx
movl $0x11, %r8d
movq %r12, %r9
callq 0x45d79
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r12d, %ebx
movl %ebx, %eax
movq 0x20(%rsp), %r12
jmp 0x59e76