// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, 0x2c(%rsp)
movl %esi, %r12d
movq %rdi, %r14
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl 0x90e0d(%rip), %ebx     # 0x9b280
pushq $0x9
popq %rdi
pushq $0xd
popq %rsi
callq 0x6e93
movl %eax, %r15d
movq %r14, 0x30(%rsp)
movq %r14, %rdi
callq 0x76f6
movl %eax, %r14d
pushq $0x10
popq %rbp
xorl %edi, %edi
movl %ebp, %esi
callq 0x6e93
movl %eax, %r13d
xorl %edi, %edi
movl %ebp, %esi
callq 0x6e93
cmpl $0x3, %ebx
jne 0xa52a
pushq $0x9
popq %r14
pushq $0xc
popq %rsi
movl %r14d, %edi
callq 0x6e93
movl %eax, %ebp
movl %r14d, %edi
movl %r14d, %esi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8ff67(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %r15d
pushq $0xa
popq %rsi
movl %r14d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8ff43(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %ebp, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0x7476
pushq $0xb
popq %r12
xorl %r15d, %r15d
movq 0x30(%rsp), %r13
jmp 0xa933
movl %eax, %ebp
movaps 0x10(%rsp), %xmm4
movaps %xmm4, %xmm0
shufps $0x55, %xmm4, %xmm0     # xmm0 = xmm0[1,1],xmm4[1,1]
movaps (%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
cvtsi2ss %r15d, %xmm2
addss %xmm4, %xmm2
cvtsi2ss %r14d, %xmm3
addss %xmm2, %xmm3
addss 0x4ead2(%rip), %xmm3    # 0x5902c
mulss 0x4eaaa(%rip), %xmm1    # 0x5900c
addss %xmm0, %xmm1
cvtsi2ss %r13d, %xmm0
subss %xmm0, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movaps %xmm3, 0x50(%rsp)
cmpb $0x0, 0x90d06(%rip)     # 0x9b284
je 0xa58d
xorl %r15d, %r15d
movq 0x30(%rsp), %r13
jmp 0xa809
callq 0x1fd8b
cmpb $0x0, 0x2c(%rsp)
je 0xa686
movaps %xmm0, 0x60(%rsp)
incl 0x91318(%rip)           # 0x9b8c0
callq 0x2435e
movl %eax, %r13d
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x6300
movq %rax, %r15
decl %r12d
cmpl %r15d, %r12d
jle 0xa6b7
movl %ebp, %r12d
pushq $0x9
popq %rdi
pushq $0x10
popq %rbp
movl %ebp, %esi
callq 0x6e93
addl %eax, %eax
cvtsi2ss %eax, %xmm0
movaps (%rsp), %xmm1
subss %xmm0, %xmm1
movaps %xmm1, 0x80(%rsp)
movq %rbx, %rdi
callq 0x76f6
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x4c(%rsp)
xorl %ebx, %ebx
xorl %edi, %edi
movl %ebp, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps 0x80(%rsp), %xmm1
subss %xmm0, %xmm1
ucomiss 0x4c(%rsp), %xmm1
seta %al
cmpl $0x20, %r13d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa6d3
leaq 0x7c(%rsp), %r14
andl $0x0, (%r14)
movl %r13d, %edi
movq %r14, %rsi
callq 0x44e24
movl (%r14), %edx
movslq %r15d, %rsi
testl %edx, %edx
cmovlel %ebx, %edx
movq %r15, %rcx
shlq $0x20, %rcx
movq 0x30(%rsp), %r9
addq %r9, %rsi
movabsq $0x100000000, %rdi      # imm = 0x100000000
cmpq %rbx, %rdx
je 0xa6c4
movb (%rax,%rbx), %r8b
movb %r8b, (%rsi,%rbx)
incq %rbx
addq %rdi, %rcx
jmp 0xa671
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
callq 0x2a643
testb %al, %al
movq 0x30(%rsp), %r13
je 0xa6bc
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2459e
pushq $0x1
popq %rbx
testb %al, %al
jne 0xa7ff
jmp 0xa80e
movl %ebp, %r12d
jmp 0xa6d3
xorl %r15d, %r15d
jmp 0xa809
addl %r15d, %ebx
sarq $0x20, %rcx
movb $0x0, (%r9,%rcx)
movl %ebx, %r15d
testl %r15d, %r15d
movq 0x30(%rsp), %r13
jle 0xa72a
movl $0x103, %edi            # imm = 0x103
callq 0x242af
testb %al, %al
je 0xa6fd
movl %r15d, %eax
movb $0x0, -0x1(%r13,%rax)
andl $0x0, 0x911c5(%rip)     # 0x9b8c0
jmp 0xa72a
movl $0x103, %edi            # imm = 0x103
callq 0x1fdd6
testb %al, %al
je 0xa72a
movl 0x911af(%rip), %eax     # 0x9b8c0
cmpl $0x15, %eax
setge %cl
testb $0x1, %al
sete %al
andb %cl, %al
movzbl %al, %eax
subl %eax, %r15d
movb $0x0, (%r13,%r15)
movl $0x101, %edi            # imm = 0x101
callq 0x242af
testb %al, %al
je 0xa73d
movb $0x1, %bpl
jmp 0xa761
movaps 0x60(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
callq 0x2a643
xorl %ebp, %ebp
testb %al, %al
jne 0xa761
xorl %edi, %edi
callq 0x2459e
testb %al, %al
jne 0xa738
pushq $0x9
popq %rdi
pushq $0xe
popq %rsi
callq 0x6e93
cmpl $0x2, %eax
je 0xa7bf
cmpl $0x1, %eax
jne 0xa7f4
movq %r13, %rdi
callq 0x76f6
pushq $0x2
popq %rbx
cltd
idivl %ebx
cvtsi2ss %eax, %xmm0
addss 0x10(%rsp), %xmm0
movss 0x4e876(%rip), %xmm1    # 0x5900c
mulss (%rsp), %xmm1
addss %xmm0, %xmm1
addss 0x4e85d(%rip), %xmm1    # 0x59004
movaps 0x50(%rsp), %xmm0
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps %xmm0, 0x50(%rsp)
testb %bpl, %bpl
jne 0xa7fc
jmp 0xa85a
movaps 0x10(%rsp), %xmm0
addss (%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
pushq $0x9
popq %rdi
pushq $0x10
popq %rsi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps 0x60(%rsp), %xmm1
subss %xmm0, %xmm1
movaps 0x50(%rsp), %xmm0
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps %xmm0, 0x50(%rsp)
testb %bpl, %bpl
je 0xa85a
pushq $0x2
popq %rbx
movl %r12d, %ebp
andl $0x0, 0x910ba(%rip)     # 0x9b8c0
movb $0x1, %r15b
cmpl $0x2, %ebx
je 0xa860
leal (%rbx,%rbx,2), %esi
pushq $0x9
popq %rdi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8fc18(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
pushq $0x1
popq %rdi
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %eax, %esi
xorl %edx, %edx
callq 0x7476
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
leal (%rbx,%rbx,2), %r12d
addl $0x2, %r12d
jmp 0xa93c
xorl %r15d, %r15d
movl %r12d, %ebp
movl %ebp, %ebx
pushq $0x9
popq %rbp
pushq $0xc
popq %rsi
movl %ebp, %edi
callq 0x6e93
movl %eax, %r12d
pushq $0x6
popq %rsi
movl %ebp, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8fbb5(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %r14d
pushq $0x7
popq %rsi
movl %ebp, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8fb92(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %r12d, %edi
movl %r14d, %esi
movl %eax, %edx
callq 0x7476
pushq $0x8
popq %r12
cmpb $0x0, 0x2c(%rsp)
je 0xa933
movl 0x90fe4(%rip), %eax     # 0x9b8c0
pushq $0x14
popq %rcx
cltd
idivl %ecx
testb $0x1, %al
jne 0xa933
cvtsi2ss %ebx, %xmm0
addss %xmm0, %xmm0
movaps 0x4e7bb(%rip), %xmm1    # 0x590b0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, 0x30(%rsp)
pushq $0x9
popq %rdi
pushq $0x6
popq %rsi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8fb29(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps 0x50(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
xorl %edi, %edi
xorl %esi, %esi
movl %eax, %edx
callq 0x7476
movaps (%rsp), %xmm1
movaps 0x10(%rsp), %xmm0
pushq $0x9
popq %rbp
movl %ebp, %edi
callq 0x8f04
movaps %xmm0, (%rsp)
movaps %xmm1, 0x10(%rsp)
pushq $0xe
popq %rsi
movl %ebp, %edi
callq 0x6e93
movl %eax, %r14d
movl %ebp, %edi
movl %r12d, %esi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x8facb(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movq %r13, %rdi
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %r14d, %esi
movl %eax, %edx
callq 0x8d31
movl %r15d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq