// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq 0x3d1f1(%rip), %r15     # 0x50480
movq 0x1758(%r15), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
je 0x132ac
xorl %r14d, %r14d
jmp 0x13721
movq %rdi, %rbx
movl %ecx, -0x78(%rbp)
movl %edx, -0x4c(%rbp)
movq %rdi, %rax
orq %rsi, %rax
je 0x13736
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 0x9858
movl %eax, -0x74(%rbp)
movl %eax, -0x34(%rbp)
movss 0x40(%r12), %xmm0
movaps %xmm0, -0x90(%rbp)
pushq $0x1
popq %rdx
movss 0x2309e(%rip), %xmm0    # 0x3639c
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc6e3
movaps %xmm0, -0x60(%rbp)
movlps %xmm0, -0xb0(%rbp)
movl 0xa8(%r12), %r14d
movl 0xac(%r12), %r13d
movd %r13d, %xmm0
movdqa %xmm0, -0x70(%rbp)
callq 0x9fb7
movaps -0x60(%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 %r14d, -0x48(%rbp)
movl %r13d, -0x44(%rbp)
movss %xmm0, -0x40(%rbp)
movss %xmm6, -0x3c(%rbp)
movd %r14d, %xmm4
movl -0x4c(%rbp), %eax
testb %al, %al
je 0x133b2
movaps -0x90(%rbp), %xmm1
mulss 0x23057(%rip), %xmm1    # 0x363d0
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss 0x23014(%rip), %xmm1    # 0x3639c
subss %xmm1, %xmm4
movss %xmm4, -0x48(%rbp)
addss %xmm0, %xmm1
movss %xmm1, -0x40(%rbp)
movss 0x140c(%r15), %xmm0
addss %xmm0, %xmm0
addss %xmm6, %xmm0
movss %xmm0, -0x3c(%rbp)
jmp 0x133b5
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, -0xc0(%rbp)
addss %xmm3, %xmm1
maxss %xmm7, %xmm5
addss %xmm1, %xmm5
addss %xmm4, %xmm5
movaps %xmm5, %xmm1
subss %xmm4, %xmm1
subss %xmm2, %xmm0
movss %xmm1, -0xa0(%rbp)
movss %xmm0, -0x9c(%rbp)
testb %al, %al
movss %xmm4, -0x90(%rbp)
je 0x13439
movss 0x140c(%r15), %xmm0
leaq -0xa0(%rbp), %r14
movq %r14, %rdi
callq 0x99d9
movups -0x48(%rbp), %xmm0
movaps %xmm0, (%r14)
pushq $0x2
popq %rax
jmp 0x13495
leaq -0xa0(%rbp), %r14
xorps %xmm0, %xmm0
movq %r14, %rdi
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0xd0(%rbp)
callq 0x99d9
movss 0x1408(%r15), %xmm0
addss %xmm0, %xmm0
movaps -0x60(%rbp), %xmm1
addss %xmm0, %xmm1
movaps -0xd0(%rbp), %xmm0
addss 0x22f36(%rip), %xmm0    # 0x363b0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movss -0x90(%rbp), %xmm0
movss %xmm0, (%r14)
movl %r13d, 0x4(%r14)
movlps %xmm1, 0x8(%r14)
xorl %eax, %eax
movzbl -0x78(%rbp), %esi
orl %eax, %esi
movl -0x74(%rbp), %edi
callq 0x131a8
movl %eax, %r14d
leaq -0xa0(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x9b28
testb %al, %al
je 0x13721
movl -0x34(%rbp), %esi
leaq -0xa0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1077a
testb %al, %al
je 0x134f7
xorb $0x1, %r14b
movq 0x110(%r12), %rdi
movl -0x34(%rbp), %esi
movzbl %r14b, %edx
callq 0x8f22
movb -0x2a(%rbp), %al
movb -0x29(%rbp), %cl
movl %eax, %edx
xorb $0x1, %dl
andb %cl, %dl
movzbl %dl, %edx
orl $0x18, %edx
testb $0x1, %cl
pushq $0x1a
popq %rsi
cmovel %edx, %esi
testb %al, %al
cmovel %edx, %esi
movss 0x22e70(%rip), %xmm0    # 0x36390
movq %r12, %rdi
callq 0x1eae4
cmpb $0x0, -0x4c(%rbp)
je 0x13682
leaq -0x40(%rbp), %r13
movsd -0x8(%r13), %xmm0
movaps %xmm0, -0x60(%rbp)
movsd (%r13), %xmm1
movss 0x1410(%r15), %xmm2
pushq $0x1
popq %r12
movl %eax, %edi
movl %r12d, %esi
callq 0xc76b
movss 0x1408(%r15), %xmm0
addss -0x60(%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 0x22e08(%rip), %xmm1    # 0x36390
movl %r12d, %esi
callq 0xc888
cmpb $0x1, 0x2be8(%r15)
jne 0x135d7
leaq -0x2d(%rbp), %rdx
movl $0x23230a, -0x3(%rdx)   # imm = 0x23230A
movss 0x1408(%r15), %xmm0
addss -0x60(%rbp), %xmm0
movss 0x140c(%r15), %xmm1
addss -0x70(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xa8(%rbp), %rdi
movlps %xmm0, (%rdi)
leaq -0x30(%rbp), %rsi
callq 0xc29f
movss 0x1408(%r15), %xmm0
addss -0x60(%rbp), %xmm0
movss 0x140c(%r15), %xmm1
addss -0x70(%rbp), %xmm1
movaps -0xc0(%rbp), %xmm2
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
leaq -0xa8(%rbp), %rdi
movlps %xmm2, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0xb0(%rbp), %r8
pushq $0x9
popq %r9
movq %r13, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xc49f
cmpb $0x1, 0x2be8(%r15)
jne 0x13721
leaq -0x2e(%rbp), %rdx
movb $0x0, (%rdx)
movw $0x2323, -0x2(%rdx)     # imm = 0x2323
movss 0x1408(%r15), %xmm0
movaps -0x70(%rbp), %xmm1
addss 0x140c(%r15), %xmm1
addss -0x60(%rbp), %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xa8(%rbp), %rdi
movlps %xmm0, (%rdi)
leaq -0x30(%rbp), %rsi
callq 0xc29f
jmp 0x13721
testb $0x1, -0x29(%rbp)
je 0x1369e
movsd -0x48(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
xorps %xmm2, %xmm2
movl %eax, %edi
xorl %esi, %esi
callq 0xc76b
movss 0x1718(%r15), %xmm1
mulss 0x22d7d(%rip), %xmm1    # 0x3642c
movss 0x1408(%r15), %xmm0
addss -0x90(%rbp), %xmm0
addss -0x70(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl %r14b, %edi
movss 0x22d5c(%rip), %xmm1    # 0x36430
xorl %esi, %esi
callq 0xc888
cmpb $0x1, 0x2be8(%r15)
jne 0x136f7
leaq 0x26ae0(%rip), %rsi     # 0x3a1cc
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0xc29f
movaps -0xc0(%rbp), %xmm0
addss -0x90(%rbp), %xmm0
xorps %xmm2, %xmm2
movaps -0x70(%rbp), %xmm1
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc16e
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23ab4(%rip), %rdi     # 0x371f1
leaq 0x22f29(%rip), %rsi     # 0x3666d
leaq 0x23aca(%rip), %rcx     # 0x37215
movl $0x1566, %edx           # imm = 0x1566
callq 0x7140