// File: /workspace/github_cpp_makefile_star2_O1/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 0x6add1(%rip), %rax     # 0xfdcd0
movq (%rax), %rbx
movq 0x1ae0(%rbx), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
je 0x92f23
xorl %r13d, %r13d
jmp 0x93116
movq %rsi, %r13
movq %rdi, %r14
movq %r15, %rdi
movq %r14, %rsi
movl %edx, -0x38(%rbp)
xorl %edx, %edx
callq 0x46258
movl %eax, -0x54(%rbp)
movss 0x2408c(%rip), %xmm0    # 0xb6fd0
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4548d
movlps %xmm0, -0x50(%rbp)
movl 0xd8(%r15), %r12d
movss 0xdc(%r15), %xmm2
movd %r12d, %xmm0
movdqa %xmm0, -0x70(%rbp)
cmpw $0x0, -0x38(%rbp)
movq %r14, -0x60(%rbp)
jns 0x92f9a
movss 0x159c(%rbx), %xmm1
movss 0x110(%r15), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x92f9a
subss %xmm1, %xmm0
addss %xmm0, %xmm2
movss %xmm2, -0x30(%rbp)
movsd (%r13), %xmm0
movss 0x1598(%rbx), %xmm1
addss %xmm1, %xmm1
addss -0x50(%rbp), %xmm1
movss 0x159c(%rbx), %xmm2
addss %xmm2, %xmm2
addss -0x4c(%rbp), %xmm2
callq 0x57311
leaq -0x88(%rbp), %rdi
movlps %xmm0, (%rdi)
movaps -0x70(%rbp), %xmm1
addss (%rdi), %xmm1
movss 0x4(%rdi), %xmm0
movss -0x30(%rbp), %xmm2
addss %xmm2, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq -0x48(%rbp), %r14
movl %r12d, (%r14)
movss %xmm2, 0x4(%r14)
movlps %xmm1, 0x8(%r14)
movss 0x159c(%rbx), %xmm0
callq 0x532de
xorl %r13d, %r13d
movq %r14, %rdi
movl -0x54(%rbp), %r12d
movl %r12d, %esi
xorl %edx, %edx
callq 0x5346f
testb %al, %al
je 0x93116
movl 0x1cc(%r15), %r8d
andl $0x2, %r8d
shll $0x9, %r8d
orl -0x38(%rbp), %r8d
leaq -0x48(%rbp), %r15
leaq -0x29(%rbp), %rdx
leaq -0x31(%rbp), %r14
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rcx
callq 0x92870
movl %eax, %r13d
cmpb $0x1, (%r14)
jne 0x9306b
movl $0x17, %edi
cmpb $0x0, -0x29(%rbp)
jne 0x93072
movzbl -0x29(%rbp), %edi
addl $0x15, %edi
movss 0x23f6a(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movl %eax, %r14d
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x45ca4
movsd -0x48(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
movss 0x15a0(%rbx), %xmm2
movl %r14d, %edi
movl $0x1, %esi
callq 0x459e5
movss 0x1598(%rbx), %xmm0
movss 0x159c(%rbx), %xmm1
movss -0x48(%rbp), %xmm2
addss %xmm0, %xmm2
movss -0x44(%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 -0x40(%rbp), %xmm2
movss -0x3c(%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
movq %r15, (%rsp)
leaq -0x50(%rbp), %r8
movq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movq %rbx, %r9
callq 0x45527
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq