// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::ImageButton(void*, ImVec2 const&, ImVec2 const&, ImVec2 const&, int, ImVec4 const&, ImVec4 const&)
bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    // Default to using texture ID as ID. User can still push string/integer prefixes.
    // We could hash the size/uv to create a unique ID but that would prevent the user from animating UV.
    ImGui::PushID((void *)user_texture_id);
    const ImGuiID id = window->GetID("#image");
    ImGui::PopID();

    const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding;
    const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2);
    const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
    ItemSize(bb);
    if (!ItemAdd(bb, &id))
        return false;

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

    // Render
    const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
    RenderFrame(bb.Min, bb.Max, col);
    if (bg_col.w > 0.0f)
        window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, window->Color(bg_col));
    window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, window->Color(tint_col));

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x3d7fe(%rip), %r13     # 0x50480
movq 0x1758(%r13), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
jne 0x12e53
movl %r8d, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movq %r9, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
callq 0x12e66
leaq 0x244b8(%rip), %rsi     # 0x37174
movq %r12, %rdi
xorl %edx, %edx
callq 0x9858
movl %eax, -0x30(%rbp)
callq 0x12ea2
testl %r14d, %r14d
js 0x12cdd
cvtsi2ss %r14d, %xmm1
movaps %xmm1, %xmm0
jmp 0x12cef
movss 0x1408(%r13), %xmm1
movss 0x140c(%r13), %xmm0
movss (%rbx), %xmm2
movss 0x4(%rbx), %xmm3
movss 0xa8(%r12), %xmm4
addss %xmm2, %xmm4
movss 0xac(%r12), %xmm5
movaps %xmm0, %xmm6
addss %xmm5, %xmm0
addss %xmm3, %xmm5
movaps %xmm1, %xmm7
addss %xmm1, %xmm7
addss %xmm6, %xmm6
addss %xmm4, %xmm7
addss %xmm5, %xmm6
unpcklps %xmm6, %xmm7            # xmm7 = xmm7[0],xmm6[0],xmm7[1],xmm6[1]
movq 0xa8(%r12), %rax
leaq -0x68(%rbp), %rbx
movq %rax, (%rbx)
movlps %xmm7, 0x8(%rbx)
movd %eax, %xmm4
addss %xmm1, %xmm4
addss %xmm4, %xmm2
unpcklps %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1]
addss %xmm3, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movlhps %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0]
movups %xmm4, -0x58(%rbp)
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9af8
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x9b28
testb %al, %al
je 0x12e53
movl -0x30(%rbp), %esi
leaq -0x68(%rbp), %r14
leaq -0x2a(%rbp), %rbx
leaq -0x29(%rbp), %r13
pushq $0x1
popq %r8
movq %r14, %rdi
movq %rbx, %rdx
movq %r13, %rcx
xorl %r9d, %r9d
callq 0x1077a
movzbl (%r13), %ecx
leaq -0x50(%rbp), %r13
andl $0x1, %ecx
orl $0x16, %ecx
cmpb $0x0, (%rbx)
movl %eax, %ebx
pushq $0x15
popq %rsi
cmovnel %ecx, %esi
movss 0x235ca(%rip), %xmm0    # 0x36390
movq %r12, %rdi
callq 0x1eae4
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
xorps %xmm2, %xmm2
movl %eax, %edi
pushq $0x1
popq %rsi
callq 0xc76b
movq -0x38(%rbp), %rsi
movss 0xc(%rsi), %xmm0
ucomiss 0x235ba(%rip), %xmm0    # 0x363b0
jbe 0x12e20
movq 0x270(%r12), %r14
movq %r12, %rdi
callq 0x1f43c
leaq -0x58(%rbp), %rsi
pushq $0xf
popq %r8
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rdx
movl %eax, %ecx
callq 0x29a42
movq 0x270(%r12), %r14
movq %r12, %rdi
movq 0x10(%rbp), %rsi
callq 0x1f43c
movl %eax, (%rsp)
leaq -0x58(%rbp), %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
callq 0x2a510
jmp 0x12e55
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq