// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./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, 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 %xmm2, 0xa0(%rsp)
testq %rcx, %rcx
je 0x274f6
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r14
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x274d9
movl %r8d, %ebp
movq %rdi, %r15
movss %xmm1, 0x3c(%rsp)
movaps %xmm3, 0x90(%rsp)
leaq 0x10(%rsp), %rsi
movl $0x0, (%rsi)
movq $0x0, 0xb0(%rsp)
movl %r8d, 0xb8(%rsp)
movl %r9d, 0xbc(%rsp)
movq %r14, %rdi
movl %r13d, %edx
movaps %xmm0, 0x60(%rsp)
callq 0x4edc
movaps 0x60(%rsp), %xmm0
testl %eax, %eax
je 0x274d9
xorps %xmm2, %xmm2
movaps 0xa0(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0xa0(%rsp)
testl %r13d, %r13d
jle 0x27432
movl %eax, %r12d
movl %ebp, 0xc(%rsp)
movq %r15, 0x50(%rsp)
movq %rbx, 0x30(%rsp)
movl %r13d, %eax
movq %rax, 0xe0(%rsp)
leaq 0x1(%r14), %rax
movq %rax, 0xd8(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x80(%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, 0x28(%rsp)
movq %r14, 0x20(%rsp)
xorl %ebx, %ebx
movl %r13d, 0x14(%rsp)
movl %ebx, %r13d
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
movq %r13, 0x58(%rsp)
movslq %r13d, %r14
movq %r14, %rbx
shlq $0x20, %rbx
movl 0x14(%rsp), %eax
subl %r14d, %eax
movq %rax, 0x78(%rsp)
movq 0xd8(%rsp), %rax
addq %r14, %rax
movq %rax, 0xc0(%rsp)
incq %r14
movq $-0x1, %r13
xorl %r15d, %r15d
movl 0x10(%rsp), %eax
cmpl $0xd, %eax
jne 0x27244
leaq (%r14,%r15), %rbp
movq 0xc0(%rsp), %rax
leaq (%rax,%r15), %rdi
movq 0x78(%rsp), %rax
leal (%rax,%r13), %edx
leaq 0x10(%rsp), %rsi
callq 0x4edc
movaps 0x60(%rsp), %xmm0
incq %r15
cmpq 0xe0(%rsp), %rbp
jge 0x27408
movl %eax, %r12d
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
decq %r13
testl %r12d, %r12d
jne 0x271e5
jmp 0x27408
cmpl $0xa, %eax
je 0x272c4
movq 0x30(%rsp), %rax
movss 0x8(%rax), %xmm0
sarq $0x20, %rbx
movq 0x28(%rsp), %r13
addq %r13, %rbx
movq (%rax), %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq *0x10(%rax)
movaps 0x40(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
movq 0x58(%rsp), %rbx
addl %r12d, %ebx
leal (%rbx,%r15), %eax
movslq %eax, %r14
leaq (%r14,%r13), %rdi
movq %rax, %r13
movq 0x78(%rsp), %rdx
subl %r12d, %edx
subl %r15d, %edx
leaq 0x10(%rsp), %rsi
callq 0x4edc
movaps 0x60(%rsp), %xmm0
cmpl 0x14(%rsp), %r14d
jge 0x274eb
movl %eax, %r12d
testl %eax, %eax
jne 0x271aa
jmp 0x274eb
movaps 0x80(%rsp), %xmm3
addss 0x3c(%rsp), %xmm3
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
cmpl $0x0, 0x18(%rsp)
jne 0x272ec
movaps 0xa0(%rsp), %xmm0
movss %xmm0, %xmm3            # xmm3 = xmm0[0],xmm3[1,2,3]
movaps 0x90(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cmpl $0x0, 0x120(%rsp)
movq 0x50(%rsp), %r14
je 0x27337
xorps %xmm2, %xmm2
movq %r14, %rdi
movaps %xmm3, %xmm0
movl 0xc(%rsp), %esi
movaps %xmm1, 0x40(%rsp)
movaps %xmm3, 0xc0(%rsp)
callq 0x6fee
movaps 0xc0(%rsp), %xmm3
movaps 0x40(%rsp), %xmm1
shrq $0x20, %rbx
movq 0x28(%rsp), %r12
addl %r12d, %ebx
movq 0x20(%rsp), %rsi
subl %esi, %ebx
movq %r14, %rdi
movaps %xmm3, %xmm0
movl %ebx, %edx
leaq 0xb0(%rsp), %rcx
movl $0x12, %r8d
movq 0x30(%rsp), %r9
callq 0x13f12
movq 0x58(%rsp), %rax
leal (%rax,%r15), %ebx
incl %ebx
movslq %ebx, %r14
leaq (%r12,%r14), %rdi
movaps 0x80(%rsp), %xmm0
addss 0x90(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x78(%rsp), %rdx
addl %r13d, %edx
movq %rdi, 0x20(%rsp)
leaq 0x10(%rsp), %rsi
callq 0x4edc
movl 0x14(%rsp), %r13d
cmpl %r13d, %r14d
movaps 0x60(%rsp), %xmm0
jge 0x273d3
movl %eax, %r12d
movq 0x18(%rsp), %rax
incl %eax
movq %rax, 0x18(%rsp)
testl %r12d, %r12d
jne 0x2719f
movq 0x58(%rsp), %r13
addl %r15d, %r13d
incl %r13d
xorps %xmm1, %xmm1
movl $0x1, %eax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
movq 0x50(%rsp), %r15
movl 0xc(%rsp), %ebp
movq 0x20(%rsp), %r12
xorps %xmm2, %xmm2
jmp 0x2744c
movq 0x58(%rsp), %r13
addl %r15d, %r13d
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
movq 0x50(%rsp), %r15
movl 0xc(%rsp), %ebp
movq 0x20(%rsp), %r12
xorps %xmm2, %xmm2
movaps 0x40(%rsp), %xmm1
jmp 0x2744c
movq $0x0, 0x18(%rsp)
movq %r14, %r12
xorps %xmm1, %xmm1
movaps %xmm1, 0x80(%rsp)
xorl %r13d, %r13d
ucomiss %xmm2, %xmm1
jbe 0x274d9
movaps 0x80(%rsp), %xmm2
addss 0x3c(%rsp), %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
cmpl $0x0, 0x18(%rsp)
movaps 0x90(%rsp), %xmm3
jne 0x27481
movaps 0xa0(%rsp), %xmm2
movss %xmm2, %xmm0            # xmm0 = xmm2[0],xmm0[1,2,3]
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
cmpl $0x0, 0x120(%rsp)
je 0x274b4
xorps %xmm2, %xmm2
movq %r15, %rdi
movaps %xmm0, 0x60(%rsp)
movaps 0x60(%rsp), %xmm0
movl %ebp, %esi
movaps %xmm1, 0x40(%rsp)
callq 0x6fee
movaps 0x40(%rsp), %xmm1
movaps 0x60(%rsp), %xmm0
addl %r13d, %r14d
subl %r12d, %r14d
leaq 0xb0(%rsp), %rcx
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl $0x11, %r8d
movq %rbx, %r9
callq 0x13f12
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r15d, %ebx
movl %ebx, %r13d
jmp 0x27410
leaq 0x3190(%rip), %rdi      # 0x2a68d
leaq 0x217f(%rip), %rsi      # 0x29683
leaq 0x9663(%rip), %rcx      # 0x30b6e
movl $0x583e, %edx           # imm = 0x583E
callq 0x3100