// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movlpd %xmm0, -0x10(%rbp)
movlpd %xmm1, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xaac0
movq %rax, -0x40(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6060
movss 0x7a5ec(%rip), %xmm0    # 0x8c01c
addss -0x10(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movss -0xc(%rbp), %xmm0
addss -0x4(%rbp), %xmm0
movss 0x7a604(%rip), %xmm1    # 0x8c050
subss %xmm1, %xmm0
movss 0x7a5c4(%rip), %xmm1    # 0x8c01c
subss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x8(%rbp), %xmm0
movl -0x38(%rbp), %eax
addl $0x1, %eax
imull $0xa, %eax, %eax
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
cvtsi2ssl -0x38(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movss 0x7a5c3(%rip), %xmm0    # 0x8c050
movss %xmm0, -0x44(%rbp)
cvttss2si -0x4(%rbp), %eax
subl $0x16, %eax
movl %eax, -0x8c(%rbp)
movl $0xf, %edi
movl $0xc, %esi
callq 0x6f90
movl %eax, %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
subl $0x18, %eax
subl $0x14, %eax
movl %eax, -0x54(%rbp)
leaq -0x64(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6060
cmpq $0x0, -0x20(%rbp)
je 0x11bb6
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
xorl %edi, %edi
movl $0x10, %esi
callq 0x6f90
movq -0x98(%rbp), %rdi
cvtsi2ss %eax, %xmm0
movups 0xb8602(%rip), %xmm1    # 0xca108
movq %rsp, %rax
movups %xmm1, 0x20(%rax)
movups 0xb85e4(%rip), %xmm1    # 0xca0f8
movups %xmm1, 0x10(%rax)
movups 0xb85c9(%rip), %xmm1    # 0xca0e8
movups %xmm1, (%rax)
movss 0x7a4da(%rip), %xmm1    # 0x8c004
callq 0x66400
movlpd %xmm0, -0x6c(%rbp)
movss -0x10(%rbp), %xmm0
movss -0x8(%rbp), %xmm1
movss 0x7a4c2(%rip), %xmm2    # 0x8c008
divss %xmm2, %xmm1
addss %xmm1, %xmm0
movss -0x6c(%rbp), %xmm1
movss 0x7a4ad(%rip), %xmm2    # 0x8c008
divss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x64(%rbp)
movss 0x7a4e4(%rip), %xmm0    # 0x8c054
addss -0xc(%rbp), %xmm0
movl -0x54(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss -0x68(%rbp), %xmm1
movss 0x7a473(%rip), %xmm2    # 0x8c008
divss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp)
movss -0x6c(%rbp), %xmm0
movss %xmm0, -0x5c(%rbp)
movss -0x68(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
leaq -0x7c(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6060
movss 0x7a44e(%rip), %xmm0    # 0x8c01c
addss -0x10(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movss 0x7a474(%rip), %xmm0    # 0x8c054
addss -0xc(%rbp), %xmm0
movss 0x7a46b(%rip), %xmm1    # 0x8c058
subss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x11c18
movl -0x54(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2ss %eax, %xmm0
addss -0x78(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
jmp 0x11c4c
movl -0x54(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x9c(%rbp)
movl -0x54(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x9c(%rbp), %eax
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
addss -0x78(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x8(%rbp), %xmm0
movss 0x7a3b7(%rip), %xmm1    # 0x8c010
addss %xmm1, %xmm0
movss %xmm0, -0x74(%rbp)
movl $0x41f00000, -0x70(%rbp) # imm = 0x41F00000
movq -0x18(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
callq 0x6fd0
testb $0x1, %al
jne 0x11c82
jmp 0x11c89
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x11ce6
movl $0x1, %edi
movl %edi, -0xa0(%rbp)
movl $0xe, %esi
movl %esi, -0xa4(%rbp)
callq 0x6f90
movl -0xa4(%rbp), %esi
movl -0xa0(%rbp), %edx
movl %eax, -0x80(%rbp)
movl %edx, %edi
callq 0x6ee0
movq -0x20(%rbp), %rdi
movsd -0x64(%rbp), %xmm0
movsd -0x5c(%rbp), %xmm1
callq 0x7ba0
movl -0x80(%rbp), %edx
movl $0x1, %edi
movl $0xe, %esi
callq 0x6ee0
movq -0x30(%rbp), %rdi
movb 0xb8a3c(%rip), %al      # 0xca72c
movsd -0x7c(%rbp), %xmm0
movsd -0x74(%rbp), %xmm1
movzbl %al, %edx
andl $0x1, %edx
movl $0x100, %esi            # imm = 0x100
callq 0xbea0
testb $0x1, %al
jne 0x11d10
jmp 0x11d20
movb 0xb8a16(%rip), %al      # 0xca72c
xorb $-0x1, %al
andb $0x1, %al
movb %al, 0xb8a0c(%rip)      # 0xca72c
movl $0x2, %edi
movl $0xe, %esi
callq 0x6f90
movl %eax, -0x84(%rbp)
movl $0x2, %edi
movl $0xe, %esi
movl $0x1, %edx
callq 0x6ee0
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x11db6
movq -0x40(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
callq 0x73e0
testb $0x1, %al
jne 0x11d82
jmp 0x11d8e
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movss 0x7a286(%rip), %xmm0    # 0x8c01c
addss -0x48(%rbp), %xmm0
addss -0x50(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x11d53
movl -0x84(%rbp), %edx
movl $0x2, %edi
movl $0xe, %esi
callq 0x6ee0
movl -0x34(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw (%rax,%rax)