// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: TableSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer*)
static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
{
    ImGuiContext& g = *ctx;
    for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
    {
        if (settings->ID == 0) // Skip ditched settings
            continue;

        // TableSaveSettings() may clear some of those flags when we establish that the data can be stripped
        // (e.g. Order was unchanged)
        const bool save_size    = (settings->SaveFlags & ImGuiTableFlags_Resizable) != 0;
        const bool save_visible = (settings->SaveFlags & ImGuiTableFlags_Hideable) != 0;
        const bool save_order   = (settings->SaveFlags & ImGuiTableFlags_Reorderable) != 0;
        const bool save_sort    = (settings->SaveFlags & ImGuiTableFlags_Sortable) != 0;
        if (!save_size && !save_visible && !save_order && !save_sort)
            continue;

        buf->reserve(buf->size() + 30 + settings->ColumnsCount * 50); // ballpark reserve
        buf->appendf("[%s][0x%08X,%d]\n", handler->TypeName, settings->ID, settings->ColumnsCount);
        if (settings->RefScale != 0.0f)
            buf->appendf("RefScale=%g\n", settings->RefScale);
        ImGuiTableColumnSettings* column = settings->GetColumnSettings();
        for (int column_n = 0; column_n < settings->ColumnsCount; column_n++, column++)
        {
            // "Column 0  UserID=0x42AD2D21 Width=100 Visible=1 Order=0 Sort=0v"
            buf->appendf("Column %-2d", column_n);
            if (column->UserID != 0)                    buf->appendf(" UserID=%08X", column->UserID);
            if (save_size && column->IsStretch)         buf->appendf(" Weight=%.4f", column->WidthOrWeight);
            if (save_size && !column->IsStretch)        buf->appendf(" Width=%d", (int)column->WidthOrWeight);
            if (save_visible)                           buf->appendf(" Visible=%d", column->IsEnabled);
            if (save_order)                             buf->appendf(" Order=%d", column->DisplayOrder);
            if (save_sort && column->SortOrder != -1)   buf->appendf(" Sort=%d%c", column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? 'v' : '^');
            buf->append("\n");
        }
        buf->append("\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movq 0x3120(%rdi), %r12
testq %r12, %r12
je 0x8f661
movq %rdx, %rbx
movq %rdi, %r14
addq $0x3118, %r14           # imm = 0x3118
addq $0x4, %r12
movq %r14, -0x30(%rbp)
cmpl $0x0, (%r12)
je 0x8f64a
movl 0x4(%r12), %r13d
testb $0xf, %r13b
je 0x8f64a
movl (%rbx), %eax
subl $0x1, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
movsbl 0xc(%r12), %ecx
imull $0x32, %ecx, %ecx
leal (%rax,%rcx), %esi
addl $0x1e, %esi
movq %rbx, %rdi
callq 0x5ff18
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movl (%r12), %ecx
movsbl 0xc(%r12), %r8d
movq %rbx, %rdi
leaq 0x43426(%rip), %rsi     # 0xd2910
xorl %eax, %eax
callq 0x43d94
movss 0x8(%r12), %xmm0
ucomiss 0x28345(%rip), %xmm0    # 0xb7844
jne 0x8f503
jnp 0x8f518
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
leaq 0x43410(%rip), %rsi     # 0xd2921
movb $0x1, %al
callq 0x43d94
cmpb $0x0, 0xc(%r12)
jle 0x8f635
leaq 0x1b(%r12), %r14
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x433f8(%rip), %rsi     # 0xd292e
movl %r15d, %edx
xorl %eax, %eax
callq 0x43d94
movl -0x7(%r14), %edx
testl %edx, %edx
je 0x8f559
movq %rbx, %rdi
leaq 0x433e8(%rip), %rsi     # 0xd293a
xorl %eax, %eax
callq 0x43d94
testb $0x1, %r13b
je 0x8f59c
testb $0x8, (%r14)
je 0x8f57f
xorps %xmm0, %xmm0
cvtss2sd -0xb(%r14), %xmm0
movq %rbx, %rdi
leaq 0x433cf(%rip), %rsi     # 0xd2947
movb $0x1, %al
callq 0x43d94
testb $0x8, (%r14)
jne 0x8f59c
cvttss2si -0xb(%r14), %edx
movq %rbx, %rdi
leaq 0x433bf(%rip), %rsi     # 0xd2954
xorl %eax, %eax
callq 0x43d94
testb $0x4, %r13b
je 0x8f5bd
movzbl (%r14), %edx
shrl $0x2, %edx
andl $0x1, %edx
movq %rbx, %rdi
leaq 0x433a8(%rip), %rsi     # 0xd295e
xorl %eax, %eax
callq 0x43d94
testb $0x2, %r13b
je 0x8f5d9
movsbl -0x2(%r14), %edx
movq %rbx, %rdi
leaq 0x43398(%rip), %rsi     # 0xd296a
xorl %eax, %eax
callq 0x43d94
testb $0x8, %r13b
je 0x8f60e
movsbl -0x1(%r14), %edx
cmpl $-0x1, %edx
je 0x8f60e
movb (%r14), %al
andb $0x3, %al
cmpb $0x1, %al
movl $0x5e, %ecx
movl $0x76, %eax
cmovel %eax, %ecx
movq %rbx, %rdi
leaq 0x4336d(%rip), %rsi     # 0xd2974
xorl %eax, %eax
callq 0x43d94
movq %rbx, %rdi
leaq 0x342af(%rip), %rsi     # 0xc38c7
xorl %edx, %edx
callq 0x43bae
incl %r15d
movsbl 0xc(%r12), %eax
addq $0xc, %r14
cmpl %eax, %r15d
jl 0x8f52c
movq %rbx, %rdi
leaq 0x34288(%rip), %rsi     # 0xc38c7
xorl %edx, %edx
callq 0x43bae
movq -0x30(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x5f6be
movq %rax, %r12
testq %rax, %rax
jne 0x8f491
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq