// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ListBoxHeader(char const*, ImVec2 const&)
bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    const ImGuiStyle& style = g.Style;
    const ImGuiID id = GetID(label);
    const ImVec2 label_size = CalcTextSize(label, NULL, true);

    // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
    ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y);
    ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
    ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
    ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
    window->DC.LastItemRect = bb; // Forward storage for ListBoxFooter.. dodgy.
    g.NextItemData.ClearFlags();

    if (!IsRectVisible(bb.Min, bb.Max))
    {
        ItemSize(bb.GetSize(), style.FramePadding.y);
        ItemAdd(bb, 0, &frame_bb);
        return false;
    }

    BeginGroup();
    if (label_size.x > 0)
        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);

    BeginChildFrame(id, frame_bb.GetSize());
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0xc0716(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0xeb270
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
testb $0x1, 0x93(%rax)
je 0x152850
movb $0x0, -0x1(%rbp)
jmp 0x152aea
movq -0x20(%rbp), %rax
addq $0x1560, %rax           # imm = 0x1560
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0xdb6a0
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
movss 0x1f701(%rip), %xmm0    # 0x171f80
callq 0xc87e0
movlpd %xmm0, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0xdcdc0
movss %xmm0, -0xd0(%rbp)
callq 0xdd020
movss -0xd0(%rbp), %xmm1
movaps %xmm0, %xmm2
movq -0x30(%rbp), %rax
movss 0x4c(%rax), %xmm0
movss 0x3b95a(%rip), %xmm3    # 0x18e21c
mulss %xmm3, %xmm2
addss %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
callq 0xdcef0
movlpd %xmm0, -0x44(%rbp)
movss -0x44(%rbp), %xmm0
movss %xmm0, -0xcc(%rbp)
movss -0x40(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
callq 0x139050
movaps %xmm0, %xmm1
movss -0xcc(%rbp), %xmm0
leaq -0x58(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0xbf4c0
movq -0xc8(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0xd8, %rdi
movq %rdi, -0xc0(%rbp)
callq 0x139090
movq -0xc0(%rbp), %rsi
movlpd %xmm0, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xe8660
leaq -0x68(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x68(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xb0(%rbp)
movss -0x3c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x152986
movq -0x30(%rbp), %rax
movss 0x50(%rax), %xmm0
addss -0x3c(%rbp), %xmm0
movss %xmm0, -0xd4(%rbp)
jmp 0x152993
xorps %xmm0, %xmm0
movss %xmm0, -0xd4(%rbp)
jmp 0x152993
movss -0xd4(%rbp), %xmm0
leaq -0x90(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
xorps %xmm1, %xmm1
callq 0xbf4c0
movq -0xb0(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x139090
movq -0xb8(%rbp), %rsi
movlpd %xmm0, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0xe8660
movq -0x28(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, 0x12c(%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0x134(%rax)
movq -0x20(%rbp), %rdi
addq $0x1bf8, %rdi           # imm = 0x1BF8
callq 0x162560
leaq -0x80(%rbp), %rdi
leaq -0x80(%rbp), %rsi
addq $0x8, %rsi
callq 0xdb7d0
testb $0x1, %al
jne 0x152a60
leaq -0x80(%rbp), %rdi
callq 0xeb560
movlpd %xmm0, -0x98(%rbp)
movq -0x30(%rbp), %rax
movss 0x3c(%rax), %xmm0
leaq -0x98(%rbp), %rdi
callq 0xd6030
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
leaq -0x68(%rbp), %rdx
callq 0xd6250
movb $0x0, -0x1(%rbp)
jmp 0x152aea
callq 0xdd220
movss -0x3c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x152ab8
movss -0x64(%rbp), %xmm1
movss -0x60(%rbp), %xmm0
movq -0x30(%rbp), %rax
movss 0x3c(%rax), %xmm2
movss 0x50(%rax), %xmm3
addss %xmm3, %xmm0
addss %xmm2, %xmm1
leaq -0xa0(%rbp), %rdi
callq 0xbf4c0
movq -0x10(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0xc8120
movl -0x34(%rbp), %eax
movl %eax, -0xe4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xeb560
movl -0xe4(%rbp), %edi
movlpd %xmm0, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
xorl %edx, %edx
callq 0xd6400
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)