// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a5ca(%rip), %rax     # 0xfdcd0
movq (%rax), %r13
movss 0x1980(%r13), %xmm0
movss (%rsi), %xmm1
addss %xmm0, %xmm1
addss 0x4(%rsi), %xmm0
movq 0x1ae0(%r13), %rbx
movss 0x1598(%r13), %xmm2
movss 0x159c(%r13), %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 -0x40(%rbp), %r15
movq %rax, (%r15)
movlps %xmm2, 0x8(%r15)
movq %r15, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x5346f
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %r12
movq %r15, %rdi
movl %r14d, %esi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x92870
movl %eax, %r14d
cmpb $0x1, (%r12)
jne 0x93795
movl $0x17, %edi
cmpb $0x0, -0x29(%rbp)
jne 0x9379c
movzbl -0x29(%rbp), %edi
addl $0x15, %edi
movss 0x23840(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movl %eax, %r12d
xorl %edi, %edi
movss 0x2382e(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movl %eax, %r15d
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
addss -0x38(%rbp), %xmm0
movss 0x2382f(%rip), %xmm2    # 0xb7004
mulss %xmm2, %xmm0
addss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, -0x48(%rbp)
cmpb $0x0, -0x29(%rbp)
jne 0x937f5
cmpb $0x1, -0x2a(%rbp)
jne 0x93826
movq 0x2b8(%rbx), %rdi
movss 0x1980(%r13), %xmm0
mulss 0x237f7(%rip), %xmm0    # 0xb7004
addss 0x237cf(%rip), %xmm0    # 0xb6fe4
leaq -0x48(%rbp), %rsi
movl %r12d, %edx
movl $0xc, %ecx
callq 0x7aa54
movq 0x2b8(%rbx), %rdi
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
addss 0x1598(%r13), %xmm0
addss 0x159c(%r13), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movzbl 0x91(%rbx), %eax
xorl $0x1, %eax
leal 0x1(,%rax,2), %edx
movss 0x2377f(%rip), %xmm1    # 0xb6fe4
movl %r15d, %esi
callq 0x8391b
callq 0x529d2
testb %al, %al
je 0x93891
movss 0x23752(%rip), %xmm0    # 0xb6fd0
xorl %edi, %edi
callq 0x5278b
testb %al, %al
je 0x93891
movq %rbx, %rdi
callq 0x47d1d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq