// File: /workspace/github_cpp_makefile_star2_O3/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::CollapsingHeader(char const*, char const*, bool, bool)
bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display_frame, bool default_open)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    IM_ASSERT(str_id != NULL || label != NULL);
    if (str_id == NULL)
        str_id = label;
    if (label == NULL)
        label = str_id;
    const ImGuiID id = window->GetID(str_id);

    // Framed header expand a little outside the default padding
    const ImVec2 window_padding = window->WindowPadding;
    const ImVec2 label_size = CalcTextSize(label, NULL, true);
    const ImVec2 pos_min = window->DC.CursorPos;
    const ImVec2 pos_max = window->Pos + GetContentRegionMax();
    ImRect bb = ImRect(pos_min, ImVec2(pos_max.x, pos_min.y + label_size.y));
    if (display_frame)
    {
        bb.Min.x -= (float)(int)(window_padding.x*0.5f) - 1;
        bb.Max.x += (float)(int)(window_padding.x*0.5f) - 1;
        bb.Max.y += style.FramePadding.y * 2;
    }

    const float collapser_width = g.FontSize + style.FramePadding.x*2;
    const ImRect text_bb(bb.Min, bb.Min + ImVec2(collapser_width + style.FramePadding.x*2*0 + (label_size.x > 0.0f ? label_size.x : 0.0f), label_size.y));
    ItemSize(ImVec2(text_bb.GetSize().x, bb.GetSize().y), display_frame ? style.FramePadding.y : 0.0f);

    const ImRect interact_bb = display_frame ? bb : ImRect(text_bb.Min, text_bb.Max + ImVec2(style.FramePadding.x*2,0.0f)); // FIXME
    bool opened = TreeNodeBehaviorIsOpened(id, (default_open ? ImGuiTreeNodeFlags_DefaultOpen : 0) | (display_frame ? ImGuiTreeNodeFlags_NoAutoExpandOnLog : 0));

    if (!ItemAdd(interact_bb, &id))
        return opened;

    bool hovered, held;
    bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, false);
    if (pressed)
    {
        opened = !opened;
        window->DC.StateStorage->SetInt(id, opened);
    }

    // Render
    const ImU32 col = window->Color((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
    if (display_frame)
    {
        // Framed type
        RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
        RenderCollapseTriangle(bb.Min + style.FramePadding, opened, 1.0f, true);
        if (g.LogEnabled)
        {
            // NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here.
            const char log_prefix[] = "\n##";
            LogRenderedText(bb.Min + style.FramePadding, log_prefix, log_prefix+3);
        }
        RenderTextClipped(bb.Min + style.FramePadding + ImVec2(collapser_width,0), bb.Max, label, NULL, &label_size);
        if (g.LogEnabled)
        {
            const char log_suffix[] = "##";
            LogRenderedText(bb.Min + style.FramePadding, log_suffix, log_suffix+2);
        }
    }
    else
    {
        // Unframed typed for tree nodes
        if ((held && hovered) || hovered)
            RenderFrame(bb.Min, bb.Max, col, false);
        RenderCollapseTriangle(bb.Min + ImVec2(style.FramePadding.x, g.FontSize*0.15f), opened, 0.70f, false);
        if (g.LogEnabled)
            LogRenderedText(bb.Min, ">");
        RenderText(bb.Min + ImVec2(collapser_width,0), label);
    }

    return opened;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq 0x3e348(%rip), %r15     # 0x55480
movq 0x1758(%r15), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
je 0x17155
xorl %r14d, %r14d
jmp 0x175f8
movq %rdi, %rbx
movl %ecx, -0x78(%rbp)
movl %edx, -0x34(%rbp)
movq %rdi, %rax
orq %rsi, %rax
je 0x1760d
testq %rsi, %rsi
movq %rsi, %rax
cmoveq %rbx, %rax
testq %rbx, %rbx
cmoveq %rsi, %rbx
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa766
movl %eax, -0x74(%rbp)
movl %eax, -0x30(%rbp)
movss 0x40(%r12), %xmm0
movaps %xmm0, -0xa0(%rbp)
movss 0x261f8(%rip), %xmm0    # 0x3d39c
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xe505
movaps %xmm0, -0x90(%rbp)
movlps %xmm0, -0xb8(%rbp)
movl 0xa8(%r12), %r13d
movl 0xac(%r12), %r14d
movd %r14d, %xmm0
movdqa %xmm0, -0x70(%rbp)
callq 0xaf8c
movaps -0x90(%rbp), %xmm5
movaps -0x70(%rbp), %xmm2
addss 0x18(%r12), %xmm0
movaps %xmm5, %xmm6
shufps $0x55, %xmm5, %xmm6     # xmm6 = xmm6[1,1],xmm5[1,1]
addss %xmm2, %xmm6
movl %r13d, -0x60(%rbp)
movl %r14d, -0x5c(%rbp)
movss %xmm0, -0x58(%rbp)
movss %xmm6, -0x54(%rbp)
movd %r13d, %xmm4
movl -0x34(%rbp), %eax
testb %al, %al
je 0x17263
movaps -0xa0(%rbp), %xmm1
mulss 0x261a2(%rip), %xmm1    # 0x3d3cc
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0x26163(%rip), %xmm1    # 0x3d39c
subss %xmm1, %xmm4
movss %xmm4, -0x60(%rbp)
addss %xmm0, %xmm1
movss %xmm1, -0x58(%rbp)
movss 0x140c(%r15), %xmm0
addss %xmm0, %xmm0
addss %xmm6, %xmm0
movss %xmm0, -0x54(%rbp)
jmp 0x17266
movaps %xmm6, %xmm0
movss 0x1408(%r15), %xmm1
addss %xmm1, %xmm1
movss 0x1718(%r15), %xmm3
addss %xmm1, %xmm3
xorps %xmm7, %xmm7
mulss %xmm7, %xmm1
movaps %xmm3, -0xd0(%rbp)
addss %xmm3, %xmm1
maxss %xmm7, %xmm5
addss %xmm1, %xmm5
addss %xmm4, %xmm5
movaps %xmm5, %xmm1
subss %xmm4, %xmm1
subss %xmm2, %xmm0
movss %xmm1, -0x50(%rbp)
movss %xmm0, -0x4c(%rbp)
testb %al, %al
movss %xmm4, -0xa0(%rbp)
je 0x172e3
movss 0x140c(%r15), %xmm0
leaq -0x50(%rbp), %rdi
callq 0xa99d
movups -0x60(%rbp), %xmm0
movaps %xmm0, -0xb0(%rbp)
movl $0x2, %eax
jmp 0x17347
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm5, -0x90(%rbp)
movaps %xmm6, -0xe0(%rbp)
callq 0xa99d
movss 0x1408(%r15), %xmm0
addss %xmm0, %xmm0
movaps -0x90(%rbp), %xmm1
addss %xmm0, %xmm1
movaps -0xe0(%rbp), %xmm0
addss 0x260b4(%rip), %xmm0    # 0x3d3d8
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movss -0xa0(%rbp), %xmm0
movss %xmm0, -0xb0(%rbp)
movl %r14d, -0xac(%rbp)
movlps %xmm1, -0xa8(%rbp)
xorl %eax, %eax
movzbl -0x78(%rbp), %esi
orl %eax, %esi
movl -0x74(%rbp), %edi
callq 0x1704a
movl %eax, %r14d
leaq -0xb0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xaaef
testb %al, %al
je 0x175f8
movl -0x30(%rbp), %esi
leaq -0xb0(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x13a49
testb %al, %al
je 0x173a9
xorb $0x1, %r14b
movq 0x110(%r12), %rdi
movl -0x30(%rbp), %esi
movzbl %r14b, %edx
callq 0x95c6
movb -0x29(%rbp), %al
movb -0x2a(%rbp), %r12b
movl %eax, %ecx
xorb $0x1, %cl
andb %r12b, %cl
movzbl %cl, %ecx
orl $0x18, %ecx
testb $0x1, %r12b
movl $0x1a, %edx
cmovel %ecx, %edx
movq 0x3e0af(%rip), %r13     # 0x55480
testb %al, %al
cmovel %ecx, %edx
shll $0x4, %edx
movups 0x1460(%r13,%rdx), %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x13e8(%r13), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
cmpb $0x0, -0x34(%rbp)
je 0x1752e
leaq -0x58(%rbp), %r12
movsd -0x8(%r12), %xmm0
movaps %xmm0, -0x90(%rbp)
movsd (%r12), %xmm1
movss 0x1410(%r15), %xmm2
movl %eax, %edi
movl $0x1, %esi
callq 0xe58d
movss 0x1408(%r15), %xmm0
addss -0x90(%rbp), %xmm0
movss 0x140c(%r15), %xmm1
addss -0x70(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl %r14b, %edi
movss 0x25f2a(%rip), %xmm1    # 0x3d390
movl $0x1, %esi
callq 0xe6eb
cmpb $0x1, 0x2be8(%r15)
jne 0x1749c
leaq -0x4d(%rbp), %rsi
movl $0x23230a, -0x3(%rsi)   # imm = 0x23230A
movss 0x140c(%r15), %xmm0
addss -0x70(%rbp), %xmm0
leaq -0x50(%rbp), %rdi
callq 0xe021
movss 0x1408(%r15), %xmm0
addss -0x90(%rbp), %xmm0
movss 0x140c(%r15), %xmm1
addss -0x70(%rbp), %xmm1
movaps -0xd0(%rbp), %xmm2
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
leaq -0x50(%rbp), %rdi
movlps %xmm2, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0xb8(%rbp), %r8
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe23a
cmpb $0x1, 0x2be8(%r15)
jne 0x175f8
leaq -0x4e(%rbp), %rsi
movb $0x0, (%rsi)
movw $0x2323, -0x2(%rsi)     # imm = 0x2323
movaps -0x70(%rbp), %xmm0
addss 0x140c(%r15), %xmm0
leaq -0x50(%rbp), %rdi
callq 0xe021
jmp 0x175f8
testb $0x1, %r12b
je 0x17573
movsd -0x60(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
leaq -0x50(%rbp), %rsi
movsd %xmm0, (%rsi)
leaq -0xe8(%rbp), %rdx
movsd %xmm1, (%rdx)
movq 0x1758(%r13), %rcx
movb $0x1, 0x72(%rcx)
movq 0x270(%rcx), %rdi
xorps %xmm0, %xmm0
movl %eax, %ecx
movl $0xf, %r8d
callq 0x2f984
movss 0x1718(%r15), %xmm1
mulss 0x25eac(%rip), %xmm1    # 0x3d430
movss 0x1408(%r15), %xmm0
addss -0xa0(%rbp), %xmm0
addss -0x70(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl %r14b, %edi
movss 0x25e8b(%rip), %xmm1    # 0x3d434
xorl %esi, %esi
callq 0xe6eb
cmpb $0x1, 0x2be8(%r15)
jne 0x175cc
leaq 0x29a1b(%rip), %rdi     # 0x40fdc
movaps -0x70(%rbp), %xmm0
xorl %esi, %esi
callq 0xe021
movaps -0xd0(%rbp), %xmm0
addss -0xa0(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps -0x70(%rbp), %xmm2
addss %xmm1, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xdecf
movl %r14d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26c25(%rip), %rdi     # 0x3e239
leaq 0x2609a(%rip), %rsi     # 0x3d6b5
leaq 0x26c3b(%rip), %rcx     # 0x3e25d
movl $0x1566, %edx           # imm = 0x1566
callq 0x7140