// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x6c1d9(%rip), %rax     # 0xe3ce0
movq (%rax), %r12
movq 0x1ae0(%r12), %rbx
movb $0x1, 0x90(%rbx)
testl %esi, %esi
jle 0x77ea5
movl %edx, -0x40(%rbp)
cmpq $0x0, 0x1b0(%rbx)
jne 0x77ec4
movq %rsi, %r14
callq 0x77a95
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x779e9
cmpl %r15d, (%rax)
jne 0x77ee3
movq %rax, %r13
andl $0x0, 0xc(%rax)
movq %r14, %rsi
movl %esi, 0x10(%rax)
movl -0x40(%rbp), %eax
movl %eax, 0x4(%r13)
movq %r13, 0x1b0(%rbx)
movss 0xdc(%rbx), %xmm0
movss %xmm0, 0x24(%r13)
movss 0xf0(%rbx), %xmm0
movss %xmm0, 0x28(%r13)
movups 0x258(%rbx), %xmm0
movups %xmm0, 0x2c(%r13)
movups 0x248(%rbx), %xmm0
movups %xmm0, 0x4c(%r13)
movups 0x238(%rbx), %xmm0
movups %xmm0, 0x248(%rbx)
movss 0x15a8(%r12), %xmm5
movss 0x40(%rbx), %xmm0
movss 0x4c(%rbx), %xmm1
movaps %xmm5, %xmm2
subss %xmm0, %xmm2
mulss 0x24448(%rip), %xmm0    # 0x9c018
movaps %xmm1, %xmm3
cmpless %xmm0, %xmm3
andps %xmm3, %xmm0
andnps %xmm1, %xmm3
orps %xmm0, %xmm3
cvttps2dq %xmm3, %xmm0
cvtdq2ps %xmm0, %xmm0
movss 0x240(%rbx), %xmm1
movaps %xmm5, %xmm3
addss %xmm1, %xmm3
xorps %xmm4, %xmm4
cmpless %xmm2, %xmm4
andps %xmm2, %xmm4
subss %xmm4, %xmm3
addss %xmm1, %xmm0
minss %xmm0, %xmm3
movss 0x118(%rbx), %xmm0
movss %xmm5, -0x54(%rbp)
subss %xmm5, %xmm0
addss %xmm4, %xmm0
movss %xmm0, 0x14(%r13)
subss 0x10(%rbx), %xmm3
addss 0x243c2(%rip), %xmm0    # 0x9bff8
movaps %xmm0, %xmm1
cmpless %xmm3, %xmm1
andps %xmm1, %xmm3
andnps %xmm0, %xmm1
orps %xmm3, %xmm1
movss %xmm1, 0x18(%r13)
movq %rbx, -0x50(%rbp)
movss 0xdc(%rbx), %xmm0
movss %xmm0, 0x20(%r13)
movss %xmm0, 0x1c(%r13)
leaq 0x60(%r13), %rax
movq %rax, -0x48(%rbp)
movl 0x60(%r13), %eax
testl %eax, %eax
sete %cl
incl %r14d
cmpl %r14d, %eax
sete %dl
orb %cl, %dl
movq %rsi, %rcx
movq %rsi, %rbx
jne 0x77c9d
movq -0x48(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x78c82
movq %rbx, %rcx
movl (%r15), %eax
testl %eax, %eax
movq %r13, -0x60(%rbp)
sete 0x8(%r13)
je 0x77e49
movq -0x50(%rbp), %rax
leaq 0x258(%rax), %r13
xorl %r14d, %r14d
movq -0x50(%rbp), %r12
cmpl %r14d, %ecx
je 0x77d6f
movq -0x48(%rbp), %rdi
movl %r14d, %esi
callq 0x4bb92
movq %rax, %r15
movss 0x10(%r12), %xmm0
movss %xmm0, -0x40(%rbp)
movl %r14d, %edi
callq 0x775d3
addss -0x40(%rbp), %xmm0
movss 0x2431f(%rip), %xmm1    # 0x9c018
addss %xmm1, %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movss 0x10(%r12), %xmm0
movss %xmm0, -0x2c(%rbp)
incl %r14d
movl %r14d, %edi
callq 0x775d3
addss -0x2c(%rbp), %xmm0
addss 0x242c4(%rip), %xmm0    # 0x9bff0
addss 0x242e4(%rip), %xmm0    # 0x9c018
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
leaq 0xc(%r15), %rdi
movaps -0x40(%rbp), %xmm1
movss %xmm1, 0xc(%r15)
movl $0xff7fffff, 0x10(%r15) # imm = 0xFF7FFFFF
movss %xmm0, 0x14(%r15)
movl $0x7f7fffff, 0x18(%r15) # imm = 0x7F7FFFFF
movq %r13, %rsi
callq 0x4b582
movq %rbx, %rcx
jmp 0x77cc0
movq -0x60(%rbp), %r15
movl 0x10(%r15), %edx
cmpl $0x1, %edx
movq -0x50(%rbp), %rbx
jle 0x77db1
movq %r15, %r14
addq $0x70, %r14
movq 0x2b8(%rbx), %rsi
incl %edx
movq %r14, %rdi
callq 0x6533a
movq 0x2b8(%rbx), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x656c2
xorl %edi, %edi
callq 0x778fd
movl 0xc(%r15), %edi
callq 0x775d3
movss %xmm0, -0x2c(%rbp)
movl 0xc(%r15), %edi
incl %edi
callq 0x775d3
movss %xmm0, -0x40(%rbp)
subss -0x2c(%rbp), %xmm0
mulss 0x24b08(%rip), %xmm0    # 0x9c8e4
callq 0x43b8c
movss -0x54(%rbp), %xmm3
movaps %xmm3, %xmm0
subss 0x40(%rbx), %xmm0
xorps %xmm1, %xmm1
cmpless %xmm0, %xmm1
andps %xmm0, %xmm1
movss %xmm1, 0x11c(%rbx)
movss 0x10(%rbx), %xmm0
movss 0x118(%rbx), %xmm2
addss %xmm0, %xmm2
addss %xmm1, %xmm2
cvttps2dq %xmm2, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, 0xd8(%rbx)
movss -0x40(%rbp), %xmm1
addss %xmm0, %xmm1
subss %xmm3, %xmm1
movss %xmm1, 0x240(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x48(%rbp), %rdi
movl %r14d, %esi
callq 0x78cc0
movq %rbx, %rcx
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x40(%rbp)
xorl %r15d, %r15d
leaq -0x78(%rbp), %r13
leaq -0x7c(%rbp), %r14
cmpl %ecx, %r15d
jg 0x77cae
andq $0x0, 0x10(%r13)
cvtsi2ss %r15d, %xmm0
xorps %xmm1, %xmm1
movups %xmm1, (%r13)
divss -0x40(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x78d18
movq %rbx, %rcx
incl %r15d
jmp 0x77e6c
leaq 0x3f9d5(%rip), %rdi     # 0xb7881
leaq 0x3e253(%rip), %rsi     # 0xb6106
leaq 0x3f9da(%rip), %rcx     # 0xb7894
movl $0xe74, %edx            # imm = 0xE74
callq 0xc140
leaq 0x3fa0a(%rip), %rdi     # 0xb78d5
leaq 0x3e234(%rip), %rsi     # 0xb6106
leaq 0x3f9bb(%rip), %rcx     # 0xb7894
movl $0xe75, %edx            # imm = 0xE75
callq 0xc140
leaq 0x3fa0f(%rip), %rdi     # 0xb78f9
leaq 0x3e215(%rip), %rsi     # 0xb6106
leaq 0x3f99c(%rip), %rcx     # 0xb7894
movl $0xe7a, %edx            # imm = 0xE7A
callq 0xc140