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

    // We intentionally allow interaction when clipped so that a mechanical Alt,Right,Validate sequence close a window.
    // (this isn't the regular behavior of buttons, but it doesn't affect the user much because navigation tends to keep items visible).
    const ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f);
    bool is_clipped = !ItemAdd(bb, id);

    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held);
    if (is_clipped)
        return pressed;

    // Render
    ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered);
    ImVec2 center = bb.GetCenter();
    if (hovered)
        window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col, 12);

    float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f;
    ImU32 cross_col = GetColorU32(ImGuiCol_Text);
    center -= ImVec2(0.5f, 0.5f);
    window->DrawList->AddLine(center + ImVec2(+cross_extent, +cross_extent), center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
    window->DrawList->AddLine(center + ImVec2(+cross_extent, -cross_extent), center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edi, %ebx
leaq 0x692d5(%rip), %rax     # 0xe3ce0
movq (%rax), %r12
movss 0x1980(%r12), %xmm0
movss (%rsi), %xmm1
addss %xmm0, %xmm1
addss 0x4(%rsi), %xmm0
movq 0x1ae0(%r12), %r13
movss 0x1598(%r12), %xmm2
movss 0x159c(%r12), %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 -0x48(%rbp), %r14
movq %rax, (%r14)
movlps %xmm2, 0x8(%r14)
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x40ea5
movl %eax, %r15d
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movq %r14, %rdi
movl %ebx, %esi
xorl %r8d, %r8d
callq 0x79dde
movl %eax, %ebx
testb %r15b, %r15b
je 0x7ac09
movzbl -0x29(%rbp), %edi
orl $0x16, %edi
movss 0x21557(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movss -0x48(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
addss -0x40(%rbp), %xmm0
movss 0x2155b(%rip), %xmm2    # 0x9c018
mulss %xmm2, %xmm0
addss -0x3c(%rbp), %xmm1
mulss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, -0x38(%rbp)
cmpb $0x1, -0x2a(%rbp)
jne 0x7ab12
movq 0x2b8(%r13), %rdi
movss 0x1980(%r12), %xmm1
mulss 0x21528(%rip), %xmm1    # 0x9c018
addss 0x21500(%rip), %xmm1    # 0x9bff8
movss 0x21d94(%rip), %xmm0    # 0x9c894
maxss %xmm1, %xmm0
leaq -0x38(%rbp), %rsi
pushq $0xc
popq %rcx
movl %eax, %edx
callq 0x64486
movss 0x1980(%r12), %xmm0
mulss 0x214f4(%rip), %xmm0    # 0x9c018
mulss 0x3d5b8(%rip), %xmm0    # 0xb80e4
addss 0x214bc(%rip), %xmm0    # 0x9bff0
movaps %xmm0, -0x70(%rbp)
movss 0x214b8(%rip), %xmm0    # 0x9bff8
xorl %edi, %edi
callq 0x35d33
movl %eax, %r14d
movss 0x21da2(%rip), %xmm0    # 0x9c8f4
movss -0x38(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp)
addss -0x34(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movq 0x2b8(%r13), %rdi
movaps -0x70(%rbp), %xmm4
movaps %xmm4, %xmm2
addss %xmm1, %xmm2
movaps %xmm4, %xmm3
addss %xmm0, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
leaq -0x58(%rbp), %r15
movlps %xmm2, (%r15)
subss %xmm4, %xmm1
subss %xmm4, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq -0x50(%rbp), %r12
movlps %xmm1, (%r12)
movq %r15, %rsi
movq %r12, %rdx
movl %eax, %ecx
movss 0x21446(%rip), %xmm0    # 0x9bff8
callq 0x63ec2
movq 0x2b8(%r13), %rdi
movss -0x38(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movaps -0x70(%rbp), %xmm4
movaps %xmm4, %xmm2
addss %xmm0, %xmm2
movaps %xmm1, %xmm3
subss %xmm4, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movlps %xmm2, (%r15)
subss %xmm4, %xmm0
addss %xmm1, %xmm4
unpcklps %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movlps %xmm0, (%r12)
leaq -0x58(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movl %r14d, %ecx
movss 0x213f4(%rip), %xmm0    # 0x9bff8
callq 0x63ec2
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq