// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_text
NK_API void
nk_draw_text(struct nk_command_buffer *b, struct nk_rect r,
    const char *string, int length, const struct nk_user_font *font,
    struct nk_color bg, struct nk_color fg)
{
    float text_width = 0;
    struct nk_command_text *cmd;

    NK_ASSERT(b);
    NK_ASSERT(font);
    if (!b || !string || !length || (bg.a == 0 && fg.a == 0)) return;
    if (b->use_clipping) {
        const struct nk_rect *c = &b->clip;
        if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
            return;
    }

    /* make sure text fits inside bounds */
    text_width = font->width(font->userdata, font->height, string, length);
    if (text_width > r.w){
        int glyphs = 0;
        float txt_width = (float)text_width;
        length = nk_text_clamp(font, string, length, r.w, &glyphs, &txt_width, 0,0);
    }

    if (!length) return;
    cmd = (struct nk_command_text*)
        nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1));
    if (!cmd) return;
    cmd->x = (short)r.x;
    cmd->y = (short)r.y;
    cmd->w = (unsigned short)r.w;
    cmd->h = (unsigned short)r.h;
    cmd->background = bg;
    cmd->foreground = fg;
    cmd->font = font;
    cmd->length = length;
    cmd->height = font->height;
    NK_MEMCPY(cmd->string, string, (nk_size)length);
    cmd->string[length] = '\0';
}

// Assembly:
subq $0x68, %rsp
movlpd %xmm0, 0x58(%rsp)
movlpd %xmm1, 0x60(%rsp)
movl %r8d, 0x54(%rsp)
movl %r9d, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movq %rcx, 0x30(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x2c(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x34771
movq 0x908ab(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x7cc51(%rip), %rsi     # 0xb13a0
leaq 0x7cc68(%rip), %rdx     # 0xb13be
movl $0x24f4, %ecx           # imm = 0x24F4
movb $0x0, %al
callq 0x13ec0
movq 0x90887(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x34773
jmp 0x34775
cmpq $0x0, 0x30(%rsp)
jne 0x347b0
movq 0x9086c(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x7cc12(%rip), %rsi     # 0xb13a0
leaq 0x7cc29(%rip), %rdx     # 0xb13be
movl $0x24f5, %ecx           # imm = 0x24F5
movb $0x0, %al
callq 0x13ec0
movq 0x90848(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x347b2
cmpq $0x0, 0x48(%rsp)
je 0x347dd
cmpq $0x0, 0x40(%rsp)
je 0x347dd
cmpl $0x0, 0x3c(%rsp)
je 0x347dd
movzbl 0x57(%rsp), %eax
cmpl $0x0, %eax
jne 0x347e2
movzbl 0x53(%rsp), %eax
cmpl $0x0, %eax
jne 0x347e2
jmp 0x34a19
movq 0x48(%rsp), %rax
cmpl $0x0, 0x18(%rax)
je 0x348a7
movq 0x48(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movss 0x8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x34818
jp 0x34818
jmp 0x348a0
movq 0x18(%rsp), %rax
movss 0xc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3482e
jp 0x3482e
jmp 0x348a0
movq 0x18(%rsp), %rax
movss (%rax), %xmm1
movss 0x58(%rsp), %xmm0
addss 0x60(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x348a0
movss 0x58(%rsp), %xmm1
movq 0x18(%rsp), %rax
movss (%rax), %xmm0
movq 0x18(%rsp), %rax
addss 0x8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x348a0
movq 0x18(%rsp), %rax
movss 0x4(%rax), %xmm1
movss 0x5c(%rsp), %xmm0
addss 0x64(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x348a0
movss 0x5c(%rsp), %xmm1
movq 0x18(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x18(%rsp), %rax
addss 0xc(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0x348a5
jmp 0x34a19
jmp 0x348a7
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rcx
movq 0x30(%rsp), %rdx
movss 0x8(%rdx), %xmm0
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq (%rcx), %rdi
callq *%rax
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
ucomiss 0x60(%rsp), %xmm0
jbe 0x34929
movl $0x0, 0x14(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movss 0x60(%rsp), %xmm0
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x34a20
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0x34935
jmp 0x34a19
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdx
addq $0x38, %rdx
movl $0x10, %esi
callq 0x31f50
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x34964
jmp 0x34a19
cvttss2si 0x58(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x20(%rax)
cvttss2si 0x5c(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x22(%rax)
cvttss2si 0x60(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x24(%rax)
cvttss2si 0x64(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x26(%rax)
movq 0x20(%rsp), %rax
movl 0x54(%rsp), %ecx
movl %ecx, 0x18(%rax)
movq 0x20(%rsp), %rax
movl 0x50(%rsp), %ecx
movl %ecx, 0x1c(%rax)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movl 0x3c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x2c(%rax)
movq 0x30(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x28(%rax)
movq 0x20(%rsp), %rdi
addq $0x30, %rdi
movq 0x40(%rsp), %rsi
movslq 0x3c(%rsp), %rdx
callq 0x2f750
movq 0x20(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movb $0x0, 0x30(%rax,%rcx)
addq $0x68, %rsp
retq
nop