// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableBeginCell(ImGuiTable*, int)
void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
{
    ImGuiTableColumn* column = &table->Columns[column_n];
    ImGuiWindow* window = table->InnerWindow;
    table->CurrentColumn = column_n;

    // Start position is roughly ~~ CellRect.Min + CellPadding + Indent
    float start_x = column->WorkMinX;
    if (column->Flags & ImGuiTableColumnFlags_IndentEnable)
        start_x += table->RowIndentOffsetX; // ~~ += window.DC.Indent.x - table->HostIndentX, except we locked it for the row.

    window->DC.CursorPos.x = start_x;
    window->DC.CursorPos.y = table->RowPosY1 + table->CellPaddingY;
    window->DC.CursorMaxPos.x = window->DC.CursorPos.x;
    window->DC.ColumnsOffset.x = start_x - window->Pos.x - window->DC.Indent.x; // FIXME-WORKRECT
    window->DC.CurrLineTextBaseOffset = table->RowTextBaseline;
    window->DC.NavLayerCurrent = (ImGuiNavLayer)column->NavLayerCurrent;

    window->WorkRect.Min.y = window->DC.CursorPos.y;
    window->WorkRect.Min.x = column->WorkMinX;
    window->WorkRect.Max.x = column->WorkMaxX;
    window->DC.ItemWidth = column->ItemWidth;

    // To allow ImGuiListClipper to function we propagate our row height
    if (!column->IsEnabled)
        window->DC.CursorPos.y = ImMax(window->DC.CursorPos.y, table->RowPosY2);

    window->SkipItems = column->IsSkipItems;
    if (column->IsSkipItems)
    {
        window->DC.LastItemId = 0;
        window->DC.LastItemStatusFlags = 0;
    }

    if (table->Flags & ImGuiTableFlags_NoClip)
    {
        // FIXME: if we end up drawing all borders/bg in EndTable, could remove this and just assert that channel hasn't changed.
        table->DrawSplitter.SetCurrentChannel(window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
        //IM_ASSERT(table->DrawSplitter._Current == TABLE_DRAW_CHANNEL_NOCLIP);
    }
    else
    {
        // FIXME-TABLE: Could avoid this if draw channel is dummy channel?
        SetWindowClipRectBeforeSetChannel(window, column->ClipRect);
        table->DrawSplitter.SetCurrentChannel(window->DrawList, column->DrawChannelCurrent);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r12d
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x4c4c6
movq %rax, %r15
movq 0x1d0(%rbx), %r14
movl %r12d, 0x74(%rbx)
movss 0x34(%rax), %xmm1
testb $0x40, 0x1(%rax)
movaps %xmm1, %xmm2
je 0x750f1
movss 0x8c(%rbx), %xmm2
addss %xmm1, %xmm2
movss %xmm2, 0xd8(%r14)
movss 0x7c(%rbx), %xmm0
addss 0xc0(%rbx), %xmm0
movss %xmm0, 0xdc(%r14)
movss %xmm2, 0xf0(%r14)
subss 0x10(%r14), %xmm2
subss 0x118(%r14), %xmm2
movss %xmm2, 0x11c(%r14)
movss 0x88(%rbx), %xmm2
movss %xmm2, 0x110(%r14)
movsbl 0x61(%r15), %eax
movl %eax, 0x14c(%r14)
movss %xmm0, 0x23c(%r14)
movss %xmm1, 0x238(%r14)
movss 0x38(%r15), %xmm1
movss %xmm1, 0x240(%r14)
movss 0x3c(%r15), %xmm1
movss %xmm1, 0x1d0(%r14)
cmpb $0x0, 0x5a(%r15)
jne 0x751a7
movss 0x80(%rbx), %xmm1
movaps %xmm1, %xmm2
cmpless %xmm0, %xmm2
andps %xmm2, %xmm0
andnps %xmm1, %xmm2
orps %xmm0, %xmm2
movss %xmm2, 0xdc(%r14)
movb 0x5f(%r15), %al
movb %al, 0x93(%r14)
cmpb $0x1, %al
jne 0x751be
andq $0x0, 0x124(%r14)
testb $0x10, 0x6(%rbx)
jne 0x751e8
movq %r15, %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x74fd7
addq $0x1e8, %rbx            # imm = 0x1E8
movq 0x2b8(%r14), %rsi
movzbl 0x57(%r15), %edx
jmp 0x751f9
addq $0x1e8, %rbx            # imm = 0x1E8
movq 0x2b8(%r14), %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x656c2