// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movl %edx, %eax
andl $0xc, %eax
je 0x8a1f9
leal -0x1(%rax), %ecx
testl %ecx, %eax
je 0x8a217
leaq 0x48553(%rip), %rdi     # 0xd2734
leaq 0x46cd2(%rip), %rsi     # 0xd0eba
leaq 0x4857e(%rip), %rcx     # 0xd276d
movl $0x27c, %edx            # imm = 0x27C
callq 0xc140
movl $0xe000, %eax           # imm = 0xE000
andl 0x4(%rdi), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x8a20f
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x8a214
orl $0x8, %edx
jmp 0x8a217
orl $0x4, %edx
movl 0x4(%rdi), %eax
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 0x8a278
movq 0x10(%rdi), %rax
cmpq %rsi, %rax
ja 0x8a36b
cmpq %rsi, 0x18(%rdi)
jbe 0x8a36b
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 0x8a2a2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %r11d
andl $0x1200, %r11d          # imm = 0x1200
xorl %ebx, %ebx
cmpl $0x1000, %r11d          # imm = 0x1000
movl $0x8, %r8d
movl $0x2, %r14d
cmovel %r8d, %r14d
sete %bl
leal (%rbx,%rbx), %r15d
movl %ecx, %r9d
andl $0x2400, %r9d           # imm = 0x2400
leal 0x1(%rbx), %r8d
xorl %r10d, %r10d
cmpl $0x2000, %r9d           # imm = 0x2000
leal 0x4(%rbx,%rbx), %r9d
cmovnel %ebx, %r8d
cmovnel %r15d, %r9d
cmovel %r14d, %r10d
orl %ebx, %r10d
testl %r11d, %r11d
jne 0x8a30c
orl $0x2, %r9d
leal (%r8,%r8), %r11d
btsl %r11d, %r10d
incl %r8d
testl $0x2400, %ecx           # imm = 0x2400
jne 0x8a32b
leal (%r8,%r8), %ecx
movl $0x2, %r11d
shll %cl, %r11d
orl $0x4, %r9d
orl %r11d, %r10d
incl %r8d
shrl $0x1b, %edx
andl $0x1, %edx
testl %r8d, %r8d
sete %cl
orb %dl, %cl
movzbl %cl, %ecx
addl %ecx, %r8d
orl %ecx, %r9d
movb %r10b, 0x65(%rsi)
shlb $0x4, %r9b
shlb $0x2, %r8b
andb $0xc, %r8b
orb %r9b, %r8b
orb %al, %r8b
movb %r8b, 0x64(%rsi)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8de3b
leaq 0x4844f(%rip), %rdi     # 0xd27c1
leaq 0x312c6(%rip), %rsi     # 0xbb63f
leaq 0x4845c(%rip), %rcx     # 0xd27dc
movl $0x217, %edx            # imm = 0x217
callq 0xc140