// File: /workspace/github_c_makefile_star2_O3/arkanis[P]process-map/./deps/raygui.h
// Function: GuiTextBox
bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
{
    static int framesCounter = 0;           // Required for blinking cursor

    GuiControlState state = guiState;
    bool pressed = false;

    Rectangle cursor = {
        bounds.x + GuiGetStyle(TEXTBOX, TEXT_PADDING) + GetTextWidth(text) + 2,
        bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE),
        1,
        (float)GuiGetStyle(DEFAULT, TEXT_SIZE)*2
    };

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

        if (editMode)
        {
            state = GUI_STATE_PRESSED;
            framesCounter++;

            int key = GetCharPressed();      // Returns codepoint as Unicode
            int keyCount = (int)strlen(text);

            // Only allow keys in range [32..125]
            if (keyCount < (textSize - 1))
            {
                float maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)*2));

                if ((GetTextWidth(text) < (maxWidth - GuiGetStyle(DEFAULT, TEXT_SIZE))) && (key >= 32))
                {
                    int byteLength = 0;
                    const char *textUtf8 = CodepointToUtf8(key, &byteLength);

                    for (int i = 0; i < byteLength; i++)
                    {
                        text[keyCount] = textUtf8[i];
                        keyCount++;
                    }

                    text[keyCount] = '\0';
                }
            }

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

            if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true;

            // Check text alignment to position cursor properly
            int textAlignment = GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT);
            if (textAlignment == GUI_TEXT_ALIGN_CENTER) cursor.x = bounds.x + GetTextWidth(text)/2 + bounds.width/2 + 1;
            else if (textAlignment == GUI_TEXT_ALIGN_RIGHT) cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING);
        }
        else
        {
            if (CheckCollisionPointRec(mousePoint, bounds))
            {
                state = GUI_STATE_FOCUSED;
                if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true;
            }
        }

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

    // Draw control
    //--------------------------------------------------------------------
    if (state == GUI_STATE_PRESSED)
    {
        GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha));

        // Draw blinking cursor
        if (editMode && ((framesCounter/20)%2 == 0)) GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha));
    }
    else if (state == GUI_STATE_DISABLED)
    {
        GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha));
    }
    else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK);

    GuiDrawText(text, GetTextBounds(TEXTBOX, bounds), GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state*3))), guiAlpha));
    //--------------------------------------------------------------------

    return pressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
movaps %xmm1, (%rsp)
movl 0x97e12(%rip), %r12d    # 0xa4250
cmpb $0x0, 0x97e10(%rip)     # 0xa4255
movaps %xmm0, 0x10(%rsp)
jne 0xc456
callq 0x6a3c
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x981c3(%rip), %xmm1 # 0xa4624
addss %xmm0, %xmm1
movss %xmm1, 0x30(%rsp)
movq %rbx, %rdi
callq 0x81f3
cvtsi2ss %eax, %xmm2
addss 0x30(%rsp), %xmm2
addss 0x58ba3(%rip), %xmm2    # 0x65028
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss 0x58b72(%rip), %xmm1    # 0x6500c
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm0, %xmm1
cmpb $0x1, 0x97dac(%rip)     # 0xa4255
jne 0xc4c3
xorps %xmm0, %xmm0
cvtsi2ssl 0x97e1a(%rip), %xmm0 # 0xa42d0
subss %xmm0, %xmm1
movlhps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[2,3]
jmp 0xc515
movaps %xmm1, 0x30(%rsp)
movaps %xmm2, 0x60(%rsp)
callq 0x6a3c
movaps 0x30(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x97dee(%rip), %xmm0 # 0xa42d0
subss %xmm0, %xmm1
movaps 0x60(%rsp), %xmm2
movlhps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[2,3]
cmpb $0x0, 0x97d5c(%rip)     # 0xa4255
jne 0xc515
movaps %xmm1, 0x30(%rsp)
callq 0x6a3c
movaps 0x30(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x97dbb(%rip), %xmm0 # 0xa42d0
cmpl $0x3, %r12d
jne 0xc52c
cmpb $0x1, 0x97d33(%rip)     # 0xa4255
jne 0xc547
movl 0x980f6(%rip), %ebp     # 0xa4620
jmp 0xc560
cmpb $0x0, 0x97d21(%rip)     # 0xa4254
movss %xmm0, 0x60(%rsp)
je 0xc5d1
xorl %r14d, %r14d
jmp 0xc865
callq 0x6a3c
movl 0x980ce(%rip), %ebp     # 0xa4620
cmpb $0x0, 0x97cfc(%rip)     # 0xa4255
jne 0xc560
callq 0x6a3c
movl 0x980ae(%rip), %edi     # 0xa4614
callq 0x4144d
movss 0x96ebd(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movl %eax, %r14d
cmpb $0x0, 0x97cd1(%rip)     # 0xa4255
jne 0xc58b
callq 0x6a3c
movl 0x98087(%rip), %edi     # 0xa4618
callq 0x4144d
movss 0x96e92(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %ebp, %edi
movl %r14d, %esi
movl %eax, %edx
callq 0x7ee9
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl $0xe3, %r15d
xorl %r14d, %r14d
jmp 0xca03
movaps %xmm1, 0x30(%rsp)
callq 0x26136
testb %bpl, %bpl
je 0xc703
movaps %xmm0, 0x50(%rsp)
incl 0x982a1(%rip)           # 0xa4890
callq 0x2ba7a
movl %eax, %r12d
movq %rbx, %rdi
callq 0x62f0
movq %rax, %r14
decl %r15d
cmpl %r14d, %r15d
jle 0xc6d8
movaps (%rsp), %xmm1
cmpb $0x0, 0x97c3c(%rip)     # 0xa4255
jne 0xc62c
movss %xmm1, 0x2c(%rsp)
callq 0x6a3c
movss 0x2c(%rsp), %xmm1
movl 0x97ffe(%rip), %eax     # 0xa4630
addl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
subss %xmm0, %xmm1
movss %xmm1, 0x2c(%rsp)
movq %rbx, %rdi
callq 0x81f3
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
cmpb $0x0, 0x97bfa(%rip)     # 0xa4255
jne 0xc66e
movss %xmm2, 0x4c(%rsp)
callq 0x6a3c
movss 0x4c(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x97c57(%rip), %xmm0 # 0xa42d0
movss 0x2c(%rsp), %xmm1
subss %xmm0, %xmm1
ucomiss %xmm2, %xmm1
seta %al
cmpl $0x20, %r12d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc6d8
leaq 0x7c(%rsp), %r15
movl $0x0, (%r15)
movl %r12d, %edi
movq %r15, %rsi
callq 0x4f373
movslq (%r15), %rcx
testq %rcx, %rcx
jle 0xc6d1
movslq %r14d, %rsi
addq %rbx, %rsi
xorl %edx, %edx
movb (%rax,%rdx), %dil
movb %dil, (%rsi,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0xc6be
addl %edx, %r14d
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
testl %r14d, %r14d
jle 0xc76d
movl $0x103, %edi            # imm = 0x103
callq 0x2b9b9
testb %al, %al
je 0xc741
movl %r14d, %eax
movb $0x0, -0x1(%rbx,%rax)
movl $0x0, 0x9818f(%rip)     # 0xa4890
jmp 0xc76d
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
callq 0x320c1
xorl %r14d, %r14d
testb %al, %al
je 0xc737
xorl %edi, %edi
callq 0x2bccc
movl $0x1, %r12d
testb %al, %al
movaps 0x30(%rsp), %xmm1
jne 0xc858
jmp 0xc86b
movaps 0x30(%rsp), %xmm1
jmp 0xc865
movl $0x103, %edi            # imm = 0x103
callq 0x26181
testb %al, %al
je 0xc76d
movl 0x9813b(%rip), %eax     # 0xa4890
cmpl $0x15, %eax
setge %cl
testb $0x1, %al
sete %al
andb %cl, %al
movzbl %al, %eax
subl %eax, %r14d
movb $0x0, (%rbx,%r14)
movl $0x101, %edi            # imm = 0x101
callq 0x2b9b9
testb %al, %al
je 0xc780
movb $0x1, %r14b
jmp 0xc7a5
movaps 0x50(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
callq 0x320c1
xorl %r14d, %r14d
testb %al, %al
jne 0xc7a5
xorl %edi, %edi
callq 0x2bccc
testb %al, %al
jne 0xc77b
cmpb $0x0, 0x97aa9(%rip)     # 0xa4255
jne 0xc7b3
callq 0x6a3c
movl 0x97e6f(%rip), %eax     # 0xa4628
cmpl $0x2, %eax
movaps 0x10(%rsp), %xmm0
je 0xc811
cmpl $0x1, %eax
jne 0xc8d2
movq %rbx, %rdi
callq 0x81f3
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
addss 0x10(%rsp), %xmm0
movss 0x5881a(%rip), %xmm1    # 0x6500c
mulss (%rsp), %xmm1
addss %xmm0, %xmm1
addss 0x58801(%rip), %xmm1    # 0x65004
movaps 0x30(%rsp), %xmm0
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps %xmm0, %xmm1
jmp 0xc849
movaps %xmm0, %xmm2
addss (%rsp), %xmm2
cmpb $0x0, 0x97a35(%rip)     # 0xa4255
jne 0xc831
movaps %xmm2, 0x50(%rsp)
callq 0x6a3c
movaps 0x50(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x97df4(%rip), %xmm0 # 0xa4630
subss %xmm0, %xmm2
movaps 0x30(%rsp), %xmm1
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
movl $0x2, %r12d
testb %r14b, %r14b
je 0xc8e6
movl $0x0, 0x9802e(%rip)     # 0xa4890
movb $0x1, %r14b
cmpl $0x2, %r12d
je 0xc8e9
leal (%r12,%r12,2), %ebp
cmpb $0x0, 0x979df(%rip)     # 0xa4255
jne 0xc87d
callq 0x6a3c
movslq %ebp, %r15
leaq 0x97a09(%rip), %rax     # 0xa4290
movl 0x360(%rax,%r15,4), %edi
callq 0x4144d
movss 0x96b94(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl $0x1, %edi
movl %eax, %esi
xorl %edx, %edx
callq 0x7ee9
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
addl $0xda, %r15d
movslq %r15d, %r15
jmp 0xca03
movl $0x2, %r12d
testb %r14b, %r14b
movaps 0x30(%rsp), %xmm1
jne 0xc858
xorl %r14d, %r14d
movaps %xmm1, 0x30(%rsp)
cmpb $0x1, 0x97960(%rip)     # 0xa4255
jne 0xc900
movl 0x97d22(%rip), %r15d    # 0xa4620
jmp 0xc91a
callq 0x6a3c
movl 0x97d14(%rip), %r15d    # 0xa4620
cmpb $0x0, 0x97942(%rip)     # 0xa4255
jne 0xc91a
callq 0x6a3c
movl 0x97ce8(%rip), %edi     # 0xa4608
callq 0x4144d
movss 0x96b03(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movl %eax, %r12d
cmpb $0x0, 0x97917(%rip)     # 0xa4255
jne 0xc945
callq 0x6a3c
movl 0x97cc1(%rip), %edi     # 0xa460c
callq 0x4144d
movss 0x96ad8(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %r15d, %edi
movl %r12d, %esi
movl %eax, %edx
callq 0x7ee9
movl $0xe0, %r15d
testb %bpl, %bpl
je 0xc9fa
movslq 0x97f09(%rip), %rax     # 0xa4890
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x23, %rax
addl %ecx, %eax
testb $0x1, %al
jne 0xc9fa
cmpb $0x0, 0x978af(%rip)     # 0xa4255
jne 0xc9ad
callq 0x6a3c
movl 0x97c55(%rip), %edi     # 0xa4608
callq 0x4144d
movss 0x96a70(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0xc9fa
movss 0x60(%rsp), %xmm1
addss %xmm1, %xmm1
movaps 0x30(%rsp), %xmm0
cvttss2si %xmm0, %edi
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvttss2si %xmm0, %esi
cvttss2si %xmm1, %ecx
movl $0x1, %edx
movl %eax, %r8d
callq 0x2e4dc
movaps (%rsp), %xmm1
movaps 0x10(%rsp), %xmm0
movl $0x9, %edi
callq 0xa726
movaps %xmm0, 0x10(%rsp)
movaps %xmm1, (%rsp)
cmpb $0x1, 0x97838(%rip)     # 0xa4255
jne 0xca27
movl 0x97c03(%rip), %ebp     # 0xa4628
jmp 0xca40
callq 0x6a3c
movl 0x97bf6(%rip), %ebp     # 0xa4628
cmpb $0x0, 0x9781c(%rip)     # 0xa4255
jne 0xca40
callq 0x6a3c
leaq 0x97849(%rip), %rax     # 0xa4290
movl (%rax,%r15,4), %edi
callq 0x4144d
movss 0x969d8(%rip), %xmm0    # 0xa3430
movl %eax, %edi
callq 0x41122
movq %rbx, %rdi
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0xa506
movl %r14d, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq