// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ButtonEx(char const*, ImVec2 const&, int)
bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags flags)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);
    const ImVec2 label_size = CalcTextSize(label, NULL, true);

    ImVec2 pos = window->DC.CursorPos;
    if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
        pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y;
    ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);

    const ImRect bb(pos, pos + size);
    ItemSize(size, style.FramePadding.y);
    if (!ItemAdd(bb, id))
        return false;

    if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat)
        flags |= ImGuiButtonFlags_Repeat;
    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);

    // Render
    const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
    RenderNavHighlight(bb, id);
    RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
    RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb);

    // Automatically close popups
    //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
    //    CloseCurrentPopup();

    IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags);
    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x698d1(%rip), %rax     # 0xe3ce0
movq (%rax), %rbx
movq 0x1ae0(%rbx), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
je 0x7a433
xorl %r14d, %r14d
jmp 0x7a639
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r13
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x3700a
movl %eax, -0x48(%rbp)
pushq $0x1
popq %rdx
movss 0x21b99(%rip), %xmm0    # 0x9bff0
movq %r13, -0x50(%rbp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x365e8
movlps %xmm0, -0x58(%rbp)
movl 0xd8(%r15), %r13d
movss 0xdc(%r15), %xmm3
movd %r13d, %xmm1
movdqa %xmm1, -0x70(%rbp)
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
movss 0x159c(%rbx), %xmm2
testw %r12w, %r12w
movl %r12d, -0x44(%rbp)
jns 0x7a4b2
movss 0x110(%r15), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x7a4b2
subss %xmm2, %xmm1
addss %xmm1, %xmm3
movss %xmm3, -0x2c(%rbp)
movsd (%r14), %xmm3
movss 0x1598(%rbx), %xmm1
addss %xmm1, %xmm1
addss %xmm0, %xmm1
addss %xmm2, %xmm2
addss %xmm4, %xmm2
movaps %xmm3, %xmm0
callq 0x43dc5
leaq -0x88(%rbp), %rdi
movlps %xmm0, (%rdi)
movaps -0x70(%rbp), %xmm1
addss %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss -0x2c(%rbp), %xmm2
addss %xmm2, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq -0x40(%rbp), %r12
movl %r13d, (%r12)
movss %xmm2, 0x4(%r12)
movlps %xmm1, 0x8(%r12)
movss 0x159c(%rbx), %xmm0
callq 0x40d3b
xorl %r14d, %r14d
movq %r12, %rdi
movl -0x48(%rbp), %r13d
movl %r13d, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x7a639
movl 0x1cc(%r15), %r8d
andl $0x2, %r8d
shll $0x9, %r8d
orl -0x44(%rbp), %r8d
leaq -0x2e(%rbp), %r14
leaq -0x2d(%rbp), %r15
leaq -0x40(%rbp), %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x79dde
movb (%r15), %cl
movb (%r14), %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
movl %eax, %r14d
testb %cl, %cl
cmovel %esi, %edi
movss 0x21a60(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movl %eax, %r15d
pushq $0x1
popq %r12
leaq -0x40(%rbp), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x36c91
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movss 0x15a0(%rbx), %xmm2
movl %r15d, %edi
movl %r12d, %esi
callq 0x36a6f
movss 0x1598(%rbx), %xmm0
movss 0x159c(%rbx), %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 -0x80(%rbp), %rdi
movlps %xmm2, (%rdi)
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 -0x78(%rbp), %rsi
movlps %xmm2, (%rsi)
addq $0x15f4, %rbx           # imm = 0x15F4
leaq -0x40(%rbp), %rax
movq %rax, (%rsp)
leaq -0x58(%rbp), %r8
movq -0x50(%rbp), %rdx
xorl %ecx, %ecx
movq %rbx, %r9
callq 0x36673
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq