// File: /workspace/github_cpp_makefile_star2_O3/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, -0x50(%rbp)
movq $0x0, 0x14(%rdi)
movq %rdi, -0x40(%rbp)
movl 0x10(%rdi), %eax
testl %eax, %eax
jle 0x7ac5b
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
xorl %ebx, %ebx
xorl %r12d, %r12d
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx,%r12,8), %r13
movl 0x10(%r13), %r14d
testl %r14d, %r14d
je 0x7ac3e
cmpl %r14d, %ebx
jge 0x7ab05
testl %ebx, %ebx
je 0x7ab0e
movl %ebx, %eax
shrl $0x1f, %eax
addl %ebx, %eax
sarl %eax
addl %eax, %ebx
jmp 0x7ab13
movq -0x30(%rbp), %r9
movl %r14d, %eax
jmp 0x7ab63
movl $0x8, %ebx
cmpl %r14d, %ebx
cmovlel %r14d, %ebx
movslq %ebx, %rax
shlq $0x2, %rax
leaq (%rax,%rax,4), %rdi
callq 0x41c63
movq %rax, %r9
cmpq $0x0, -0x30(%rbp)
je 0x7ab5f
movslq -0x38(%rbp), %rax
shlq $0x2, %rax
leaq (%rax,%rax,4), %rdx
movq %r9, %rdi
movq -0x30(%rbp), %r15
movq %r15, %rsi
movq %r9, -0x38(%rbp)
callq 0xc080
movq %r15, %rdi
callq 0x41d3c
movq -0x38(%rbp), %r9
movl 0x10(%r13), %eax
testl %eax, %eax
jle 0x7abbb
testl %r14d, %r14d
movl $0x0, %eax
cmovgl %r14d, %eax
movq %r9, %rcx
xorl %edx, %edx
movq 0x18(%r13), %rsi
movzwl (%rsi,%rdx,2), %esi
cmpl %esi, 0x20(%r13)
jle 0x7ac6a
cmpq %rdx, %rax
je 0x7ac6a
movq 0x28(%r13), %rdi
leaq (%rsi,%rsi,4), %rsi
movl 0x10(%rdi,%rsi,4), %r8d
movl %r8d, 0x10(%rcx)
movups (%rdi,%rsi,4), %xmm0
movups %xmm0, (%rcx)
incq %rdx
movslq 0x10(%r13), %rsi
addq $0x14, %rcx
cmpq %rsi, %rdx
jl 0x7ab78
movl 0x20(%r13), %eax
movq %rax, -0x38(%rbp)
movl %eax, -0x50(%rbp)
movl %r14d, 0x20(%r13)
movl 0x24(%r13), %r15d
movl %r15d, -0x4c(%rbp)
movl %ebx, 0x24(%r13)
movq 0x28(%r13), %rcx
movq %rcx, -0x30(%rbp)
movq %rcx, -0x48(%rbp)
movq %r9, 0x28(%r13)
cmpl $0x0, 0x14(%r13)
jns 0x7ac28
xorl %edi, %edi
callq 0x41c63
movq %rax, %rbx
movq 0x18(%r13), %rsi
testq %rsi, %rsi
je 0x7ac18
movslq 0x10(%r13), %rdx
addq %rdx, %rdx
movq %rbx, %rdi
callq 0xc080
movq 0x18(%r13), %rdi
callq 0x41d3c
movq %rbx, 0x18(%r13)
movl $0x0, 0x14(%r13)
movl 0x20(%r13), %r14d
movl $0x0, 0x10(%r13)
movq -0x40(%rbp), %rax
addl %r14d, 0x18(%rax)
movl 0x10(%rax), %eax
movl %r15d, %ebx
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x7aad6
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x7ac5b
callq 0x41d3c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ea07(%rip), %rdi     # 0xb9678
leaq 0x3ea13(%rip), %rsi     # 0xb968b
leaq 0x53f14(%rip), %rcx     # 0xceb93
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
movq %rax, %rdi
callq 0x39dbe
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x85f02
movq %rbx, %rdi
callq 0xc560
nop