// File: /workspace/github_cpp_makefile_star2_O1/donfreiday[P]gb/./imgui/imgui.cpp
// Function: SaveSettings()
static void SaveSettings()
{
    ImGuiState& g = *GImGui;
    const char* filename = g.IO.IniFilename;
    if (!filename)
        return;

    // Gather data from windows that were active during this session
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
            continue;
        ImGuiIniData* settings = FindWindowSettings(window->Name);
        settings->Pos = window->Pos;
        settings->Size = window->SizeFull;
        settings->Collapsed = window->Collapsed;
    }

    // Write .ini file
    // If a window wasn't opened in this session we preserve its settings
    FILE* f = fopen(filename, "wt");
    if (!f)
        return;
    for (int i = 0; i != g.Settings.Size; i++)
    {
        const ImGuiIniData* settings = &g.Settings[i];
        if (settings->Pos.x == FLT_MAX)
            continue;
        const char* name = settings->Name;
        if (const char* p = strstr(name, "###"))  // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
            name = p;
        fprintf(f, "[%s]\n", name);
        fprintf(f, "Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y);
        fprintf(f, "Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y);
        fprintf(f, "Collapsed=%d\n", settings->Collapsed);
        fprintf(f, "\n");
    }

    fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x49232(%rip), %r12     # 0x55490
movq 0x18(%r12), %rbx
testq %rbx, %rbx
je 0xc3fd
movl 0x1738(%r12), %eax
testl %eax, %eax
je 0xc2c8
xorl %r14d, %r14d
cltq
cmpq %rax, %r14
jge 0xc40c
movq 0x1740(%r12), %rax
movq (%rax,%r14,8), %r15
testb $0x1, 0xd(%r15)
jne 0xc2b8
movq (%r15), %rdi
callq 0x2352f
movq 0x18(%r15), %rcx
movq %rcx, 0xc(%rax)
movq 0x28(%r15), %rcx
movq %rcx, 0x14(%rax)
movb 0x73(%r15), %cl
movb %cl, 0x1c(%rax)
incq %r14
movl 0x1738(%r12), %eax
cmpq %rax, %r14
jne 0xc27b
leaq 0x32812(%rip), %rsi     # 0x3eae1
movq %rbx, %rdi
callq 0x78d0
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0xc3fd
movl 0x17b0(%r12), %eax
testl %eax, %eax
je 0xc3e6
movl $0x1c, %r13d
movss 0x310be(%rip), %xmm1    # 0x3d3c0
xorl %r14d, %r14d
movq %r12, -0x38(%rbp)
cltq
cmpq %rax, %r14
jge 0xc423
movq 0x17b8(%r12), %rbx
movss -0x10(%rbx,%r13), %xmm0
ucomiss %xmm1, %xmm0
jne 0xc32e
jnp 0xc3ce
movq -0x1c(%rbx,%r13), %r15
movq %r15, %rdi
leaq 0x327a7(%rip), %rsi     # 0x3eae4
callq 0x7360
testq %rax, %rax
cmovneq %rax, %r15
movq -0x30(%rbp), %r12
movq %r12, %rdi
leaq 0x32791(%rip), %rsi     # 0x3eae8
movq %r15, %rdx
xorl %eax, %eax
callq 0x7180
cvttss2si -0x10(%rbx,%r13), %edx
cvttss2si -0xc(%rbx,%r13), %ecx
movq %r12, %rdi
leaq 0x32775(%rip), %rsi     # 0x3eaee
xorl %eax, %eax
callq 0x7180
cvttss2si -0x8(%rbx,%r13), %edx
cvttss2si -0x4(%rbx,%r13), %ecx
movq %r12, %rdi
leaq 0x32761(%rip), %rsi     # 0x3eaf9
xorl %eax, %eax
callq 0x7180
movzbl (%rbx,%r13), %edx
movq %r12, %rdi
leaq 0x32757(%rip), %rsi     # 0x3eb05
xorl %eax, %eax
callq 0x7180
movl $0xa, %edi
movq %r12, %rsi
movq -0x38(%rbp), %r12
callq 0x7650
movss 0x30ff2(%rip), %xmm1    # 0x3d3c0
incq %r14
movl 0x17b0(%r12), %eax
addq $0x20, %r13
cmpq %rax, %r14
jne 0xc309
movq -0x30(%rbp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7340
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3299d(%rip), %rdi     # 0x3edb0
leaq 0x32679(%rip), %rsi     # 0x3ea93
leaq 0x32def(%rip), %rcx     # 0x3f210
jmp 0xc438
leaq 0x32986(%rip), %rdi     # 0x3edb0
leaq 0x32662(%rip), %rsi     # 0x3ea93
leaq 0x32e60(%rip), %rcx     # 0x3f298
movl $0x31c, %edx            # imm = 0x31C
callq 0x7140