// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableSortSpecsBuild(ImGuiTable*)
void ImGui::TableSortSpecsBuild(ImGuiTable* table)
{
    IM_ASSERT(table->IsSortSpecsDirty);
    TableSortSpecsSanitize(table);

    // Write output
    table->SortSpecsMulti.resize(table->SortSpecsCount <= 1 ? 0 : table->SortSpecsCount);
    ImGuiTableColumnSortSpecs* sort_specs = (table->SortSpecsCount == 0) ? NULL : (table->SortSpecsCount == 1) ? &table->SortSpecsSingle : table->SortSpecsMulti.Data;
    for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
    {
        ImGuiTableColumn* column = &table->Columns[column_n];
        if (column->SortOrder == -1)
            continue;
        IM_ASSERT(column->SortOrder < table->SortSpecsCount);
        ImGuiTableColumnSortSpecs* sort_spec = &sort_specs[column->SortOrder];
        sort_spec->ColumnUserID = column->UserID;
        sort_spec->ColumnIndex = (ImGuiTableColumnIdx)column_n;
        sort_spec->SortOrder = (ImGuiTableColumnIdx)column->SortOrder;
        sort_spec->SortDirection = column->SortDirection;
    }
    table->SortSpecs.Specs = sort_specs;
    table->SortSpecs.SpecsCount = table->SortSpecsCount;
    table->SortSpecs.SpecsDirty = true; // Mark as dirty for user
    table->IsSortSpecsDirty = false; // Mark as not dirty for us
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x0, 0x24b(%rdi)
je 0x89140
movq %rdi, %rbx
callq 0x8c3cc
movl 0x214(%rbx), %eax
movl 0x230(%rbx), %ecx
xorl %edx, %edx
cmpb $0x2, %cl
cmovgel %ecx, %edx
movsbl %dl, %r15d
cmpl %r15d, %eax
jge 0x8902f
testl %eax, %eax
je 0x88fcc
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
addl %eax, %r12d
jmp 0x88fd2
movl $0x8, %r12d
cmpl %r15d, %r12d
cmovlel %r15d, %r12d
movslq %r12d, %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x41c63
movq %rax, %r14
movq 0x218(%rbx), %rsi
testq %rsi, %rsi
je 0x8901b
movslq 0x210(%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdx
movq %r14, %rdi
callq 0xc080
movq 0x218(%rbx), %rdi
callq 0x41d3c
movq %r14, 0x218(%rbx)
movl %r12d, 0x214(%rbx)
movb 0x230(%rbx), %cl
movl %r15d, 0x210(%rbx)
testb %cl, %cl
je 0x8904b
movzbl %cl, %eax
cmpl $0x1, %eax
jne 0x8904f
leaq 0x200(%rbx), %rax
jmp 0x89056
xorl %eax, %eax
jmp 0x89056
movq 0x218(%rbx), %rax
movl 0x6c(%rbx), %edi
testl %edi, %edi
jle 0x890db
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movq 0x10(%rbx), %r8
leaq (%r8,%rcx), %r9
cmpq 0x18(%rbx), %r9
jae 0x89102
movsbq 0x56(%r8,%rcx), %r9
cmpq $-0x1, %r9
je 0x890c0
cmpb 0x230(%rbx), %r9b
jge 0x89121
leaq (%r9,%r9,2), %rdi
movl 0x30(%r8,%rcx), %r10d
movl %r10d, (%rax,%rdi,4)
movswl %dx, %r10d
shrl $0x8, %r10d
movw %r10w, 0x4(%rax,%rdi,4)
movw %r9w, 0x6(%rax,%rdi,4)
movb 0x64(%r8,%rcx), %r8b
andb $0x3, %r8b
movb %r8b, 0x8(%rax,%rdi,4)
movl 0x6c(%rbx), %edi
incq %rsi
movslq %edi, %r8
addl $0x100, %edx            # imm = 0x100
addq $0x68, %rcx
cmpq %r8, %rsi
jl 0x89063
movb 0x230(%rbx), %cl
movq %rax, 0x220(%rbx)
movsbl %cl, %eax
movl %eax, 0x228(%rbx)
movb $0x1, 0x22c(%rbx)
movb $0x0, 0x24b(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x315af(%rip), %rdi     # 0xba6b8
leaq 0x3052f(%rip), %rsi     # 0xb963f
leaq 0x315ba(%rip), %rcx     # 0xba6d1
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x46d4f(%rip), %rdi     # 0xcfe77
leaq 0x45d5b(%rip), %rsi     # 0xcee8a
leaq 0x46d13(%rip), %rcx     # 0xcfe49
movl $0xa60, %edx            # imm = 0xA60
callq 0xc140
leaq 0x46cea(%rip), %rdi     # 0xcfe31
leaq 0x45d3c(%rip), %rsi     # 0xcee8a
leaq 0x46cf4(%rip), %rcx     # 0xcfe49
movl $0xa55, %edx            # imm = 0xA55
callq 0xc140