// File: /workspace/github_c_makefile_star2_O2/arkanis[P]process-map/./deps/raygui.h
// Function: GuiTextInputBox
int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text)
{
    #define TEXTINPUTBOX_BUTTON_HEIGHT      24
    #define TEXTINPUTBOX_BUTTON_PADDING     10
    #define TEXTINPUTBOX_HEIGHT             30

    #define TEXTINPUTBOX_MAX_TEXT_LENGTH   256

    // Used to enable text edit mode
    // WARNING: No more than one GuiTextInputBox() should be open at the same time
    static bool textEditMode = false;

    int btnIndex = -1;

    int buttonsCount = 0;
    const char **buttonsText = GuiTextSplit(buttons, &buttonsCount, NULL);
    Rectangle buttonBounds = { 0 };
    buttonBounds.x = bounds.x + TEXTINPUTBOX_BUTTON_PADDING;
    buttonBounds.y = bounds.y + bounds.height - TEXTINPUTBOX_BUTTON_HEIGHT - TEXTINPUTBOX_BUTTON_PADDING;
    buttonBounds.width = (bounds.width - TEXTINPUTBOX_BUTTON_PADDING*(buttonsCount + 1))/buttonsCount;
    buttonBounds.height = TEXTINPUTBOX_BUTTON_HEIGHT;

    int messageInputHeight = (int)bounds.height - WINDOW_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - TEXTINPUTBOX_BUTTON_HEIGHT - 2*TEXTINPUTBOX_BUTTON_PADDING;

    Rectangle textBounds = { 0 };
    if (message != NULL)
    {
        Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1);

        textBounds.x = bounds.x + bounds.width/2 - textSize.x/2;
        textBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT + messageInputHeight/4 - textSize.y/2;
        textBounds.width = textSize.x;
        textBounds.height = textSize.y;
    }

    Rectangle textBoxBounds = { 0 };
    textBoxBounds.x = bounds.x + TEXTINPUTBOX_BUTTON_PADDING;
    textBoxBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT - TEXTINPUTBOX_HEIGHT/2;
    if (message == NULL) textBoxBounds.y += messageInputHeight/2;
    else textBoxBounds.y += (messageInputHeight/2 + messageInputHeight/4);
    textBoxBounds.width = bounds.width - TEXTINPUTBOX_BUTTON_PADDING*2;
    textBoxBounds.height = TEXTINPUTBOX_HEIGHT;

    // Draw control
    //--------------------------------------------------------------------
    if (GuiWindowBox(bounds, title)) btnIndex = 0;

    // Draw message if available
    if (message != NULL)
    {
        int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT);
        GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);
        GuiLabel(textBounds, message);
        GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment);
    }

    if (GuiTextBox(textBoxBounds, text, TEXTINPUTBOX_MAX_TEXT_LENGTH, textEditMode)) textEditMode = !textEditMode;

    int prevBtnTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT);
    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);

    for (int i = 0; i < buttonsCount; i++)
    {
        if (GuiButton(buttonBounds, buttonsText[i])) btnIndex = i + 1;
        buttonBounds.x += (buttonBounds.width + MESSAGEBOX_BUTTON_PADDING);
    }

    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevBtnTextAlignment);
    //--------------------------------------------------------------------

    return btnIndex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rcx, %r13
movq %rsi, %r14
movq %rdi, %r15
movaps %xmm0, 0x60(%rsp)
movss %xmm1, 0x3c(%rsp)
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movaps %xmm2, 0x40(%rsp)
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movaps %xmm0, 0x90(%rsp)
movaps %xmm1, 0x50(%rsp)
movaps %xmm1, 0xd0(%rsp)
leaq 0xac(%rsp), %r12
andl $0x0, (%r12)
movq %rdx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x96e1
movss 0x4ad03(%rip), %xmm0    # 0x59010
addss 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm0, 0x80(%rsp)
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
movaps %xmm1, 0xc0(%rsp)
movl (%r12), %ebx
imull $0xa, %ebx, %eax
addl $0xa, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x38(%rsp)
movaps 0x40(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
addss %xmm1, %xmm0
movaps %xmm0, 0x70(%rsp)
cvttss2si %xmm1, %ebp
pushq $0xf
popq %rdi
pushq $0xc
popq %rsi
callq 0x6e93
subl %eax, %ebp
addl $-0x42, %ebp
testq %r14, %r14
je 0xe435
pushq $0x10
popq %rsi
xorl %edi, %edi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movups 0x8cf22(%rip), %xmm1    # 0x9b2a8
movups %xmm1, 0x20(%rsp)
movups 0x8cf06(%rip), %xmm1    # 0x9b298
movups %xmm1, 0x10(%rsp)
movups 0x8ceea(%rip), %xmm1    # 0x9b288
movups %xmm1, (%rsp)
movss 0x4ac5a(%rip), %xmm1    # 0x59004
movq %r14, %rdi
callq 0x44746
movaps 0x60(%rsp), %xmm4
movaps %xmm4, %xmm5
movaps 0x50(%rsp), %xmm3
shufps $0x1, %xmm3, %xmm5      # xmm5 = xmm5[1,0],xmm3[0,0]
shufps $0xe2, %xmm3, %xmm5     # xmm5 = xmm5[2,0],xmm3[2,3]
movss 0x4ac3d(%rip), %xmm6    # 0x5900c
mulps %xmm3, %xmm6
addps 0x4adb7(%rip), %xmm5    # 0x59190
movaps %xmm5, %xmm1
pushq $0x4
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ecx
cvtsi2ss %eax, %xmm2
shufps $0x1, %xmm6, %xmm1      # xmm1 = xmm1[1,0],xmm6[0,0]
shufps $0xe2, %xmm6, %xmm1     # xmm1 = xmm1[2,0],xmm6[2,3]
movlhps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm2     # xmm2 = xmm2[2,0],xmm4[2,3]
addps %xmm1, %xmm2
movaps %xmm0, 0xb0(%rsp)
mulps 0x4ad95(%rip), %xmm0    # 0x591a0
addps %xmm2, %xmm0
movaps %xmm0, 0x90(%rsp)
pushq $0x2
popq %rsi
movl %ebp, %eax
cltd
idivl %esi
movl %eax, %r12d
addl %ecx, %r12d
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
movaps %xmm5, 0x40(%rsp)
movaps %xmm3, %xmm2
movaps %xmm4, %xmm0
jmp 0xe472
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps 0x40(%rsp), %xmm0
addss 0x4ac0b(%rip), %xmm0    # 0x59058
movaps %xmm0, 0x40(%rsp)
pushq $0x2
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %r12d
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps 0x50(%rsp), %xmm2
movaps 0x60(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
addss 0x4abd1(%rip), %xmm1    # 0x59050
movaps %xmm1, 0x70(%rsp)
subss 0x38(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
cvtsi2ss %ebx, %xmm1
movss %xmm1, 0x38(%rsp)
movaps 0xd0(%rsp), %xmm1
movq %r15, %rdi
callq 0x6ec0
movaps 0x40(%rsp), %xmm0
addss 0x4aba6(%rip), %xmm0    # 0x5905c
cvtsi2ss %r12d, %xmm2
addss %xmm0, %xmm2
movaps 0xc0(%rsp), %xmm0
movlhps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm2     # xmm2 = xmm2[2,0],xmm0[2,3]
movss 0x4ab8a(%rip), %xmm0    # 0x59060
addss 0x3c(%rsp), %xmm0
movaps 0x4accd(%rip), %xmm1    # 0x591b0
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
testq %r14, %r14
je 0xe558
pushq $0x1
popq %r15
pushq $0xe
popq %r12
movl %r15d, %edi
movl %r12d, %esi
movaps %xmm2, 0x40(%rsp)
movb %al, 0x3c(%rsp)
movaps %xmm1, 0x60(%rsp)
callq 0x6e93
movq %r13, %rbp
movl %eax, %r13d
movl %r15d, %edi
movl %r12d, %esi
movl %r15d, %edx
callq 0x6e0e
movaps 0x90(%rsp), %xmm0
movaps 0xb0(%rsp), %xmm1
movq %r14, %rdi
callq 0x7768
movl %r15d, %edi
movl %r12d, %esi
movl %r13d, %edx
movq %rbp, %r13
callq 0x6e0e
movaps 0x60(%rsp), %xmm1
movb 0x3c(%rsp), %al
movaps 0x40(%rsp), %xmm2
movaps 0x70(%rsp), %xmm0
addss 0x4aab7(%rip), %xmm0    # 0x5901c
movaps %xmm0, 0x70(%rsp)
movaps 0x50(%rsp), %xmm0
divss 0x38(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movaps 0x4abff(%rip), %xmm0    # 0x59180
movaps %xmm0, 0x40(%rsp)
movzbl %al, %ebp
pushq $0x1
popq %r14
movzbl 0x8d338(%rip), %edx     # 0x9b8cc
movaps %xmm2, %xmm0
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xa449
testb %al, %al
je 0xe5af
xorb $0x1, 0x8d31d(%rip)     # 0x9b8cc
movaps 0x80(%rsp), %xmm0
unpcklps 0x70(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movaps %xmm0, 0x80(%rsp)
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps %xmm0, 0x40(%rsp)
decl %ebp
pushq $0x2
popq %r15
pushq $0xe
popq %r12
movl %r15d, %edi
movl %r12d, %esi
callq 0x6e93
movl %eax, %r13d
movl %r15d, %edi
movl %r12d, %esi
movl %r14d, %edx
callq 0x6e0e
movaps 0x50(%rsp), %xmm2
addss 0x4aa06(%rip), %xmm2    # 0x59010
xorl %r15d, %r15d
testl %ebx, %ebx
cmovlel %r15d, %ebx
shlq $0x3, %rbx
leaq 0x8d2b2(%rip), %r12     # 0x9b8d0
movaps %xmm2, 0x50(%rsp)
cmpq %r15, %rbx
je 0xe666
movq (%r15,%r12), %rdi
movaps 0x80(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
callq 0x71e9
movaps 0x50(%rsp), %xmm2
testb %al, %al
cmovnel %r14d, %ebp
movaps 0x80(%rsp), %xmm0
addss %xmm2, %xmm0
movaps %xmm0, 0x80(%rsp)
addq $0x8, %r15
incl %r14d
jmp 0xe623
pushq $0x2
popq %rdi
pushq $0xe
popq %rsi
movl %r13d, %edx
callq 0x6e0e
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq