// File: /workspace/github_c_makefile_star2_O2/arkanis[P]process-map/./deps/raygui.h
// Function: GuiMessageBox
int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons)
{
    #define MESSAGEBOX_BUTTON_HEIGHT    24
    #define MESSAGEBOX_BUTTON_PADDING   10

    int clicked = -1;    // Returns clicked button from buttons list, 0 refers to closed window button

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

    Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1);

    Rectangle textBounds = { 0 };
    textBounds.x = bounds.x + bounds.width/2 - textSize.x/2;
    textBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT + (bounds.height - WINDOW_STATUSBAR_HEIGHT - MESSAGEBOX_BUTTON_HEIGHT - MESSAGEBOX_BUTTON_PADDING)/2 - textSize.y/2;
    textBounds.width = textSize.x;
    textBounds.height = textSize.y;

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

    int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT);
    GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);
    GuiLabel(textBounds, message);
    GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment);

    prevTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT);
    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);

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

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

    return clicked;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r12
movq %rsi, 0x70(%rsp)
movq %rdi, %r14
movaps %xmm1, 0x80(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x7c(%rsp), %r15
andl $0x0, (%r15)
xorl %r13d, %r13d
movq %rdx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x96e1
movaps 0x30(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x80(%rsp), %xmm2
addps %xmm2, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss 0x4afb9(%rip), %xmm0    # 0x59050
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
addps 0x4b0cb(%rip), %xmm0    # 0x59170
movaps %xmm0, 0x60(%rsp)
movaps %xmm2, %xmm3
movl (%r15), %ebx
imull $0xa, %ebx, %eax
addl $0xa, %eax
cvtsi2ss %eax, %xmm0
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
cvtsi2ss %ebx, %xmm0
shufps $0x55, %xmm2, %xmm3     # xmm3 = xmm3[1,1],xmm2[1,1]
movaps %xmm3, 0x40(%rsp)
divss %xmm0, %xmm1
movaps %xmm1, 0x50(%rsp)
movaps 0x4b0a2(%rip), %xmm0    # 0x59180
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movaps %xmm0, 0xa0(%rsp)
pushq $0x10
popq %rsi
xorl %edi, %edi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movups 0x8d1a9(%rip), %xmm1    # 0x9b2a8
movups %xmm1, 0x20(%rsp)
movups 0x8d18d(%rip), %xmm1    # 0x9b298
movups %xmm1, 0x10(%rsp)
movups 0x8d171(%rip), %xmm1    # 0x9b288
movups %xmm1, (%rsp)
movss 0x4aee1(%rip), %xmm1    # 0x59004
movq %r12, %rdi
callq 0x44746
movaps %xmm0, %xmm5
movaps %xmm0, 0x90(%rsp)
movaps 0x40(%rsp), %xmm3
addss 0x4af11(%rip), %xmm3    # 0x59054
addss 0x4af05(%rip), %xmm3    # 0x59050
addss 0x4aec9(%rip), %xmm3    # 0x5901c
movss 0x4aeb1(%rip), %xmm0    # 0x5900c
mulss %xmm0, %xmm3
movaps 0x80(%rsp), %xmm1
mulps %xmm1, %xmm0
movaps 0x4b01f(%rip), %xmm4    # 0x59190
movaps 0x30(%rsp), %xmm2
addps %xmm2, %xmm4
shufps $0x1, %xmm0, %xmm4      # xmm4 = xmm4[1,0],xmm0[0,0]
shufps $0xe2, %xmm0, %xmm4     # xmm4 = xmm4[2,0],xmm0[2,3]
movlhps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm3     # xmm3 = xmm3[2,0],xmm2[2,3]
movaps %xmm2, %xmm0
addps %xmm4, %xmm3
movaps 0x4b00b(%rip), %xmm2    # 0x591a0
mulps %xmm5, %xmm2
addps %xmm3, %xmm2
movaps %xmm2, 0x40(%rsp)
movq %r14, %rdi
callq 0x6ec0
movzbl %al, %ebp
decl %ebp
pushq $0x1
popq %r14
pushq $0xe
popq %r15
movl %r14d, %edi
movl %r15d, %esi
callq 0x6e93
movl %eax, %r12d
movl %r14d, %edi
movl %r15d, %esi
movl %r14d, %edx
callq 0x6e0e
movaps 0x40(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
movq 0x70(%rsp), %rdi
callq 0x7768
movl %r14d, %edi
movl %r15d, %esi
movl %r12d, %edx
callq 0x6e0e
pushq $0x2
popq %r12
movl %r12d, %edi
movl %r15d, %esi
callq 0x6e93
movl %eax, 0x30(%rsp)
movl %r12d, %edi
movl %r15d, %esi
movl %r14d, %edx
callq 0x6e0e
movaps 0x50(%rsp), %xmm0
addss 0x4adec(%rip), %xmm0    # 0x59010
movaps %xmm0, 0x50(%rsp)
testl %ebx, %ebx
movl $0x0, %r15d
cmovgl %ebx, %r15d
shlq $0x3, %r15
leaq 0x8d690(%rip), %rbx     # 0x9b8d0
cmpq %r13, %r15
je 0xe27b
movq (%r13,%rbx), %rdi
movaps 0x60(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
callq 0x71e9
testb %al, %al
cmovnel %r14d, %ebp
movaps 0x60(%rsp), %xmm0
addss 0x50(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
addq $0x8, %r13
incl %r14d
jmp 0xe240
pushq $0x2
popq %rdi
pushq $0xe
popq %rsi
movl 0x30(%rsp), %edx
callq 0x6e0e
movl %ebp, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq