// File: 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
subq $0xe0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq 0xd6b5f(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0xeb270
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
testb $0x1, 0x93(%rax)
je 0x13c407
movb $0x0, -0x1(%rbp)
jmp 0x13c67d
movq -0x40(%rbp), %rdi
addq $0xd8, %rdi
movq %rdi, -0xa8(%rbp)
movq -0x18(%rbp), %rsi
callq 0x139090
movlpd %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movss 0x35b99(%rip), %xmm0    # 0x171fcc
callq 0x13b210
movlpd %xmm0, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x139090
movq -0xa8(%rbp), %rsi
movlpd %xmm0, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0xe8660
leaq -0x50(%rbp), %rdi
movss 0x35b11(%rip), %xmm0    # 0x171f80
callq 0xdc300
movl -0x8(%rbp), %esi
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0xd6250
testb $0x1, %al
jne 0x13c491
movb $0x0, -0x1(%rbp)
jmp 0x13c67d
movl -0x8(%rbp), %esi
leaq -0x50(%rbp), %rdi
leaq -0x69(%rbp), %rdx
leaq -0x6a(%rbp), %rcx
xorl %r8d, %r8d
callq 0x139df0
andb $0x1, %al
movb %al, -0x6b(%rbp)
testb $0x1, -0x6a(%rbp)
je 0x13c4c6
testb $0x1, -0x69(%rbp)
je 0x13c4c6
movl $0x17, %eax
movl %eax, -0xac(%rbp)
jmp 0x13c4df
movb -0x69(%rbp), %dl
movl $0x15, %eax
movl $0x16, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %edi
movss 0x3474f(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0x70(%rbp)
movl -0x8(%rbp), %esi
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq 0xc91e0
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0xb0(%rbp)
movq -0x30(%rbp), %rax
movss (%rax), %xmm0
movss 0x4(%rax), %xmm1
callq 0x13c690
movq -0x38(%rbp), %rax
movss 0x15a0(%rax), %xmm2
xorps %xmm1, %xmm1
callq 0x13c020
movl -0xb0(%rbp), %edi
movaps %xmm0, %xmm2
movsd -0x78(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
movl $0x1, %esi
callq 0xc8f20
movq 0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x13c5dd
movq -0x40(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x139090
movlpd %xmm0, -0x88(%rbp)
leaq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1390e0
movlpd %xmm0, -0x90(%rbp)
movq 0x10(%rbp), %rdi
callq 0xc7750
movq -0xb8(%rbp), %rdi
movl %eax, %ecx
leaq -0x88(%rbp), %rsi
leaq -0x90(%rbp), %rdx
xorps %xmm0, %xmm0
movl $0xf, %r8d
callq 0x113090
movq -0x40(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x139090
movlpd %xmm0, -0x98(%rbp)
leaq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1390e0
movlpd %xmm0, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq 0x18(%rbp), %rdi
callq 0xc7750
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %r8
movq -0xc0(%rbp), %r9
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
movl %eax, (%rsp)
callq 0x1146d0
movb -0x6b(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)