// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movq 0x3e83a(%rip), %r15     # 0x55490
movq 0x1758(%r15), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
jne 0x16eb8
movl %r8d, %r14d
movq %rcx, %r13
movq %rsi, %rbx
movq %r9, -0x50(%rbp)
movq %rdx, -0x60(%rbp)
movq %rdi, -0x58(%rbp)
callq 0x16ecb
leaq 0x274fc(%rip), %rsi     # 0x3e18c
movq %r12, %rdi
xorl %edx, %edx
callq 0xa872
movl %eax, -0x30(%rbp)
callq 0x16fc0
testl %r14d, %r14d
js 0x16cb1
cvtsi2ss %r14d, %xmm0
movaps %xmm0, %xmm1
jmp 0x16cc3
movss 0x1408(%r15), %xmm0
movss 0x140c(%r15), %xmm1
movss (%rbx), %xmm2
movss 0x4(%rbx), %xmm3
movss 0xa8(%r12), %xmm4
addss %xmm2, %xmm4
movss 0xac(%r12), %xmm5
movaps %xmm5, %xmm6
addss %xmm3, %xmm6
movaps %xmm0, %xmm7
addss %xmm0, %xmm7
movaps %xmm1, %xmm8
addss %xmm1, %xmm8
addss %xmm4, %xmm7
addss %xmm6, %xmm8
unpcklps %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1]
movq 0xa8(%r12), %rax
leaq -0x80(%rbp), %rbx
movq %rax, (%rbx)
movlps %xmm7, 0x8(%rbx)
addss 0xa8(%r12), %xmm0
addss %xmm5, %xmm1
addss %xmm0, %xmm2
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
addss %xmm3, %xmm1
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movlhps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movss 0x8(%rbx), %xmm1
movss 0xc(%rbx), %xmm2
subss (%rbx), %xmm1
subss 0x4(%rbx), %xmm2
movups %xmm0, -0x70(%rbp)
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
leaq -0x40(%rbp), %rdi
movlps %xmm1, (%rdi)
xorps %xmm0, %xmm0
callq 0xaab7
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0xac09
testb %al, %al
je 0x16eb8
movq %r13, -0x48(%rbp)
movl -0x30(%rbp), %esi
leaq -0x80(%rbp), %r14
leaq -0x2a(%rbp), %r13
leaq -0x29(%rbp), %r15
movq %r14, %rdi
movq %r13, %rdx
movq %r15, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x13d8d
movl %eax, %ebx
movzbl (%r15), %eax
leaq -0x68(%rbp), %r15
andl $0x1, %eax
orl $0x16, %eax
cmpb $0x0, (%r13)
movq 0x3e6d3(%rip), %rcx     # 0x55490
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 0x8cce
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
xorps %xmm2, %xmm2
movl %eax, %edi
movl $0x1, %esi
callq 0xe7a8
movq -0x50(%rbp), %rax
movss 0xc(%rax), %xmm0
ucomiss 0x26588(%rip), %xmm0    # 0x3d3a0
jbe 0x16e64
movq 0x270(%r12), %r14
movups (%rax), %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movq 0x3e65d(%rip), %rax     # 0x55490
movss 0x13e8(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8cce
leaq -0x70(%rbp), %rsi
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rdx
movl %eax, %ecx
movl $0xf, %r8d
callq 0x300c8
movq 0x270(%r12), %r14
movq 0x10(%rbp), %rax
movups (%rax), %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movq 0x3e60f(%rip), %rax     # 0x55490
movss 0x13e8(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8cce
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 0x311b2
jmp 0x16eba
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq