// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_vertex_element
NK_INTERN void
nk_draw_vertex_element(void *dst, const float *values, int value_count,
    enum nk_draw_vertex_layout_format format)
{
    int value_index;
    void *attribute = dst;
    /* if this triggers you tried to provide a color format for a value */
    NK_ASSERT(format < NK_FORMAT_COLOR_BEGIN);
    if (format >= NK_FORMAT_COLOR_BEGIN && format <= NK_FORMAT_COLOR_END) return;
    for (value_index = 0; value_index < value_count; ++value_index) {
        switch (format) {
        default: NK_ASSERT(0 && "invalid vertex layout format"); break;
        case NK_FORMAT_SCHAR: {
            char value = (char)NK_CLAMP((float)NK_SCHAR_MIN, values[value_index], (float)NK_SCHAR_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(char));
        } break;
        case NK_FORMAT_SSHORT: {
            nk_short value = (nk_short)NK_CLAMP((float)NK_SSHORT_MIN, values[value_index], (float)NK_SSHORT_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(value));
        } break;
        case NK_FORMAT_SINT: {
            nk_int value = (nk_int)NK_CLAMP((float)NK_SINT_MIN, values[value_index], (float)NK_SINT_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(nk_int));
        } break;
        case NK_FORMAT_UCHAR: {
            unsigned char value = (unsigned char)NK_CLAMP((float)NK_UCHAR_MIN, values[value_index], (float)NK_UCHAR_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(unsigned char));
        } break;
        case NK_FORMAT_USHORT: {
            nk_ushort value = (nk_ushort)NK_CLAMP((float)NK_USHORT_MIN, values[value_index], (float)NK_USHORT_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(value));
            } break;
        case NK_FORMAT_UINT: {
            nk_uint value = (nk_uint)NK_CLAMP((float)NK_UINT_MIN, values[value_index], (float)NK_UINT_MAX);
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(nk_uint));
        } break;
        case NK_FORMAT_FLOAT:
            NK_MEMCPY(attribute, &values[value_index], sizeof(values[value_index]));
            attribute = (void*)((char*)attribute + sizeof(float));
            break;
        case NK_FORMAT_DOUBLE: {
            double value = (double)values[value_index];
            NK_MEMCPY(attribute, &value, sizeof(value));
            attribute = (void*)((char*)attribute + sizeof(double));
            } break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x8, %edx
jb 0x54a68
movq 0x335af(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x1d340(%rip), %rsi     # 0x71d8c
leaq 0x1d357(%rip), %rdx     # 0x71daa
movl $0x2671, %ecx           # imm = 0x2671
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
leal -0x8(%rbx), %eax
cmpl $0xb, %eax
jb 0x54c81
movl %ebx, %r13d
leaq 0x1a086(%rip), %r12     # 0x6eb04
xorl %ebp, %ebp
cmpl $0x7, %ebx
ja 0x54c40
movslq (%r12,%r13,4), %rax
addq %r12, %rax
jmpq *%rax
movss (%r14,%rbp), %xmm0
xorl %eax, %eax
movss 0x19ed2(%rip), %xmm1    # 0x6e974
ucomiss %xmm0, %xmm1
seta %al
movss 0x19ec8(%rip), %xmm2    # 0x6e978
ucomiss %xmm0, %xmm2
leal 0x7f(%rax,%rax), %eax
movl $0x7f, %ecx
cmovbel %ecx, %eax
cvttss2si %xmm0, %ecx
cmovbel %eax, %ecx
ucomiss %xmm0, %xmm1
cmoval %eax, %ecx
movb %cl, (%rsp)
jmp 0x54b5c
movss (%r14,%rbp), %xmm0
movss 0x19e16(%rip), %xmm2    # 0x6e8f8
ucomiss %xmm0, %xmm2
seta %al
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
seta %cl
andb %al, %cl
movzbl %cl, %eax
decl %eax
ucomiss %xmm0, %xmm2
jmp 0x54bc8
movss (%r14,%rbp), %xmm0
movss 0x19e56(%rip), %xmm1    # 0x6e964
ucomiss %xmm0, %xmm1
cvttss2si %xmm0, %eax
movl $0x80000000, %ecx       # imm = 0x80000000
cmovbel %ecx, %eax
movss 0x19e43(%rip), %xmm1    # 0x6e968
ucomiss %xmm0, %xmm1
cmoval %ecx, %eax
movl %eax, (%rsp)
jmp 0x54c1c
movss (%r14,%rbp), %xmm0
movss 0x19e1f(%rip), %xmm1    # 0x6e960
ucomiss %xmm0, %xmm1
cvttss2si %xmm0, %eax
movl $0x0, %ecx
cmovbel %ecx, %eax
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
cmoval %ecx, %eax
movb %al, (%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %rsp, %rsi
callq 0x258b3
incq %r15
jmp 0x54c73
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rbp), %xmm0
movsd %xmm0, (%rsp)
movl $0x8, %edx
movq %r15, %rdi
movq %rsp, %rsi
callq 0x258b3
addq $0x8, %r15
jmp 0x54c73
movss (%r14,%rbp), %xmm0
xorl %eax, %eax
movss 0x19dc1(%rip), %xmm1    # 0x6e96c
ucomiss %xmm0, %xmm1
seta %al
addl %eax, %eax
movl $0x7fff, %ecx           # imm = 0x7FFF
addl %ecx, %eax
movss 0x19dae(%rip), %xmm2    # 0x6e970
ucomiss %xmm0, %xmm2
cmovbel %ecx, %eax
cvttss2si %xmm0, %ecx
cmovbel %eax, %ecx
ucomiss %xmm0, %xmm1
cmoval %eax, %ecx
movw %cx, (%rsp)
movl $0x2, %edx
movq %r15, %rdi
movq %rsp, %rsi
callq 0x258b3
addq $0x2, %r15
jmp 0x54c73
movss (%r14,%rbp), %xmm0
movss 0x19cf4(%rip), %xmm1    # 0x6e8f4
ucomiss %xmm0, %xmm1
cvttss2si %xmm0, %rax
movl $0x0, %ecx
cmovbel %ecx, %eax
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
cmoval %ecx, %eax
movl %eax, (%rsp)
movl $0x4, %edx
movq %r15, %rdi
movq %rsp, %rsi
jmp 0x54c35
leaq (%r14,%rbp), %rsi
movl $0x4, %edx
movq %r15, %rdi
callq 0x258b3
addq $0x4, %r15
jmp 0x54c73
movq 0x333a9(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
leaq 0x1d13b(%rip), %rsi     # 0x71d8c
leaq 0x1d152(%rip), %rdx     # 0x71daa
movl $0x2675, %ecx           # imm = 0x2675
xorl %eax, %eax
callq 0x12d80
movq 0x33385(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
addq $0x4, %rbp
cmpq $0x4, %rbp
je 0x54a80
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq