// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_triangle_from_direction
NK_API void
nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r,
    float pad_x, float pad_y, enum nk_heading direction)
{
    float w_half, h_half;
    NK_ASSERT(result);

    r.w = NK_MAX(2 * pad_x, r.w);
    r.h = NK_MAX(2 * pad_y, r.h);
    r.w = r.w - 2 * pad_x;
    r.h = r.h - 2 * pad_y;

    r.x = r.x + pad_x;
    r.y = r.y + pad_y;

    w_half = r.w / 2.0f;
    h_half = r.h / 2.0f;

    if (direction == NK_UP) {
        result[0] = nk_vec2(r.x + w_half, r.y);
        result[1] = nk_vec2(r.x + r.w, r.y + r.h);
        result[2] = nk_vec2(r.x, r.y + r.h);
    } else if (direction == NK_RIGHT) {
        result[0] = nk_vec2(r.x, r.y);
        result[1] = nk_vec2(r.x + r.w, r.y + h_half);
        result[2] = nk_vec2(r.x, r.y + r.h);
    } else if (direction == NK_DOWN) {
        result[0] = nk_vec2(r.x, r.y);
        result[1] = nk_vec2(r.x + r.w, r.y);
        result[2] = nk_vec2(r.x + w_half, r.y + r.h);
    } else {
        result[0] = nk_vec2(r.x, r.y + h_half);
        result[1] = nk_vec2(r.x + r.w, r.y);
        result[2] = nk_vec2(r.x + r.w, r.y + r.h);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x235f4
movq 0x63a47(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x4d7e9(%rip), %rsi     # 0x70d9c
leaq 0x4d800(%rip), %rdx     # 0x70dba
movl $0x194c, %ecx           # imm = 0x194C
xorl %eax, %eax
movaps %xmm1, 0x30(%rsp)
movaps %xmm2, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm3, (%rsp)
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movaps (%rsp), %xmm3
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm1
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movaps %xmm2, %xmm3
addps %xmm2, %xmm3
maxps %xmm3, %xmm1
subps %xmm3, %xmm1
addps %xmm0, %xmm2
movss 0x4a292(%rip), %xmm0    # 0x6d8a0
movaps %xmm1, %xmm3
mulss %xmm0, %xmm3
cmpl $0x2, %ebp
je 0x2366b
movaps %xmm1, %xmm4
shufps $0x55, %xmm1, %xmm4     # xmm4 = xmm4[1,1],xmm1[1,1]
mulss %xmm4, %xmm0
cmpl $0x1, %ebp
je 0x23648
testl %ebp, %ebp
jne 0x2368b
movaps %xmm2, %xmm0
addss %xmm3, %xmm0
addps %xmm2, %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, (%rbx)
shufps $0x1, %xmm2, %xmm1      # xmm1 = xmm1[1,0],xmm2[0,0]
shufps $0xe2, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[2,3]
jmp 0x236ae
movaps %xmm2, %xmm3
addps %xmm1, %xmm3
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
addps %xmm2, %xmm1
movaps %xmm2, %xmm0
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, (%rbx)
shufps $0x1, %xmm2, %xmm3      # xmm3 = xmm3[1,0],xmm2[0,0]
shufps $0xe2, %xmm2, %xmm3     # xmm3 = xmm3[2,0],xmm2[2,3]
movlps %xmm3, 0x10(%rbx)
jmp 0x236b2
movaps %xmm2, %xmm0
addps %xmm1, %xmm0
movaps %xmm2, %xmm4
shufps $0x1, %xmm0, %xmm4      # xmm4 = xmm4[1,0],xmm0[0,0]
movaps %xmm2, %xmm0
shufps $0x24, %xmm4, %xmm0     # xmm0 = xmm0[0,1],xmm4[2,0]
movups %xmm0, (%rbx)
movss %xmm3, %xmm1            # xmm1 = xmm3[0],xmm1[1,2,3]
addps %xmm2, %xmm1
jmp 0x236ae
movaps %xmm2, %xmm3
shufps $0x55, %xmm2, %xmm3     # xmm3 = xmm3[1,1],xmm2[1,1]
addss %xmm3, %xmm0
movlhps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
addps %xmm2, %xmm1
shufps $0x1, %xmm1, %xmm2      # xmm2 = xmm2[1,0],xmm1[0,0]
shufps $0x22, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[2,0]
movups %xmm0, (%rbx)
addss %xmm4, %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movlps %xmm1, 0x10(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq