// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movq 0x3ecc1(%rip), %r15     # 0x55480
movq 0x1758(%r15), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
jne 0x16a21
movl %r8d, %r14d
movq %rcx, %r13
movq %rsi, %rbx
movq %r9, -0x50(%rbp)
movq %rdx, -0x60(%rbp)
movq %rdi, -0x58(%rbp)
callq 0x16a34
leaq 0x279c3(%rip), %rsi     # 0x3e1bc
movq %r12, %rdi
xorl %edx, %edx
callq 0xa766
movl %eax, -0x30(%rbp)
callq 0x16b19
testl %r14d, %r14d
js 0x1681a
cvtsi2ss %r14d, %xmm0
movaps %xmm0, %xmm1
jmp 0x1682c
movss 0x1408(%r15), %xmm0
movss 0x140c(%r15), %xmm1
movss (%rbx), %xmm3
movss 0x4(%rbx), %xmm5
movss 0xa8(%r12), %xmm6
addss %xmm3, %xmm6
movss 0xac(%r12), %xmm7
addss %xmm5, %xmm7
movaps %xmm0, %xmm2
addss %xmm0, %xmm2
movaps %xmm1, %xmm4
addss %xmm1, %xmm4
addss %xmm6, %xmm2
addss %xmm7, %xmm4
movaps %xmm2, %xmm6
unpcklps %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0],xmm6[1],xmm4[1]
movq 0xa8(%r12), %r15
leaq -0x90(%rbp), %rbx
movq %r15, (%rbx)
movaps %xmm6, -0x80(%rbp)
movlps %xmm6, 0x8(%rbx)
movd %r15d, %xmm6
movq %r15, %rax
shrq $0x20, %rax
movd %eax, %xmm7
addss %xmm6, %xmm0
addss %xmm7, %xmm1
addss %xmm0, %xmm3
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
addss %xmm5, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movlhps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
movups %xmm0, -0x70(%rbp)
subss %xmm6, %xmm2
subss %xmm7, %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
leaq -0x40(%rbp), %rdi
movlps %xmm2, (%rdi)
xorps %xmm0, %xmm0
callq 0xa99d
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0xaaef
testb %al, %al
je 0x16a21
movq %r13, -0x48(%rbp)
movl -0x30(%rbp), %esi
leaq -0x90(%rbp), %rdi
leaq -0x2a(%rbp), %r14
leaq -0x29(%rbp), %r13
movq %r14, %rdx
movq %r13, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x13a49
movl %eax, %ebx
movzbl (%r13), %eax
andl $0x1, %eax
orl $0x16, %eax
cmpb $0x0, (%r14)
movq 0x3eb5c(%rip), %rcx     # 0x55480
movl $0x15, %edx
cmovnel %eax, %edx
shll $0x4, %edx
movups 0x1460(%rcx,%rdx), %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x13e8(%rcx), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
movq %r15, %xmm0
leaq -0x68(%rbp), %r15
xorps %xmm2, %xmm2
movaps -0x80(%rbp), %xmm1
movl %eax, %edi
movl $0x1, %esi
callq 0xe58d
movq -0x50(%rbp), %rax
movss 0xc(%rax), %xmm0
ucomiss 0x26a57(%rip), %xmm0    # 0x3d3d8
jbe 0x169cd
movq 0x270(%r12), %r14
movups (%rax), %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movq 0x3eae4(%rip), %rax     # 0x55480
movss 0x13e8(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
leaq -0x70(%rbp), %rsi
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rdx
movl %eax, %ecx
movl $0xf, %r8d
callq 0x2f984
movq 0x270(%r12), %r14
movq 0x10(%rbp), %rax
movups (%rax), %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movq 0x3ea96(%rip), %rax     # 0x55480
movss 0x13e8(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
movl %eax, (%rsp)
leaq -0x70(%rbp), %rdx
movq %r14, %rdi
movq -0x58(%rbp), %rsi
movq %r15, %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
callq 0x3090a
jmp 0x16a23
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq