// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::EndColumns()
void ImGui::EndColumns()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();
    ImGuiOldColumns* columns = window->DC.CurrentColumns;
    IM_ASSERT(columns != NULL);

    PopItemWidth();
    if (columns->Count > 1)
    {
        PopClipRect();
        columns->Splitter.Merge(window->DrawList);
    }

    const ImGuiOldColumnFlags flags = columns->Flags;
    columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y);
    window->DC.CursorPos.y = columns->LineMaxY;
    if (!(flags & ImGuiOldColumnFlags_GrowParentContentsSize))
        window->DC.CursorMaxPos.x = columns->HostCursorMaxPosX;  // Restore cursor max pos, as columns don't grow parent

    // Draw columns borders and handle resize
    // The IsBeingResized flag ensure we preserve pre-resize columns width so back-and-forth are not lossy
    bool is_being_resized = false;
    if (!(flags & ImGuiOldColumnFlags_NoBorder) && !window->SkipItems)
    {
        // We clip Y boundaries CPU side because very long triangles are mishandled by some GPU drivers.
        const float y1 = ImMax(columns->HostCursorPosY, window->ClipRect.Min.y);
        const float y2 = ImMin(window->DC.CursorPos.y, window->ClipRect.Max.y);
        int dragging_column = -1;
        for (int n = 1; n < columns->Count; n++)
        {
            ImGuiOldColumnData* column = &columns->Columns[n];
            float x = window->Pos.x + GetColumnOffset(n);
            const ImGuiID column_id = columns->ID + ImGuiID(n);
            const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
            const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
            KeepAliveID(column_id);
            if (IsClippedEx(column_hit_rect, column_id, false))
                continue;

            bool hovered = false, held = false;
            if (!(flags & ImGuiOldColumnFlags_NoResize))
            {
                ButtonBehavior(column_hit_rect, column_id, &hovered, &held);
                if (hovered || held)
                    g.MouseCursor = ImGuiMouseCursor_ResizeEW;
                if (held && !(column->Flags & ImGuiOldColumnFlags_NoResize))
                    dragging_column = n;
            }

            // Draw column
            const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
            const float xi = IM_FLOOR(x);
            window->DrawList->AddLine(ImVec2(xi, y1 + 1.0f), ImVec2(xi, y2), col);
        }

        // Apply dragging after drawing the column lines, so our rendered lines are in sync with how items were displayed during the frame.
        if (dragging_column != -1)
        {
            if (!columns->IsBeingResized)
                for (int n = 0; n < columns->Count + 1; n++)
                    columns->Columns[n].OffsetNormBeforeResize = columns->Columns[n].OffsetNorm;
            columns->IsBeingResized = is_being_resized = true;
            float x = GetDraggedColumnOffset(columns, dragging_column);
            SetColumnOffset(dragging_column, x);
        }
    }
    columns->IsBeingResized = is_being_resized;

    window->WorkRect = window->ParentWorkRect;
    window->ParentWorkRect = columns->HostBackupParentWorkRect;
    window->DC.CurrentColumns = NULL;
    window->DC.ColumnsOffset.x = 0.0f;
    window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0xdcb4e(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x8(%rbp)
callq 0xeb270
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x1b0(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x13641a
jmp 0x136439
leaq 0x5750a(%rip), %rdi     # 0x18d92b
leaq 0x55b7a(%rip), %rsi     # 0x18bfa2
movl $0xef8, %edx            # imm = 0xEF8
leaq 0x57611(%rip), %rcx     # 0x18da45
callq 0xd180
callq 0xdcd30
movq -0x18(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jle 0x136465
callq 0xd3550
movq -0x18(%rbp), %rdi
addq $0x70, %rdi
movq -0x10(%rbp), %rax
movq 0x2b8(%rax), %rsi
callq 0x114e20
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movss 0x20(%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0xdc(%rax), %xmm1
callq 0x12a620
movq -0x18(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x18(%rbp), %rax
movss 0x20(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xdc(%rax)
movl -0x1c(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x1364c7
movq -0x18(%rbp), %rax
movss 0x28(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xf0(%rax)
movb $0x0, -0x1d(%rbp)
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1367e4
movq -0x10(%rbp), %rax
testb $0x1, 0x93(%rax)
jne 0x1367e4
movq -0x18(%rbp), %rax
movss 0x24(%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0x25c(%rax), %xmm1
callq 0x12a620
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0x264(%rax), %xmm1
callq 0x12a6b0
movss %xmm0, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x13672e
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
movl -0x30(%rbp), %esi
callq 0xec8a0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, -0x8c(%rbp)
movl -0x30(%rbp), %edi
callq 0x135370
movaps %xmm0, %xmm1
movss -0x8c(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x40(%rbp)
movss 0x3c195(%rip), %xmm0    # 0x172734
movss %xmm0, -0x44(%rbp)
movss -0x3c(%rbp), %xmm0
movss 0x3c183(%rip), %xmm1    # 0x172734
subss %xmm1, %xmm0
movss -0x24(%rbp), %xmm1
leaq -0x5c(%rbp), %rdi
callq 0xbf4c0
movss 0x3c169(%rip), %xmm0    # 0x172734
addss -0x3c(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
leaq -0x64(%rbp), %rdi
callq 0xbf4c0
leaq -0x54(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0xe8660
movl -0x40(%rbp), %edi
callq 0xc9a90
movl -0x40(%rbp), %esi
leaq -0x54(%rbp), %rdi
xorl %edx, %edx
callq 0xca6e0
testb $0x1, %al
jne 0x13660b
jmp 0x136610
jmp 0x136720
movb $0x0, -0x65(%rbp)
movb $0x0, -0x66(%rbp)
movl -0x1c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x136671
movl -0x40(%rbp), %esi
leaq -0x54(%rbp), %rdi
leaq -0x65(%rbp), %rdx
leaq -0x66(%rbp), %rcx
xorl %r8d, %r8d
callq 0x139df0
testb $0x1, -0x65(%rbp)
jne 0x136646
testb $0x1, -0x66(%rbp)
je 0x136654
movq -0x8(%rbp), %rax
movl $0x4, 0x2000(%rax)
testb $0x1, -0x66(%rbp)
je 0x13666f
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x13666f
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x136671
testb $0x1, -0x66(%rbp)
je 0x136684
movl $0x1d, %eax
movl %eax, -0x90(%rbp)
jmp 0x13669d
movb -0x65(%rbp), %dl
movl $0x1b, %eax
movl $0x1c, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %edi
movss 0x3a591(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0x6c(%rbp)
cvttss2si -0x3c(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x98(%rbp)
movss -0x70(%rbp), %xmm0
movss 0x3a55c(%rip), %xmm1    # 0x170c3c
addss -0x24(%rbp), %xmm1
leaq -0x78(%rbp), %rdi
callq 0xbf4c0
movss -0x70(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
leaq -0x80(%rbp), %rdi
callq 0xbf4c0
movq -0x98(%rbp), %rdi
movl -0x6c(%rbp), %ecx
leaq -0x78(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movss 0x3a521(%rip), %xmm0    # 0x170c3c
callq 0x112e20
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13653a
cmpl $-0x1, -0x2c(%rbp)
je 0x1367e2
movq -0x18(%rbp), %rax
testb $0x1, 0x9(%rax)
jne 0x1367b2
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1367b0
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
movl -0x84(%rbp), %esi
callq 0xec8a0
movss (%rax), %xmm0
movss %xmm0, -0x9c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
movl -0x84(%rbp), %esi
callq 0xec8a0
movss -0x9c(%rbp), %xmm0
movss %xmm0, 0x4(%rax)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x13674c
jmp 0x1367b2
movb $0x1, -0x1d(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, 0x9(%rax)
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x136890
movss %xmm0, -0x88(%rbp)
movl -0x2c(%rbp), %edi
movss -0x88(%rbp), %xmm0
callq 0x135540
jmp 0x1367e4
movb -0x1d(%rbp), %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x9(%rax)
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x248(%rcx), %rdx
movq %rdx, 0x238(%rax)
movq 0x250(%rcx), %rcx
movq %rcx, 0x240(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x4c(%rcx), %rdx
movq %rdx, 0x248(%rax)
movq 0x54(%rcx), %rcx
movq %rcx, 0x250(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1b0(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x11c(%rax)
movq -0x10(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0x118(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0x11c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xd8(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nop