// File: /workspace/github_c_makefile_star2_O2/arkanis[P]process-map/./deps/raygui.h
// Function: GuiSpinner
bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode)
{
    GuiControlState state = guiState;

    bool pressed = false;
    int tempValue = *value;

    Rectangle spinner = { bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING), bounds.y,
                          bounds.width - 2*(GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING)), bounds.height };
    Rectangle leftButtonBound = { (float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height };
    Rectangle rightButtonBound = { (float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height };

    Rectangle textBounds = { 0 };
    if (text != NULL)
    {
        textBounds.width = (float)GetTextWidth(text);
        textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE);
        textBounds.x = bounds.x + bounds.width + GuiGetStyle(SPINNER, TEXT_PADDING);
        textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2;
        if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING);
    }

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

        // Check spinner state
        if (CheckCollisionPointRec(mousePoint, bounds))
        {
            if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED;
            else state = GUI_STATE_FOCUSED;
        }
    }

    if (!editMode)
    {
        if (tempValue < minValue) tempValue = minValue;
        if (tempValue > maxValue) tempValue = maxValue;
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    // TODO: Set Spinner properties for ValueBox
    pressed = GuiValueBox(spinner, NULL, &tempValue, minValue, maxValue, editMode);

    // Draw value selector custom buttons
    // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values
    int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH);
    int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT);
    GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH));
    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);

#if defined(RAYGUI_SUPPORT_ICONS)
    if (GuiButton(leftButtonBound, GuiIconText(RICON_ARROW_LEFT_FILL, NULL))) tempValue--;
    if (GuiButton(rightButtonBound, GuiIconText(RICON_ARROW_RIGHT_FILL, NULL))) tempValue++;
#else
    if (GuiButton(leftButtonBound, "<")) tempValue--;
    if (GuiButton(rightButtonBound, ">")) tempValue++;
#endif

    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign);
    GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth);

    // Draw text label if provided
    if (text != NULL) GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha));
    //--------------------------------------------------------------------

    *value = tempValue;
    return pressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r8d, 0x64(%rsp)
movl %ecx, 0x6c(%rsp)
movl %edx, 0x68(%rsp)
movq %rdi, %r12
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0xb0(%rsp)
movl 0x908a0(%rip), %eax     # 0x9b280
movq %rax, 0x38(%rsp)
movq %rsi, 0xc8(%rsp)
movl (%rsi), %eax
movl %eax, 0x5c(%rsp)
movl %eax, 0x8(%rsp)
pushq $0xb
popq %r14
pushq $0x10
popq %rbp
movl %r14d, %edi
movl %ebp, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
addss 0x20(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
pushq $0x11
popq %rbx
movl %r14d, %edi
movl %ebx, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movss %xmm0, 0xc(%rsp)
movl %r14d, %edi
movl %ebp, %esi
callq 0x6e93
movl %eax, %r15d
movl %r14d, %edi
movl %ebx, %esi
callq 0x6e93
movl %eax, %r13d
addl %r15d, %r13d
movq %r12, %r15
addl %r13d, %r13d
movl %r14d, %edi
movl %ebp, %esi
callq 0x6e93
movl %eax, 0x60(%rsp)
movaps 0x20(%rsp), %xmm0
addss 0x10(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movl %r14d, %edi
movl %ebp, %esi
callq 0x6e93
movl %eax, %ebx
movl %r14d, %edi
movl %ebp, %esi
callq 0x6e93
movl %eax, %r12d
testq %r15, %r15
je 0xab79
movaps 0x10(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0x40(%rsp)
movaps 0x20(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0xd0(%rsp)
movq %r15, %rdi
callq 0x76f6
movl %eax, %ebp
pushq $0x10
popq %r14
xorl %edi, %edi
movl %r14d, %esi
callq 0x6e93
movd %eax, %xmm0
movd %ebp, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2ps %xmm1, %xmm0
movaps %xmm0, 0xa0(%rsp)
pushq $0xb
popq %rbp
pushq $0xd
popq %rsi
movl %ebp, %edi
callq 0x6e93
cvtsi2ss %eax, %xmm0
addss 0x80(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movaps 0x40(%rsp), %xmm0
mulss 0x4e4fb(%rip), %xmm0    # 0x5900c
addss 0xd0(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %edi, %edi
movl %r14d, %esi
callq 0x6e93
pushq $0x2
popq %rcx
cltd
idivl %ecx
cvtsi2ss %eax, %xmm0
movaps 0x40(%rsp), %xmm1
subss %xmm0, %xmm1
movaps 0x90(%rsp), %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm0, 0x90(%rsp)
pushq $0xe
popq %rsi
movl %ebp, %edi
callq 0x6e93
testl %eax, %eax
je 0xab8b
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm3
movaps 0xa0(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
jmp 0xabd7
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm3
jmp 0xabd7
movaps 0xb0(%rsp), %xmm0
subss 0xa0(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
pushq $0xb
popq %rdi
pushq $0xd
popq %rsi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps 0x40(%rsp), %xmm2
subss %xmm0, %xmm2
movaps 0x90(%rsp), %xmm1
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm3
movaps 0xa0(%rsp), %xmm0
cvtsi2ss %ebx, %xmm7
movaps 0x70(%rsp), %xmm4
addss 0xc(%rsp), %xmm4
cvtsi2ss %r13d, %xmm6
cmpl $0x3, 0x38(%rsp)
movaps 0x80(%rsp), %xmm5
movaps %xmm0, 0xa0(%rsp)
movaps %xmm1, 0x90(%rsp)
jne 0xac17
pushq $0x3
popq %rax
movq %rax, 0x38(%rsp)
jmp 0xaca4
cmpb $0x0, 0x90666(%rip)     # 0x9b284
jne 0xaca4
movaps %xmm4, 0x70(%rsp)
movaps %xmm6, 0x40(%rsp)
movss %xmm7, 0xc(%rsp)
callq 0x1fd8b
movaps 0xb0(%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x2a643
movss 0xc(%rsp), %xmm7
movaps 0x40(%rsp), %xmm6
movaps 0x80(%rsp), %xmm5
movaps 0x70(%rsp), %xmm4
movaps 0x20(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
testb %al, %al
je 0xaca4
xorl %edi, %edi
callq 0x1fdb3
movss 0xc(%rsp), %xmm7
movaps 0x40(%rsp), %xmm6
movaps 0x80(%rsp), %xmm5
movaps 0x70(%rsp), %xmm4
movaps 0x20(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movzbl %al, %eax
incl %eax
jmp 0xac0d
movq %r15, %rbx
subss %xmm7, %xmm5
movaps %xmm3, %xmm0
movss %xmm4, %xmm0            # xmm0 = xmm4[0],xmm0[1,2,3]
movaps %xmm2, %xmm1
subss %xmm6, %xmm1
movaps %xmm2, %xmm4
cvtsi2ssl 0x60(%rsp), %xmm4
movaps %xmm4, 0x70(%rsp)
movl 0x64(%rsp), %eax
testb %al, %al
movl 0x6c(%rsp), %ecx
movl 0x68(%rsp), %edx
jne 0xace9
movl 0x5c(%rsp), %esi
cmpl %edx, %esi
cmovlel %edx, %esi
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x8(%rsp)
movss %xmm5, %xmm3            # xmm3 = xmm5[0],xmm3[1,2,3]
movaps %xmm3, 0x20(%rsp)
cvtsi2ss %r12d, %xmm2
movaps %xmm2, 0x10(%rsp)
movzbl %al, %r8d
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0xae45
movb %al, 0x80(%rsp)
pushq $0x2
popq %r14
pushq $0xc
popq %r12
movl %r14d, %edi
movl %r12d, %esi
callq 0x6e93
movl %eax, %ebp
pushq $0xe
popq %r13
movl %r14d, %edi
movl %r13d, %esi
callq 0x6e93
movl %eax, %r15d
pushq $0xb
popq %rdi
movl %r12d, %esi
callq 0x6e93
movl %r14d, %edi
movl %r12d, %esi
movl %eax, %edx
callq 0x6e0e
pushq $0x1
popq %rdx
movl %r14d, %edi
movl %r13d, %esi
callq 0x6e0e
leaq 0x4e64f(%rip), %rdi     # 0x593b6
movaps 0xb0(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
callq 0x71e9
testb %al, %al
je 0xad81
decl 0x8(%rsp)
leaq 0x4e630(%rip), %rdi     # 0x593b8
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x71e9
testb %al, %al
je 0xad9f
incl 0x8(%rsp)
pushq $0x2
popq %r14
pushq $0xe
popq %rsi
movl %r14d, %edi
movl %r15d, %edx
callq 0x6e0e
pushq $0xc
popq %rsi
movl %r14d, %edi
movl %ebp, %edx
callq 0x6e0e
testq %rbx, %rbx
je 0xae1e
pushq $0xb
popq %rdi
pushq $0xe
popq %rsi
callq 0x6e93
xorl %ebp, %ebp
cmpl $0x2, %eax
setne %bpl
addl %ebp, %ebp
movq 0x38(%rsp), %rax
leal (%rax,%rax,2), %esi
addl $0x2, %esi
pushq $0x1
popq %rdi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8f645(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movq %rbx, %rdi
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0x8d31
movl 0x8(%rsp), %eax
movq 0xc8(%rsp), %rcx
movl %eax, (%rcx)
movb 0x80(%rsp), %al
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq