// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImDrawData::DeIndexAllBuffers()
void ImDrawData::DeIndexAllBuffers()
{
    ImVector<ImDrawVert> new_vtx_buffer;
    TotalVtxCount = TotalIdxCount = 0;
    for (int i = 0; i < CmdListsCount; i++)
    {
        ImDrawList* cmd_list = CmdLists[i];
        if (cmd_list->IdxBuffer.empty())
            continue;
        new_vtx_buffer.resize(cmd_list->IdxBuffer.Size);
        for (int j = 0; j < cmd_list->IdxBuffer.Size; j++)
            new_vtx_buffer[j] = cmd_list->VtxBuffer[cmd_list->IdxBuffer[j]];
        cmd_list->VtxBuffer.swap(new_vtx_buffer);
        cmd_list->IdxBuffer.resize(0);
        TotalVtxCount += cmd_list->VtxBuffer.Size;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, 0x14(%rdi)
cmpl $0x0, 0x10(%rdi)
jle 0x7c561
xorl %r12d, %r12d
movq %rdi, -0x48(%rbp)
movq 0x8(%rdi), %rax
movq (%rax,%r12,8), %r13
movl 0x10(%r13), %r15d
testl %r15d, %r15d
je 0x7c551
movl -0x3c(%rbp), %eax
cmpl %r15d, %eax
jge 0x7c463
testl %eax, %eax
je 0x7c40f
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
addl %eax, %ebx
jmp 0x7c414
movl $0x8, %ebx
cmpl %r15d, %ebx
cmovlel %r15d, %ebx
cmpl %ebx, %eax
jge 0x7c463
movslq %ebx, %rax
shlq $0x2, %rax
leaq (%rax,%rax,4), %rdi
callq 0x424fb
movq %rax, %r14
movq -0x38(%rbp), %rsi
testq %rsi, %rsi
je 0x7c458
movslq -0x40(%rbp), %rax
shlq $0x2, %rax
leaq (%rax,%rax,4), %rdx
movq %r14, %rdi
callq 0xc080
movq -0x38(%rbp), %rdi
callq 0x425d4
movq %r14, -0x38(%rbp)
movl %ebx, -0x3c(%rbp)
movq -0x48(%rbp), %rdi
movl %r15d, -0x40(%rbp)
cmpl $0x0, 0x10(%r13)
jle 0x7c4c4
movq -0x38(%rbp), %rax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
xorl %edx, %edx
movq 0x18(%r13), %rsi
movzwl (%rsi,%rdx,2), %esi
cmpl %esi, 0x20(%r13)
jle 0x7c57e
cmpq %rdx, %rcx
je 0x7c57e
movq 0x28(%r13), %r9
leaq (%rsi,%rsi,4), %rsi
movl 0x10(%r9,%rsi,4), %r8d
movl %r8d, 0x10(%rax)
movups (%r9,%rsi,4), %xmm0
movups %xmm0, (%rax)
incq %rdx
movslq 0x10(%r13), %rsi
addq $0x14, %rax
cmpq %rsi, %rdx
jl 0x7c480
movl 0x20(%r13), %eax
movl %eax, -0x40(%rbp)
movl %r15d, 0x20(%r13)
movl -0x3c(%rbp), %eax
movl 0x24(%r13), %ecx
movl %ecx, -0x3c(%rbp)
movl %eax, 0x24(%r13)
movq -0x38(%rbp), %rax
movq 0x28(%r13), %rcx
movq %rcx, -0x38(%rbp)
movq %rax, 0x28(%r13)
movl 0x14(%r13), %eax
testl %eax, %eax
jns 0x7c542
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
addl %eax, %ebx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
leal (%rbx,%rbx), %edi
callq 0x424fb
movq %rax, %r14
movq 0x18(%r13), %rsi
testq %rsi, %rsi
je 0x7c536
movslq 0x10(%r13), %rdx
addq %rdx, %rdx
movq %r14, %rdi
callq 0xc080
movq 0x18(%r13), %rdi
callq 0x425d4
movq %r14, 0x18(%r13)
movl %ebx, 0x14(%r13)
movq -0x48(%rbp), %rdi
movl $0x0, 0x10(%r13)
movl 0x20(%r13), %eax
addl %eax, 0x18(%rdi)
incq %r12
movslq 0x10(%rdi), %rax
cmpq %rax, %r12
jl 0x7c3e1
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x7c56f
callq 0x425d4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f0f3(%rip), %rdi     # 0xbb678
leaq 0x3f0ff(%rip), %rsi     # 0xbb68b
leaq 0x54664(%rip), %rcx     # 0xd0bf7
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
movq %rax, %rdi
callq 0x3a5b4
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x87c02
movq %rbx, %rdi
callq 0xc560
nop