// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
movl 0x9cb3a(%rip), %r15d    # 0xa7250
cmpb $0x0, 0x9cb38(%rip)     # 0xa7255
jne 0xa724
callq 0x6a18
movl 0x9ce45(%rip), %r14d    # 0xa7570
cmpb $0x0, 0x9cb23(%rip)     # 0xa7255
jne 0xa739
callq 0x6a18
addl 0x9ce34(%rip), %r14d    # 0xa7574
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
movaps 0x20(%rsp), %xmm2
movaps %xmm0, 0x30(%rsp)
subss %xmm0, %xmm2
addss 0x10(%rsp), %xmm2
cmpb $0x0, 0x9caf2(%rip)     # 0xa7255
jne 0xa772
movaps %xmm2, (%rsp)
callq 0x6a18
movaps (%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x9cdf7(%rip), %xmm0 # 0xa7574
addss %xmm0, %xmm2
cmpb $0x0, 0x9cacd(%rip)     # 0xa7255
jne 0xa797
movaps %xmm2, (%rsp)
callq 0x6a18
movaps (%rsp), %xmm2
movaps 0x20(%rsp), %xmm0
movaps %xmm0, %xmm1
subss 0x30(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps 0x10(%rsp), %xmm1
movl 0x9cdbc(%rip), %eax     # 0xa7570
cvtsi2ss %eax, %xmm0
movaps %xmm0, 0x20(%rsp)
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
movaps %xmm1, 0x30(%rsp)
xorl %r12d, %r12d
leaq 0x4c(%rsp), %r14
movl %r12d, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xa184
movl (%r14), %r14d
leal -0x1(%r14), %ebx
cmpl %ebp, %r14d
cmovgl %ebp, %ebx
testl %ebp, %ebp
cmovsl %r12d, %ebx
cmpl $0x3, %r15d
jne 0xa7ff
movl $0x3, %r15d
jmp 0xa86f
cmpl $0x2, %r14d
setl %al
orb 0x9ca48(%rip), %al      # 0xa7254
testb $0x1, %al
jne 0xa86f
callq 0x2867d
movaps %xmm0, 0x50(%rsp)
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
callq 0x34d6b
testb %al, %al
jne 0xa844
movaps 0x50(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm2
callq 0x34d6b
testb %al, %al
je 0xa86f
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x2e834
leal 0x1(%rbx), %r12d
cmpl %r14d, %r12d
cmovgel %ebp, %r12d
testb %al, %al
cmovel %ebx, %r12d
xorl %edi, %edi
callq 0x286ba
movzbl %al, %r15d
incl %r15d
movl %r12d, %ebx
cmpb $0x0, 0x9c9df(%rip)     # 0xa7255
jne 0xa87d
callq 0x6a18
movl 0x9ccdd(%rip), %ebp     # 0xa7560
leal (%r15,%r15,2), %r12d
cmpb $0x0, 0x9c9c7(%rip)     # 0xa7255
jne 0xa895
callq 0x6a18
movslq %r12d, %rax
leaq 0x9c9f1(%rip), %r13     # 0xa7290
movl 0x2a0(%r13,%rax,4), %edi
callq 0x44152
movss 0x9bb7c(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
movl %eax, %r15d
cmpb $0x0, 0x9c990(%rip)     # 0xa7255
jne 0xa8cc
callq 0x6a18
leal 0xa9(%r12), %eax
cltq
movl (%r13,%rax,4), %edi
callq 0x44152
movss 0x9bb48(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %ebp, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0x7546
movslq %ebx, %rax
leaq 0x9cf92(%rip), %rcx     # 0xa78a0
movq (%rcx,%rax,8), %r15
movl $0x7, %edi
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
callq 0x982d
movaps %xmm0, 0x10(%rsp)
movaps %xmm1, (%rsp)
cmpb $0x0, 0x9c920(%rip)     # 0xa7255
jne 0xa93c
callq 0x6a18
movl 0x9cc26(%rip), %ebp     # 0xa7568
cmpb $0x0, 0x9c90c(%rip)     # 0xa7255
jne 0xa950
callq 0x6a18
addl $0xaa, %r12d
movslq %r12d, %rax
movl (%r13,%rax,4), %edi
callq 0x44152
movss 0x9bac4(%rip), %xmm0    # 0xa6430
movl %eax, %edi
callq 0x43e1c
movq %r15, %rdi
movaps 0x10(%rsp), %xmm0
movaps (%rsp), %xmm1
movl %ebp, %esi
movl %eax, %edx
callq 0x95ee
cmpb $0x0, 0x9c8c6(%rip)     # 0xa7255
jne 0xa996
callq 0x6a18
movl 0x9c9e4(%rip), %ebp     # 0xa7380
cmpb $0x0, 0x9c8b2(%rip)     # 0xa7255
jne 0xa9aa
callq 0x6a18
movl 0x9c9d7(%rip), %r15d    # 0xa7388
cmpb $0x0, 0x9c89d(%rip)     # 0xa7255
jne 0xa9bf
callq 0x6a18
movl $0x1, 0x9c9b7(%rip)     # 0xa7380
cmpb $0x0, 0x9c885(%rip)     # 0xa7255
jne 0xa9d7
callq 0x6a18
movl $0x1, 0x9c9a7(%rip)     # 0xa7388
leal 0x1(%rbx), %esi
leaq 0x5d8bd(%rip), %rdi     # 0x682a8
movl %r14d, %edx
xorl %eax, %eax
callq 0x50f37
movaps 0x30(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rax, %rdi
callq 0x724a
cmpb $0x0, 0x9c847(%rip)     # 0xa7255
jne 0xaa15
callq 0x6a18
movl %r15d, 0x9c96c(%rip)    # 0xa7388
cmpb $0x0, 0x9c832(%rip)     # 0xa7255
jne 0xaa2a
callq 0x6a18
movl %ebp, 0x9c950(%rip)     # 0xa7380
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq