// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x128, %rsp            # imm = 0x128
movl 0x138(%rsp), %eax
movl 0x130(%rsp), %eax
movl %r9d, 0x124(%rsp)
movq %rdi, 0x118(%rsp)
movq %rsi, 0x110(%rsp)
movss %xmm0, 0x10c(%rsp)
movss %xmm1, 0x108(%rsp)
movss %xmm2, 0x104(%rsp)
movq %rdx, 0xf8(%rsp)
movl %ecx, 0xf4(%rsp)
movss %xmm3, 0xf0(%rsp)
movq %r8, 0xe8(%rsp)
cmpq $0x0, 0x118(%rsp)
je 0x3f8d5
jmp 0x3f8f4
leaq 0x8a74(%rip), %rdi      # 0x48350
leaq 0x5ad0(%rip), %rsi      # 0x453b3
movl $0x5905, %edx           # imm = 0x5905
leaq 0xbfcd(%rip), %rcx      # 0x4b8bc
callq 0x20a0
cmpq $0x0, 0xe8(%rsp)
je 0x3f901
jmp 0x3f920
leaq 0x7443(%rip), %rdi      # 0x46d4b
leaq 0x5aa4(%rip), %rsi      # 0x453b3
movl $0x5906, %edx           # imm = 0x5906
leaq 0xbfa1(%rip), %rcx      # 0x4b8bc
callq 0x20a0
cmpq $0x0, 0x110(%rsp)
je 0x3f92d
jmp 0x3f94c
leaq 0x92a6(%rip), %rdi      # 0x48bda
leaq 0x5a78(%rip), %rsi      # 0x453b3
movl $0x5907, %edx           # imm = 0x5907
leaq 0xbf75(%rip), %rcx      # 0x4b8bc
callq 0x20a0
cmpq $0x0, 0xf8(%rsp)
je 0x3f977
cmpl $0x0, 0xf4(%rsp)
je 0x3f977
cmpq $0x0, 0x118(%rsp)
je 0x3f977
cmpq $0x0, 0x110(%rsp)
jne 0x3f97c
jmp 0x3fe6a
movl $0x0, 0xe4(%rsp)
movl $0x0, 0xe0(%rsp)
movl $0x0, 0xdc(%rsp)
movl $0x0, 0xd8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movl $0x0, 0xc4(%rsp)
movl $0x0, 0xc0(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x41b0
movlpd %xmm0, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movl 0x124(%rsp), %eax
movl %eax, 0xb8(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0xbc(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xdc(%rsp), %rax
addq %rax, %rdi
movl 0xf4(%rsp), %edx
subl 0xdc(%rsp), %edx
leaq 0xe0(%rsp), %rsi
callq 0x7840
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x3fa52
jmp 0x3fe6a
jmp 0x3fa54
movl 0xdc(%rsp), %ecx
xorl %eax, %eax
cmpl 0xf4(%rsp), %ecx
movb %al, 0xf(%rsp)
jge 0x3fa79
cmpl $0x0, 0xe4(%rsp)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x3fa86
jmp 0x3fd5d
cmpl $0xa, 0xe0(%rsp)
jne 0x3fc4b
movss 0x108(%rsp), %xmm0
addss 0xc4(%rsp), %xmm0
movss %xmm0, 0x9c(%rsp)
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0xa4(%rsp)
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0xa0(%rsp)
movss 0x10c(%rsp), %xmm0
movss %xmm0, 0x98(%rsp)
cmpl $0x0, 0xc0(%rsp)
jne 0x3fb0a
movss 0x104(%rsp), %xmm0
addss 0x98(%rsp), %xmm0
movss %xmm0, 0x98(%rsp)
cmpl $0x0, 0x138(%rsp)
je 0x3fb55
movq 0x118(%rsp), %rdi
movups 0x98(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movl 0x124(%rsp), %eax
movl %eax, 0x7c(%rsp)
movsd 0x80(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
movl 0x7c(%rsp), %esi
xorps %xmm2, %xmm2
callq 0xb130
movq 0x118(%rsp), %rdi
movups 0x98(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movq 0xc8(%rsp), %rsi
movl 0xf8(%rsp), %edx
movl 0xdc(%rsp), %eax
addl %eax, %edx
movl %esi, %eax
subl %eax, %edx
movq 0xe8(%rsp), %r9
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
leaq 0xb0(%rsp), %rcx
movl $0x12, %r8d
callq 0x24820
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0xd8(%rsp)
movq 0xf8(%rsp), %rax
movslq 0xdc(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0xc8(%rsp)
movss 0xf0(%rsp), %xmm0
addss 0xc4(%rsp), %xmm0
movss %xmm0, 0xc4(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xdc(%rsp), %rax
addq %rax, %rdi
movl 0xf4(%rsp), %edx
subl 0xdc(%rsp), %edx
leaq 0xe0(%rsp), %rsi
callq 0x7840
movl %eax, 0xe4(%rsp)
jmp 0x3fa54
cmpl $0xd, 0xe0(%rsp)
jne 0x3fca0
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xdc(%rsp), %rax
addq %rax, %rdi
movl 0xf4(%rsp), %edx
subl 0xdc(%rsp), %edx
leaq 0xe0(%rsp), %rsi
callq 0x7840
movl %eax, 0xe4(%rsp)
jmp 0x3fa54
movq 0xe8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xe8(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x58(%rsp)
movq 0xe8(%rsp), %rcx
movss 0x8(%rcx), %xmm0
movq 0xf8(%rsp), %rsi
movslq 0xdc(%rsp), %rcx
addq %rcx, %rsi
movl 0xe4(%rsp), %edx
movq 0x58(%rsp), %rdi
callq *%rax
movss %xmm0, 0xd4(%rsp)
movss 0xd4(%rsp), %xmm0
addss 0xd8(%rsp), %xmm0
movss %xmm0, 0xd8(%rsp)
movl 0xe4(%rsp), %eax
addl 0xdc(%rsp), %eax
movl %eax, 0xdc(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xdc(%rsp), %rax
addq %rax, %rdi
movl 0xf4(%rsp), %edx
subl 0xdc(%rsp), %edx
leaq 0xe0(%rsp), %rsi
callq 0x7840
movl %eax, 0xe4(%rsp)
jmp 0x3fa54
movss 0xd8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x3fe6a
movss 0x108(%rsp), %xmm0
addss 0xc4(%rsp), %xmm0
movss %xmm0, 0x4c(%rsp)
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0x54(%rsp)
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0x50(%rsp)
movss 0x10c(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
cmpl $0x0, 0xc0(%rsp)
jne 0x3fdd6
movss 0x104(%rsp), %xmm0
addss 0x48(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
cmpl $0x0, 0x138(%rsp)
je 0x3fe15
movq 0x118(%rsp), %rdi
movups 0x48(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movl 0x124(%rsp), %eax
movl %eax, 0x2c(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movl 0x2c(%rsp), %esi
xorps %xmm2, %xmm2
callq 0xb130
movq 0x118(%rsp), %rdi
movups 0x48(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0xc8(%rsp), %rsi
movl 0xf8(%rsp), %edx
movl 0xdc(%rsp), %eax
addl %eax, %edx
movl %esi, %eax
subl %eax, %edx
movq 0xe8(%rsp), %r9
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
leaq 0xb0(%rsp), %rcx
movl $0x11, %r8d
callq 0x24820
addq $0x128, %rsp            # imm = 0x128
retq
nopw %cs:(%rax,%rax)