// File: /workspace/github_c_makefile_star2_O2/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 $0xe8, %rsp
movl %r9d, %ebx
movaps %xmm3, 0xa0(%rsp)
movl %ecx, %r12d
movq %rdx, %rbp
movaps %xmm2, 0x80(%rsp)
movss %xmm1, 0x34(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq %rsi, %r14
movq %rdi, %r13
movq %r8, 0x68(%rsp)
testq %r8, %r8
jne 0x537a1
movq 0x31874(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x16586(%rip), %rsi     # 0x69d0c
leaq 0x1659d(%rip), %rdx     # 0x69d2a
movl $0x6ab9, %ecx           # imm = 0x6AB9
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
testq %rbp, %rbp
sete %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
jne 0x53b10
movl %r12d, 0xc(%rsp)
leaq 0x8(%rsp), %r12
andl $0x0, (%r12)
andq $0x0, 0x90(%rsp)
movl 0x120(%rsp), %eax
movl %ebx, 0x98(%rsp)
movl %eax, 0x9c(%rsp)
movss 0x3bc(%r14), %xmm0
movl %ebx, %edi
callq 0x140a0
movl %eax, 0x2c(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movl 0xc(%rsp), %r12d
movl %r12d, %edx
callq 0x13020
testl %eax, %eax
je 0x53b10
movl %eax, %ebx
movq %r13, 0x58(%rsp)
movaps 0x80(%rsp), %xmm0
addss 0xb0(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movslq %r12d, %rax
movq %rax, 0xc8(%rsp)
leaq 0x1(%rbp), %rax
movq %rax, 0xc0(%rsp)
xorps %xmm0, %xmm0
xorl %r15d, %r15d
movq %rbp, 0x60(%rsp)
movq %rbp, 0x38(%rsp)
xorl %r13d, %r13d
movl %r13d, 0x30(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %r15, 0x78(%rsp)
movslq %r15d, %r14
movq %r14, %r15
shlq $0x20, %r15
movl %r12d, %eax
subl %r14d, %eax
movq %rax, 0x70(%rsp)
movq 0xc0(%rsp), %rax
leaq (%rax,%r14), %r13
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ebp, %ebp
leaq (%r14,%rbp), %rax
cmpq 0xc8(%rsp), %rax
jge 0x53a4d
testl %ebx, %ebx
je 0x53a4d
movl 0x8(%rsp), %eax
cmpl $0xd, %eax
jne 0x538ec
movq %r13, %rdi
addq %rbp, %rdi
movq 0x70(%rsp), %rax
leal (%rax,%r12), %edx
leaq 0x8(%rsp), %rsi
callq 0x13020
movl %eax, %ebx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq %rax, %r15
incq %r15
incq %rbp
decq %r12
jmp 0x5389b
cmpl $0xa, %eax
je 0x53950
movq 0x68(%rsp), %rax
movss 0x8(%rax), %xmm0
sarq $0x20, %r15
movq 0x60(%rsp), %r14
addq %r14, %r15
movq (%rax), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq *0x10(%rax)
movaps 0x10(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x78(%rsp), %r15
addl %ebx, %r15d
addl %ebp, %r15d
movslq %r15d, %rdi
addq %r14, %rdi
movq 0x70(%rsp), %rdx
subl %ebx, %edx
subl %ebp, %edx
leaq 0x8(%rsp), %rsi
callq 0x13020
movl %eax, %ebx
movl 0xc(%rsp), %r12d
jmp 0x5386d
movaps 0x40(%rsp), %xmm3
addss 0x34(%rsp), %xmm3
movaps 0xb0(%rsp), %xmm0
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
movl 0x30(%rsp), %r13d
testl %r13d, %r13d
jne 0x53980
movaps 0x80(%rsp), %xmm0
movss %xmm0, %xmm3            # xmm3 = xmm0[0],xmm3[1,2,3]
movq 0x58(%rsp), %rbx
movaps 0x10(%rsp), %xmm0
unpcklps 0xa0(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cmpl $0x0, 0x128(%rsp)
movaps %xmm0, %xmm1
je 0x539cb
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps %xmm3, %xmm0
movaps %xmm3, 0xd0(%rsp)
movl 0x2c(%rsp), %esi
movaps %xmm1, 0x10(%rsp)
callq 0x12f00
movaps 0x10(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm3
shrq $0x20, %r15
movq 0x60(%rsp), %r14
addl %r14d, %r15d
movq 0x38(%rsp), %rsi
subl %esi, %r15d
movq %rbx, %rdi
movaps %xmm3, %xmm0
movl %r15d, %edx
leaq 0x90(%rsp), %rcx
pushq $0x12
popq %r8
movq 0x68(%rsp), %r9
callq 0x41852
movq 0x78(%rsp), %r15
addl %ebp, %r15d
incl %r15d
incl %r13d
movslq %r15d, %rdi
addq %r14, %rdi
movaps 0x40(%rsp), %xmm0
addss 0xa0(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x70(%rsp), %rdx
addl %r12d, %edx
movq %rdi, 0x38(%rsp)
leaq 0x8(%rsp), %rsi
callq 0x13020
movaps 0x40(%rsp), %xmm0
movl %eax, %ebx
movl 0xc(%rsp), %r12d
jmp 0x5385b
xorps %xmm0, %xmm0
movaps 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movq 0x58(%rsp), %rbx
movq 0x60(%rsp), %r14
jbe 0x53b10
movaps 0x40(%rsp), %xmm1
addss 0x34(%rsp), %xmm1
movaps 0xb0(%rsp), %xmm0
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
movaps %xmm1, %xmm0
cmpl $0x0, 0x30(%rsp)
jne 0x53a9e
movaps %xmm0, %xmm1
movaps 0x80(%rsp), %xmm0
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
movaps %xmm1, %xmm0
movq 0x38(%rsp), %r12
movaps 0x10(%rsp), %xmm1
unpcklps 0xa0(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
cmpl $0x0, 0x128(%rsp)
je 0x53ae7
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps %xmm0, 0x40(%rsp)
movaps 0x40(%rsp), %xmm0
movaps %xmm1, 0x10(%rsp)
movaps 0x10(%rsp), %xmm1
movl 0x2c(%rsp), %esi
callq 0x12f00
movaps 0x10(%rsp), %xmm1
movaps 0x40(%rsp), %xmm0
shrq $0x20, %r15
addl %r14d, %r15d
subl %r12d, %r15d
leaq 0x90(%rsp), %rcx
pushq $0x11
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movq 0x68(%rsp), %r9
callq 0x41852
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq