// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ImageButtonEx(unsigned int, void*, ImVec2 const&, ImVec2 const&, ImVec2 const&, ImVec2 const&, ImVec4 const&, ImVec4 const&)
bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec2& padding, const ImVec4& bg_col, const ImVec4& tint_col)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2);
    ItemSize(bb);
    if (!ItemAdd(bb, id))
        return false;

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

    // Render
    const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
    RenderNavHighlight(bb, id);
    RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding));
    if (bg_col.w > 0.0f)
        window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col));
    window->DrawList->AddImage(texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x684fe(%rip), %rax     # 0xe3ce0
movq (%rax), %r13
movq 0x1ae0(%r13), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
je 0x7b805
xorl %eax, %eax
jmp 0x7ba24
movq %r9, %r12
movl %edi, %ebx
movq %rsi, -0x58(%rbp)
movq %rcx, -0x60(%rbp)
movq %r8, -0x68(%rbp)
movss 0xd8(%r15), %xmm0
movss 0xdc(%r15), %xmm1
addss (%rdx), %xmm0
addss 0x4(%rdx), %xmm1
movss (%r9), %xmm2
movss 0x4(%r9), %xmm3
addss %xmm2, %xmm2
addss %xmm3, %xmm3
addss %xmm0, %xmm2
addss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movq 0xd8(%r15), %rax
leaq -0x40(%rbp), %r14
movq %rax, (%r14)
movlps %xmm2, 0x8(%r14)
movss 0x20786(%rip), %xmm0    # 0x9bff0
movq %r14, %rdi
callq 0x4388d
movq $0x0, -0x50(%rbp)
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x7ba20
leaq -0x40(%rbp), %rdi
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %r14
movl %ebx, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x79dde
movb (%r14), %cl
leaq -0x29(%rbp), %rdx
movb (%rdx), %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
movq %rax, -0x50(%rbp)
testb %cl, %cl
cmovel %esi, %edi
movss 0x2071e(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movl %eax, -0x44(%rbp)
pushq $0x1
popq %rdx
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movl %ebx, %esi
movl %edx, %ebx
callq 0x36c91
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
movss (%r12), %xmm2
minss 0x4(%r12), %xmm2
movss 0x15a0(%r13), %xmm3
minss %xmm2, %xmm3
xorps %xmm4, %xmm4
cmpltss %xmm4, %xmm2
andnps %xmm3, %xmm2
movl -0x44(%rbp), %edi
movl %ebx, %esi
callq 0x36a6f
movq 0x10(%rbp), %rdi
movss 0xc(%rdi), %xmm0
ucomiss 0x20f85(%rip), %xmm0    # 0x9c8c4
jbe 0x7b9ac
movq 0x2b8(%r15), %rbx
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss -0x40(%rbp), %xmm2
addss %xmm0, %xmm2
movss -0x3c(%rbp), %xmm3
addss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
leaq -0x78(%rbp), %r13
movlps %xmm2, (%r13)
movss -0x38(%rbp), %xmm2
movss -0x34(%rbp), %xmm3
subss %xmm0, %xmm2
subss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
leaq -0x70(%rbp), %r14
movlps %xmm2, (%r14)
callq 0x35d75
pushq $0xf
popq %r8
xorps %xmm0, %xmm0
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl %eax, %ecx
callq 0x64020
movq 0x2b8(%r15), %rbx
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss -0x40(%rbp), %xmm2
addss %xmm0, %xmm2
movss -0x3c(%rbp), %xmm3
addss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
leaq -0x78(%rbp), %r14
movlps %xmm2, (%r14)
movss -0x38(%rbp), %xmm2
movss -0x34(%rbp), %xmm3
subss %xmm0, %xmm2
subss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
leaq -0x70(%rbp), %r15
movlps %xmm2, (%r15)
movq 0x18(%rbp), %rdi
callq 0x35d75
movl %eax, (%rsp)
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
movq %r14, %rdx
movq %r15, %rcx
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %r9
callq 0x64ee2
movq -0x50(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq