// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r13
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movl 0x9b4d3(%rip), %ebx     # 0xa7250
xorps %xmm1, %xmm1
leaq 0x70(%rsp), %rdi
movaps %xmm1, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm1, (%rdi)
movb $0x0, 0x20(%rdi)
movl (%rsi), %edx
leaq 0x61c69(%rip), %rsi     # 0x6da0a
xorl %eax, %eax
callq 0x6350
xorps %xmm1, %xmm1
movq %r13, 0x58(%rsp)
testq %r13, %r13
je 0xbf17
movq 0x58(%rsp), %rdi
callq 0x7821
movl %eax, %r13d
cmpb $0x0, 0x9b488(%rip)     # 0xa7255
jne 0xbdd4
callq 0x6a18
cvtsi2ss %r13d, %xmm3
xorps %xmm1, %xmm1
cvtsi2ssl 0x9b4ec(%rip), %xmm1 # 0xa72d0
movaps 0x40(%rsp), %xmm4
addss 0x30(%rsp), %xmm4
cmpb $0x0, 0x9b45f(%rip)     # 0xa7255
movaps %xmm3, 0x60(%rsp)
movaps %xmm1, 0x20(%rsp)
jne 0xbe19
movaps %xmm4, (%rsp)
callq 0x6a18
movaps (%rsp), %xmm4
movaps 0x60(%rsp), %xmm3
movaps 0x20(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x9b860(%rip), %xmm0 # 0xa7684
addss %xmm0, %xmm4
movaps 0x40(%rsp), %xmm0
movaps 0x30(%rsp), %xmm2
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
mulss 0x5c1d2(%rip), %xmm2    # 0x68010
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm0, %xmm2
cmpb $0x0, 0x9b408(%rip)     # 0xa7255
movaps %xmm4, (%rsp)
jne 0xbe70
movaps %xmm2, 0x10(%rsp)
callq 0x6a18
movaps (%rsp), %xmm4
movaps 0x60(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
movlhps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
movl 0x9b457(%rip), %eax     # 0xa72d0
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
subss %xmm0, %xmm2
movlhps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
cmpb $0x0, 0x9b3be(%rip)     # 0xa7255
jne 0xbebb
movaps %xmm1, 0x20(%rsp)
movaps %xmm2, 0x10(%rsp)
callq 0x6a18
movaps (%rsp), %xmm4
movaps 0x60(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
shufps $0xe2, %xmm3, %xmm1     # xmm1 = xmm1[2,0],xmm3[2,3]
shufps $0xe2, %xmm4, %xmm2     # xmm2 = xmm2[2,0],xmm4[2,3]
cmpl $0x0, 0x9b7be(%rip)     # 0xa7688
jne 0xbf12
movaps 0x40(%rsp), %xmm4
subss %xmm3, %xmm4
cmpb $0x0, 0x9b379(%rip)     # 0xa7255
jne 0xbeff
movaps %xmm1, 0x20(%rsp)
movaps %xmm2, 0x10(%rsp)
movaps %xmm4, (%rsp)
callq 0x6a18
movaps (%rsp), %xmm4
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x9b77a(%rip), %xmm0 # 0xa7684
subss %xmm0, %xmm4
movss %xmm4, %xmm2            # xmm2 = xmm4[0],xmm2[1,2,3]
movaps %xmm2, 0x10(%rsp)
movaps %xmm1, 0x20(%rsp)
cmpl $0x3, %ebx
jne 0xbf28
movl $0x3, %ebx
jmp 0xbf35
cmpb $0x0, 0x9b325(%rip)     # 0xa7254
je 0xc1d0
xorl %r15d, %r15d
cmpl $0x2, %ebx
movl %r15d, (%rsp)
jne 0xbf4a
leaq 0x9b724(%rip), %r14     # 0xa766c
jmp 0xbf59
xorl %r15d, %r15d
cmpl $0x3, %ebx
jne 0xbf72
leaq 0x9b71f(%rip), %r14     # 0xa7678
cmpb $0x0, 0x9b2f5(%rip)     # 0xa7255
jne 0xbf67
callq 0x6a18
movl (%r14), %edi
callq 0x44152
movl %eax, %r15d
cmpb $0x0, 0x9b2dc(%rip)     # 0xa7255
jne 0xbf80
callq 0x6a18
movl 0x9b6f9(%rip), %r12d    # 0xa7680
leal (%rbx,%rbx,2), %r13d
cmpb $0x0, 0x9b2c3(%rip)     # 0xa7255
jne 0xbf99
callq 0x6a18
movslq %r13d, %rax
leaq 0x9b2ed(%rip), %r14     # 0xa7290
movl 0x3c0(%r14,%rax,4), %edi
callq 0x44152
movss 0x9a478(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
movaps 0x40(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movl %r12d, %edi
movl %eax, %esi
movl %r15d, %edx
callq 0x7546
movl $0xa, %edi
movaps 0x40(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
callq 0x982d
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0xa0(%rsp)
cmpb $0x0, 0x9b257(%rip)     # 0xa7255
jne 0xc005
callq 0x6a18
cmpl $0x2, %ebx
setne %bl
leal 0xf2(%r13), %eax
cltq
movl (%r14,%rax,4), %edi
callq 0x44152
movss 0x9a40b(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
leaq 0x70(%rsp), %rdi
movaps 0x60(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movl $0x1, %esi
movl %eax, %edx
callq 0x95ee
xorb $0x1, %bpl
orb %bl, %bpl
jne 0xc14f
movslq 0x9b836(%rip), %rax     # 0xa7894
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x23, %rax
addl %ecx, %eax
testb $0x1, %al
jne 0xc14f
leaq 0x70(%rsp), %rdi
callq 0x7821
movl %eax, %ebp
cmpb $0x0, 0x9b1c8(%rip)     # 0xa7255
jne 0xc094
callq 0x6a18
movl 0x9b5e6(%rip), %ebx     # 0xa7680
cmpb $0x0, 0x9b1b4(%rip)     # 0xa7255
jne 0xc0a8
callq 0x6a18
movl 0x9b5d1(%rip), %r15d    # 0xa7680
cmpb $0x0, 0x9b19f(%rip)     # 0xa7255
jne 0xc0bd
callq 0x6a18
movl 0x9b5a5(%rip), %edi     # 0xa7668
callq 0x44152
movss 0x9a360(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0xc14f
movl %ebp, %ecx
shrl $0x1f, %ecx
addl %ebp, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movaps 0x40(%rsp), %xmm4
addss %xmm4, %xmm0
movss 0x5bf11(%rip), %xmm1    # 0x68010
movaps 0x30(%rsp), %xmm3
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
addl %ebx, %ebx
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
shll $0x2, %r15d
cvtsi2ss %r15d, %xmm2
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
addss 0x5bf02(%rip), %xmm1    # 0x68030
addss %xmm4, %xmm0
subss %xmm2, %xmm3
cvttss2si %xmm1, %edi
cvttss2si %xmm0, %esi
cvttss2si %xmm3, %ecx
movl $0x1, %edx
movl %eax, %r8d
callq 0x31115
cmpq $0x0, 0x58(%rsp)
movl (%rsp), %ebx
je 0xc1bc
cmpb $0x0, 0x9b0f4(%rip)     # 0xa7255
jne 0xc168
callq 0x6a18
xorl %ebp, %ebp
cmpl $0x2, 0x9b517(%rip)     # 0xa7688
setne %bpl
addl %ebp, %ebp
cmpb $0x0, 0x9b0d7(%rip)     # 0xa7255
jne 0xc185
callq 0x6a18
addl $0x1a, %r13d
movslq %r13d, %rax
movl (%r14,%rax,4), %edi
callq 0x44152
movss 0x9a293(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
movq 0x58(%rsp), %rdi
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0x95ee
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2867d
testb %bpl, %bpl
je 0xc22d
movaps %xmm0, (%rsp)
incl 0x9b6b0(%rip)           # 0xa7894
leaq 0x70(%rsp), %rdi
callq 0x62f0
movq %rax, %r15
cmpl $0x1f, %r15d
jg 0xc26b
leaq 0x70(%rsp), %rdi
callq 0x7821
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x30(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xc26b
callq 0x2e5ee
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0xc26b
movslq %r15d, %rcx
movb %al, 0x70(%rsp,%rcx)
incl %r15d
movb $0x1, %bl
jmp 0xc26d
movl (%r14), %eax
cmpl %r15d, %eax
jg 0xc23d
movl %r12d, %r15d
cmpl %r12d, %eax
jge 0xc240
movl %r15d, (%r14)
movaps 0x40(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
callq 0x34d6b
testb %al, %al
je 0xc309
xorl %edi, %edi
callq 0x2e834
movl %eax, %r15d
movl $0x1, %ebx
jmp 0xc30c
xorl %ebx, %ebx
testl %r15d, %r15d
jle 0xc2c4
movl $0x103, %edi            # imm = 0x103
callq 0x2e531
testb %al, %al
je 0xc295
decl %r15d
movb $0x0, 0x70(%rsp,%r15)
movl $0x0, 0x9b601(%rip)     # 0xa7894
jmp 0xc2c2
movl $0x103, %edi            # imm = 0x103
callq 0x286dd
testb %al, %al
je 0xc2c4
movl 0x9b5eb(%rip), %eax     # 0xa7894
cmpl $0x15, %eax
setge %cl
testb $0x1, %al
sete %al
andb %cl, %al
movzbl %al, %eax
subl %eax, %r15d
movb $0x0, 0x70(%rsp,%r15)
movb $0x1, %bl
testb %bl, %bl
je 0xc2d5
leaq 0x70(%rsp), %rdi
callq 0x51cda
movl %eax, (%r14)
movl $0x101, %edi            # imm = 0x101
callq 0x2e531
testb %al, %al
je 0xc2ed
movl $0x2, %ebx
movb $0x1, %r15b
jmp 0xc30c
movaps (%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
callq 0x34d6b
movl $0x2, %ebx
testb %al, %al
je 0xc324
xorl %r15d, %r15d
testb %r15b, %r15b
je 0xbf38
movl $0x0, 0x9b575(%rip)     # 0xa7894
jmp 0xbf38
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2e834
testb %al, %al
jne 0xc2e3
jmp 0xc30c