// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: TableSetupColumnFlags(ImGuiTable*, ImGuiTableColumn*, int)
static void TableSetupColumnFlags(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags flags_in)
{
    ImGuiTableColumnFlags flags = flags_in;

    // Sizing Policy
    if ((flags & ImGuiTableColumnFlags_WidthMask_) == 0)
    {
        const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
        if (table_sizing_policy == ImGuiTableFlags_SizingFixedFit || table_sizing_policy == ImGuiTableFlags_SizingFixedSame)
            flags |= ImGuiTableColumnFlags_WidthFixed;
        else
            flags |= ImGuiTableColumnFlags_WidthStretch;
    }
    else
    {
        IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiTableColumnFlags_WidthMask_)); // Check that only 1 of each set is used.
    }
    
    // Resize
    if ((table->Flags & ImGuiTableFlags_Resizable) == 0)
        flags |= ImGuiTableColumnFlags_NoResize;

    // Sorting
    if ((flags & ImGuiTableColumnFlags_NoSortAscending) && (flags & ImGuiTableColumnFlags_NoSortDescending))
        flags |= ImGuiTableColumnFlags_NoSort;

    // Indentation
    if ((flags & ImGuiTableColumnFlags_IndentMask_) == 0)
        flags |= (table->Columns.index_from_ptr(column) == 0) ? ImGuiTableColumnFlags_IndentEnable : ImGuiTableColumnFlags_IndentDisable;

    // Alignment
    //if ((flags & ImGuiTableColumnFlags_AlignMask_) == 0)
    //    flags |= ImGuiTableColumnFlags_AlignCenter;
    //IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiTableColumnFlags_AlignMask_)); // Check that only 1 of each set is used.

    // Preserve status flags
    column->Flags = flags | (column->Flags & ImGuiTableColumnFlags_StatusMask_);

    // Build an ordered list of available sort directions
    column->SortDirectionsAvailCount = column->SortDirectionsAvailMask = column->SortDirectionsAvailList = 0;
    if (table->Flags & ImGuiTableFlags_Sortable)
    {
        int count = 0, mask = 0, list = 0;
        if ((flags & ImGuiTableColumnFlags_PreferSortAscending)  != 0 && (flags & ImGuiTableColumnFlags_NoSortAscending)  == 0) { mask |= 1 << ImGuiSortDirection_Ascending;  list |= ImGuiSortDirection_Ascending  << (count << 1); count++; }
        if ((flags & ImGuiTableColumnFlags_PreferSortDescending) != 0 && (flags & ImGuiTableColumnFlags_NoSortDescending) == 0) { mask |= 1 << ImGuiSortDirection_Descending; list |= ImGuiSortDirection_Descending << (count << 1); count++; }
        if ((flags & ImGuiTableColumnFlags_PreferSortAscending)  == 0 && (flags & ImGuiTableColumnFlags_NoSortAscending)  == 0) { mask |= 1 << ImGuiSortDirection_Ascending;  list |= ImGuiSortDirection_Ascending  << (count << 1); count++; }
        if ((flags & ImGuiTableColumnFlags_PreferSortDescending) == 0 && (flags & ImGuiTableColumnFlags_NoSortDescending) == 0) { mask |= 1 << ImGuiSortDirection_Descending; list |= ImGuiSortDirection_Descending << (count << 1); count++; }
        if ((table->Flags & ImGuiTableFlags_SortTristate) || count == 0) { mask |= 1 << ImGuiSortDirection_None; count++; }
        column->SortDirectionsAvailList = (ImU8)list;
        column->SortDirectionsAvailMask = (ImU8)mask;
        column->SortDirectionsAvailCount = (ImU8)count;
        ImGui::TableFixColumnSortDirection(table, column);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %eax
andl $0xc, %eax
je 0x88594
leal -0x1(%rax), %ecx
testl %ecx, %eax
jne 0x88701
movl 0x4(%rdi), %eax
jmp 0x885b7
movl 0x4(%rdi), %eax
movl %eax, %ecx
andl $0xe000, %ecx           # imm = 0xE000
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x885af
cmpl $0x2000, %ecx           # imm = 0x2000
jne 0x885b4
orl $0x8, %edx
jmp 0x885b7
orl $0x4, %edx
notl %eax
shll $0x4, %eax
andl $0x10, %eax
orl %edx, %eax
notl %edx
movl %eax, %ecx
orl $0x100, %ecx            # imm = 0x100
testl $0x600, %edx            # imm = 0x600
cmovnel %eax, %ecx
testl $0xc000, %ecx           # imm = 0xC000
jne 0x88615
movq 0x10(%rdi), %rax
cmpq %rsi, %rax
ja 0x88720
cmpq %rsi, 0x18(%rdi)
jbe 0x88720
movq %rsi, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
imull $0xc4ec4ec5, %edx, %eax # imm = 0xC4EC4EC5
xorl %edx, %edx
testl %eax, %eax
setne %dl
shll $0xe, %edx
addl %edx, %ecx
addl $0x4000, %ecx           # imm = 0x4000
movl $0xf00000, %eax         # imm = 0xF00000
andl (%rsi), %eax
orl %ecx, %eax
movl %eax, (%rsi)
movb $0x0, 0x65(%rsi)
movb 0x64(%rsi), %al
andb $0x3, %al
movb %al, 0x64(%rsi)
movl 0x4(%rdi), %edx
testb $0x8, %dl
jne 0x8863d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %r11d
andl $0x1200, %r11d          # imm = 0x1200
xorl %ebx, %ebx
cmpl $0x1000, %r11d          # imm = 0x1000
sete %bl
movl $0x8, %r8d
movl $0x2, %r14d
cmovel %r8d, %r14d
leal (%rbx,%rbx), %r10d
andl $0x2400, %ecx           # imm = 0x2400
leal 0x4(%r10), %r15d
leal 0x1(%rbx), %r8d
xorl %r9d, %r9d
cmpl $0x2000, %ecx           # imm = 0x2000
cmovnel %ebx, %r8d
movzbl %r10b, %r12d
movzbl %r15b, %r10d
cmovnel %r12d, %r10d
cmovel %r14d, %r9d
orl %ebx, %r9d
testl %r11d, %r11d
jne 0x886a9
orb $0x2, %r10b
leal (%r8,%r8), %r11d
btsl %r11d, %r9d
incl %r8d
testl %ecx, %ecx
jne 0x886c4
leal (%r8,%r8), %ecx
movl $0x2, %r11d
shll %cl, %r11d
orb $0x4, %r10b
orl %r11d, %r9d
incl %r8d
shrl $0x1b, %edx
andl $0x1, %edx
testl %r8d, %r8d
sete %cl
orb %dl, %cl
movzbl %cl, %ecx
addl %ecx, %r8d
orb %r10b, %cl
movb %r9b, 0x65(%rsi)
shlb $0x4, %cl
shlb $0x2, %r8b
andb $0xc, %r8b
orb %cl, %r8b
orb %al, %r8b
movb %r8b, 0x64(%rsi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8c147
leaq 0x47ffc(%rip), %rdi     # 0xd0704
leaq 0x4677b(%rip), %rsi     # 0xcee8a
leaq 0x48027(%rip), %rcx     # 0xd073d
movl $0x27c, %edx            # imm = 0x27C
callq 0xc140
leaq 0x4806a(%rip), %rdi     # 0xd0791
leaq 0x30f11(%rip), %rsi     # 0xb963f
leaq 0x48077(%rip), %rcx     # 0xd07ac
movl $0x217, %edx            # imm = 0x217
callq 0xc140