// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ListBox(char const*, int*, bool (*)(void*, int, char const**), void*, int, int)
bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
{
    if (!ListBoxHeader(label, items_count, height_in_items))
        return false;

    // Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper.
    ImGuiContext& g = *GImGui;
    bool value_changed = false;
    ImGuiListClipper clipper;
    clipper.Begin(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to.
    while (clipper.Step())
        for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
        {
            const bool item_selected = (i == *current_item);
            const char* item_text;
            if (!items_getter(data, i, &item_text))
                item_text = "*Unknown item*";

            PushID(i);
            if (Selectable(item_text, item_selected))
            {
                *current_item = i;
                value_changed = true;
            }
            if (item_selected)
                SetItemDefaultFocus();
            PopID();
        }
    ListBoxFooter();
    if (value_changed)
        MarkItemEdited(g.CurrentWindow->DC.LastItemId);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x152b00
testb $0x1, %al
jne 0x152d1f
movb $0x0, -0x1(%rbp)
jmp 0x152ecb
leaq 0xc021a(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xc6ff0
movl -0x2c(%rbp), %eax
movl %eax, -0x88(%rbp)
callq 0xdd020
movss %xmm0, -0x84(%rbp)
jmp 0x152d52
movss -0x84(%rbp), %xmm0
movl -0x88(%rbp), %esi
leaq -0x58(%rbp), %rdi
callq 0xc7090
jmp 0x152d6b
jmp 0x152d6d
leaq -0x58(%rbp), %rdi
callq 0xc7320
movb %al, -0x89(%rbp)
jmp 0x152d7e
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x152d8d
jmp 0x152e93
movl -0x58(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x152e8e
movl -0x68(%rbp), %eax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
subl %ecx, %eax
sete -0x69(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdi
movl -0x68(%rbp), %esi
leaq -0x78(%rbp), %rdx
callq *%rax
movb %al, -0x8a(%rbp)
jmp 0x152dc7
movb -0x8a(%rbp), %al
testb $0x1, %al
jne 0x152dfa
jmp 0x152dd3
leaq 0x3baec(%rip), %rax     # 0x18e8c6
movq %rax, -0x78(%rbp)
jmp 0x152dfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xc7030
jmp 0x152ed9
movl -0x68(%rbp), %edi
callq 0xdb550
jmp 0x152e04
movq -0x78(%rbp), %rax
movq %rax, -0x98(%rbp)
movb -0x69(%rbp), %al
movb %al, -0x8b(%rbp)
leaq -0x80(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
jmp 0x152e29
movq -0x98(%rbp), %rdi
movb -0x8b(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
xorl %edx, %edx
leaq -0x80(%rbp), %rcx
callq 0x13f2b0
movb %al, -0x99(%rbp)
jmp 0x152e4f
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x152e5b
jmp 0x152e68
movl -0x68(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x39(%rbp)
testb $0x1, -0x69(%rbp)
je 0x152e77
callq 0xdb110
jmp 0x152e75
jmp 0x152e77
callq 0xdb640
jmp 0x152e7e
jmp 0x152e80
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x152d93
jmp 0x152d6d
callq 0x152bc0
jmp 0x152e9a
testb $0x1, -0x39(%rbp)
je 0x152eba
movq -0x38(%rbp), %rax
movq 0x1ae0(%rax), %rax
movl 0x124(%rax), %edi
callq 0xca110
jmp 0x152eb8
jmp 0x152eba
movb -0x39(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xc7030
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0xd620
nopw %cs:(%rax,%rax)