// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableSaveSettings(ImGuiTable*)
void ImGui::TableSaveSettings(ImGuiTable* table)
{
    table->IsSettingsDirty = false;
    if (table->Flags & ImGuiTableFlags_NoSavedSettings)
        return;

    // Bind or create settings data
    ImGuiContext& g = *GImGui;
    ImGuiTableSettings* settings = TableGetBoundSettings(table);
    if (settings == NULL)
    {
        settings = TableSettingsCreate(table->ID, table->ColumnsCount);
        table->SettingsOffset = g.SettingsTables.offset_from_ptr(settings);
    }
    settings->ColumnsCount = (ImGuiTableColumnIdx)table->ColumnsCount;

    // Serialize ImGuiTable/ImGuiTableColumn into ImGuiTableSettings/ImGuiTableColumnSettings
    IM_ASSERT(settings->ID == table->ID);
    IM_ASSERT(settings->ColumnsCount == table->ColumnsCount && settings->ColumnsCountMax >= settings->ColumnsCount);
    ImGuiTableColumn* column = table->Columns.Data;
    ImGuiTableColumnSettings* column_settings = settings->GetColumnSettings();

    bool save_ref_scale = false;
    settings->SaveFlags = ImGuiTableFlags_None;
    for (int n = 0; n < table->ColumnsCount; n++, column++, column_settings++)
    {
        const float width_or_weight = (column->Flags & ImGuiTableColumnFlags_WidthStretch) ? column->StretchWeight : column->WidthRequest;
        column_settings->WidthOrWeight = width_or_weight;
        column_settings->Index = (ImGuiTableColumnIdx)n;
        column_settings->DisplayOrder = column->DisplayOrder;
        column_settings->SortOrder = column->SortOrder;
        column_settings->SortDirection = column->SortDirection;
        column_settings->IsEnabled = column->IsEnabled;
        column_settings->IsStretch = (column->Flags & ImGuiTableColumnFlags_WidthStretch) ? 1 : 0;
        if ((column->Flags & ImGuiTableColumnFlags_WidthStretch) == 0)
            save_ref_scale = true;

        // We skip saving some data in the .ini file when they are unnecessary to restore our state.
        // Note that fixed width where initial width was derived from auto-fit will always be saved as InitStretchWeightOrWidth will be 0.0f.
        // FIXME-TABLE: We don't have logic to easily compare SortOrder to DefaultSortOrder yet so it's always saved when present.
        if (width_or_weight != column->InitStretchWeightOrWidth)
            settings->SaveFlags |= ImGuiTableFlags_Resizable;
        if (column->DisplayOrder != n)
            settings->SaveFlags |= ImGuiTableFlags_Reorderable;
        if (column->SortOrder != -1)
            settings->SaveFlags |= ImGuiTableFlags_Sortable;
        if (column->IsEnabled != ((column->Flags & ImGuiTableColumnFlags_DefaultHide) == 0))
            settings->SaveFlags |= ImGuiTableFlags_Hideable;
    }
    settings->SaveFlags &= table->Flags;
    settings->RefScale = save_ref_scale ? table->RefScale : 0.0f;

    MarkIniSettingsDirty();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movb $0x0, 0x24f(%rdi)
testb $0x10, 0x4(%rdi)
jne 0x74663
movq %rdi, %rbx
leaq 0x6f7af(%rip), %rax     # 0xe3ce0
movq (%rax), %r15
callq 0x7653d
movq %rax, %r14
testq %rax, %rax
jne 0x74563
movl (%rbx), %edi
movl 0x6c(%rbx), %esi
callq 0x76445
movq %rax, %r14
addq $0x3118, %r15           # imm = 0x3118
movq %r15, %rdi
movq %rax, %rsi
callq 0x78b4c
movl %eax, 0x64(%rbx)
movl 0x6c(%rbx), %edi
movb %dil, 0xc(%r14)
movl (%r14), %eax
cmpl (%rbx), %eax
jne 0x746b8
movsbl %dil, %eax
cmpl %edi, %eax
jne 0x74699
movsbl 0xd(%r14), %eax
cmpl %eax, %edi
jg 0x74699
movq 0x10(%rbx), %rcx
andl $0x0, 0x4(%r14)
leaq 0x10(%r14), %rdx
xorl %eax, %eax
xorl %esi, %esi
cmpl %edi, %esi
jge 0x7466e
movl (%rcx), %edi
andl $0x4, %edi
movss 0x10(%rcx,%rdi,2), %xmm0
movss %xmm0, (%rdx)
movb %sil, 0x8(%rdx)
movb 0x52(%rcx), %dil
movb %dil, 0x9(%rdx)
movb 0x56(%rcx), %dil
movb %dil, 0xa(%rdx)
movb 0x64(%rcx), %dil
andb $0x3, %dil
movb 0xb(%rdx), %r8b
andb $-0x4, %r8b
orb %dil, %r8b
movb %r8b, 0xb(%rdx)
movb 0x5a(%rcx), %dil
shlb $0x2, %dil
andb $-0x5, %r8b
orb %dil, %r8b
movb %r8b, 0xb(%rdx)
movb (%rcx), %dil
addb %dil, %dil
andb $0x8, %dil
andb $-0x9, %r8b
orb %dil, %r8b
movb %r8b, 0xb(%rdx)
movl (%rcx), %r8d
testb $0x4, %r8b
sete %dil
ucomiss 0x1c(%rcx), %xmm0
jne 0x7461c
jnp 0x74621
orb $0x1, 0x4(%r14)
movsbl 0x52(%rcx), %r9d
cmpl %r9d, %esi
je 0x74630
orb $0x2, 0x4(%r14)
cmpb $-0x1, 0x56(%rcx)
je 0x7463b
orb $0x8, 0x4(%r14)
movzbl 0x5a(%rcx), %r9d
andl $0x1, %r8d
cmpl %r9d, %r8d
jne 0x7464e
orb $0x4, 0x4(%r14)
orb %dil, %al
incl %esi
addq $0x68, %rcx
addq $0xc, %rdx
movl 0x6c(%rbx), %edi
jmp 0x7459f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rbx), %ecx
andl %ecx, 0x4(%r14)
xorps %xmm0, %xmm0
testb $0x1, %al
je 0x74684
movss 0xe8(%rbx), %xmm0
movss %xmm0, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x466fe
leaq 0x42cbf(%rip), %rdi     # 0xb735f
leaq 0x41a5f(%rip), %rsi     # 0xb6106
leaq 0x42c85(%rip), %rcx     # 0xb7333
movl $0xc1b, %edx            # imm = 0xC1B
callq 0xc140
leaq 0x42c1b(%rip), %rdi     # 0xb72da
leaq 0x41a40(%rip), %rsi     # 0xb6106
leaq 0x42c66(%rip), %rcx     # 0xb7333
movl $0xc1a, %edx            # imm = 0xC1A
callq 0xc140