// File: /workspace/github_c_makefile_star2_O3/arkanis[P]process-map/./deps/raygui.h
// Function: GuiColorPanelEx
Color GuiColorPanelEx(Rectangle bounds, Color color, float hue)
{
    GuiControlState state = guiState;
    Vector2 pickerSelector = { 0 };

    Vector3 vcolor = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f };
    Vector3 hsv = ConvertRGBtoHSV(vcolor);

    pickerSelector.x = bounds.x + (float)hsv.y*bounds.width;            // HSV: Saturation
    pickerSelector.y = bounds.y + (1.0f - (float)hsv.z)*bounds.height;  // HSV: Value

    Vector3 maxHue = { hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f };
    Vector3 rgbHue = ConvertHSVtoRGB(maxHue);
    Color maxHueCol = { (unsigned char)(255.0f*rgbHue.x),
                      (unsigned char)(255.0f*rgbHue.y),
                      (unsigned char)(255.0f*rgbHue.z), 255 };

    const Color colWhite = { 255, 255, 255, 255 };
    const Color colBlack = { 0, 0, 0, 255 };

    // Update control
    //--------------------------------------------------------------------
    if ((state != GUI_STATE_DISABLED) && !guiLocked)
    {
        Vector2 mousePoint = GetMousePosition();

        if (CheckCollisionPointRec(mousePoint, bounds))
        {
            if (IsMouseButtonDown(MOUSE_LEFT_BUTTON))
            {
                state = GUI_STATE_PRESSED;
                pickerSelector = mousePoint;

                // Calculate color from picker
                Vector2 colorPick = { pickerSelector.x - bounds.x, pickerSelector.y - bounds.y };

                colorPick.x /= (float)bounds.width;     // Get normalized value on x
                colorPick.y /= (float)bounds.height;    // Get normalized value on y

                hsv.y = colorPick.x;
                hsv.z = 1.0f - colorPick.y;

                Vector3 rgb = ConvertHSVtoRGB(hsv);

                // NOTE: Vector3ToColor() only available on raylib 1.8.1
                color = RAYGUI_CLITERAL(Color){ (unsigned char)(255.0f*rgb.x),
                                 (unsigned char)(255.0f*rgb.y),
                                 (unsigned char)(255.0f*rgb.z),
                                 (unsigned char)(255.0f*(float)color.a/255.0f) };

            }
            else state = GUI_STATE_FOCUSED;
        }
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    if (state != GUI_STATE_DISABLED)
    {
        DrawRectangleGradientEx(bounds, Fade(colWhite, guiAlpha), Fade(colWhite, guiAlpha), Fade(maxHueCol, guiAlpha), Fade(maxHueCol, guiAlpha));
        DrawRectangleGradientEx(bounds, Fade(colBlack, 0), Fade(colBlack, guiAlpha), Fade(colBlack, guiAlpha), Fade(colBlack, 0));

        // Draw color picker: selector
        Rectangle selector = { pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) };
        GuiDrawRectangle(selector, 0, BLANK, Fade(colWhite, guiAlpha));
    }
    else
    {
        DrawRectangleGradientEx(bounds, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.6f), guiAlpha));
    }

    GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK);
    //--------------------------------------------------------------------

    return color;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movaps %xmm2, 0x50(%rsp)
movl %edi, %ebx
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movl %edi, %ebp
shrl $0x8, %ebp
movl %edi, %r13d
shrl $0x10, %r13d
movl %edi, %r12d
shrl $0x18, %r12d
movl 0x940fc(%rip), %r14d    # 0xa4250
movl $0xff, %eax
movl %ebp, %ecx
andl %eax, %ecx
movl %edi, %edx
andl %eax, %edx
movd %edx, %xmm0
pinsrw $0x2, %ecx, %xmm0
cvtdq2ps %xmm0, %xmm0
movl %r13d, %ecx
andl %eax, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
divps 0x54ff0(%rip), %xmm0    # 0x65170
divss 0x54ea8(%rip), %xmm1    # 0x65030
callq 0x106a2
movss %xmm1, 0x10(%rsp)
movss 0x54e69(%rip), %xmm1    # 0x65004
xorps %xmm4, %xmm4
movaps 0x50(%rsp), %xmm3
cmpless %xmm3, %xmm4
movaps %xmm4, %xmm2
movaps %xmm0, 0x20(%rsp)
andnps %xmm0, %xmm2
andps %xmm3, %xmm4
orps %xmm2, %xmm4
movaps 0x54f80(%rip), %xmm0    # 0x65140
movss %xmm4, %xmm0            # xmm0 = xmm4[0],xmm0[1,2,3]
callq 0x1074e
movaps 0x30(%rsp), %xmm4
movaps 0x40(%rsp), %xmm3
cmpl $0x3, %r14d
movl %ebp, 0xc(%rsp)
jne 0x102c1
cmpb $0x0, 0x9406d(%rip)     # 0xa4255
jne 0x101ef
callq 0x6a3c
movl 0x945a3(%rip), %edi     # 0xa4798
callq 0x4144d
movss 0x54e32(%rip), %xmm0    # 0x65034
movl %eax, %edi
callq 0x41122
movss 0x9321f(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movl %eax, %ebp
movss 0x54e16(%rip), %xmm0    # 0x65038
movl $0xff000000, %edi       # imm = 0xFF000000
callq 0x41122
movss 0x931fc(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movl %eax, %r14d
movl $0xff000000, %edi       # imm = 0xFF000000
movss 0x54ded(%rip), %xmm0    # 0x65038
callq 0x41122
movss 0x931d8(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movl %eax, %r15d
cmpb $0x0, 0x93fec(%rip)     # 0xa4255
jne 0x10270
callq 0x6a3c
movl 0x9451e(%rip), %edi     # 0xa4794
callq 0x4144d
movss 0x54db5(%rip), %xmm0    # 0x65038
movl %eax, %edi
callq 0x41122
movss 0x9319e(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
movl %eax, %ecx
callq 0x2e863
movl $0x3, %r14d
movl 0xc(%rsp), %ebp
jmp 0x105a8
movl %r12d, 0x8(%rsp)
movss 0x54d36(%rip), %xmm2    # 0x65004
subss 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm5
shufps $0xd4, %xmm5, %xmm2     # xmm2 = xmm2[0,1],xmm5[1,3]
shufps $0x52, %xmm5, %xmm2     # xmm2 = xmm2[2,0],xmm5[1,1]
mulps %xmm3, %xmm2
addps %xmm4, %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm0, %xmm2
movss 0x54d39(%rip), %xmm5    # 0x65030
mulss %xmm5, %xmm2
cvttss2si %xmm2, %eax
movl %eax, 0x10(%rsp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss %xmm5, %xmm0
cvttss2si %xmm0, %r12d
mulss %xmm5, %xmm1
cvttss2si %xmm1, %r15d
cmpb $0x0, 0x93f34(%rip)     # 0xa4254
jne 0x103f6
callq 0x26136
movaps %xmm0, 0x60(%rsp)
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
callq 0x320c1
testb %al, %al
je 0x103f6
xorl %edi, %edi
callq 0x2615e
testb %al, %al
je 0x10665
movaps 0x40(%rsp), %xmm3
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
movaps 0x60(%rsp), %xmm0
subps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
divss %xmm3, %xmm0
divss %xmm1, %xmm2
movss 0x54c81(%rip), %xmm1    # 0x65004
subss %xmm2, %xmm1
movaps 0x20(%rsp), %xmm2
movlhps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[2,3]
callq 0x1074e
movaps %xmm0, %xmm2
movss 0x54c8d(%rip), %xmm3    # 0x65030
mulss %xmm3, %xmm2
cvttss2si %xmm2, %ebx
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss %xmm3, %xmm0
cvttss2si %xmm0, %eax
movl %eax, 0xc(%rsp)
mulss %xmm3, %xmm1
movzbl 0x8(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
cvttss2si %xmm1, %r13d
mulss %xmm3, %xmm0
divss %xmm3, %xmm0
cvttss2si %xmm0, %eax
movl %eax, 0x8(%rsp)
movl $0x2, %eax
movq %rax, 0x20(%rsp)
movaps 0x60(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
jmp 0x103fb
movq %r14, 0x20(%rsp)
movss 0x9302d(%rip), %xmm0    # 0xa3430
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x41122
movl %eax, %ebp
movss 0x93019(%rip), %xmm0    # 0xa3430
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x41122
movl %eax, %r14d
movss 0x93004(%rip), %xmm0    # 0xa3430
movzbl %r15b, %eax
shll $0x10, %eax
movzbl %r12b, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x10(%rsp), %r15d
orl %ecx, %r15d
orl $0xff000000, %r15d      # imm = 0xFF000000
movl %r15d, %edi
callq 0x41122
movl %eax, %r12d
movss 0x92fd1(%rip), %xmm0    # 0xa3430
movl %r15d, %edi
callq 0x41122
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl %ebp, %edi
movl %r14d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x2e863
xorps %xmm0, %xmm0
movl $0xff000000, %edi       # imm = 0xFF000000
callq 0x41122
movl %eax, %ebp
movss 0x92f99(%rip), %xmm0    # 0xa3430
movl $0xff000000, %edi       # imm = 0xFF000000
callq 0x41122
movl %eax, %r14d
movss 0x92f84(%rip), %xmm0    # 0xa3430
movl $0xff000000, %edi       # imm = 0xFF000000
callq 0x41122
movl %eax, %r15d
xorps %xmm0, %xmm0
movl $0xff000000, %edi       # imm = 0xFF000000
callq 0x41122
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
movl %eax, %ecx
callq 0x2e863
cmpb $0x1, 0x93d6f(%rip)     # 0xa4255
jne 0x104fe
movl 0x942c2(%rip), %ebp     # 0xa47b0
movaps 0x50(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movl 0x8(%rsp), %r12d
jmp 0x10524
callq 0x6a3c
movl 0x942a7(%rip), %ebp     # 0xa47b0
movaps 0x50(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
cmpb $0x1, 0x93d3c(%rip)     # 0xa4255
movl 0x8(%rsp), %r12d
jne 0x10623
movl %ebp, %eax
shrl $0x1f, %eax
addl %ebp, %eax
sarl %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
subss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
movl %ebp, %r14d
movl %ebp, %r15d
movss 0x92ee5(%rip), %xmm0    # 0xa3430
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x41122
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0x1059f
movl %ebp, %ecx
shrl $0x1f, %ecx
addl %ebp, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
movaps 0x50(%rsp), %xmm2
subss %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
cvttss2si %xmm2, %edi
cvttss2si 0x10(%rsp), %esi
cvttss2si %xmm0, %edx
cvttss2si %xmm1, %ecx
movl %eax, %r8d
callq 0x2e4dc
movl 0xc(%rsp), %ebp
movq 0x20(%rsp), %r14
cmpb $0x0, 0x93ca6(%rip)     # 0xa4255
jne 0x105b6
callq 0x6a3c
leal (%r14,%r14,2), %eax
cltq
leaq 0x93ccd(%rip), %rcx     # 0xa4290
movl 0x4e0(%rcx,%rax,4), %edi
callq 0x4144d
movss 0x92e59(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl $0x1, %edi
movl %eax, %esi
xorl %edx, %edx
callq 0x7ee9
movzbl %r12b, %eax
shll $0x18, %eax
movzbl %r13b, %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl %bpl, %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl %bl, %eax
orl %edx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps %xmm1, 0x10(%rsp)
callq 0x6a3c
movl 0x9417c(%rip), %r14d    # 0xa47b0
movl %r14d, %eax
shrl $0x1f, %eax
addl %r14d, %eax
sarl %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x10(%rsp), %xmm1
subss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
cmpb $0x0, 0x93bfa(%rip)     # 0xa4255
je 0x10674
movl %r14d, %r15d
jmp 0x10543
movl $0x1, %eax
movq %rax, 0x20(%rsp)
jmp 0x103fb
callq 0x6a3c
movl 0x94130(%rip), %r15d    # 0xa47b0
cmpb $0x0, 0x93bce(%rip)     # 0xa4255
je 0x10691
movl %r15d, %r14d
jmp 0x10543
callq 0x6a3c
movl 0x94113(%rip), %r14d    # 0xa47b0
jmp 0x10543