// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::SetDragDropPayload(char const*, void const*, unsigned long, int)
bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_size, ImGuiCond cond)
{
    ImGuiContext& g = *GImGui;
    ImGuiPayload& payload = g.DragDropPayload;
    if (cond == 0)
        cond = ImGuiCond_Always;

    IM_ASSERT(type != NULL);
    IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long");
    IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0));
    IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once);
    IM_ASSERT(payload.SourceId != 0);                               // Not called between BeginDragDropSource() and EndDragDropSource()

    if (cond == ImGuiCond_Always || payload.DataFrameCount == -1)
    {
        // Copy payload
        ImStrncpy(payload.DataType, type, IM_ARRAYSIZE(payload.DataType));
        g.DragDropPayloadBufHeap.resize(0);
        if (data_size > sizeof(g.DragDropPayloadBufLocal))
        {
            // Store in heap
            g.DragDropPayloadBufHeap.resize((int)data_size);
            payload.Data = g.DragDropPayloadBufHeap.Data;
            memcpy(payload.Data, data, data_size);
        }
        else if (data_size > 0)
        {
            // Store locally
            memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal));
            payload.Data = g.DragDropPayloadBufLocal;
            memcpy(payload.Data, data, data_size);
        }
        else
        {
            payload.Data = NULL;
        }
        payload.DataSize = (int)data_size;
    }
    payload.DataFrameCount = g.FrameCount;

    return (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x45da2
movl %ecx, %r12d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x9e03f(%rip), %r13     # 0xe3ce0
callq 0xc380
cmpq $0x21, %rax
jae 0x45dc1
testq %r14, %r14
setne %al
testq %rbx, %rbx
setne %cl
testb %cl, %al
jne 0x45cd2
testq %r14, %r14
jne 0x45e1e
testq %rbx, %rbx
jne 0x45e1e
cmpl $0x3, %r12d
jae 0x45de0
cmpl $0x0, 0x2024(%r13)
je 0x45dff
cmpl $0x2, %r12d
jb 0x45cfa
cmpl $-0x1, 0x202c(%r13)
jne 0x45d66
leaq 0x2030(%r13), %rdi
pushq $0x21
popq %rdx
movq %r15, %rsi
callq 0x343b1
leaq 0x2088(%r13), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x4b984
cmpq $0x11, %rbx
jb 0x45d36
movq %r15, %rdi
movl %ebx, %esi
callq 0x4b984
movq 0x2090(%r13), %rdi
jmp 0x45d4d
testq %rbx, %rbx
je 0x45d98
leaq 0x2098(%r13), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x2098(%r13)
movq %rdi, 0x2018(%r13)
movq %r14, %rsi
movq %rbx, %rdx
callq 0xc080
movl %ebx, 0x2020(%r13)
movl 0x1a68(%r13), %eax
movl %eax, 0x202c(%r13)
movl 0x207c(%r13), %ecx
cmpl %eax, %ecx
sete %dl
decl %eax
cmpl %eax, %ecx
sete %al
orb %dl, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andq $0x0, 0x2018(%r13)
jmp 0x45d5f
leaq 0x59763(%rip), %rdi     # 0x9f50c
leaq 0x573e5(%rip), %rsi     # 0x9d195
leaq 0x59764(%rip), %rcx     # 0x9f51b
movl $0x25b1, %edx           # imm = 0x25B1
callq 0xc140
leaq 0x597a1(%rip), %rdi     # 0x9f569
leaq 0x573c6(%rip), %rsi     # 0x9d195
leaq 0x59745(%rip), %rcx     # 0x9f51b
movl $0x25b2, %edx           # imm = 0x25B2
callq 0xc140
leaq 0x5984d(%rip), %rdi     # 0x9f634
leaq 0x573a7(%rip), %rsi     # 0x9d195
leaq 0x59726(%rip), %rcx     # 0x9f51b
movl $0x25b4, %edx           # imm = 0x25B4
callq 0xc140
leaq 0x59861(%rip), %rdi     # 0x9f667
leaq 0x57388(%rip), %rsi     # 0x9d195
leaq 0x59707(%rip), %rcx     # 0x9f51b
movl $0x25b5, %edx           # imm = 0x25B5
callq 0xc140
leaq 0x597c7(%rip), %rdi     # 0x9f5ec
leaq 0x57369(%rip), %rsi     # 0x9d195
leaq 0x596e8(%rip), %rcx     # 0x9f51b
movl $0x25b3, %edx           # imm = 0x25B3
callq 0xc140