// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::CollapseButton(unsigned int, ImVec2 const&)
bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;

    ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f);
    ItemAdd(bb, id);
    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_None);

    // Render
    ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
    ImU32 text_col = GetColorU32(ImGuiCol_Text);
    ImVec2 center = bb.GetCenter();
    if (hovered || held)
        window->DrawList->AddCircleFilled(center/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col, 12);
    RenderArrow(window->DrawList, bb.Min + g.Style.FramePadding, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);

    // Switch to moving the window after mouse is moved beyond the initial drag threshold
    if (IsItemActive() && IsMouseDragging(0))
        StartMouseMovingWindow(window);

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r14d
leaq 0x690ab(%rip), %rax     # 0xe3ce0
movq (%rax), %rbx
movss 0x1980(%rbx), %xmm0
movss (%rsi), %xmm1
addss %xmm0, %xmm1
addss 0x4(%rsi), %xmm0
movq 0x1ae0(%rbx), %rax
movq %rax, -0x38(%rbp)
movss 0x1598(%rbx), %xmm2
movss 0x159c(%rbx), %xmm3
addss %xmm2, %xmm2
addss %xmm3, %xmm3
addss %xmm1, %xmm2
addss %xmm0, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movq (%rsi), %rax
leaq -0x50(%rbp), %r12
movq %rax, (%r12)
movlps %xmm2, 0x8(%r12)
movq %r12, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x40ea5
leaq -0x2b(%rbp), %r13
leaq -0x2a(%rbp), %r15
movq %r12, %rdi
movl %r14d, %esi
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x79dde
movb (%r15), %cl
movb (%r13), %dl
movl %ecx, %esi
xorb $0x1, %sil
andb %dl, %sil
movzbl %sil, %esi
addl $0x15, %esi
testb $0x1, %dl
pushq $0x17
popq %rdi
cmovel %esi, %edi
movb %al, -0x29(%rbp)
testb %cl, %cl
cmovel %esi, %edi
movss 0x21313(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movl %eax, %r14d
xorl %edi, %edi
movss 0x21301(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movl %eax, %r15d
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss 0x8(%r12), %xmm2
addss %xmm0, %xmm2
movss 0x212f9(%rip), %xmm3    # 0x9c018
mulss %xmm3, %xmm2
movss 0xc(%r12), %xmm4
movq -0x38(%rbp), %r12
addss %xmm1, %xmm4
mulss %xmm3, %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
movlps %xmm2, -0x40(%rbp)
cmpb $0x0, (%r13)
jne 0x7ad4a
cmpb $0x1, -0x2a(%rbp)
jne 0x7ad83
movq 0x2b8(%r12), %rdi
movss 0x1980(%rbx), %xmm0
mulss 0x212b6(%rip), %xmm0    # 0x9c018
addss 0x2128e(%rip), %xmm0    # 0x9bff8
leaq -0x40(%rbp), %rsi
pushq $0xc
popq %rcx
movl %r14d, %edx
callq 0x64486
movss -0x50(%rbp), %xmm0
movss -0x4c(%rbp), %xmm1
movq 0x2b8(%r12), %rdi
addss 0x1598(%rbx), %xmm0
addss 0x159c(%rbx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl 0x91(%r12), %eax
xorl $0x1, %eax
leal 0x1(,%rax,2), %edx
movss 0x2123f(%rip), %xmm1    # 0x9bff8
movl %r15d, %esi
callq 0x6b8b0
callq 0x40529
testb %al, %al
je 0x7ade5
movss 0x2121e(%rip), %xmm0    # 0x9bff0
xorl %edi, %edi
callq 0x40317
testb %al, %al
je 0x7ade5
movq %r12, %rdi
callq 0x37f23
movb -0x29(%rbp), %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq