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

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

    Rectangle boundsOpen = bounds;
    boundsOpen.height = (itemsCount + 1)*(bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING));

    Rectangle itemBounds = bounds;

    bool pressed = false;       // Check mouse button pressed

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

        if (editMode)
        {
            state = GUI_STATE_PRESSED;

            // Check if mouse has been pressed or released outside limits
            if (!CheckCollisionPointRec(mousePoint, boundsOpen))
            {
                if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true;
            }

            // Check if already selected item has been pressed again
            if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true;

            // Check focused and selected item
            for (int i = 0; i < itemsCount; i++)
            {
                // Update item rectangle y position for next item
                itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING));

                if (CheckCollisionPointRec(mousePoint, itemBounds))
                {
                    itemFocused = i;
                    if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON))
                    {
                        itemSelected = i;
                        pressed = true;     // Item selected, change to editMode = false
                    }
                    break;
                }
            }

            itemBounds = bounds;
        }
        else
        {
            if (CheckCollisionPointRec(mousePoint, bounds))
            {
                if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
                {
                    pressed = true;
                    state = GUI_STATE_PRESSED;
                }
                else state = GUI_STATE_FOCUSED;
            }
        }
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    if (editMode) GuiPanel(boundsOpen);

    GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state*3)), guiAlpha));
    GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state*3)), guiAlpha));

    if (editMode)
    {
        // Draw visible items
        for (int i = 0; i < itemsCount; i++)
        {
            // Update item rectangle y position for next item
            itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING));

            if (i == itemSelected)
            {
                GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_PRESSED)), guiAlpha));
                GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_PRESSED)), guiAlpha));
            }
            else if (i == itemFocused)
            {
                GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_FOCUSED)), guiAlpha));
                GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_FOCUSED)), guiAlpha));
            }
            else GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha));
        }
    }

    // TODO: Avoid this function, use icon instead or 'v'
    DrawTriangle(RAYGUI_CLITERAL(Vector2){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2 },
                 RAYGUI_CLITERAL(Vector2){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING) + 5, bounds.y + bounds.height/2 - 2 + 5 },
                 RAYGUI_CLITERAL(Vector2){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING) + 10, bounds.y + bounds.height/2 - 2 },
                 Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha));

    //GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 },
    //            GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha));
    //--------------------------------------------------------------------

    *active = itemSelected;
    return pressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, %ebp
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movaps %xmm0, 0x90(%rsp)
movl 0x9144f(%rip), %r13d    # 0x9b280
movq %rsi, 0xa0(%rsp)
movl (%rsi), %r12d
leaq 0xb4(%rsp), %rbx
andl $0x0, (%rbx)
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x96e1
movl (%rbx), %ebx
leal 0x1(%rbx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, (%rsp)
pushq $0x8
popq %rdi
pushq $0x11
popq %rsi
callq 0x6e93
movaps 0x10(%rsp), %xmm0
cvtsi2ss %eax, %xmm1
addss 0x90(%rsp), %xmm1
mulss (%rsp), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
movaps %xmm1, 0x80(%rsp)
pushq $-0x1
popq %rax
movl %eax, 0x30(%rsp)
cmpl $0x3, %r13d
movq %rbx, (%rsp)
jne 0x9eaa
pushq $0x3
popq %r13
jmp 0x9ec1
cmpl $0x2, %ebx
setl %al
orb 0x913ce(%rip), %al      # 0x9b284
testb $0x1, %al
je 0xa2f9
xorl %r14d, %r14d
movaps 0x20(%rsp), %xmm0
testb %bpl, %bpl
movq %r14, 0x70(%rsp)
je 0x9edd
movaps 0x80(%rsp), %xmm1
callq 0x7165
pushq $0x8
popq %r14
pushq $0xc
popq %rsi
movl %r14d, %edi
callq 0x6e93
movl %eax, %ebx
leal (%r13,%r13,2), %esi
movl %r14d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90536(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %r15d
leal 0x1(%r13,%r13,2), %esi
movl %r14d, %edi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90510(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %ebx, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0x7476
movl %r12d, 0x3c(%rsp)
movslq %r12d, %rax
leaq 0x91974(%rip), %rcx     # 0x9b8d0
movq (%rcx,%rax,8), %rbx
xorl %r12d, %r12d
xorl %edi, %edi
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x8f04
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x60(%rsp)
pushq $0xe
popq %rsi
movl %r14d, %edi
callq 0x6e93
movl %eax, %r15d
leal 0x2(%r13,%r13,2), %esi
movl %r14d, %edi
movl %esi, 0x7c(%rsp)
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90494(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movq %rbx, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movl %r15d, %esi
movl %eax, %edx
callq 0x8d31
testb %bpl, %bpl
movaps 0x20(%rsp), %xmm0
movq (%rsp), %rax
je 0xa1f2
movl 0x3c(%rsp), %edx
testl %eax, %eax
cmovlel %r12d, %eax
movl 0x30(%rsp), %esi
leaq 0x918df(%rip), %rcx     # 0x9b8d0
leaq (%rcx,%rsi,8), %rdi
movq %rdi, 0xa8(%rsp)
leaq (%rcx,%rdx,8), %rcx
movq %rcx, 0x58(%rsp)
shlq $0x3, %rax
shlq $0x3, %rsi
movq %rsi, 0x80(%rsp)
shlq $0x3, %rdx
movq %rdx, 0x30(%rsp)
movaps %xmm0, %xmm1
movq %rax, %rbp
cmpq %r12, %rax
je 0xa1f2
movl %r14d, %edi
pushq $0x11
popq %rsi
movaps %xmm1, (%rsp)
callq 0x6e93
cvtsi2ss %eax, %xmm1
addss 0x90(%rsp), %xmm1
movaps (%rsp), %xmm2
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
addss %xmm1, %xmm0
movlhps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[2,3]
cmpq %r12, 0x30(%rsp)
movaps %xmm0, (%rsp)
jne 0xa0e8
movl %r14d, %edi
pushq $0xc
popq %rsi
callq 0x6e93
movl %eax, %ebx
movl %r14d, %edi
pushq $0x6
popq %rsi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x903ae(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %r15d
movl %r14d, %edi
pushq $0x7
popq %rsi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x9038a(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %ebx, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0x7476
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm0
movq 0x58(%rsp), %rax
movl %r14d, %r15d
jmp 0xa183
cmpq %r12, 0x80(%rsp)
jne 0xa170
movl %r14d, %edi
pushq $0xc
popq %rsi
callq 0x6e93
movl %eax, %ebx
movl %r14d, %edi
pushq $0x3
popq %rsi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90327(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movl %eax, %r15d
movl %r14d, %edi
pushq $0x4
popq %rsi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90303(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movl %ebx, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0x7476
movaps 0x10(%rsp), %xmm1
movaps (%rsp), %xmm0
movq 0xa8(%rsp), %rax
pushq $0x5
popq %r15
jmp 0xa183
leaq 0x91759(%rip), %rax     # 0x9b8d0
addq %r12, %rax
pushq $0x2
popq %r15
movaps 0x10(%rsp), %xmm1
movq (%rax), %rbx
xorl %edi, %edi
callq 0x8f04
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x60(%rsp)
movl %r14d, %edi
pushq $0xe
popq %rsi
callq 0x6e93
movl %eax, %r13d
movl %r14d, %edi
movl %r15d, %esi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90281(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movq %rbx, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movl %r13d, %esi
movl %eax, %edx
callq 0x8d31
addq $0x8, %r12
movaps (%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
movq %rbp, %rax
jmp 0xa025
movaps %xmm0, %xmm1
addss 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
pushq $0x8
popq %rbx
pushq $0x10
popq %rbp
movl %ebx, %edi
movl %ebp, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps (%rsp), %xmm1
subss %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
movaps 0x20(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movss 0x4eddc(%rip), %xmm0    # 0x5900c
mulss 0x90(%rsp), %xmm0
addss %xmm1, %xmm0
addss 0x4ede3(%rip), %xmm0    # 0x59028
movaps %xmm0, 0x10(%rsp)
movl %ebx, %edi
movl %ebp, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps (%rsp), %xmm1
subss %xmm0, %xmm1
unpcklps 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
addps 0x4eeb5(%rip), %xmm1    # 0x59120
movaps %xmm1, 0x60(%rsp)
movl %ebx, %edi
movl %ebp, %esi
callq 0x6e93
cvtsi2ss %eax, %xmm0
movaps (%rsp), %xmm1
subss %xmm0, %xmm1
addss 0x4ed83(%rip), %xmm1    # 0x59010
movaps %xmm1, (%rsp)
movl %ebx, %edi
movl 0x7c(%rsp), %esi
callq 0x6e93
movl %eax, %edi
callq 0x38400
movss 0x90195(%rip), %xmm0    # 0x9a440
movl %eax, %edi
callq 0x380d5
movaps 0x40(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps (%rsp), %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movaps 0x60(%rsp), %xmm1
movl %eax, %edi
callq 0x299ef
movq 0xa0(%rsp), %rax
movl 0x3c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x70(%rsp), %rax
andb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1fd8b
testb %bpl, %bpl
je 0xa323
movaps %xmm0, 0x60(%rsp)
movaps 0x20(%rsp), %xmm1
movaps 0x80(%rsp), %xmm2
callq 0x2a643
testb %al, %al
je 0xa359
xorl %r15d, %r15d
jmp 0xa375
movaps 0x20(%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x2a643
pushq $-0x1
popq %rcx
movl %ecx, 0x30(%rsp)
testb %al, %al
je 0xa416
xorl %edi, %edi
callq 0x2459e
movq %rax, 0x70(%rsp)
movzbl %al, %r13d
incl %r13d
jmp 0x9edd
xorl %edi, %edi
callq 0x2459e
testb %al, %al
jne 0xa372
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x245dd
testb %al, %al
je 0xa375
movb $0x1, %r15b
movaps 0x60(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x10(%rsp), %xmm2
callq 0x2a643
testb %al, %al
movl %ebp, 0x58(%rsp)
je 0xa39e
xorl %edi, %edi
callq 0x2459e
orb %r15b, %al
movl %eax, %r15d
pushq $0x2
popq %r13
xorl %ebp, %ebp
pushq $0x8
popq %rbx
pushq $0x11
popq %r14
movaps 0x20(%rsp), %xmm0
movaps %xmm0, %xmm1
cmpl %ebp, (%rsp)
je 0xa411
movl %ebx, %edi
movl %r14d, %esi
movaps %xmm1, 0x40(%rsp)
callq 0x6e93
cvtsi2ss %eax, %xmm0
addss 0x90(%rsp), %xmm0
movaps 0x40(%rsp), %xmm2
movaps %xmm2, %xmm1
shufps $0x55, %xmm2, %xmm1     # xmm1 = xmm1[1,1],xmm2[1,1]
addss %xmm0, %xmm1
movlhps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[2,3]
movaps 0x60(%rsp), %xmm0
movaps %xmm1, 0x40(%rsp)
movaps 0x10(%rsp), %xmm2
callq 0x2a643
testb %al, %al
jne 0xa424
incl %ebp
movaps 0x40(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
jmp 0xa3b3
movq %r15, %r14
jmp 0xa440
movq $0x0, 0x70(%rsp)
jmp 0x9edd
xorl %edi, %edi
callq 0x245dd
movq %r15, %r14
orb %al, %r14b
testb %al, %al
cmovnel %ebp, %r12d
movl %ebp, 0x30(%rsp)
movaps 0x20(%rsp), %xmm0
movl 0x58(%rsp), %ebp
jmp 0x9ec6