// File: /workspace/github_c_makefile_star2_O3/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 $0xd8, %rsp
movq %rcx, 0x80(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm1, 0xc0(%rsp)
leaq 0x8c(%rsp), %r12
movl $0x0, (%r12)
movq %rdx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xb11b
movaps 0x30(%rsp), %xmm0
movss 0x535a9(%rip), %xmm3    # 0x65010
addss %xmm0, %xmm3
xorps %xmm2, %xmm2
movl (%r12), %r12d
cvttss2si 0xc0(%rsp), %r13d
cmpb $0x0, 0x927d2(%rip)     # 0xa4255
movaps %xmm3, 0x50(%rsp)
jne 0x11a9c
callq 0x6a3c
movaps 0x30(%rsp), %xmm0
xorps %xmm2, %xmm2
movaps 0x50(%rsp), %xmm3
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss %xmm3, %xmm2            # xmm2 = xmm3[0],xmm2[1,2,3]
movaps %xmm2, 0x60(%rsp)
subl 0x92dad(%rip), %r13d    # 0xa4860
addl $-0x42, %r13d
testq %r14, %r14
movaps %xmm1, 0x70(%rsp)
je 0x11b9a
cmpb $0x0, 0x92789(%rip)     # 0xa4255
jne 0x11ad3
callq 0x6a3c
xorps %xmm0, %xmm0
cvtsi2ssl 0x927f2(%rip), %xmm0 # 0xa42d0
movaps 0x9279b(%rip), %xmm1    # 0xa4280
movups %xmm1, 0x20(%rsp)
movaps 0x9277f(%rip), %xmm1    # 0xa4270
movups %xmm1, 0x10(%rsp)
movaps 0x92763(%rip), %xmm1    # 0xa4260
movups %xmm1, (%rsp)
movss 0x534fb(%rip), %xmm1    # 0x65004
movq %r14, %rdi
callq 0x4eae9
movaps %xmm0, %xmm3
movaps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm4
movaps 0x40(%rsp), %xmm1
shufps $0x1, %xmm1, %xmm4      # xmm4 = xmm4[1,0],xmm1[0,0]
shufps $0xe2, %xmm1, %xmm4     # xmm4 = xmm4[2,0],xmm1[2,3]
movss 0x534db(%rip), %xmm2    # 0x6500c
mulps %xmm1, %xmm2
addps 0x53675(%rip), %xmm4    # 0x651b0
movaps %xmm4, %xmm5
shufps $0x1, %xmm2, %xmm5      # xmm5 = xmm5[1,0],xmm2[0,0]
shufps $0xe2, %xmm2, %xmm5     # xmm5 = xmm5[2,0],xmm2[2,3]
leal 0x3(%r13), %eax
testl %r13d, %r13d
cmovnsl %r13d, %eax
sarl $0x2, %eax
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
movlhps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm2     # xmm2 = xmm2[2,0],xmm0[2,3]
movaps %xmm3, 0xa0(%rsp)
mulps 0x5364f(%rip), %xmm3    # 0x651c0
addps %xmm5, %xmm2
addps %xmm2, %xmm3
movaps %xmm3, 0x90(%rsp)
movl %r13d, %ebx
shrl $0x1f, %ebx
addl %r13d, %ebx
sarl %ebx
addl %eax, %ebx
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
movaps %xmm4, 0xb0(%rsp)
jmp 0x11bd1
movss 0x534b6(%rip), %xmm2    # 0x65058
addss %xmm1, %xmm2
movaps %xmm2, 0xb0(%rsp)
movl %r13d, %ebx
shrl $0x1f, %ebx
addl %r13d, %ebx
sarl %ebx
xorps %xmm1, %xmm1
movaps %xmm1, 0x90(%rsp)
movaps %xmm1, 0xa0(%rsp)
movaps 0x40(%rsp), %xmm1
movq %r15, %rdi
callq 0x77d5
movaps 0xb0(%rsp), %xmm1
addss 0x53473(%rip), %xmm1    # 0x6505c
movl %eax, %ebp
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
addss %xmm1, %xmm0
movaps 0x60(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movss 0x53456(%rip), %xmm2    # 0x65060
addss 0x40(%rsp), %xmm2
movaps 0x535b9(%rip), %xmm1    # 0x651d0
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
testq %r14, %r14
je 0x11c94
cmpb $0x1, 0x9262e(%rip)     # 0xa4255
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x60(%rsp)
jne 0x11c3b
movl 0x926ef(%rip), %ebx     # 0xa4328
jmp 0x11c54
callq 0x6a3c
movl 0x926e2(%rip), %ebx     # 0xa4328
cmpb $0x0, 0x92608(%rip)     # 0xa4255
jne 0x11c54
callq 0x6a3c
movl $0x1, 0x926ca(%rip)     # 0xa4328
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movq %r14, %rdi
callq 0x8278
cmpb $0x0, 0x925d8(%rip)     # 0xa4255
jne 0x11c84
callq 0x6a3c
movl %ebx, 0x9269e(%rip)     # 0xa4328
movaps 0x30(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movzbl 0x92c01(%rip), %edx     # 0xa489c
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xc41c
testb %al, %al
je 0x11cb8
xorb $0x1, 0x92be4(%rip)     # 0xa489c
movzbl %bpl, %ebx
cmpb $0x1, 0x92592(%rip)     # 0xa4255
jne 0x11ccd
movl 0x926bd(%rip), %ebp     # 0xa4388
jmp 0x11ce6
callq 0x6a3c
movl 0x926b0(%rip), %ebp     # 0xa4388
cmpb $0x0, 0x92576(%rip)     # 0xa4255
jne 0x11ce6
callq 0x6a3c
movaps 0x70(%rsp), %xmm2
decl %ebx
movl $0x1, 0x92691(%rip)     # 0xa4388
testl %r12d, %r12d
jle 0x11dac
leal (%r12,%r12,4), %eax
leal 0xa(,%rax,2), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
addss 0xc0(%rsp), %xmm2
addss 0x5332d(%rip), %xmm2    # 0x65050
movaps 0x40(%rsp), %xmm1
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
addss 0x532dc(%rip), %xmm2    # 0x65018
divss %xmm0, %xmm1
movaps 0x53459(%rip), %xmm3    # 0x651a0
movaps 0x50(%rsp), %xmm0
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movss %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1,2,3]
movaps %xmm3, 0x30(%rsp)
addss 0x532b0(%rip), %xmm1    # 0x65010
shlq $0x3, %r12
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x92b2c(%rip), %r13     # 0xa48a0
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movq (%r15,%r13), %rdi
movaps 0x30(%rsp), %xmm1
callq 0x7be9
movaps 0x50(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
testb %al, %al
cmovnel %r14d, %ebx
addss %xmm1, %xmm0
addq $0x8, %r15
incl %r14d
cmpq %r15, %r12
jne 0x11d79
cmpb $0x0, 0x924a2(%rip)     # 0xa4255
jne 0x11dba
callq 0x6a3c
movl %ebp, 0x925c8(%rip)     # 0xa4388
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq