// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer*)
static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
{
    // Gather data from windows that were active during this session
    // (if a window wasn't opened in this session we preserve its settings)
    ImGuiContext& g = *ctx;
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
            continue;

        ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID);
        if (!settings)
        {
            settings = ImGui::CreateNewWindowSettings(window->Name);
            window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
        }
        IM_ASSERT(settings->ID == window->ID);
        settings->Pos = ImVec2ih((short)window->Pos.x, (short)window->Pos.y);
        settings->Size = ImVec2ih((short)window->SizeFull.x, (short)window->SizeFull.y);
        settings->Collapsed = window->Collapsed;
    }

    // Write to text buffer
    buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
    for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
    {
        const char* settings_name = settings->GetName();
        buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
        buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
        buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
        buf->appendf("Collapsed=%d\n", settings->Collapsed);
        buf->append("\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, -0x40(%rbp)
leaq 0x1a88(%rdi), %r13
movq %rdi, -0x38(%rbp)
leaq 0x3108(%rdi), %rax
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
cmpl (%r13), %r12d
je 0x3eee3
movq %r13, %rdi
movl %r12d, %esi
callq 0x4ad62
movq (%rax), %r15
testb $0x1, 0xd(%r15)
jne 0x3eedb
movl 0x2b4(%r15), %esi
cmpl $-0x1, %esi
je 0x3ee61
movq -0x30(%rbp), %rdi
callq 0x4c492
jmp 0x3ee6a
movl 0x8(%r15), %edi
callq 0x467a1
movq %rax, %r14
testq %rax, %rax
jne 0x3ee90
movq (%r15), %rdi
callq 0x46724
movq %rax, %r14
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x4c1ce
movl %eax, 0x2b4(%r15)
movl (%r14), %eax
cmpl 0x8(%r15), %eax
jne 0x3efc9
cvttss2si 0x10(%r15), %eax
cvttss2si 0x14(%r15), %ecx
shll $0x10, %ecx
movl $0xffff, %edx           # imm = 0xFFFF
andl %edx, %eax
orl %ecx, %eax
movl %eax, 0x4(%r14)
cvttss2si 0x20(%r15), %eax
cvttss2si 0x24(%r15), %ecx
shll $0x10, %ecx
andl %edx, %eax
orl %ecx, %eax
movl %eax, 0x8(%r14)
movb 0x91(%r15), %al
movb %al, 0xc(%r14)
incl %r12d
jmp 0x3ee27
movl (%rbx), %eax
xorl %ecx, %ecx
subl $0x1, %eax
cmovbl %ecx, %eax
movq -0x38(%rbp), %r14
imull $0x6, 0x3108(%r14), %esi
addl %eax, %esi
movq %rbx, %rdi
callq 0x49c66
movq 0x3110(%r14), %rax
leaq 0x4(%rax), %r12
testq %rax, %rax
cmoveq %rax, %r12
leaq 0x6268f(%rip), %r15     # 0xa15ab
leaq 0x626a9(%rip), %r14     # 0xa15cc
leaq 0x69c9d(%rip), %r13     # 0xa8bc7
testq %r12, %r12
je 0x3efba
leaq 0x10(%r12), %rcx
movq -0x40(%rbp), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3563c
movswl 0x4(%r12), %edx
movswl 0x6(%r12), %ecx
movq %rbx, %rdi
leaq 0x62653(%rip), %rsi     # 0xa15b5
xorl %eax, %eax
callq 0x3563c
movswl 0x8(%r12), %edx
movswl 0xa(%r12), %ecx
movq %rbx, %rdi
leaq 0x62641(%rip), %rsi     # 0xa15c0
xorl %eax, %eax
callq 0x3563c
movzbl 0xc(%r12), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3563c
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x355a2
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x4ba3e
movq %rax, %r12
jmp 0x3ef2a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x62561(%rip), %rdi     # 0xa1531
leaq 0x5e1be(%rip), %rsi     # 0x9d195
leaq 0x6256e(%rip), %rcx     # 0xa154c
movl $0x2843, %edx           # imm = 0x2843
callq 0xc140