// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq 0xa41b7(%rip), %rbx     # 0xfdcd0
cmpb $0x0, 0x2004(%rbx)
je 0x59d79
cmpl $-0x1, 0x202c(%rbx)
je 0x59d98
movl %esi, %r12d
movq 0x1ae0(%rbx), %r13
testq %rdi, %rdi
je 0x59b63
cmpl $-0x1, 0x202c(%rbx)
je 0x59d3a
leaq 0x2030(%rbx), %rsi
callq 0xc720
testl %eax, %eax
jne 0x59d3a
movl 0x2068(%rbx), %r15d
movl 0x2078(%rbx), %r14d
cmpl %r15d, %r14d
sete %al
movups 0x2058(%rbx), %xmm0
movaps %xmm0, -0x40(%rbp)
movss -0x38(%rbp), %xmm1
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm2
movaps %xmm1, %xmm5
subss %xmm0, %xmm5
movss -0x34(%rbp), %xmm3
movaps %xmm3, %xmm4
subss %xmm2, %xmm4
mulss %xmm5, %xmm4
movss 0x2070(%rbx), %xmm5
ucomiss %xmm4, %xmm5
jb 0x59bcb
movl %r12d, 0x206c(%rbx)
movl %r15d, 0x2074(%rbx)
movss %xmm4, 0x2070(%rbx)
movl %r14d, %ecx
xorl %r15d, %ecx
movb %al, 0x2051(%rbx)
movl 0x2008(%rbx), %eax
orl %r12d, %eax
andl $0x800, %eax            # imm = 0x800
orl %ecx, %eax
jne 0x59cf5
movss 0x5dd03(%rip), %xmm4    # 0xb78f8
addss %xmm4, %xmm0
movss %xmm0, -0x40(%rbp)
addss %xmm4, %xmm2
movss %xmm2, -0x3c(%rbp)
movss 0x5dced(%rip), %xmm4    # 0xb78fc
addss %xmm4, %xmm1
movss %xmm1, -0x38(%rbp)
addss %xmm4, %xmm3
movss %xmm3, -0x34(%rbp)
ucomiss 0x258(%r13), %xmm0
jb 0x59c47
ucomiss 0x25c(%r13), %xmm2
jb 0x59c47
movss 0x260(%r13), %xmm4
ucomiss %xmm1, %xmm4
jae 0x59d65
xorl %eax, %eax
movl %r12d, -0x48(%rbp)
movl %eax, -0x44(%rbp)
testb %al, %al
jne 0x59c89
movq 0x2b8(%r13), %rdi
movss 0x5d36d(%rip), %xmm3    # 0xb6fd0
addss %xmm3, %xmm0
addss %xmm3, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movss 0x5d36e(%rip), %xmm2    # 0xb6fe4
addss %xmm2, %xmm1
addss -0x34(%rbp), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
xorl %esi, %esi
callq 0x77162
movq 0x2b8(%r13), %r12
movq 0xa4039(%rip), %rax     # 0xfdcd0
movups 0x1924(%rax), %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42e9e
leaq -0x40(%rbp), %rsi
movss 0x5dba0(%rip), %xmm1    # 0xb7868
xorps %xmm0, %xmm0
movq %r12, %rdi
leaq -0x38(%rbp), %rdx
movl %eax, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x79c80
cmpb $0x0, -0x44(%rbp)
movl -0x48(%rbp), %r12d
jne 0x59cf5
movq 0x2b8(%r13), %rdi
callq 0x772e8
movl 0x1a68(%rbx), %eax
movl %eax, 0x207c(%rbx)
cmpl %r15d, %r14d
jne 0x59d3e
movl 0x2010(%rbx), %eax
cmpq $0x5, %rax
jae 0x59db7
movq 0xa3fb3(%rip), %rcx     # 0xfdcd0
movb 0x130(%rcx,%rax), %al
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x2052(%rbx)
btl $0xa, %r12d
jb 0x59d4c
testb %al, %al
je 0x59d4c
xorl %ebx, %ebx
jmp 0x59d53
movb $0x0, 0x2052(%rbx)
btl $0xa, %r12d
jae 0x59d3a
addq $0x2018, %rbx           # imm = 0x2018
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movss 0x264(%r13), %xmm4
ucomiss %xmm3, %xmm4
setae %al
jmp 0x59c49
leaq 0x5eb30(%rip), %rdi     # 0xb88b0
leaq 0x5e3de(%rip), %rsi     # 0xb8165
leaq 0x60940(%rip), %rcx     # 0xba6ce
movl $0x2616, %edx           # imm = 0x2616
callq 0xc140
leaq 0x60982(%rip), %rdi     # 0xba721
leaq 0x5e3bf(%rip), %rsi     # 0xb8165
leaq 0x60921(%rip), %rcx     # 0xba6ce
movl $0x2617, %edx           # imm = 0x2617
callq 0xc140
leaq 0x5ef88(%rip), %rdi     # 0xb8d46
leaq 0x5e3a0(%rip), %rsi     # 0xb8165
leaq 0x5efce(%rip), %rcx     # 0xb8d9a
movl $0x11be, %edx           # imm = 0x11BE
callq 0xc140