// File: /workspace/github_c_makefile_star2_O1/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 $0xc8, %rsp
movq %rcx, 0x80(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movaps %xmm0, 0x30(%rsp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm1, 0x90(%rsp)
leaq 0x8c(%rsp), %r12
movl $0x0, (%r12)
movq %rdx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xa184
movl (%r12), %r12d
cvttss2si 0x90(%rsp), %r13d
cmpb $0x0, 0x97402(%rip)     # 0xa7255
jne 0xfe5a
callq 0x6a18
movss 0x581b6(%rip), %xmm1    # 0x68018
movaps 0x30(%rsp), %xmm0
addss %xmm0, %xmm1
xorps %xmm2, %xmm2
subl 0x979eb(%rip), %r13d    # 0xa7860
addl $-0x42, %r13d
xorps %xmm5, %xmm5
xorps %xmm6, %xmm6
testq %r14, %r14
movaps %xmm1, 0x60(%rsp)
je 0xff3f
cmpb $0x0, 0x973c1(%rip)     # 0xa7255
jne 0xfe9b
callq 0x6a18
xorps %xmm0, %xmm0
cvtsi2ssl 0x9742a(%rip), %xmm0 # 0xa72d0
movups 0x973cb(%rip), %xmm1    # 0xa7278
movups %xmm1, 0x20(%rsp)
movups 0x973af(%rip), %xmm1    # 0xa7268
movups %xmm1, 0x10(%rsp)
movups 0x97393(%rip), %xmm1    # 0xa7258
movups %xmm1, (%rsp)
movss 0x58133(%rip), %xmm1    # 0x68004
movq %r14, %rdi
callq 0x51b09
movaps %xmm0, %xmm5
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
movss 0x58125(%rip), %xmm1    # 0x68010
movaps 0x40(%rsp), %xmm6
mulss %xmm1, %xmm6
movaps 0x30(%rsp), %xmm0
addss %xmm0, %xmm6
movaps %xmm5, %xmm2
mulss %xmm1, %xmm2
subss %xmm2, %xmm6
movss 0x58150(%rip), %xmm2    # 0x68060
addss 0x50(%rsp), %xmm2
leal 0x3(%r13), %eax
testl %r13d, %r13d
cmovnsl %r13d, %eax
sarl $0x2, %eax
cvtsi2ss %eax, %xmm3
addss %xmm2, %xmm3
mulss %xmm1, %xmm4
subss %xmm4, %xmm3
unpcklps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
movaps 0x60(%rsp), %xmm1
xorps %xmm2, %xmm2
movss %xmm1, %xmm2            # xmm2 = xmm1[0],xmm2[1,2,3]
movl %r13d, %ebx
shrl $0x1f, %ebx
addl %r13d, %ebx
sarl %ebx
movss 0x5810a(%rip), %xmm1    # 0x68060
addss 0x50(%rsp), %xmm1
addss 0x58104(%rip), %xmm1    # 0x68068
testq %r14, %r14
movaps %xmm2, 0x70(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xa0(%rsp)
movaps %xmm1, 0x30(%rsp)
je 0xff93
leal 0x3(%r13), %eax
testl %r13d, %r13d
cmovnsl %r13d, %eax
sarl $0x2, %eax
addl %eax, %ebx
movaps 0x40(%rsp), %xmm1
movq %r15, %rdi
callq 0x6e4e
movl %eax, %ebp
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
movaps 0x30(%rsp), %xmm0
addss %xmm1, %xmm0
movaps 0x70(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movss 0x58046(%rip), %xmm2    # 0x6800c
addss 0x40(%rsp), %xmm2
movaps 0x5814d(%rip), %xmm1    # 0x68120
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
testq %r14, %r14
je 0x10048
movaps %xmm1, 0x70(%rsp)
movaps %xmm0, 0x30(%rsp)
cmpb $0x0, 0x97268(%rip)     # 0xa7255
jne 0xfff4
callq 0x6a18
movl 0x9732e(%rip), %ebx     # 0xa7328
cmpb $0x0, 0x97254(%rip)     # 0xa7255
jne 0x10008
callq 0x6a18
movl $0x1, 0x97316(%rip)     # 0xa7328
movaps 0xa0(%rsp), %xmm0
movaps 0xb0(%rsp), %xmm1
movq %r14, %rdi
callq 0x78a6
cmpb $0x0, 0x97224(%rip)     # 0xa7255
jne 0x10038
callq 0x6a18
movl %ebx, 0x972ea(%rip)     # 0xa7328
movaps 0x30(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movzbl 0x9784d(%rip), %edx     # 0xa789c
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xb1ac
testb %al, %al
je 0x1006c
xorb $0x1, 0x97830(%rip)     # 0xa789c
cmpb $0x0, 0x971e2(%rip)     # 0xa7255
jne 0x1007a
callq 0x6a18
movzbl %bpl, %ebx
movl 0x97304(%rip), %ebp     # 0xa7388
cmpb $0x0, 0x971ca(%rip)     # 0xa7255
jne 0x10092
callq 0x6a18
decl %ebx
movl $0x1, 0x972ea(%rip)     # 0xa7388
testl %r12d, %r12d
jle 0x10158
leal (%r12,%r12,4), %eax
leal 0xa(,%rax,2), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x50(%rsp), %xmm2
addss 0x90(%rsp), %xmm2
addss 0x57f8d(%rip), %xmm2    # 0x6805c
movaps 0x40(%rsp), %xmm1
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
addss 0x57f38(%rip), %xmm2    # 0x68020
divss %xmm0, %xmm1
movaps 0x5801d(%rip), %xmm3    # 0x68110
movaps 0x60(%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, 0x50(%rsp)
addss 0x57f0c(%rip), %xmm1    # 0x68018
shlq $0x3, %r12
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x97780(%rip), %r13     # 0xa78a0
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x60(%rsp)
movq (%r15,%r13), %rdi
movaps 0x50(%rsp), %xmm1
callq 0x724a
movaps 0x60(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
testb %al, %al
cmovnel %r14d, %ebx
addss %xmm1, %xmm0
addq $0x8, %r15
incl %r14d
cmpq %r15, %r12
jne 0x10125
cmpb $0x0, 0x970f6(%rip)     # 0xa7255
jne 0x10166
callq 0x6a18
movl %ebp, 0x9721c(%rip)     # 0xa7388
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq