// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movb %r8b, %al
movlpd %xmm0, -0x10(%rbp)
movlpd %xmm1, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movl 0xbd61f(%rip), %eax     # 0xca0e0
movl %eax, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x21, %edx
callq 0x6060
leaq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x84d34(%rip), %rsi     # 0x9181d
movb $0x0, %al
callq 0x6340
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6060
cmpq $0x0, -0x18(%rbp)
je 0xcbff
movq -0x18(%rbp), %rdi
callq 0x7af0
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x68(%rbp)
xorl %edi, %edi
movl $0x10, %esi
callq 0x6f90
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x10(%rbp), %xmm0
addss -0x8(%rbp), %xmm0
movss %xmm0, -0xdc(%rbp)
movl $0xa, %edi
movl $0xd, %esi
callq 0x6f90
movss -0xdc(%rbp), %xmm0
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
movss -0xc(%rbp), %xmm0
movss -0x4(%rbp), %xmm1
movss 0x7f48e(%rip), %xmm2    # 0x8c008
divss %xmm2, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0xd8(%rbp)
xorl %edi, %edi
movl $0x10, %esi
callq 0x6f90
movss -0xd8(%rbp), %xmm0
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x6c(%rbp)
movl $0xa, %edi
movl $0xe, %esi
callq 0x6f90
cmpl $0x0, %eax
jne 0xcbfd
movss -0x10(%rbp), %xmm0
subss -0x68(%rbp), %xmm0
movss %xmm0, -0xe0(%rbp)
movl $0xa, %edi
movl $0xd, %esi
callq 0x6f90
movss -0xe0(%rbp), %xmm0
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
jmp 0xcbff
cmpl $0x3, -0x30(%rbp)
je 0xce0b
testb $0x1, 0xbd4d4(%rip)     # 0xca0e4
jne 0xce0b
callq 0x2dd60
movlpd %xmm0, -0x78(%rbp)
movb $0x0, -0x79(%rbp)
testb $0x1, -0x29(%rbp)
je 0xcd97
movl $0x2, -0x30(%rbp)
movl 0xbdae9(%rip), %eax     # 0xca724
addl $0x1, %eax
movl %eax, 0xbdae0(%rip)     # 0xca724
leaq -0x60(%rbp), %rdi
callq 0x62f0
movl %eax, -0x80(%rbp)
cmpl $0x20, -0x80(%rbp)
jge 0xccab
leaq -0x60(%rbp), %rdi
callq 0x7af0
cvtsi2ss %eax, %xmm1
movss -0x8(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xcca9
callq 0x34670
movl %eax, -0x84(%rbp)
cmpl $0x30, -0x84(%rbp)
jl 0xcca7
cmpl $0x39, -0x84(%rbp)
jg 0xcca7
movl -0x84(%rbp), %eax
movb %al, %cl
movslq -0x80(%rbp), %rax
movb %cl, -0x60(%rbp,%rax)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movb $0x1, -0x79(%rbp)
jmp 0xcca9
jmp 0xccab
cmpl $0x0, -0x80(%rbp)
jle 0xcd47
movl $0x103, %edi            # imm = 0x103
callq 0x34500
testb $0x1, %al
jne 0xccc5
jmp 0xccf4
movl -0x80(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x80(%rbp)
movslq -0x80(%rbp), %rax
movb $0x0, -0x60(%rbp,%rax)
movl $0x0, 0xbda43(%rip)     # 0xca724
cmpl $0x0, -0x80(%rbp)
jge 0xccee
movl $0x0, -0x80(%rbp)
movb $0x1, -0x79(%rbp)
jmp 0xcd45
movl $0x103, %edi            # imm = 0x103
callq 0x2de20
testb $0x1, %al
jne 0xcd04
jmp 0xcd43
cmpl $0x14, 0xbda19(%rip)    # 0xca724
jle 0xcd29
movl 0xbda11(%rip), %eax     # 0xca724
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xcd29
movl -0x80(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x80(%rbp)
movslq -0x80(%rbp), %rax
movb $0x0, -0x60(%rbp,%rax)
cmpl $0x0, -0x80(%rbp)
jge 0xcd3f
movl $0x0, -0x80(%rbp)
movb $0x1, -0x79(%rbp)
jmp 0xcd45
jmp 0xcd47
testb $0x1, -0x79(%rbp)
je 0xcd5e
leaq -0x60(%rbp), %rdi
callq 0x66650
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x101, %edi            # imm = 0x101
callq 0x34500
testb $0x1, %al
jne 0xcd91
movsd -0x78(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x8(%rbp), %xmm2
callq 0x3e640
testb $0x1, %al
jne 0xcd95
xorl %edi, %edi
callq 0x34bb0
testb $0x1, %al
jne 0xcd91
jmp 0xcd95
movb $0x1, -0x31(%rbp)
jmp 0xcdf9
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0x28(%rbp), %eax
jle 0xcdad
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xcdc3
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jge 0xcdc1
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xcdc3
movsd -0x78(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x8(%rbp), %xmm2
callq 0x3e640
testb $0x1, %al
jne 0xcddd
jmp 0xcdf7
movl $0x1, -0x30(%rbp)
xorl %edi, %edi
callq 0x34bb0
testb $0x1, %al
jne 0xcdf1
jmp 0xcdf5
movb $0x1, -0x31(%rbp)
jmp 0xcdf7
jmp 0xcdf9
testb $0x1, -0x31(%rbp)
je 0xce09
movl $0x0, 0xbd91b(%rip)     # 0xca724
jmp 0xce0b
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x6060
cmpl $0x2, -0x30(%rbp)
jne 0xce4e
movl $0xa, %edi
movl $0x7, %esi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0xce7b
cmpl $0x3, -0x30(%rbp)
jne 0xce79
movl $0xa, %esi
movl %esi, %edi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0xce7b
movl $0xa, %edi
movl %edi, -0xec(%rbp)
movl $0xc, %esi
callq 0x6f90
movl -0xec(%rbp), %edi
movl %eax, -0xf0(%rbp)
movl -0x30(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %esi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0x98(%rbp)
movss 0xbb552(%rip), %xmm0    # 0xc8410
movl -0x98(%rbp), %edi
callq 0x51fa0
movl -0xf0(%rbp), %edi
movl %eax, -0x94(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
movl -0x94(%rbp), %esi
movl -0x88(%rbp), %edx
callq 0x77c0
movl -0xec(%rbp), %edi
leaq -0x60(%rbp), %rax
movq %rax, -0xe8(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
callq 0x9f70
movl -0xec(%rbp), %edi
movlpd %xmm0, -0xa8(%rbp)
movlpd %xmm1, -0xa0(%rbp)
movl -0x30(%rbp), %ecx
movl %ecx, %eax
leal 0x2(%rax,%rax,2), %esi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0xb0(%rbp)
movss 0xbb4c7(%rip), %xmm0    # 0xc8410
movl -0xb0(%rbp), %edi
callq 0x51fa0
movq -0xe8(%rbp), %rdi
movl %eax, -0xac(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm1
movl -0xac(%rbp), %edx
movl $0x1, %esi
callq 0x9cf0
cmpl $0x2, -0x30(%rbp)
jne 0xd106
testb $0x1, -0x29(%rbp)
je 0xd106
movl 0xbd789(%rip), %eax     # 0xca724
movl $0x14, %ecx
cltd
idivl %ecx
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xd106
movss -0x10(%rbp), %xmm0
movss %xmm0, -0x104(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7af0
movss -0x104(%rbp), %xmm0
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss -0x8(%rbp), %xmm1
movss 0x7f024(%rip), %xmm2    # 0x8c014
mulss %xmm2, %xmm1
addss %xmm1, %xmm0
movss 0x7f008(%rip), %xmm1    # 0x8c008
addss %xmm1, %xmm0
movss %xmm0, -0xc0(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x100(%rbp)
movl $0xa, %edi
movl %edi, -0xf4(%rbp)
movl $0xc, %esi
movl %esi, -0xfc(%rbp)
callq 0x6f90
movss -0x100(%rbp), %xmm0
movl -0xfc(%rbp), %esi
movl -0xf4(%rbp), %edi
addl %eax, %eax
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0xbc(%rbp)
movl $0x3f800000, -0xb8(%rbp) # imm = 0x3F800000
movss -0x4(%rbp), %xmm0
movss %xmm0, -0xf8(%rbp)
callq 0x6f90
movss -0xf8(%rbp), %xmm0
movl -0xf4(%rbp), %edi
shll $0x2, %eax
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0xb4(%rbp)
movb $0x0, -0xc4(%rbp)
movb $0x0, -0xc3(%rbp)
movb $0x0, -0xc2(%rbp)
movb $0x0, -0xc1(%rbp)
movl $0x6, %esi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0xcc(%rbp)
movss 0xbb33e(%rip), %xmm0    # 0xc8410
movl -0xcc(%rbp), %edi
callq 0x51fa0
movl %eax, -0xc8(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movl -0xc4(%rbp), %esi
movl -0xc8(%rbp), %edx
xorl %edi, %edi
callq 0x77c0
cmpq $0x0, -0x18(%rbp)
je 0xd197
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0xa, %edi
movl $0xe, %esi
callq 0x6f90
subl $0x2, %eax
setne %al
movzbl %al, %eax
addl %eax, %eax
movl %eax, -0x108(%rbp)
movl -0x30(%rbp), %ecx
movl %ecx, %eax
leal 0x2(%rax,%rax,2), %esi
movl $0x1, %edi
callq 0x6f90
movl %eax, %edi
callq 0x526e0
movl %eax, -0xd4(%rbp)
movss 0xbb2ac(%rip), %xmm0    # 0xc8410
movl -0xd4(%rbp), %edi
callq 0x51fa0
movq -0x110(%rbp), %rdi
movl -0x108(%rbp), %esi
movl %eax, -0xd0(%rbp)
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movl -0xd0(%rbp), %edx
callq 0x9cf0
movb -0x31(%rbp), %al
andb $0x1, %al
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)