// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::BeginColumns(char const*, int, int)
void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();

    IM_ASSERT(columns_count >= 1);
    IM_ASSERT(window->DC.CurrentColumns == NULL);   // Nested columns are currently not supported

    // Acquire storage for the columns set
    ImGuiID id = GetColumnsID(str_id, columns_count);
    ImGuiOldColumns* columns = FindOrCreateColumns(window, id);
    IM_ASSERT(columns->ID == id);
    columns->Current = 0;
    columns->Count = columns_count;
    columns->Flags = flags;
    window->DC.CurrentColumns = columns;

    columns->HostCursorPosY = window->DC.CursorPos.y;
    columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
    columns->HostInitialClipRect = window->ClipRect;
    columns->HostBackupParentWorkRect = window->ParentWorkRect;
    window->ParentWorkRect = window->WorkRect;

    // Set state for first column
    // We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect
    const float column_padding = g.Style.ItemSpacing.x;
    const float half_clip_extend_x = ImFloor(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize));
    const float max_1 = window->WorkRect.Max.x + column_padding - ImMax(column_padding - window->WindowPadding.x, 0.0f);
    const float max_2 = window->WorkRect.Max.x + half_clip_extend_x;
    columns->OffMinX = window->DC.Indent.x - column_padding + ImMax(column_padding - window->WindowPadding.x, 0.0f);
    columns->OffMaxX = ImMax(ImMin(max_1, max_2) - window->Pos.x, columns->OffMinX + 1.0f);
    columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y;

    // Clear data if columns count changed
    if (columns->Columns.Size != 0 && columns->Columns.Size != columns_count + 1)
        columns->Columns.resize(0);

    // Initialize default widths
    columns->IsFirstFrame = (columns->Columns.Size == 0);
    if (columns->Columns.Size == 0)
    {
        columns->Columns.reserve(columns_count + 1);
        for (int n = 0; n < columns_count + 1; n++)
        {
            ImGuiOldColumnData column;
            column.OffsetNorm = n / (float)columns_count;
            columns->Columns.push_back(column);
        }
    }

    for (int n = 0; n < columns_count; n++)
    {
        // Compute clipping rectangle
        ImGuiOldColumnData* column = &columns->Columns[n];
        float clip_x1 = IM_ROUND(window->Pos.x + GetColumnOffset(n));
        float clip_x2 = IM_ROUND(window->Pos.x + GetColumnOffset(n + 1) - 1.0f);
        column->ClipRect = ImRect(clip_x1, -FLT_MAX, clip_x2, +FLT_MAX);
        column->ClipRect.ClipWithFull(window->ClipRect);
    }

    if (columns->Count > 1)
    {
        columns->Splitter.Split(window->DrawList, 1 + columns->Count);
        columns->Splitter.SetCurrentChannel(window->DrawList, 1);
        PushColumnClipRect(0);
    }

    // We don't generally store Indent.x inside ColumnsOffset because it may be manipulated by the user.
    float offset_0 = GetColumnOffset(columns->Current);
    float offset_1 = GetColumnOffset(columns->Current + 1);
    float width = offset_1 - offset_0;
    PushItemWidth(width * 0.65f);
    window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
    window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
    window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
leaq 0xdd3a4(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x18(%rbp)
callq 0xeb270
movq %rax, -0x20(%rbp)
cmpl $0x1, -0xc(%rbp)
jl 0x135bb4
jmp 0x135bd3
leaq 0x57dd1(%rip), %rdi     # 0x18d98c
leaq 0x563e0(%rip), %rsi     # 0x18bfa2
movl $0xe74, %edx            # imm = 0xE74
leaq 0x57dd1(%rip), %rcx     # 0x18d99f
callq 0xd180
movq -0x20(%rbp), %rax
cmpq $0x0, 0x1b0(%rax)
jne 0x135be3
jmp 0x135c02
leaq 0x57df6(%rip), %rdi     # 0x18d9e0
leaq 0x563b1(%rip), %rsi     # 0x18bfa2
movl $0xe75, %edx            # imm = 0xE75
leaq 0x57da2(%rip), %rcx     # 0x18d99f
callq 0xd180
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x135af0
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x1359d0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x135c2e
jmp 0x135c4d
leaq 0x57dcf(%rip), %rdi     # 0x18da04
leaq 0x56366(%rip), %rsi     # 0x18bfa2
movl $0xe7a, %edx            # imm = 0xE7A
leaq 0x57d57(%rip), %rcx     # 0x18d99f
callq 0xd180
movq -0x30(%rbp), %rax
movl $0x0, 0xc(%rax)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x10(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x1b0(%rax)
movq -0x20(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x24(%rax)
movq -0x20(%rbp), %rax
movss 0xf0(%rax), %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x28(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x258(%rcx), %rdx
movq %rdx, 0x2c(%rax)
movq 0x260(%rcx), %rcx
movq %rcx, 0x34(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x248(%rcx), %rdx
movq %rdx, 0x4c(%rax)
movq 0x250(%rcx), %rcx
movq %rcx, 0x54(%rax)
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x238(%rcx), %rdx
movq %rdx, 0x248(%rax)
movq 0x240(%rcx), %rcx
movq %rcx, 0x250(%rax)
movq -0x18(%rbp), %rax
movss 0x15a8(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movss 0x3c2b6(%rip), %xmm0    # 0x171fd8
mulss 0x40(%rax), %xmm0
movq -0x20(%rbp), %rax
movss 0x4c(%rax), %xmm1
callq 0x12a620
callq 0x12cdc0
movss %xmm0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movss 0x240(%rax), %xmm0
addss -0x34(%rbp), %xmm0
movss %xmm0, -0x9c(%rbp)
movss -0x34(%rbp), %xmm0
movq -0x20(%rbp), %rax
subss 0x40(%rax), %xmm0
xorps %xmm1, %xmm1
callq 0x12a620
movaps %xmm0, %xmm1
movss -0x9c(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movss 0x240(%rax), %xmm0
addss -0x38(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movss 0x118(%rax), %xmm0
subss -0x34(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
movss -0x34(%rbp), %xmm0
movq -0x20(%rbp), %rax
subss 0x40(%rax), %xmm0
xorps %xmm1, %xmm1
callq 0x12a620
movaps %xmm0, %xmm1
movss -0x98(%rbp), %xmm0
addss %xmm1, %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x14(%rax)
movss -0x3c(%rbp), %xmm0
movss -0x40(%rbp), %xmm1
callq 0x12a6b0
movq -0x20(%rbp), %rax
subss 0x10(%rax), %xmm0
movq -0x30(%rbp), %rax
movss 0x3ae39(%rip), %xmm1    # 0x170c3c
addss 0x14(%rax), %xmm1
callq 0x12a620
movq -0x30(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq -0x20(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x30(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x60(%rax)
je 0x135e5e
movq -0x30(%rbp), %rax
movl 0x60(%rax), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
je 0x135e5e
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
xorl %esi, %esi
callq 0x137b50
movq -0x30(%rbp), %rax
cmpl $0x0, 0x60(%rax)
sete %cl
movq -0x30(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x135ede
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq 0x137ba0
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x135edc
leaq -0x60(%rbp), %rdi
callq 0x137c20
cvtsi2ssl -0x44(%rbp), %xmm0
cvtsi2ssl -0xc(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
leaq -0x60(%rbp), %rsi
callq 0x137c60
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x135e97
jmp 0x135ede
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x135ff9
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
movl -0x64(%rbp), %esi
callq 0xec8a0
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, -0xa4(%rbp)
movl -0x64(%rbp), %edi
callq 0x135370
movaps %xmm0, %xmm1
movss -0xa4(%rbp), %xmm0
addss %xmm1, %xmm0
movss 0x3c0a3(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x74(%rbp)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, -0xa0(%rbp)
movl -0x64(%rbp), %edi
addl $0x1, %edi
callq 0x135370
movaps %xmm0, %xmm1
movss -0xa0(%rbp), %xmm0
addss %xmm1, %xmm0
movss 0x3acc3(%rip), %xmm1    # 0x170c3c
subss %xmm1, %xmm0
movss 0x3c053(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x74(%rbp), %xmm0
movss -0x78(%rbp), %xmm2
leaq -0x88(%rbp), %rdi
movss 0x3c7a9(%rip), %xmm1    # 0x172758
movss 0x3bffd(%rip), %xmm3    # 0x171fb4
callq 0xec090
movq -0x70(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0xc(%rax)
movq -0x80(%rbp), %rcx
movq %rcx, 0x14(%rax)
movq -0x70(%rbp), %rdi
addq $0xc, %rdi
movq -0x20(%rbp), %rsi
addq $0x258, %rsi            # imm = 0x258
callq 0xeb8d0
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x135ee5
movq -0x30(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jle 0x136049
movq -0x30(%rbp), %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rsi
movq -0x30(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
callq 0x114c90
movq -0x30(%rbp), %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rsi
movl $0x1, %edx
callq 0x115220
xorl %edi, %edi
callq 0x135870
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x135370
movss %xmm0, -0x8c(%rbp)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
addl $0x1, %edi
callq 0x135370
movss %xmm0, -0x90(%rbp)
movss -0x90(%rbp), %xmm0
subss -0x8c(%rbp), %xmm0
movss %xmm0, -0x94(%rbp)
movss 0x3c6f8(%rip), %xmm0    # 0x17278c
mulss -0x94(%rbp), %xmm0
callq 0xdcb10
movss -0x34(%rbp), %xmm0
movq -0x20(%rbp), %rax
subss 0x40(%rax), %xmm0
xorps %xmm1, %xmm1
callq 0x12a620
movq -0x20(%rbp), %rax
movss %xmm0, 0x11c(%rax)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x20(%rbp), %rax
addss 0x118(%rax), %xmm0
movq -0x20(%rbp), %rax
addss 0x11c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0xd8(%rax)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
addss -0x90(%rbp), %xmm0
subss -0x34(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x240(%rax)
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)