// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %eax
andl $0xc, %eax
je 0x72138
leal -0x1(%rax), %ecx
testl %ecx, %eax
jne 0x72292
movl 0x4(%r14), %eax
jmp 0x7215b
movl 0x4(%r14), %eax
movl %eax, %ecx
andl $0xe000, %ecx           # imm = 0xE000
cmpw $0x4000, %cx            # imm = 0x4000
je 0x72153
cmpl $0x2000, %ecx           # imm = 0x2000
jne 0x72158
orl $0x8, %edx
jmp 0x7215b
orl $0x4, %edx
notl %eax
shll $0x4, %eax
andl $0x10, %eax
orl %edx, %eax
notl %edx
movl %eax, %r15d
orl $0x100, %r15d           # imm = 0x100
testw $0x600, %dx             # imm = 0x600
cmovnel %eax, %r15d
testw $0xc000, %r15w          # imm = 0xC000
jne 0x721a2
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x78d76
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
shll $0xe, %ecx
addl %ecx, %r15d
addl $0x4000, %r15d          # imm = 0x4000
movl $0xf00000, %eax         # imm = 0xF00000
andl (%rbx), %eax
orl %r15d, %eax
movl %eax, (%rbx)
movb $0x0, 0x65(%rbx)
movb 0x64(%rbx), %al
andb $0x3, %al
movb %al, 0x64(%rbx)
movl 0x4(%r14), %edx
testb $0x8, %dl
jne 0x721d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, %ecx
andl $0x1200, %ecx           # imm = 0x1200
xorl %r10d, %r10d
cmpl $0x1000, %ecx           # imm = 0x1000
sete %r10b
pushq $0x8
popq %r11
pushq $0x2
popq %r9
cmovnel %r9d, %r11d
leal (%r10,%r10), %r8d
andl $0x2400, %r15d          # imm = 0x2400
leal 0x4(%r8), %r12d
leal 0x1(%r10), %esi
xorl %edi, %edi
cmpl $0x2000, %r15d          # imm = 0x2000
cmovnel %r10d, %esi
movzbl %r8b, %r13d
movzbl %r12b, %r8d
cmovnel %r13d, %r8d
cmovel %r11d, %edi
orl %r10d, %edi
testl %ecx, %ecx
jne 0x72237
orb $0x2, %r8b
leal (%rsi,%rsi), %ecx
btsl %ecx, %edi
incl %esi
testl %r15d, %r15d
jne 0x7224b
leal (%rsi,%rsi), %ecx
shll %cl, %r9d
orb $0x4, %r8b
orl %r9d, %edi
incl %esi
shrl $0x1b, %edx
andl $0x1, %edx
testl %esi, %esi
sete %cl
orb %dl, %cl
movzbl %cl, %ecx
addl %ecx, %esi
orb %r8b, %cl
movb %dil, 0x65(%rbx)
shlb $0x4, %cl
shlb $0x2, %sil
andb $0xc, %sil
orb %cl, %sil
orb %al, %sil
movb %sil, 0x64(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7557d
leaq 0x456e7(%rip), %rdi     # 0xb7980
leaq 0x43e66(%rip), %rsi     # 0xb6106
leaq 0x45712(%rip), %rcx     # 0xb79b9
movl $0x27c, %edx            # imm = 0x27C
callq 0xc140