// File: /workspace/github_c_makefile_star2_O3/arkanis[P]process-map/./deps/raygui.h
// Function: GuiValueBox
bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode)
{
    #if !defined(VALUEBOX_MAX_CHARS)
        #define VALUEBOX_MAX_CHARS  32
    #endif

    static int framesCounter = 0;           // Required for blinking cursor

    GuiControlState state = guiState;
    bool pressed = false;

    char textValue[VALUEBOX_MAX_CHARS + 1] = "\0";
    sprintf(textValue, "%i", *value);

    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(VALUEBOX, TEXT_PADDING);
        textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2;
        if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING);
    }

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

        bool valueHasChanged = false;

        if (editMode)
        {
            state = GUI_STATE_PRESSED;

            framesCounter++;

            int keyCount = (int)strlen(textValue);

            // Only allow keys in range [48..57]
            if (keyCount < VALUEBOX_MAX_CHARS)
            {
                if (GetTextWidth(textValue) < bounds.width)
                {
                    int key = GetCharPressed();
                    if ((key >= 48) && (key <= 57))
                    {
                        textValue[keyCount] = (char)key;
                        keyCount++;
                        valueHasChanged = true;
                    }
                }
            }

            // Delete text
            if (keyCount > 0)
            {
                if (IsKeyPressed(KEY_BACKSPACE))
                {
                    keyCount--;
                    textValue[keyCount] = '\0';
                    framesCounter = 0;
                    if (keyCount < 0) keyCount = 0;
                    valueHasChanged = true;
                }
                else if (IsKeyDown(KEY_BACKSPACE))
                {
                    if ((framesCounter > TEXTEDIT_CURSOR_BLINK_FRAMES) && (framesCounter%2) == 0) keyCount--;
                    textValue[keyCount] = '\0';
                    if (keyCount < 0) keyCount = 0;
                    valueHasChanged = true;
                }
            }

            if (valueHasChanged) *value = TextToInteger(textValue);

            if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true;
        }
        else
        {
            if (*value > maxValue) *value = maxValue;
            else if (*value < minValue) *value = minValue;

            if (CheckCollisionPointRec(mousePoint, bounds))
            {
                state = GUI_STATE_FOCUSED;
                if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true;
            }
        }

        if (pressed) framesCounter = 0;
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    Color baseColor = BLANK;
    if (state == GUI_STATE_PRESSED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED));
    else if (state == GUI_STATE_DISABLED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED));

    // WARNING: BLANK color does not work properly with Fade()
    GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state*3))), guiAlpha), baseColor);
    GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state*3))), guiAlpha));

    // Draw blinking cursor
    if ((state == GUI_STATE_PRESSED) && (editMode && ((framesCounter/20)%2 == 0)))
    {
        // NOTE: ValueBox internal text is always centered
        Rectangle cursor = { bounds.x + GetTextWidth(textValue)/2 + bounds.width/2 + 2, bounds.y + 2*GuiGetStyle(VALUEBOX, BORDER_WIDTH), 1, bounds.height - 4*GuiGetStyle(VALUEBOX, BORDER_WIDTH) };
        GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha));
    }

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

    return pressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, 0x30(%rsp)
movl 0x970d8(%rip), %r13d    # 0xa4250
xorps %xmm1, %xmm1
leaq 0x70(%rsp), %rdi
movaps %xmm1, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm1, (%rdi)
movb $0x0, 0x20(%rdi)
movl (%rsi), %edx
leaq 0x5db3f(%rip), %rsi     # 0x6acda
xorl %eax, %eax
callq 0x6350
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq %rbx, 0x48(%rsp)
testq %rbx, %rbx
je 0xd361
movq 0x48(%rsp), %rdi
callq 0x81f3
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
cmpb $0x1, 0x97082(%rip)     # 0xa4255
movaps %xmm1, 0x50(%rsp)
jne 0xd20c
xorps %xmm0, %xmm0
cvtsi2ssl 0x970eb(%rip), %xmm0 # 0xa42d0
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, 0xa0(%rsp)
movaps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm4
movaps 0x10(%rsp), %xmm1
addss %xmm1, %xmm4
movb $0x1, %al
movaps %xmm0, %xmm2
jmp 0xd276
callq 0x6a3c
xorps %xmm0, %xmm0
cvtsi2ssl 0x970b4(%rip), %xmm0 # 0xa42d0
movaps 0x50(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, 0xa0(%rsp)
movaps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm2
movaps %xmm0, %xmm4
movaps 0x10(%rsp), %xmm1
addss %xmm1, %xmm4
movb $0x1, %al
cmpb $0x0, 0x97008(%rip)     # 0xa4255
jne 0xd276
movaps %xmm2, 0x20(%rsp)
movaps %xmm4, (%rsp)
callq 0x6a3c
movaps (%rsp), %xmm4
movaps 0x20(%rsp), %xmm2
movaps 0x10(%rsp), %xmm1
movaps 0x30(%rsp), %xmm0
movb 0x96fdf(%rip), %al      # 0xa4255
cvtsi2ssl 0x97406(%rip), %xmm3 # 0xa4684
addss %xmm4, %xmm3
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss 0x57d7a(%rip), %xmm1    # 0x6500c
addss %xmm0, %xmm1
testb $0x1, %al
je 0xd2bd
movl 0x97030(%rip), %eax     # 0xa42d0
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
subss %xmm0, %xmm1
movlhps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
shufps $0xe2, %xmm3, %xmm1     # xmm1 = xmm1[2,0],xmm3[2,3]
jmp 0xd31b
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, (%rsp)
movaps %xmm3, 0xb0(%rsp)
callq 0x6a3c
movaps (%rsp), %xmm1
movl 0x96ff3(%rip), %eax     # 0xa42d0
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
subss %xmm0, %xmm1
movaps 0xb0(%rsp), %xmm0
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
cmpb $0x0, 0x96f4e(%rip)     # 0xa4255
jne 0xd316
movaps %xmm1, (%rsp)
callq 0x6a3c
movaps (%rsp), %xmm1
movaps 0x20(%rsp), %xmm2
cmpl $0x0, 0x97366(%rip)     # 0xa4688
jne 0xd35d
subss 0x50(%rsp), %xmm2
cmpb $0x0, 0x96f24(%rip)     # 0xa4255
jne 0xd34a
movaps %xmm1, (%rsp)
movaps %xmm2, 0x20(%rsp)
callq 0x6a3c
movaps 0x20(%rsp), %xmm2
movaps (%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x9732f(%rip), %xmm0 # 0xa4684
subss %xmm0, %xmm2
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
movaps %xmm1, (%rsp)
cmpl $0x3, %r13d
movl %ebp, 0x60(%rsp)
jne 0xd396
cmpb $0x0, 0x96ee3(%rip)     # 0xa4255
jne 0xd379
callq 0x6a3c
movl 0x972f9(%rip), %edi     # 0xa4678
callq 0x4144d
movl %eax, %r15d
movl $0x3, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0xd528
cmpb $0x0, 0x96eb7(%rip)     # 0xa4254
je 0xd3a6
xorl %ebx, %ebx
jmp 0xd4f2
callq 0x26136
testb %bpl, %bpl
je 0xd409
movaps %xmm0, 0x50(%rsp)
incl 0x974d9(%rip)           # 0xa4894
leaq 0x70(%rsp), %rdi
callq 0x62f0
movq %rax, %r15
cmpl $0x1f, %r15d
jg 0xd45f
leaq 0x70(%rsp), %rdi
callq 0x81f3
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xd463
callq 0x2ba7a
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0xd463
movslq %r15d, %rcx
movb %al, 0x70(%rsp,%rcx)
incl %r15d
movb $0x1, %bpl
jmp 0xd465
movl (%r14), %eax
cmpl %r15d, %eax
jg 0xd419
movl %r12d, %r15d
cmpl %r12d, %eax
jge 0xd41c
movl %r15d, (%r14)
movaps 0x30(%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x320c1
xorl %r15d, %r15d
movl $0x0, %ebx
testb %al, %al
je 0xd4f2
xorl %edi, %edi
callq 0x2bccc
movl $0x1, %r13d
movl $0x0, %ebp
movl $0x0, %ebx
testb %al, %al
jne 0xd4e6
jmp 0xd528
xorl %ebp, %ebp
jmp 0xd46a
xorl %ebp, %ebp
testl %r15d, %r15d
jle 0xd4bc
movl $0x103, %edi            # imm = 0x103
callq 0x2b9b9
testb %al, %al
je 0xd48d
decl %r15d
movb $0x0, 0x70(%rsp,%r15)
movl $0x0, 0x97409(%rip)     # 0xa4894
jmp 0xd4c1
movl $0x103, %edi            # imm = 0x103
callq 0x26181
testb %al, %al
je 0xd4bc
movl 0x973f3(%rip), %eax     # 0xa4894
cmpl $0x15, %eax
setge %cl
testb $0x1, %al
sete %al
andb %cl, %al
movzbl %al, %eax
subl %eax, %r15d
movb $0x0, 0x70(%rsp,%r15)
jmp 0xd4c1
testb %bpl, %bpl
je 0xd4ce
leaq 0x70(%rsp), %rdi
callq 0x4ecd4
movl %eax, (%r14)
movl $0x101, %edi            # imm = 0x101
callq 0x2b9b9
movl $0x2, %r13d
testb %al, %al
je 0xd7a4
movl $0x0, 0x973a4(%rip)     # 0xa4894
movb $0x1, %bl
movl $0x0, %ebp
movl $0x0, %r15d
cmpl $0x2, %r13d
jne 0xd528
cmpb $0x0, 0x96d4b(%rip)     # 0xa4255
jne 0xd511
callq 0x6a3c
movl 0x97155(%rip), %edi     # 0xa466c
callq 0x4144d
movl %eax, %r15d
movl $0x2, %r13d
movb $0x1, %bpl
cmpb $0x1, 0x96d26(%rip)     # 0xa4255
jne 0xd53a
movl 0x97148(%rip), %r12d    # 0xa4680
jmp 0xd554
callq 0x6a3c
movl 0x9713a(%rip), %r12d    # 0xa4680
cmpb $0x0, 0x96d08(%rip)     # 0xa4255
jne 0xd554
callq 0x6a3c
leal (%r13,%r13,2), %r13d
movslq %r13d, %rax
leaq 0x96d2d(%rip), %r14     # 0xa4290
movl 0x3c0(%r14,%rax,4), %edi
callq 0x4144d
movss 0x95eb8(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %r12d, %edi
movl %eax, %esi
movl %r15d, %edx
callq 0x7ee9
movl $0xa, %edi
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xa726
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x20(%rsp)
cmpb $0x0, 0x96c9a(%rip)     # 0xa4255
jne 0xd5c2
callq 0x6a3c
leal 0xf2(%r13), %eax
cltq
movl (%r14,%rax,4), %edi
callq 0x4144d
movss 0x95e54(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
leaq 0x70(%rsp), %rdi
movaps 0x50(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movl $0x1, %esi
movl %eax, %edx
callq 0xa506
andb 0x60(%rsp), %bpl
cmpb $0x1, %bpl
jne 0xd713
movslq 0x97280(%rip), %rax     # 0xa4894
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x23, %rax
addl %ecx, %eax
testb $0x1, %al
jne 0xd713
leaq 0x70(%rsp), %rdi
callq 0x81f3
movl %eax, %ebp
cmpb $0x1, 0x96c12(%rip)     # 0xa4255
jne 0xd657
movl 0x97034(%rip), %r15d    # 0xa4680
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
jmp 0xd679
callq 0x6a3c
movl 0x9701d(%rip), %r15d    # 0xa4680
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
cmpb $0x1, 0x96be2(%rip)     # 0xa4255
jne 0xd7d6
leal (,%r15,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
subss %xmm0, %xmm1
movaps %xmm1, 0x60(%rsp)
movl 0x96fd1(%rip), %edi     # 0xa4668
callq 0x4144d
movss 0x95d8c(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0xd713
movl %ebp, %ecx
shrl $0x1f, %ecx
addl %ebp, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movaps 0x30(%rsp), %xmm2
addss %xmm2, %xmm0
movss 0x57939(%rip), %xmm1    # 0x6500c
mulss 0x10(%rsp), %xmm1
addss %xmm0, %xmm1
addss 0x57943(%rip), %xmm1    # 0x65028
addl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
addss %xmm2, %xmm0
cvttss2si %xmm1, %edi
cvttss2si %xmm0, %esi
cvttss2si 0x60(%rsp), %ecx
movl $0x1, %edx
movl %eax, %r8d
callq 0x2e4dc
cmpq $0x0, 0x48(%rsp)
je 0xd790
cmpb $0x1, 0x96b33(%rip)     # 0xa4255
jne 0xd735
xorl %ebp, %ebp
cmpl $0x2, 0x96f5b(%rip)     # 0xa4688
setne %bpl
addl %ebp, %ebp
jmp 0xd757
callq 0x6a3c
xorl %ebp, %ebp
cmpl $0x2, 0x96f45(%rip)     # 0xa4688
setne %bpl
addl %ebp, %ebp
cmpb $0x0, 0x96b05(%rip)     # 0xa4255
jne 0xd757
callq 0x6a3c
addl $0x1a, %r13d
movslq %r13d, %rax
movl (%r14,%rax,4), %edi
callq 0x4144d
movss 0x95cc1(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movq 0x48(%rsp), %rdi
movaps (%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0xa506
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps 0x50(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x320c1
xorl %ebx, %ebx
testb %al, %al
jne 0xd503
xorl %edi, %edi
callq 0x2bccc
testb %al, %al
jne 0xd4e6
jmp 0xd503
movaps %xmm1, 0x60(%rsp)
callq 0x6a3c
movl 0x96e9a(%rip), %eax     # 0xa4680
shll $0x2, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x60(%rsp), %xmm1
subss %xmm0, %xmm1
movaps %xmm1, 0x60(%rsp)
cmpb $0x0, 0x96a50(%rip)     # 0xa4255
jne 0xd691
callq 0x6a3c
jmp 0xd691