// File: /workspace/github_c_makefile_star2_O2/space222[P]silo/./nuklear.h
// Function: nk_edit_draw_text(nk_command_buffer*, nk_style_edit const*, float, float, float, char const*, int, float, nk_user_font const*, nk_color, nk_color, int)
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, int 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;

    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
movaps %xmm3, 0xa0(%rsp)
movaps %xmm2, 0x80(%rsp)
movss %xmm1, 0x34(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq %rcx, 0x60(%rsp)
testq %rcx, %rcx
je 0x1ec09
movl %edx, %r12d
movq %rsi, %r13
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x1ebf7
movq %rdi, %r14
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
andq $0x0, 0x90(%rsp)
movl %r8d, 0x2c(%rsp)
movl %r8d, 0x98(%rsp)
movl %r9d, 0x9c(%rsp)
movq %r13, %rdi
movl %r12d, %edx
callq 0x49bd
testl %eax, %eax
je 0x1ebf7
movl %eax, %ebx
movq %r14, 0x50(%rsp)
movaps 0x80(%rsp), %xmm0
addss 0xb0(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movslq %r12d, %rax
movq %rax, 0xc8(%rsp)
leaq 0x1(%r13), %rax
movq %rax, 0xc0(%rsp)
xorps %xmm0, %xmm0
xorl %ebp, %ebp
movq %r13, 0x38(%rsp)
xorl %r15d, %r15d
movq %r13, 0x58(%rsp)
movl %r12d, 0x30(%rsp)
movq %rbp, 0x70(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %r15, 0x78(%rsp)
movslq %r15d, %rbp
movq %rbp, %r15
shlq $0x20, %r15
movl %r12d, %eax
subl %ebp, %eax
movq %rax, 0x68(%rsp)
movq 0xc0(%rsp), %rax
leaq (%rax,%rbp), %r13
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
leaq (%r12,%rbp), %rax
cmpq 0xc8(%rsp), %rax
jge 0x1eb37
testl %ebx, %ebx
je 0x1eb37
movl 0xc(%rsp), %eax
cmpl $0xd, %eax
jne 0x1e9d7
leaq (%r12,%r13), %rdi
movq 0x68(%rsp), %rax
leal (%rax,%r14), %edx
leaq 0xc(%rsp), %rsi
callq 0x49bd
movl %eax, %ebx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq %rax, %r15
incq %r15
incq %r12
decq %r14
jmp 0x1e988
cmpl $0xa, %eax
je 0x1ea3c
movq 0x60(%rsp), %rax
movq (%rax), %rdi
movss 0x8(%rax), %xmm0
sarq $0x20, %r15
movq 0x58(%rsp), %r14
addq %r14, %r15
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 %r12d, %r15d
movslq %r15d, %rdi
addq %r14, %rdi
movq 0x68(%rsp), %rdx
subl %ebx, %edx
subl %r12d, %edx
leaq 0xc(%rsp), %rsi
callq 0x49bd
movl %eax, %ebx
movl 0x30(%rsp), %r12d
jmp 0x1e95a
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]
movq 0x70(%rsp), %rbp
testl %ebp, %ebp
movq 0x58(%rsp), %r13
jne 0x1ea70
movaps 0x80(%rsp), %xmm0
movss %xmm0, %xmm3            # xmm3 = xmm0[0],xmm3[1,2,3]
movq 0x50(%rsp), %rbx
movaps 0x10(%rsp), %xmm0
unpcklps 0xa0(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cmpl $0x0, 0x120(%rsp)
movaps %xmm0, %xmm1
je 0x1eabb
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps %xmm3, %xmm0
movaps %xmm3, 0xd0(%rsp)
movl 0x2c(%rsp), %esi
movaps %xmm1, 0x10(%rsp)
callq 0x6858
movaps 0x10(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm3
shrq $0x20, %r15
addl %r13d, %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 0x60(%rsp), %r9
callq 0x12660
movq 0x78(%rsp), %r15
addl %r12d, %r15d
incl %r15d
incl %ebp
movslq %r15d, %rdi
addq %r13, %rdi
movaps 0x40(%rsp), %xmm0
addss 0xa0(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x68(%rsp), %rdx
addl %r14d, %edx
movq %rdi, 0x38(%rsp)
leaq 0xc(%rsp), %rsi
callq 0x49bd
movaps 0x40(%rsp), %xmm0
movl %eax, %ebx
movl 0x30(%rsp), %r12d
jmp 0x1e948
xorps %xmm0, %xmm0
movaps 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r14
jbe 0x1ebf7
movaps 0x40(%rsp), %xmm0
addss 0x34(%rsp), %xmm0
movaps 0xb0(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
cmpl $0x0, 0x70(%rsp)
jne 0x1eb85
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, 0x120(%rsp)
je 0x1ebce
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 0x6858
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 0x60(%rsp), %r9
callq 0x12660
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2aa1(%rip), %rdi      # 0x216b1
leaq 0x1a8c(%rip), %rsi      # 0x206a3
leaq 0x79a3(%rip), %rcx      # 0x265c1
movl $0x5906, %edx           # imm = 0x5906
callq 0x20a0