// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: AddDrawListToDrawData(ImVector<ImDrawList*>*, ImDrawList*)
static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
{
    // Remove trailing command if unused.
    // Technically we could return directly instead of popping, but this make things looks neat in Metrics/Debugger window as well.
    draw_list->_PopUnusedDrawCmd();
    if (draw_list->CmdBuffer.Size == 0)
        return;

    // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
    // May trigger for you if you are using PrimXXX functions incorrectly.
    IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size);
    IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size);
    if (!(draw_list->Flags & ImDrawListFlags_AllowVtxOffset))
        IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size);

    // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
    // If this assert triggers because you are drawing lots of stuff manually:
    // - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
    //   Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics/Debugger window to inspect draw list contents.
    // - If you want large meshes with more than 64K vertices, you can either:
    //   (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
    //       Most example backends already support this from 1.71. Pre-1.71 backends won't.
    //       Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
    //   (B) Or handle 32-bit indices in your renderer backend, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
    //       Most example backends already support this. For example, the OpenGL example code detect index size at compile-time:
    //         glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
    //       Your own engine or render API may use different parameters or function calls to specify index sizes.
    //       2 and 4 bytes indices are generally supported by most graphics API.
    // - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
    //   the 64K limit to split your draw commands in multiple draw lists.
    if (sizeof(ImDrawIdx) == 2)
        IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above");

    out_list->push_back(draw_list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x7590a
cmpl $0x0, (%r14)
je 0x513cb
movslq 0x20(%r14), %rax
testq %rax, %rax
je 0x512e7
leaq (%rax,%rax,4), %rcx
shlq $0x2, %rcx
addq 0x28(%r14), %rcx
cmpq %rcx, 0x48(%r14)
jne 0x513f3
movslq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x51301
addq %rcx, %rcx
addq 0x18(%r14), %rcx
cmpq %rcx, 0x50(%r14)
jne 0x51412
testb $0x8, 0x30(%r14)
movl 0x34(%r14), %ecx
jne 0x51316
cmpl %eax, %ecx
movl %eax, %ecx
jne 0x51431
cmpl $0x10000, %ecx          # imm = 0x10000
jae 0x513d4
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
jne 0x5133e
leal 0x1(%rax), %r12d
testl %eax, %eax
je 0x51344
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl %eax, %ecx
jmp 0x51349
movq 0x8(%rbx), %r15
jmp 0x513c3
movl $0x8, %ecx
cmpl %r12d, %ecx
cmovgl %ecx, %r12d
movslq %r12d, %rdi
shlq $0x3, %rdi
movq 0xaa972(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x51369
incl 0x3b4(%rax)
movq 0xaa970(%rip), %rsi     # 0xfbce0
callq *0xa619a(%rip)          # 0xf7510
movq %rax, %r15
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x513b9
movslq (%rbx), %rdx
shlq $0x3, %rdx
movq %r15, %rdi
callq 0xc080
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x513ac
movq 0xaa92f(%rip), %rax     # 0xfbcd0
testq %rax, %rax
je 0x513ac
decl 0x3b4(%rax)
movq 0xaa92d(%rip), %rsi     # 0xfbce0
callq *0xa615f(%rip)          # 0xf7518
movq %r15, 0x8(%rbx)
movl %r12d, 0x4(%rbx)
movl (%rbx), %eax
cltq
movq %r14, (%r15,%rax,8)
incl (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x684ab(%rip), %rdi     # 0xb9886
leaq 0x64d83(%rip), %rsi     # 0xb6165
leaq 0x683ab(%rip), %rcx     # 0xb9794
movl $0x1041, %edx           # imm = 0x1041
callq 0xc140
leaq 0x68327(%rip), %rdi     # 0xb9721
leaq 0x64d64(%rip), %rsi     # 0xb6165
leaq 0x6838c(%rip), %rcx     # 0xb9794
movl $0x102c, %edx           # imm = 0x102C
callq 0xc140
leaq 0x683be(%rip), %rdi     # 0xb97d7
leaq 0x64d45(%rip), %rsi     # 0xb6165
leaq 0x6836d(%rip), %rcx     # 0xb9794
movl $0x102d, %edx           # imm = 0x102D
callq 0xc140
leaq 0x68412(%rip), %rdi     # 0xb984a
leaq 0x64d26(%rip), %rsi     # 0xb6165
leaq 0x6834e(%rip), %rcx     # 0xb9794
movl $0x102f, %edx           # imm = 0x102F
callq 0xc140