// File: /workspace/github_cpp_makefile_star2_O1/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 0x8ad85
movq %rdi, %rbx
callq 0x8e0da
movl 0x214(%rbx), %eax
movl 0x230(%rbx), %ecx
xorl %edx, %edx
cmpb $0x2, %cl
cmovgel %ecx, %edx
movsbl %dl, %r15d
cmpl %r15d, %eax
jge 0x8ac75
testl %eax, %eax
je 0x8ac13
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
addl %eax, %r12d
jmp 0x8ac19
movl $0x8, %r12d
cmpl %r15d, %r12d
cmovlel %r15d, %r12d
cmpl %r12d, %eax
jge 0x8ac75
movslq %r12d, %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x424fb
movq %rax, %r14
movq 0x218(%rbx), %rsi
testq %rsi, %rsi
je 0x8ac67
movslq 0x210(%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdx
movq %r14, %rdi
callq 0xc080
movq 0x218(%rbx), %rdi
callq 0x425d4
movq %r14, 0x218(%rbx)
movl %r12d, 0x214(%rbx)
movl %r15d, 0x210(%rbx)
movzbl 0x230(%rbx), %eax
testl %eax, %eax
je 0x8ac95
cmpl $0x1, %eax
jne 0x8ac99
leaq 0x200(%rbx), %rax
jmp 0x8aca0
xorl %eax, %eax
jmp 0x8aca0
movq 0x218(%rbx), %rax
cmpl $0x0, 0x6c(%rbx)
jle 0x8ad1c
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movq 0x10(%rbx), %rdi
leaq (%rdi,%rcx), %r8
cmpq 0x18(%rbx), %r8
jae 0x8ad47
movsbq 0x56(%rdi,%rcx), %r8
cmpq $-0x1, %r8
je 0x8ad06
cmpb 0x230(%rbx), %r8b
jge 0x8ad66
leaq (%r8,%r8,2), %r9
movl 0x30(%rdi,%rcx), %r10d
movl %r10d, (%rax,%r9,4)
movswl %dx, %r10d
shrl $0x8, %r10d
movw %r10w, 0x4(%rax,%r9,4)
movw %r8w, 0x6(%rax,%r9,4)
movb 0x64(%rdi,%rcx), %dil
andb $0x3, %dil
movb %dil, 0x8(%rax,%r9,4)
incq %rsi
movslq 0x6c(%rbx), %rdi
addl $0x100, %edx            # imm = 0x100
addq $0x68, %rcx
cmpq %rdi, %rsi
jl 0x8acac
movq %rax, 0x220(%rbx)
movsbl 0x230(%rbx), %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 0x3196a(%rip), %rdi     # 0xbc6b8
leaq 0x308ea(%rip), %rsi     # 0xbb63f
leaq 0x31975(%rip), %rcx     # 0xbc6d1
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x4713a(%rip), %rdi     # 0xd1ea7
leaq 0x46146(%rip), %rsi     # 0xd0eba
leaq 0x470fe(%rip), %rcx     # 0xd1e79
movl $0xa60, %edx            # imm = 0xA60
callq 0xc140
leaq 0x470d5(%rip), %rdi     # 0xd1e61
leaq 0x46127(%rip), %rsi     # 0xd0eba
leaq 0x470df(%rip), %rcx     # 0xd1e79
movl $0xa55, %edx            # imm = 0xA55
callq 0xc140