// File: /workspace/github_cpp_makefile_star2_O3/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 0xa3340(%rip), %rbx     # 0xfbcd0
cmpb $0x0, 0x2004(%rbx)
je 0x58bdf
cmpl $-0x1, 0x202c(%rbx)
je 0x58bfe
movl %esi, %r12d
movq 0x1ae0(%rbx), %r13
testq %rdi, %rdi
je 0x589cd
leaq 0x2030(%rbx), %rsi
callq 0xc720
testl %eax, %eax
jne 0x58bb4
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), %xmm3
movaps %xmm1, %xmm5
subss %xmm0, %xmm5
movss -0x34(%rbp), %xmm2
movaps %xmm2, %xmm4
subss %xmm3, %xmm4
mulss %xmm5, %xmm4
movss 0x2070(%rbx), %xmm5
ucomiss %xmm4, %xmm5
jb 0x58a35
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 0x58b6f
movl %r12d, -0x48(%rbp)
leaq -0x38(%rbp), %rax
movss 0x5ce91(%rip), %xmm4    # 0xb58f8
addss %xmm4, %xmm0
movss %xmm0, -0x8(%rax)
addss %xmm4, %xmm3
movss %xmm3, -0x4(%rax)
movss 0x5ce7b(%rip), %xmm4    # 0xb58fc
addss %xmm4, %xmm1
movss %xmm1, (%rax)
addss %xmm4, %xmm2
movss %xmm2, 0x4(%rax)
ucomiss 0x258(%r13), %xmm0
jb 0x58ac8
ucomiss 0x25c(%r13), %xmm3
jb 0x58ac8
movss 0x260(%r13), %xmm4
ucomiss %xmm1, %xmm4
jb 0x58ac8
movss 0x264(%r13), %xmm4
movb $0x1, %r12b
ucomiss %xmm2, %xmm4
movq %rbx, %rax
jae 0x58b06
movq 0x2b8(%r13), %rdi
movss 0x5c4f9(%rip), %xmm4    # 0xb4fd0
addss %xmm4, %xmm0
addss %xmm4, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movss 0x5c4fa(%rip), %xmm3    # 0xb4fe4
addss %xmm3, %xmm1
addss %xmm3, %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x75b8a
movq 0xa31ca(%rip), %rax     # 0xfbcd0
movl %r12d, -0x44(%rbp)
movq 0x2b8(%r13), %r12
movups 0x1924(%rax), %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42601
leaq -0x40(%rbp), %rsi
movss 0x5cd26(%rip), %xmm1    # 0xb5868
xorps %xmm0, %xmm0
movq %r12, %rdi
leaq -0x38(%rbp), %rdx
movl %eax, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x7851c
cmpb $0x0, -0x44(%rbp)
movl -0x48(%rbp), %r12d
jne 0x58b6f
movq 0x2b8(%r13), %rdi
callq 0x75d0e
movl 0x1a68(%rbx), %eax
movl %eax, 0x207c(%rbx)
cmpl %r15d, %r14d
jne 0x58bb8
movl 0x2010(%rbx), %eax
cmpq $0x5, %rax
jae 0x58c1d
movq 0xa3139(%rip), %rcx     # 0xfbcd0
movb 0x130(%rcx,%rax), %al
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x2052(%rbx)
btl $0xa, %r12d
jb 0x58bc6
testb %al, %al
je 0x58bc6
xorl %ebx, %ebx
jmp 0x58bcd
movb $0x0, 0x2052(%rbx)
btl $0xa, %r12d
jae 0x58bb4
addq $0x2018, %rbx           # imm = 0x2018
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5dcca(%rip), %rdi     # 0xb68b0
leaq 0x5d578(%rip), %rsi     # 0xb6165
leaq 0x5fada(%rip), %rcx     # 0xb86ce
movl $0x2616, %edx           # imm = 0x2616
callq 0xc140
leaq 0x5fb1c(%rip), %rdi     # 0xb8721
leaq 0x5d559(%rip), %rsi     # 0xb6165
leaq 0x5fabb(%rip), %rcx     # 0xb86ce
movl $0x2617, %edx           # imm = 0x2617
callq 0xc140
leaq 0x5e122(%rip), %rdi     # 0xb6d46
leaq 0x5d53a(%rip), %rsi     # 0xb6165
leaq 0x5e168(%rip), %rcx     # 0xb6d9a
movl $0x11be, %edx           # imm = 0x11BE
callq 0xc140