// File: /workspace/github_c_makefile_star2_O0/arkanis[P]process-map/./deps/raygui.h
// Function: ConvertHSVtoRGB
static Vector3 ConvertHSVtoRGB(Vector3 hsv)
{
    Vector3 rgb = { 0 };
    float hh = 0.0f, p = 0.0f, q = 0.0f, t = 0.0f, ff = 0.0f;
    long i = 0;

    // NOTE: Comparing float values could not work properly
    if (hsv.y <= 0.0f)
    {
        rgb.x = hsv.z;
        rgb.y = hsv.z;
        rgb.z = hsv.z;
        return rgb;
    }

    hh = hsv.x;
    if (hh >= 360.0f) hh = 0.0f;
    hh /= 60.0f;

    i = (long)hh;
    ff = hh - i;
    p = hsv.z*(1.0f - hsv.y);
    q = hsv.z*(1.0f - (hsv.y*ff));
    t = hsv.z*(1.0f - (hsv.y*(1.0f - ff)));

    switch (i)
    {
        case 0:
        {
            rgb.x = hsv.z;
            rgb.y = t;
            rgb.z = p;
        } break;
        case 1:
        {
            rgb.x = q;
            rgb.y = hsv.z;
            rgb.z = p;
        } break;
        case 2:
        {
            rgb.x = p;
            rgb.y = hsv.z;
            rgb.z = t;
        } break;
        case 3:
        {
            rgb.x = p;
            rgb.y = q;
            rgb.z = hsv.z;
        } break;
        case 4:
        {
            rgb.x = t;
            rgb.y = p;
            rgb.z = hsv.z;
        } break;
        case 5:
        default:
        {
            rgb.x = hsv.z;
            rgb.y = p;
            rgb.z = q;
        } break;
    }

    return rgb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movlpd %xmm0, -0x28(%rbp)
movss %xmm1, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
leaq -0xc(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x6060
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x14(%rbp), %xmm0
jb 0x1020c
movss -0x10(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103be
movss -0x18(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x2c(%rbp), %xmm0
movss 0x7be21(%rip), %xmm1    # 0x8c044
ucomiss %xmm1, %xmm0
jb 0x10230
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x2c(%rbp), %xmm0
movss 0x7be03(%rip), %xmm1    # 0x8c040
divss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
cvttss2si -0x2c(%rbp), %rax
movq %rax, -0x48(%rbp)
movss -0x2c(%rbp), %xmm0
cvtsi2ssq -0x48(%rbp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x14(%rbp), %xmm3
movss -0x10(%rbp), %xmm0
movss 0x7bd8e(%rip), %xmm1    # 0x8c004
movaps %xmm1, %xmm2
subss %xmm3, %xmm2
mulss %xmm2, %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x14(%rbp), %xmm3
movss -0x10(%rbp), %xmm0
movss -0x3c(%rbp), %xmm2
mulss %xmm2, %xmm3
movaps %xmm1, %xmm2
subss %xmm3, %xmm2
mulss %xmm2, %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x14(%rbp), %xmm2
movss -0x10(%rbp), %xmm0
movss -0x3c(%rbp), %xmm4
movaps %xmm1, %xmm3
subss %xmm4, %xmm3
mulss %xmm3, %xmm2
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
subq $0x5, %rax
ja 0x1039e
movq -0x60(%rbp), %rax
leaq 0x7bdd3(%rip), %rcx     # 0x8c0c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movss -0x10(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x38(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103bc
movss -0x34(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103bc
movss -0x30(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x38(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103bc
movss -0x30(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x34(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103bc
movss -0x38(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103bc
jmp 0x1039e
movss -0x10(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x34(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x103be
movl -0x4(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0xc(%rbp), %rax
movq %rax, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movss -0x50(%rbp), %xmm1
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)