// File: /workspace/github_c_makefile_star2_O2/arkanis[P]process-map/./deps/raygui.h
// Function: GuiComboBox
int GuiComboBox(Rectangle bounds, const char *text, int active)
{
    GuiControlState state = guiState;

    bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING));

    Rectangle selector = { (float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING),
                           (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height };

    // Get substrings items from text (items pointers, lengths and count)
    int itemsCount = 0;
    const char **items = GuiTextSplit(text, &itemsCount, NULL);

    if (active < 0) active = 0;
    else if (active > itemsCount - 1) active = itemsCount - 1;

    // Update control
    //--------------------------------------------------------------------
    if ((state != GUI_STATE_DISABLED) && !guiLocked && (itemsCount > 1))
    {
        Vector2 mousePoint = GetMousePosition();

        if (CheckCollisionPointRec(mousePoint, bounds) ||
            CheckCollisionPointRec(mousePoint, selector))
        {
            if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
            {
                active += 1;
                if (active >= itemsCount) active = 0;
            }

            if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED;
            else state = GUI_STATE_FOCUSED;
        }
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    // Draw combo box main
    GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state*3))), guiAlpha));
    GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state*3))), guiAlpha));

    // Draw selector using a custom button
    // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values
    int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH);
    int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT);
    GuiSetStyle(BUTTON, BORDER_WIDTH, 1);
    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);

    GuiButton(selector, TextFormat("%i/%i", active + 1, itemsCount));

    GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign);
    GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth);
    //--------------------------------------------------------------------

    return active;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, (%rsp)
movl 0x91727(%rip), %r15d    # 0x9b280
pushq $0x7
popq %r14
pushq $0x10
popq %rsi
movl %r14d, %edi
callq 0x6e93
movl %eax, %r12d
pushq $0x11
popq %r13
movl %r14d, %edi
movl %r13d, %esi
callq 0x6e93
addl %r12d, %eax
cvtsi2ss %eax, %xmm0
movaps 0x20(%rsp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
subss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
addss (%rsp), %xmm2
movaps %xmm2, 0x30(%rsp)
movl %r14d, %edi
movl %r13d, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
addss 0x30(%rsp), %xmm0
movaps (%rsp), %xmm1
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
movaps %xmm1, 0x30(%rsp)
movl %r14d, %edi
pushq $0x10
popq %rsi
callq 0x6e93
movaps 0x20(%rsp), %xmm0
cvtsi2ss %eax, %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x4c(%rsp), %r14
andl $0x0, (%r14)
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x96e1
movl (%r14), %r13d
leal -0x1(%r13), %ebx
cmpl %ebp, %r13d
cmovgl %ebp, %ebx
testl %ebp, %ebp
cmovsl %r12d, %ebx
cmpl $0x3, %r15d
movq %r13, 0x40(%rsp)
jne 0x9c18
pushq $0x3
popq %r15
jmp 0x9c88
cmpl $0x2, %r13d
setl %al
orb 0x9165f(%rip), %al      # 0x9b284
testb $0x1, %al
jne 0x9c88
callq 0x1fd8b
movaps %xmm0, 0x50(%rsp)
movaps (%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x2a643
testb %al, %al
jne 0x9c5d
movaps 0x50(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm2
callq 0x2a643
testb %al, %al
je 0x9c88
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x2459e
leal 0x1(%rbx), %r14d
cmpl %r13d, %r14d
cmovgel %ebp, %r14d
testb %al, %al
cmovel %ebx, %r14d
xorl %edi, %edi
callq 0x1fdb3
movzbl %al, %r15d
incl %r15d
movl %r14d, %ebx
pushq $0x7
popq %r12
pushq $0xc
popq %rsi
movl %r12d, %edi
callq 0x6e93
movl %eax, %r14d
leal (%r15,%r15,2), %esi
movl %r12d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x9078b(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %ebp
leal (%r15,%r15,2), %esi
incl %esi
movl %r12d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90765(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %r14d, %edi
movl %ebp, %esi
movl %eax, %edx
callq 0x7476
movslq %ebx, %r14
leaq 0x91bcf(%rip), %rax     # 0x9b8d0
movq (%rax,%r14,8), %r13
movl %r12d, %edi
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x8f04
movaps %xmm0, (%rsp)
movaps %xmm1, 0x10(%rsp)
pushq $0xe
popq %rbx
movl %r12d, %edi
movl %ebx, %esi
callq 0x6e93
movl %eax, %ebp
leal (%r15,%r15,2), %esi
addl $0x2, %esi
movl %r12d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x906f4(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movq %r13, %rdi
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0x8d31
pushq $0x2
popq %r12
movl %r12d, %edi
pushq $0xc
popq %r15
movl %r15d, %esi
callq 0x6e93
movl %eax, (%rsp)
movl %r12d, %edi
movl %ebx, %esi
callq 0x6e93
movl %eax, %ebp
pushq $0x1
popq %r13
movl %r12d, %edi
movl %r15d, %esi
movl %r13d, %edx
callq 0x6e0e
movl %r12d, %edi
movl %ebx, %esi
movl %r13d, %edx
callq 0x6e0e
leal 0x1(%r14), %esi
leaq 0x4f5fc(%rip), %rdi     # 0x593b0
movq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0x43d0d
movaps 0x30(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rax, %rdi
callq 0x71e9
movl %r12d, %edi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6e0e
movl %r12d, %edi
movl %r15d, %esi
movl (%rsp), %edx
callq 0x6e0e
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq