// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dea1(%rip), %r14     # 0x55490
movq 0x1758(%r14), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
je 0x1760c
xorl %r15d, %r15d
jmp 0x17b0b
movq %rdi, %rbx
movl %ecx, -0x8c(%rbp)
movl %edx, -0xa0(%rbp)
movq %rdi, %rax
orq %rsi, %rax
je 0x17b20
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 0xa872
movl %eax, -0x44(%rbp)
movss 0x40(%r12), %xmm0
movaps %xmm0, -0xb0(%rbp)
movss 0x25d2e(%rip), %xmm0    # 0x3d38c
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xe720
movlps %xmm0, -0x88(%rbp)
movl 0xa8(%r12), %r13d
movl 0xac(%r12), %r15d
movl %r15d, -0x60(%rbp)
callq 0xb0a3
addss 0x18(%r12), %xmm0
movss -0x84(%rbp), %xmm3
movss -0x60(%rbp), %xmm1
addss %xmm3, %xmm1
movl %r13d, -0x40(%rbp)
movl %r15d, -0x3c(%rbp)
movss %xmm0, -0x38(%rbp)
movss %xmm1, -0x34(%rbp)
movl -0xa0(%rbp), %eax
testb %al, %al
je 0x1770e
movaps -0xb0(%rbp), %xmm0
mulss 0x25cec(%rip), %xmm0    # 0x3d3bc
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
addss 0x25cad(%rip), %xmm0    # 0x3d38c
movss -0x40(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, -0x40(%rbp)
addss -0x38(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movss 0x140c(%r14), %xmm0
addss %xmm0, %xmm0
addss -0x34(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss 0x1408(%r14), %xmm0
addss %xmm0, %xmm0
movss 0x1718(%r14), %xmm1
addss %xmm0, %xmm1
xorps %xmm2, %xmm2
mulss %xmm2, %xmm0
movaps %xmm1, -0xd0(%rbp)
addss %xmm1, %xmm0
movss -0x88(%rbp), %xmm4
maxss %xmm2, %xmm4
addss %xmm0, %xmm4
movss -0x40(%rbp), %xmm5
movss -0x3c(%rbp), %xmm2
addss %xmm5, %xmm4
movaps %xmm4, %xmm0
subss %xmm5, %xmm0
movss -0x34(%rbp), %xmm1
subss %xmm2, %xmm1
movss %xmm0, -0x80(%rbp)
movss %xmm1, -0x7c(%rbp)
testb %al, %al
movaps %xmm2, -0x60(%rbp)
movss %xmm5, -0xb0(%rbp)
je 0x177a6
movss 0x140c(%r14), %xmm0
leaq -0x80(%rbp), %rdi
callq 0xaab7
movups -0x40(%rbp), %xmm0
movaps %xmm0, -0xc0(%rbp)
movl $0x2, %eax
jmp 0x17813
addss %xmm2, %xmm3
movaps %xmm3, -0xf0(%rbp)
leaq -0x80(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm4, -0xe0(%rbp)
callq 0xaab7
movss 0x1408(%r14), %xmm0
addss %xmm0, %xmm0
movaps -0xe0(%rbp), %xmm1
addss %xmm0, %xmm1
movaps -0xf0(%rbp), %xmm0
addss 0x25bb5(%rip), %xmm0    # 0x3d3a0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movss -0xb0(%rbp), %xmm0
movss %xmm0, -0xc0(%rbp)
movaps -0x60(%rbp), %xmm0
movss %xmm0, -0xbc(%rbp)
movlps %xmm1, -0xb8(%rbp)
xorl %eax, %eax
leaq -0x44(%rbp), %r13
movl (%r13), %edi
movzbl -0x8c(%rbp), %esi
orl %eax, %esi
callq 0x17501
movl %eax, %r15d
leaq -0xc0(%rbp), %rdi
movq %r13, %rsi
callq 0xac09
testb %al, %al
je 0x17b0b
movl -0x44(%rbp), %esi
leaq -0xc0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x13d8d
testb %al, %al
je 0x1787c
xorb $0x1, %r15b
movq 0x110(%r12), %rdi
movl -0x44(%rbp), %esi
movzbl %r15b, %edx
callq 0x9642
movb -0x2a(%rbp), %r12b
cmpb $0x1, %r12b
jne 0x17891
movl $0x1a, %eax
cmpb $0x0, -0x29(%rbp)
jne 0x17899
movzbl -0x29(%rbp), %eax
orq $0x18, %rax
movq 0x3dbf0(%rip), %r13     # 0x55490
shll $0x4, %eax
movups 0x1460(%r13,%rax), %xmm0
leaq -0x80(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x13e8(%r13), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8cce
cmpb $0x0, -0xa0(%rbp)
je 0x17a39
movl %r15d, %r13d
leaq -0x38(%rbp), %r15
movsd -0x8(%r15), %xmm0
movsd (%r15), %xmm1
movss 0x1410(%r14), %xmm2
movl %eax, %edi
movl $0x1, %esi
callq 0xe7a8
movss -0x8(%r15), %xmm1
movss 0x1408(%r14), %xmm0
movaps %xmm1, -0xa0(%rbp)
addss %xmm1, %xmm0
movss 0x140c(%r14), %xmm1
addss -0x60(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movl %r13d, %r12d
movzbl %r13b, %edi
movss 0x25a47(%rip), %xmm1    # 0x3d380
movl $0x1, %esi
callq 0xe906
cmpb $0x1, 0x2be8(%r14)
jne 0x1798a
leaq -0x65(%rbp), %rdx
movl $0x23230a, -0x3(%rdx)   # imm = 0x23230A
movss 0x1408(%r14), %xmm0
addss -0xa0(%rbp), %xmm0
movss 0x140c(%r14), %xmm1
addss -0x60(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x80(%rbp), %rdi
movlps %xmm0, (%rdi)
leaq -0x68(%rbp), %rsi
callq 0xe244
movss 0x1408(%r14), %xmm0
addss -0xa0(%rbp), %xmm0
movss 0x140c(%r14), %xmm1
addss -0x60(%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 -0x80(%rbp), %rdi
movlps %xmm2, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x88(%rbp), %r8
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe466
cmpb $0x1, 0x2be8(%r14)
movl %r12d, %r15d
jne 0x17b0b
leaq -0x66(%rbp), %rdx
movb $0x0, (%rdx)
movw $0x2323, -0x2(%rdx)     # imm = 0x2323
movaps -0xa0(%rbp), %xmm0
addss 0x1408(%r14), %xmm0
movaps -0x60(%rbp), %xmm1
addss 0x140c(%r14), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x80(%rbp), %rdi
movlps %xmm0, (%rdi)
leaq -0x68(%rbp), %rsi
callq 0xe244
jmp 0x17b0b
testb %r12b, %r12b
je 0x17a44
cmpb $0x0, -0x29(%rbp)
jne 0x17a4a
cmpb $0x1, -0x29(%rbp)
jne 0x17a86
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
leaq -0x80(%rbp), %rsi
movsd %xmm0, (%rsi)
leaq -0x68(%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 0x300c8
movss 0x1718(%r14), %xmm1
mulss 0x25989(%rip), %xmm1    # 0x3d420
movss 0x1408(%r14), %xmm0
addss -0xb0(%rbp), %xmm0
addss -0x60(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl %r15b, %edi
movss 0x25968(%rip), %xmm1    # 0x3d424
xorl %esi, %esi
callq 0xe906
cmpb $0x1, 0x2be8(%r14)
jne 0x17adf
leaq 0x29588(%rip), %rsi     # 0x4105c
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
callq 0xe244
movaps -0xd0(%rbp), %xmm0
addss -0xb0(%rbp), %xmm0
xorps %xmm2, %xmm2
movaps -0x60(%rbp), %xmm1
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xe0f3
movl %r15d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x266e2(%rip), %rdi     # 0x3e209
leaq 0x25b57(%rip), %rsi     # 0x3d685
leaq 0x266f8(%rip), %rcx     # 0x3e22d
movl $0x1566, %edx           # imm = 0x1566
callq 0x7140