// File: /workspace/github_cpp_makefile_star2_O3/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 0x6a2ba(%rip), %rax     # 0xfbcd0
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 0x524a8
leaq -0x2b(%rbp), %r13
leaq -0x2a(%rbp), %r15
movq %r12, %rdi
movl %r14d, %esi
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x90b6f
movb (%r15), %cl
movb (%r13), %dl
movl %ecx, %esi
xorb $0x1, %sil
andb %dl, %sil
movzbl %sil, %esi
addl $0x15, %esi
testb $0x1, %dl
movl $0x17, %edi
cmovel %esi, %edi
movb %al, -0x29(%rbp)
testb %cl, %cl
cmovel %esi, %edi
movss 0x2351c(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movl %eax, %r14d
xorl %edi, %edi
movss 0x2350a(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movl %eax, %r15d
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss 0x8(%r12), %xmm2
addss %xmm0, %xmm2
movss 0x23502(%rip), %xmm3    # 0xb5004
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 0x91b2d
cmpb $0x1, -0x2a(%rbp)
jne 0x91b68
movq 0x2b8(%r12), %rdi
movss 0x1980(%rbx), %xmm0
mulss 0x234bf(%rip), %xmm0    # 0xb5004
addss 0x23497(%rip), %xmm0    # 0xb4fe4
leaq -0x40(%rbp), %rsi
movl %r14d, %edx
movl $0xc, %ecx
callq 0x79212
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 0x23446(%rip), %xmm1    # 0xb4fe4
movl %r15d, %esi
callq 0x81dcb
callq 0x519e4
testb %al, %al
je 0x91bca
movss 0x23419(%rip), %xmm0    # 0xb4fd0
xorl %edi, %edi
callq 0x5179d
testb %al, %al
je 0x91bca
movq %r12, %rdi
callq 0x471ee
movb -0x29(%rbp), %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq