// File: donfreiday[P]gb/./imgui/imgui.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;

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

    ImVec2 pos = window->DC.CursorPos;
    if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset)
        pos.y += window->DC.CurrentLineTextBaseOffset - 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(bb, style.FramePadding.y);
    if (!ItemAdd(bb, &id))
        return false;

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

    // Render
    const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
    RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
    RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, ImGuiAlign_Center | ImGuiAlign_VCenter);

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

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
callq 0x2e220
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x1aab2
movb $0x0, -0x1(%rbp)
jmp 0x1acf7
movq 0x5ea07(%rip), %rax     # 0x794c0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x98(%rbp)
callq 0xbc60
movq -0x98(%rbp), %rsi
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x4057e(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x4c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1ab5b
movq -0x38(%rbp), %rax
movss 0x24(%rax), %xmm1
movq -0x28(%rbp), %rax
movss 0xcc(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1ab5b
movq -0x28(%rbp), %rax
movss 0xcc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x24(%rax), %xmm0
addss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movss 0x20(%rax), %xmm1
movss 0x24(%rax), %xmm2
addss %xmm1, %xmm1
movss -0x44(%rbp), %xmm3
movss -0x40(%rbp), %xmm0
addss %xmm3, %xmm1
addss %xmm2, %xmm2
addss %xmm0, %xmm2
movsd -0x60(%rbp), %xmm0
callq 0xc690
movlpd %xmm0, -0x54(%rbp)
leaq -0x4c(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xc7e0
movlpd %xmm0, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x2eb40
movq -0x38(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0x70(%rbp), %rdi
callq 0xc060
leaq -0x70(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xc0a0
testb $0x1, %al
jne 0x1abec
movb $0x0, -0x1(%rbp)
jmp 0x1acf7
movq -0x28(%rbp), %rax
testb $0x1, 0x125(%rax)
je 0x1ac02
movl -0x1c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x3c(%rbp), %esi
movl -0x1c(%rbp), %r9d
leaq -0x70(%rbp), %rdi
leaq -0x79(%rbp), %rdx
leaq -0x7a(%rbp), %rcx
movl $0x1, %r8d
callq 0x17010
andb $0x1, %al
movb %al, -0x7b(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xa0(%rbp)
testb $0x1, -0x79(%rbp)
je 0x1ac49
testb $0x1, -0x7a(%rbp)
je 0x1ac49
movl $0x17, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1ac62
movb -0x79(%rbp), %dl
movl $0x15, %eax
movl $0x16, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xa4(%rbp)
movq -0xa0(%rbp), %rdi
movl -0xa4(%rbp), %esi
movss 0x403a1(%rip), %xmm0    # 0x5b018
callq 0x2ea40
movl %eax, -0x80(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x80(%rbp), %edi
movq -0x38(%rbp), %rax
movss 0x28(%rax), %xmm2
movsd -0x88(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
movl $0x1, %esi
callq 0x10a20
leaq -0x70(%rbp), %rdi
leaq -0x70(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x44(%rbp), %r8
movl $0x12, %r9d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x105f0
movb -0x7b(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)