// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::Columns(int, char const*, bool)
void ImGui::Columns(int columns_count, const char* id, bool border)
{
    ImGuiState& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();

    if (window->DC.ColumnsCount != 1)
    {
        if (window->DC.ColumnsCurrent != 0)
            ItemSize(ImVec2(0,0));   // Advance to column 0
        ImGui::PopItemWidth();
        PopClipRect();
        window->DrawList->ChannelsMerge();

        window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
        window->DC.CursorPos.y = window->DC.ColumnsCellMaxY;
    }

    // Draw columns borders and handle resize at the time of "closing" a columns set
    if (window->DC.ColumnsCount != columns_count && window->DC.ColumnsCount != 1 && window->DC.ColumnsShowBorders && !window->SkipItems)
    {
        const float y1 = window->DC.ColumnsStartPos.y;
        const float y2 = window->DC.CursorPos.y;
        for (int i = 1; i < window->DC.ColumnsCount; i++)
        {
            float x = window->Pos.x + GetColumnOffset(i);
            const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(i);
            const ImRect column_rect(ImVec2(x-4,y1),ImVec2(x+4,y2));
            if (IsClippedEx(column_rect, &column_id, false))
                continue;

            bool hovered, held;
            ButtonBehavior(column_rect, column_id, &hovered, &held, true);
            if (hovered || held)
                g.MouseCursor = ImGuiMouseCursor_ResizeEW;

            // Draw before resize so our items positioning are in sync with the line being drawn
            const ImU32 col = window->Color(held ? ImGuiCol_ColumnActive : hovered ? ImGuiCol_ColumnHovered : ImGuiCol_Column);
            const float xi = (float)(int)x;
            window->DrawList->AddLine(ImVec2(xi, y1+1.0f), ImVec2(xi, y2), col);

            if (held)
            {
                if (g.ActiveIdIsJustActivated)
                    g.ActiveClickDeltaToCenter.x = x - g.IO.MousePos.x;

                x = GetDraggedColumnOffset(i);
                SetColumnOffset(i, x);
            }
        }
    }

    // Set state for first column
    ImGui::PushID(0x11223344); // Differentiate column ID with an arbitrary/random prefix for cases where users name their columns set the same as another non-scope widget
    window->DC.ColumnsSetID = window->GetID(id ? id : "");
    ImGui::PopID();
    window->DC.ColumnsCurrent = 0;
    window->DC.ColumnsCount = columns_count;
    window->DC.ColumnsShowBorders = border;
    window->DC.ColumnsStartPos = window->DC.CursorPos;
    window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.CursorPos.y;
    window->DC.ColumnsOffsetX = 0.0f;
    window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX);

    if (window->DC.ColumnsCount != 1)
    {
        // Cache column offsets
        window->DC.ColumnsOffsetsT.resize(columns_count + 1);
        for (int column_index = 0; column_index < columns_count + 1; column_index++)
        {
            const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
            KeepAliveID(column_id);
            const float default_t = column_index / (float)window->DC.ColumnsCount;
            const float t = window->DC.StateStorage->GetFloat(column_id, default_t);      // Cheaply store our floating point value inside the integer (could store an union into the map?)
            window->DC.ColumnsOffsetsT[column_index] = t;
        }
        window->DrawList->ChannelsSplit(window->DC.ColumnsCount);
        PushColumnClipRect();
        ImGui::PushItemWidth(ImGui::GetColumnWidth() * 0.65f);
    }
    else
    {
        window->DC.ColumnsOffsetsT.resize(2);
        window->DC.ColumnsOffsetsT[0] = 0.0f;
        window->DC.ColumnsOffsetsT[1] = 1.0f;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %dl, %al
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq 0x61620(%rip), %rax     # 0x794c0
movq %rax, -0x20(%rbp)
callq 0x2e220
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
je 0x17f41
movq -0x28(%rbp), %rax
cmpl $0x0, 0x19c(%rax)
je 0x17ee6
leaq -0x30(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq -0x30(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xbeb0
callq 0xb0f0
callq 0x18470
movq -0x28(%rbp), %rax
movq 0x270(%rax), %rdi
callq 0x3d530
movq -0x28(%rbp), %rax
movss 0x1b0(%rax), %xmm0
movq -0x28(%rbp), %rax
movss 0xac(%rax), %xmm1
callq 0xb7c0
movq -0x28(%rbp), %rax
movss %xmm0, 0x1b0(%rax)
movq -0x28(%rbp), %rax
movss 0x1b0(%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0xac(%rax)
movq -0x28(%rbp), %rax
movl 0x1a0(%rax), %eax
cmpl -0x4(%rbp), %eax
je 0x181b6
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
je 0x181b6
movq -0x28(%rbp), %rax
testb $0x1, 0x1b4(%rax)
je 0x181b6
movq -0x28(%rbp), %rax
testb $0x1, 0x74(%rax)
jne 0x181b6
movq -0x28(%rbp), %rax
movss 0x1a8(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x28(%rbp), %rax
movss 0xac(%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1a0(%rcx), %eax
jge 0x181b4
movq -0x28(%rbp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, -0x94(%rbp)
movl -0x3c(%rbp), %edi
callq 0x19660
movaps %xmm0, %xmm1
movss -0x94(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x28(%rbp), %rax
movl 0x1b8(%rax), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
movss -0x40(%rbp), %xmm0
movss 0x4304e(%rip), %xmm1    # 0x5b058
subss %xmm1, %xmm0
movss -0x34(%rbp), %xmm1
leaq -0x5c(%rbp), %rdi
callq 0x2d280
movss 0x43034(%rip), %xmm0    # 0x5b058
addss -0x40(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
leaq -0x64(%rbp), %rdi
callq 0x2d280
leaq -0x54(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0x2eb40
leaq -0x54(%rbp), %rdi
leaq -0x44(%rbp), %rsi
xorl %edx, %edx
callq 0xc220
testb $0x1, %al
jne 0x1805d
jmp 0x18062
jmp 0x181a6
movl -0x44(%rbp), %esi
leaq -0x54(%rbp), %rdi
leaq -0x65(%rbp), %rdx
leaq -0x66(%rbp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x17010
testb $0x1, -0x65(%rbp)
jne 0x1808b
testb $0x1, -0x66(%rbp)
je 0x18099
movq -0x20(%rbp), %rax
movl $0x4, 0x1940(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0xa0(%rbp)
testb $0x1, -0x66(%rbp)
je 0x180b7
movl $0x1d, %eax
movl %eax, -0xa4(%rbp)
jmp 0x180d0
movb -0x65(%rbp), %dl
movl $0x1b, %eax
movl $0x1c, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xa4(%rbp)
movq -0xa0(%rbp), %rdi
movl -0xa4(%rbp), %esi
movss 0x42f33(%rip), %xmm0    # 0x5b018
callq 0x2ea40
movl %eax, -0x6c(%rbp)
cvttss2si -0x40(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq 0x270(%rax), %rax
movq %rax, -0xb0(%rbp)
movss -0x70(%rbp), %xmm0
movss 0x42efe(%rip), %xmm1    # 0x5b018
addss -0x34(%rbp), %xmm1
leaq -0x78(%rbp), %rdi
callq 0x2d280
movss -0x70(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
leaq -0x80(%rbp), %rdi
callq 0x2d280
movq -0xb0(%rbp), %rdi
movl -0x6c(%rbp), %ecx
leaq -0x78(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movss 0x42ec3(%rip), %xmm0    # 0x5b018
callq 0x404c0
testb $0x1, -0x66(%rbp)
je 0x181a4
movq -0x20(%rbp), %rax
testb $0x1, 0x1799(%rax)
je 0x1818a
movss -0x40(%rbp), %xmm0
movq -0x20(%rbp), %rax
subss 0xf0(%rax), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x27b8(%rax)
movl -0x3c(%rbp), %edi
callq 0x2a0c0
movss %xmm0, -0x40(%rbp)
movl -0x3c(%rbp), %edi
movss -0x40(%rbp), %xmm0
callq 0x2a1d0
jmp 0x181a6
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x17fad
jmp 0x181b6
movl $0x11223344, %edi       # imm = 0x11223344
callq 0x1cc80
movq -0x28(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x181df
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x181ef
leaq 0x47068(%rip), %rax     # 0x5f24e
movq %rax, -0xc0(%rbp)
jmp 0x181ef
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xbc60
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1b8(%rax)
callq 0x1b550
movq -0x28(%rbp), %rax
movl $0x0, 0x19c(%rax)
movl -0x4(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1a0(%rax)
movb -0x11(%rbp), %cl
movq -0x28(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x1b4(%rax)
movq -0x28(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0xa8(%rcx), %rcx
movq %rcx, 0x1a4(%rax)
movq -0x28(%rbp), %rax
movss 0xac(%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0x1b0(%rax)
movq -0x28(%rbp), %rax
movss %xmm0, 0x1ac(%rax)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x198(%rax)
movq -0x28(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x28(%rbp), %rax
addss 0x194(%rax), %xmm0
movq -0x28(%rbp), %rax
addss 0x198(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0xa8(%rax)
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
je 0x18401
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0x4(%rbp), %esi
addl $0x1, %esi
callq 0x2f430
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x183c0
movq -0x28(%rbp), %rax
movl 0x1b8(%rax), %eax
addl -0x84(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %edi
callq 0xbd70
cvtsi2ssl -0x84(%rbp), %xmm0
movq -0x28(%rbp), %rax
cvtsi2ssl 0x1a0(%rax), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x8c(%rbp)
movq -0x28(%rbp), %rax
movq 0x110(%rax), %rdi
movl -0x88(%rbp), %esi
movss -0x8c(%rbp), %xmm0
callq 0xa8e0
movss %xmm0, -0x90(%rbp)
movss -0x90(%rbp), %xmm0
movss %xmm0, -0xc4(%rbp)
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0x84(%rbp), %esi
callq 0x30290
movss -0xc4(%rbp), %xmm0
movss %xmm0, (%rax)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x182f8
movq -0x28(%rbp), %rax
movq 0x270(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x1a0(%rax), %esi
callq 0x3d360
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x27800
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2a000
movss 0x42c5a(%rip), %xmm1    # 0x5b050
mulss %xmm1, %xmm0
callq 0xafc0
jmp 0x18465
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
addq $0x118, %rdi            # imm = 0x118
movl $0x2, %esi
callq 0x2f430
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
addq $0x118, %rdi            # imm = 0x118
xorl %esi, %esi
callq 0x30290
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
addq $0x118, %rdi            # imm = 0x118
movl $0x1, %esi
callq 0x30290
movss 0x42bb7(%rip), %xmm0    # 0x5b018
movss %xmm0, (%rax)
addq $0xd0, %rsp
popq %rbp
retq
nop