// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::NextColumn()
void ImGui::NextColumn()
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems || window->DC.CurrentColumns == NULL)
        return;

    ImGuiContext& g = *GImGui;
    ImGuiOldColumns* columns = window->DC.CurrentColumns;

    if (columns->Count == 1)
    {
        window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
        IM_ASSERT(columns->Current == 0);
        return;
    }

    // Next column
    if (++columns->Current == columns->Count)
        columns->Current = 0;

    PopItemWidth();

    // Optimization: avoid PopClipRect() + SetCurrentChannel() + PushClipRect()
    // (which would needlessly attempt to update commands in the wrong channel, then pop or overwrite them),
    ImGuiOldColumnData* column = &columns->Columns[columns->Current];
    SetWindowClipRectBeforeSetChannel(window, column->ClipRect);
    columns->Splitter.SetCurrentChannel(window->DrawList, columns->Current + 1);

    const float column_padding = g.Style.ItemSpacing.x;
    columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y);
    if (columns->Current > 0)
    {
        // Columns 1+ ignore IndentX (by canceling it out)
        // FIXME-COLUMNS: Unnecessary, could be locked?
        window->DC.ColumnsOffset.x = GetColumnOffset(columns->Current) - window->DC.Indent.x + column_padding;
    }
    else
    {
        // New row/line: column 0 honor IndentX.
        window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
        columns->LineMinY = columns->LineMaxY;
    }
    window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
    window->DC.CursorPos.y = columns->LineMinY;
    window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
    window->DC.CurrLineTextBaseOffset = 0.0f;

    // FIXME-COLUMNS: Share code with BeginColumns() - move code on columns setup.
    float offset_0 = GetColumnOffset(columns->Current);
    float offset_1 = GetColumnOffset(columns->Current + 1);
    float width = offset_1 - offset_0;
    PushItemWidth(width * 0.65f);
    window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
callq 0xeb270
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x93(%rax)
jne 0x13615c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1b0(%rax)
jne 0x136161
jmp 0x1363d7
leaq 0xdcdd8(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x1b0(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x1361ed
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x118(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x11c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd8(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x1361c9
jmp 0x1361e8
leaq 0x57846(%rip), %rdi     # 0x18da16
leaq 0x55dcb(%rip), %rsi     # 0x18bfa2
movl $0xec8, %edx            # imm = 0xEC8
leaq 0x57849(%rip), %rcx     # 0x18da2c
callq 0xd180
jmp 0x1363d7
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %eax
addl $0x1, %eax
movl %eax, 0xc(%rcx)
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x13620e
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
callq 0xdcd30
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xec8a0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x131940
movq -0x18(%rbp), %rdi
addq $0x70, %rdi
movq -0x8(%rbp), %rax
movq 0x2b8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
addl $0x1, %edx
callq 0x115220
movq -0x10(%rbp), %rax
movss 0x15a8(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movss 0x20(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0xdc(%rax), %xmm1
callq 0x12a620
movq -0x18(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x1362c7
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x135370
movq -0x8(%rbp), %rax
subss 0x118(%rax), %xmm0
addss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x11c(%rax)
jmp 0x1362fb
movss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
subss 0x40(%rax), %xmm0
xorps %xmm1, %xmm1
callq 0x12a620
movq -0x8(%rbp), %rax
movss %xmm0, 0x11c(%rax)
movq -0x18(%rbp), %rax
movss 0x20(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x118(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x11c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd8(%rax)
movq -0x18(%rbp), %rax
movss 0x1c(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xdc(%rax)
leaq -0x2c(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x8(%rbp), %rax
movq -0x2c(%rbp), %rcx
movq %rcx, 0x100(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x110(%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x135370
movss %xmm0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
addl $0x1, %edi
callq 0x135370
movss %xmm0, -0x34(%rbp)
movss -0x34(%rbp), %xmm0
subss -0x30(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movss 0x3c3de(%rip), %xmm0    # 0x17278c
mulss -0x38(%rbp), %xmm0
callq 0xdcb10
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
addss -0x34(%rbp), %xmm0
subss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x240(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)