// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::AcceptDragDropPayload(char const*, int)
const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    ImGuiPayload& payload = g.DragDropPayload;
    IM_ASSERT(g.DragDropActive);                        // Not called between BeginDragDropTarget() and EndDragDropTarget() ?
    IM_ASSERT(payload.DataFrameCount != -1);            // Forgot to call EndDragDropTarget() ?
    if (type != NULL && !payload.IsDataType(type))
        return NULL;

    // Accept smallest drag target bounding box, this allows us to nest drag targets conveniently without ordering constraints.
    // NB: We currently accept NULL id as target. However, overlapping targets requires a unique ID to function!
    const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId);
    ImRect r = g.DragDropTargetRect;
    float r_surface = r.GetWidth() * r.GetHeight();
    if (r_surface <= g.DragDropAcceptIdCurrRectSurface)
    {
        g.DragDropAcceptFlags = flags;
        g.DragDropAcceptIdCurr = g.DragDropTargetId;
        g.DragDropAcceptIdCurrRectSurface = r_surface;
    }

    // Render default drop visuals
    payload.Preview = was_accepted_previously;
    flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that lives for 1 frame)
    if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview)
    {
        // FIXME-DRAG: Settle on a proper default visuals for drop target.
        r.Expand(3.5f);
        bool push_clip_rect = !window->ClipRect.Contains(r);
        if (push_clip_rect) window->DrawList->PushClipRect(r.Min - ImVec2(1, 1), r.Max + ImVec2(1, 1));
        window->DrawList->AddRect(r.Min, r.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, ~0, 2.0f);
        if (push_clip_rect) window->DrawList->PopClipRect();
    }

    g.DragDropAcceptFrameCount = g.FrameCount;
    payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
    if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery))
        return NULL;

    return &payload;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x9dccc(%rip), %r15     # 0xe3ce0
cmpb $0x0, 0x2004(%r15)
je 0x46230
cmpl $-0x1, 0x202c(%r15)
je 0x4624f
movl %esi, %r13d
movq %rdi, %rsi
movq 0x1ae0(%r15), %rax
movq %rax, -0x50(%rbp)
leaq 0x2018(%r15), %rbx
testq %rdi, %rdi
je 0x4605d
movq %rbx, %rdi
callq 0x4b9c2
testb %al, %al
je 0x4620b
movl 0x2068(%r15), %r12d
movl 0x2078(%r15), %r14d
cmpl %r12d, %r14d
sete %al
movups 0x2058(%r15), %xmm0
movaps %xmm0, -0x40(%rbp)
movss -0x38(%rbp), %xmm0
movss -0x40(%rbp), %xmm3
movss -0x3c(%rbp), %xmm2
movaps %xmm0, %xmm5
subss %xmm3, %xmm5
movss -0x34(%rbp), %xmm1
movaps %xmm1, %xmm4
subss %xmm2, %xmm4
mulss %xmm5, %xmm4
movss 0x2070(%r15), %xmm5
ucomiss %xmm4, %xmm5
jb 0x460c8
movl %r13d, 0x206c(%r15)
movl %r12d, 0x2074(%r15)
movss %xmm4, 0x2070(%r15)
movl %r14d, %ecx
xorl %r12d, %ecx
movb %al, 0x2051(%r15)
movl 0x2008(%r15), %eax
orl %r13d, %eax
andl $0x800, %eax            # imm = 0x800
orl %ecx, %eax
jne 0x461d4
movl %r13d, -0x44(%rbp)
leaq -0x38(%rbp), %rax
movss 0x56830(%rip), %xmm4    # 0x9c92c
addss %xmm4, %xmm3
movss %xmm3, -0x8(%rax)
addss %xmm4, %xmm2
movss %xmm2, -0x4(%rax)
movss 0x5681a(%rip), %xmm2    # 0x9c930
addss %xmm2, %xmm0
movss %xmm0, (%rax)
addss %xmm2, %xmm1
movss %xmm1, 0x4(%rax)
movq -0x50(%rbp), %r13
leaq 0x258(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x49f2c
movb %al, -0x29(%rbp)
testb %al, %al
jne 0x46182
movss 0x55ea6(%rip), %xmm1    # 0x9bff0
movss -0x40(%rbp), %xmm0
addss %xmm1, %xmm0
addss -0x3c(%rbp), %xmm1
movq 0x2b8(%r13), %rdi
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movss 0x55e8e(%rip), %xmm2    # 0x9bff8
movss -0x38(%rbp), %xmm1
addss %xmm2, %xmm1
addss -0x34(%rbp), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
xorl %esi, %esi
callq 0x62204
movq 0x2b8(%r13), %r13
pushq $0x30
popq %rdi
movss 0x55e64(%rip), %xmm0    # 0x9bff8
callq 0x35d33
leaq -0x40(%rbp), %rsi
pushq $-0x1
popq %r8
movss 0x566eb(%rip), %xmm1    # 0x9c894
xorps %xmm0, %xmm0
movq %r13, %rdi
leaq -0x38(%rbp), %rdx
movl %eax, %ecx
callq 0x63f6c
cmpb $0x0, -0x29(%rbp)
movl -0x44(%rbp), %r13d
jne 0x461d4
movq -0x50(%rbp), %rax
movq 0x2b8(%rax), %rdi
callq 0x622f0
movl 0x1a68(%r15), %eax
movl %eax, 0x207c(%r15)
cmpl %r12d, %r14d
jne 0x4621f
movl 0x2010(%r15), %edi
callq 0x3fa7a
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x2052(%r15)
btl $0xa, %r13d
setae %cl
testb %al, %cl
je 0x4620d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x2052(%r15)
btl $0xa, %r13d
jae 0x4620b
jmp 0x4620d
leaq 0x576a9(%rip), %rdi     # 0x9d8e0
leaq 0x56f57(%rip), %rsi     # 0x9d195
leaq 0x594b9(%rip), %rcx     # 0x9f6fe
movl $0x2616, %edx           # imm = 0x2616
callq 0xc140
leaq 0x594fb(%rip), %rdi     # 0x9f751
leaq 0x56f38(%rip), %rsi     # 0x9d195
leaq 0x5949a(%rip), %rcx     # 0x9f6fe
movl $0x2617, %edx           # imm = 0x2617
callq 0xc140