// File: /workspace/github_c_makefile_star2_O3/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 $0xd8, %rsp
movaps %xmm2, 0x90(%rsp)
testq %rcx, %rcx
je 0x218c7
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %r14
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x218a9
movq %rdi, %rbp
movss %xmm1, 0x1c(%rsp)
movaps %xmm3, 0x80(%rsp)
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movq $0x0, 0xa0(%rsp)
movl %r8d, 0x14(%rsp)
movl %r8d, 0xa8(%rsp)
movl %r9d, 0xac(%rsp)
movq %r14, %rdi
movl %r15d, %edx
movaps %xmm0, 0x60(%rsp)
callq 0x502b
movaps 0x60(%rsp), %xmm0
movl %eax, %r13d
testl %eax, %eax
sete %al
testl %r15d, %r15d
setle %cl
orb %al, %cl
jne 0x218a9
movaps 0x90(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x90(%rsp)
movl %r15d, %eax
movq %rax, 0xd0(%rsp)
leaq 0x1(%r14), %rax
movq %rax, 0xc8(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq $0x0, (%rsp)
movq %r14, 0x38(%rsp)
movl $0x0, 0x10(%rsp)
movq %r12, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movq %rbp, 0x40(%rsp)
movl %r15d, 0x18(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movslq (%rsp), %r12
movq %r12, %rbx
shlq $0x20, %rbx
movl %r15d, %eax
subl %r12d, %eax
movq %rax, 0x58(%rsp)
movq 0xc8(%rsp), %rax
addq %r12, %rax
movq %rax, 0xb0(%rsp)
incq %r12
movq $-0x1, %r15
xorl %r14d, %r14d
movl 0xc(%rsp), %eax
cmpl $0xd, %eax
jne 0x2165c
leaq (%r12,%r14), %rbp
movq 0xb0(%rsp), %rax
leaq (%rax,%r14), %rdi
movq 0x58(%rsp), %rax
leal (%rax,%r15), %edx
leaq 0xc(%rsp), %rsi
callq 0x502b
movaps 0x60(%rsp), %xmm0
incq %r14
cmpq 0xd0(%rsp), %rbp
jge 0x217f6
movl %eax, %r13d
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
decq %r15
testl %r13d, %r13d
jne 0x215fd
jmp 0x217f6
cmpl $0xa, %eax
je 0x216eb
movq 0x48(%rsp), %r12
movq (%r12), %rdi
movss 0x8(%r12), %xmm0
sarq $0x20, %rbx
movq 0x50(%rsp), %rbp
addq %rbp, %rbx
movq %rbx, %rsi
movl %r13d, %edx
callq *0x10(%r12)
movaps 0x20(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x20(%rsp)
movq (%rsp), %rbx
addl %r13d, %ebx
leal (%rbx,%r14), %eax
movq %rax, (%rsp)
movslq %eax, %r15
leaq (%r15,%rbp), %rdi
movq 0x58(%rsp), %rdx
subl %r13d, %edx
subl %r14d, %edx
leaq 0xc(%rsp), %rsi
callq 0x502b
movaps 0x60(%rsp), %xmm0
movl %eax, %r13d
movl 0x18(%rsp), %eax
cmpl %eax, %r15d
jge 0x218bb
movl %eax, %r15d
testl %r13d, %r13d
jne 0x215c7
jmp 0x218bb
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, 0x10(%rsp)
movq 0x48(%rsp), %r12
movaps 0x80(%rsp), %xmm0
jne 0x2171d
movaps 0x90(%rsp), %xmm1
movss %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1,2,3]
movq 0x40(%rsp), %rbp
movaps 0x20(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cmpl $0x0, 0x110(%rsp)
je 0x21760
xorps %xmm2, %xmm2
movq %rbp, %rdi
movaps %xmm3, %xmm0
movl 0x14(%rsp), %esi
movaps %xmm1, 0x20(%rsp)
movaps %xmm3, 0xb0(%rsp)
callq 0x7178
movaps 0xb0(%rsp), %xmm3
movaps 0x20(%rsp), %xmm1
shrq $0x20, %rbx
movq 0x50(%rsp), %r13
addl %r13d, %ebx
movq 0x38(%rsp), %rsi
subl %esi, %ebx
movq %rbp, %rdi
movaps %xmm3, %xmm0
movl %ebx, %edx
leaq 0xa0(%rsp), %rcx
movl $0x12, %r8d
movq %r12, %r9
callq 0x13fa7
movq (%rsp), %rax
addl %r14d, %eax
incl %eax
movq %rax, (%rsp)
movslq %eax, %rbx
leaq (%rbx,%r13), %rdi
movq 0x58(%rsp), %rdx
addl %r15d, %edx
movq %rdi, 0x38(%rsp)
leaq 0xc(%rsp), %rsi
callq 0x502b
movl 0x18(%rsp), %r15d
cmpl %r15d, %ebx
movaps 0x60(%rsp), %xmm0
jge 0x218a9
movl %eax, %r13d
incl 0x10(%rsp)
movaps 0x70(%rsp), %xmm1
addss 0x80(%rsp), %xmm1
movaps %xmm1, 0x70(%rsp)
testl %eax, %eax
jne 0x215bf
jmp 0x218a9
movq (%rsp), %rax
addl %r14d, %eax
movq %rax, (%rsp)
movq 0x48(%rsp), %r12
xorps %xmm1, %xmm1
movaps 0x20(%rsp), %xmm3
ucomiss %xmm1, %xmm3
movq 0x50(%rsp), %rbx
movq 0x40(%rsp), %r14
jbe 0x218a9
movaps 0x70(%rsp), %xmm1
addss 0x1c(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cmpl $0x0, 0x10(%rsp)
jne 0x21842
movaps 0x90(%rsp), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps 0x80(%rsp), %xmm1
movq 0x38(%rsp), %r15
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
cmpl $0x0, 0x110(%rsp)
je 0x21882
xorps %xmm2, %xmm2
movq %r14, %rdi
movaps %xmm0, 0x60(%rsp)
movaps %xmm3, %xmm1
movl 0x14(%rsp), %esi
movaps %xmm3, 0x20(%rsp)
callq 0x7178
movaps 0x20(%rsp), %xmm3
movaps 0x60(%rsp), %xmm0
addl (%rsp), %ebx
subl %r15d, %ebx
leaq 0xa0(%rsp), %rcx
movq %r14, %rdi
movaps %xmm3, %xmm1
movq %r15, %rsi
movl %ebx, %edx
movl $0x11, %r8d
movq %r12, %r9
callq 0x13fa7
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r14d, %ebx
movq %rbx, (%rsp)
jmp 0x21806
leaq 0x2e13(%rip), %rdi      # 0x246e1
leaq 0x1dfe(%rip), %rsi      # 0x236d3
leaq 0x7c92(%rip), %rcx      # 0x2956e
movl $0x5906, %edx           # imm = 0x5906
callq 0x20a0