// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableEndRow(ImGuiTable*)
void ImGui::TableEndRow(ImGuiTable* table)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    IM_ASSERT(window == table->InnerWindow);
    IM_ASSERT(table->IsInsideRow);

    if (table->CurrentColumn != -1)
        TableEndCell(table);

    // Position cursor at the bottom of our row so it can be used for e.g. clipping calculation. However it is
    // likely that the next call to TableBeginCell() will reposition the cursor to take account of vertical padding.
    window->DC.CursorPos.y = table->RowPosY2;

    // Row background fill
    const float bg_y1 = table->RowPosY1;
    const float bg_y2 = table->RowPosY2;
    const bool unfreeze_rows_actual = (table->CurrentRow + 1 == table->FreezeRowsCount);
    const bool unfreeze_rows_request = (table->CurrentRow + 1 == table->FreezeRowsRequest);
    if (table->CurrentRow == 0)
        table->LastFirstRowHeight = bg_y2 - bg_y1;

    const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
    if (is_visible)
    {
        // Decide of background color for the row
        ImU32 bg_col0 = 0;
        ImU32 bg_col1 = 0;
        if (table->RowBgColor[0] != IM_COL32_DISABLE)
            bg_col0 = table->RowBgColor[0];
        else if (table->Flags & ImGuiTableFlags_RowBg)
            bg_col0 = GetColorU32((table->RowBgColorCounter & 1) ? ImGuiCol_TableRowBgAlt : ImGuiCol_TableRowBg);
        if (table->RowBgColor[1] != IM_COL32_DISABLE)
            bg_col1 = table->RowBgColor[1];

        // Decide of top border color
        ImU32 border_col = 0;
        const float border_size = TABLE_BORDER_SIZE;
        if (table->CurrentRow > 0 || table->InnerWindow == table->OuterWindow)
            if (table->Flags & ImGuiTableFlags_BordersInnerH)
                border_col = (table->LastRowFlags & ImGuiTableRowFlags_Headers) ? table->BorderColorStrong : table->BorderColorLight;

        const bool draw_cell_bg_color = table->RowCellDataCurrent >= 0;
        const bool draw_strong_bottom_border = unfreeze_rows_actual;
        if ((bg_col0 | bg_col1 | border_col) != 0 || draw_strong_bottom_border || draw_cell_bg_color)
        {
            // In theory we could call SetWindowClipRectBeforeSetChannel() but since we know TableEndRow() is
            // always followed by a change of clipping rectangle we perform the smallest overwrite possible here.
            if ((table->Flags & ImGuiTableFlags_NoClip) == 0)
                window->DrawList->_CmdHeader.ClipRect = table->Bg0ClipRectForDrawCmd.ToVec4();
            table->DrawSplitter.SetCurrentChannel(window->DrawList, TABLE_DRAW_CHANNEL_BG0);
        }

        // Draw row background
        // We soft/cpu clip this so all backgrounds and borders can share the same clipping rectangle
        if (bg_col0 || bg_col1)
        {
            ImRect row_rect(table->WorkRect.Min.x, bg_y1, table->WorkRect.Max.x, bg_y2);
            row_rect.ClipWith(table->BgClipRect);
            if (bg_col0 != 0 && row_rect.Min.y < row_rect.Max.y)
                window->DrawList->AddRectFilled(row_rect.Min, row_rect.Max, bg_col0);
            if (bg_col1 != 0 && row_rect.Min.y < row_rect.Max.y)
                window->DrawList->AddRectFilled(row_rect.Min, row_rect.Max, bg_col1);
        }

        // Draw cell background color
        if (draw_cell_bg_color)
        {
            ImGuiTableCellData* cell_data_end = &table->RowCellData[table->RowCellDataCurrent];
            for (ImGuiTableCellData* cell_data = &table->RowCellData[0]; cell_data <= cell_data_end; cell_data++)
            {
                const ImGuiTableColumn* column = &table->Columns[cell_data->Column];
                ImRect cell_bg_rect = TableGetCellBgRect(table, cell_data->Column);
                cell_bg_rect.ClipWith(table->BgClipRect);
                cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x);     // So that first column after frozen one gets clipped
                cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX);
                window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
            }
        }

        // Draw top border
        if (border_col && bg_y1 >= table->BgClipRect.Min.y && bg_y1 < table->BgClipRect.Max.y)
            window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y1), ImVec2(table->BorderX2, bg_y1), border_col, border_size);

        // Draw bottom border at the row unfreezing mark (always strong)
        if (draw_strong_bottom_border && bg_y2 >= table->BgClipRect.Min.y && bg_y2 < table->BgClipRect.Max.y)
            window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y2), ImVec2(table->BorderX2, bg_y2), table->BorderColorStrong, border_size);
    }

    // End frozen rows (when we are past the last frozen row line, teleport cursor and alter clipping rectangle)
    // We need to do that in TableEndRow() instead of TableBeginRow() so the list clipper can mark end of row and
    // get the new cursor position.
    if (unfreeze_rows_request)
        for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
        {
            ImGuiTableColumn* column = &table->Columns[column_n];
            column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
        }
    if (unfreeze_rows_actual)
    {
        IM_ASSERT(table->IsUnfrozenRows == false);
        table->IsUnfrozenRows = true;

        // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
        float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
        table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
        table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
        table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
        IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);

        float row_height = table->RowPosY2 - table->RowPosY1;
        table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y;
        table->RowPosY1 = table->RowPosY2 - row_height;
        for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
        {
            ImGuiTableColumn* column = &table->Columns[column_n];
            column->DrawChannelCurrent = column->DrawChannelUnfrozen;
            column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y;
        }

        // Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y
        SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect);
        table->DrawSplitter.SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent);
    }

    if (!(table->RowFlags & ImGuiTableRowFlags_Headers))
        table->RowBgColorCounter++;
    table->IsInsideRow = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x70911(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %r12
cmpq 0x1d0(%rdi), %r12
jne 0x7393f
movq %rdi, %rbx
cmpb $0x0, 0x249(%rdi)
je 0x7395e
cmpl $-0x1, 0x74(%rbx)
je 0x73404
movq %rbx, %rdi
callq 0x74f0a
movss 0x80(%rbx), %xmm1
movss %xmm1, 0xdc(%r12)
movss 0x7c(%rbx), %xmm2
movl 0x70(%rbx), %eax
testl %eax, %eax
jne 0x73431
movaps %xmm1, %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0xd0(%rbx)
leal 0x1(%rax), %r13d
movsbl 0x241(%rbx), %ecx
movl %ecx, -0x40(%rbp)
movsbl 0x240(%rbx), %r14d
ucomiss 0x120(%rbx), %xmm1
jb 0x737b9
movss 0x128(%rbx), %xmm0
ucomiss %xmm2, %xmm0
jb 0x737b9
movl %r13d, -0x50(%rbp)
movl 0x98(%rbx), %r13d
cmpl $0x1000000, %r13d       # imm = 0x1000000
movss %xmm1, -0x4c(%rbp)
movss %xmm2, -0x3c(%rbp)
movq %r12, -0x48(%rbp)
jne 0x734b4
xorl %r13d, %r13d
testb $0x40, 0x4(%rbx)
je 0x734b4
movl 0x94(%rbx), %edi
andl $0x1, %edi
addl $0x2d, %edi
movss 0x28b54(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movss -0x3c(%rbp), %xmm2
movl %eax, %r13d
movl 0x70(%rbx), %eax
movl 0x9c(%rbx), %r12d
xorl %edx, %edx
cmpl $0x1000000, %r12d       # imm = 0x1000000
cmovel %edx, %r12d
testl %eax, %eax
movl %r14d, -0x58(%rbp)
jle 0x734eb
testb $-0x80, 0x4(%rbx)
je 0x734fb
xorl %eax, %eax
testb $0x1, 0x92(%rbx)
sete %al
movl 0xa0(%rbx,%rax,4), %edx
jmp 0x734fb
movq 0x1d0(%rbx), %rax
cmpq 0x1c8(%rbx), %rax
je 0x734d0
movl -0x40(%rbp), %eax
cmpl %eax, -0x50(%rbp)
sete %al
movb 0x244(%rbx), %r15b
testb %r15b, %r15b
setns %cl
movl %r12d, %r14d
orl %r13d, %r14d
movl %edx, -0x54(%rbp)
orl %r14d, %edx
setne %dl
orb %al, %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x73566
testb $0x10, 0x6(%rbx)
jne 0x73548
movups 0x13c(%rbx), %xmm0
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rax
movups %xmm0, 0x88(%rax)
leaq 0x1e8(%rbx), %rdi
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rsi
xorl %edx, %edx
callq 0x656c2
movss -0x3c(%rbp), %xmm2
testl %r14d, %r14d
je 0x7360d
movss 0x10c(%rbx), %xmm0
movss 0x114(%rbx), %xmm1
leaq -0x38(%rbp), %rdi
movss %xmm0, (%rdi)
movss %xmm2, 0x4(%rdi)
movss %xmm1, 0x8(%rdi)
movss -0x4c(%rbp), %xmm0
movss %xmm0, 0xc(%rdi)
leaq 0x12c(%rbx), %rsi
callq 0x49efc
leaq -0x30(%rbp), %r14
testl %r13d, %r13d
je 0x735dc
movss -0x2c(%rbp), %xmm0
ucomiss -0x34(%rbp), %xmm0
jbe 0x735dc
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rdi
leaq -0x38(%rbp), %rsi
pushq $0xf
popq %r8
xorps %xmm0, %xmm0
movq %r14, %rdx
movl %r13d, %ecx
callq 0x64020
testl %r12d, %r12d
je 0x7360d
movss -0x2c(%rbp), %xmm0
ucomiss -0x34(%rbp), %xmm0
jbe 0x7360d
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rdi
leaq -0x38(%rbp), %rsi
pushq $0xf
popq %r8
xorps %xmm0, %xmm0
movq %r14, %rdx
movl %r12d, %ecx
callq 0x64020
testb %r15b, %r15b
js 0x736e6
leaq 0x30(%rbx), %r14
movsbl 0x244(%rbx), %esi
movq %r14, %rdi
callq 0x789b2
movq %rax, -0x68(%rbp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x789b2
movq %rax, %r13
leaq 0x10(%rbx), %rax
movq %rax, -0x60(%rbp)
leaq 0x12c(%rbx), %r14
leaq -0x38(%rbp), %r12
cmpq -0x68(%rbp), %r13
ja 0x736e6
movsbl 0x4(%r13), %esi
movq -0x60(%rbp), %rdi
callq 0x4c4c6
movq %rax, %r15
movsbl 0x4(%r13), %esi
movq %rbx, %rdi
callq 0x74b53
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x49efc
movss 0x20(%r15), %xmm0
movss -0x38(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movaps %xmm0, %xmm3
cmpless %xmm1, %xmm3
movaps %xmm3, %xmm4
andnps %xmm0, %xmm4
andps %xmm1, %xmm3
orps %xmm4, %xmm3
movss %xmm3, -0x38(%rbp)
minss 0xc(%r15), %xmm2
movss %xmm2, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rdi
movl (%r13), %ecx
xorps %xmm0, %xmm0
movq %r12, %rsi
leaq -0x30(%rbp), %rdx
pushq $0xf
popq %r8
callq 0x64020
addq $0x8, %r13
jmp 0x7364d
movl -0x54(%rbp), %ecx
testl %ecx, %ecx
movq -0x48(%rbp), %r12
movss -0x3c(%rbp), %xmm1
je 0x7374b
ucomiss 0x130(%rbx), %xmm1
jb 0x7374b
movss 0x138(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x7374b
movq 0x2b8(%r12), %rdi
movss 0xa8(%rbx), %xmm0
leaq -0x38(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss 0xac(%rbx), %xmm0
leaq -0x70(%rbp), %rdx
movss %xmm0, (%rdx)
movss %xmm1, 0x4(%rdx)
movss 0x288b2(%rip), %xmm0    # 0x9bff8
callq 0x63ec2
movl -0x50(%rbp), %r13d
cmpl -0x40(%rbp), %r13d
movss -0x4c(%rbp), %xmm1
movl -0x58(%rbp), %r14d
jne 0x737b9
ucomiss 0x130(%rbx), %xmm1
jb 0x737b9
movss 0x138(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x737b9
movq 0x2b8(%r12), %rdi
movss 0xa8(%rbx), %xmm0
leaq -0x38(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss 0xac(%rbx), %xmm0
leaq -0x70(%rbp), %rdx
movss %xmm0, (%rdx)
movss %xmm1, 0x4(%rdx)
movl 0xa0(%rbx), %ecx
movss 0x28844(%rip), %xmm0    # 0x9bff8
callq 0x63ec2
cmpl %r14d, %r13d
jne 0x737e9
leaq 0x10(%rbx), %r14
xorl %r15d, %r15d
cmpl 0x6c(%rbx), %r15d
jge 0x737e9
movq %r14, %rdi
movl %r15d, %esi
callq 0x4c4c6
movsbl 0x243(%rbx), %ecx
cmpl %ecx, %r15d
setl 0x61(%rax)
incl %r15d
jmp 0x737c5
cmpl -0x40(%rbp), %r13d
jne 0x7391a
cmpb $0x0, 0x253(%rbx)
jne 0x7397d
movb $0x1, 0x253(%rbx)
movss 0x80(%rbx), %xmm0
movss 0x287e1(%rip), %xmm1    # 0x9bff8
addss %xmm0, %xmm1
movss 0x22c(%r12), %xmm2
movss 0x234(%r12), %xmm3
movaps %xmm2, %xmm4
cmpless %xmm1, %xmm4
andps %xmm4, %xmm1
andnps %xmm2, %xmm4
orps %xmm1, %xmm4
minss %xmm3, %xmm4
movss %xmm4, 0x150(%rbx)
movss %xmm4, 0x130(%rbx)
movss %xmm3, 0x158(%rbx)
movss %xmm3, 0x138(%rbx)
movb 0x247(%rbx), %al
movb %al, 0x246(%rbx)
ucomiss %xmm4, %xmm3
jb 0x7399c
movaps %xmm0, %xmm1
subss 0x7c(%rbx), %xmm1
addss 0x110(%rbx), %xmm0
subss 0xf0(%rbx), %xmm0
movss %xmm0, 0xdc(%r12)
movss %xmm0, 0x80(%rbx)
subss %xmm1, %xmm0
movss %xmm0, 0x7c(%rbx)
leaq 0x10(%rbx), %r14
xorl %r15d, %r15d
cmpl 0x6c(%rbx), %r15d
jge 0x738dc
movq %r14, %rdi
movl %r15d, %esi
callq 0x4c4c6
movb 0x59(%rax), %cl
movb %cl, 0x57(%rax)
movss 0x150(%rbx), %xmm0
movss %xmm0, 0x24(%rax)
incl %r15d
jmp 0x738b3
movq %r14, %rdi
xorl %esi, %esi
callq 0x4c4c6
leaq 0x20(%rax), %rsi
movq %r12, %rdi
callq 0x74fd7
leaq 0x1e8(%rbx), %r15
movq 0x2b8(%r12), %r12
movq %r14, %rdi
xorl %esi, %esi
callq 0x4c4c6
movzbl 0x57(%rax), %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x656c2
testb $0x1, 0x90(%rbx)
jne 0x73929
incl 0x94(%rbx)
movb $0x0, 0x249(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x43147(%rip), %rdi     # 0xb6a8d
leaq 0x427b9(%rip), %rsi     # 0xb6106
leaq 0x43156(%rip), %rcx     # 0xb6aaa
movl $0x664, %edx            # imm = 0x664
callq 0xc140
leaq 0x430ed(%rip), %rdi     # 0xb6a52
leaq 0x4279a(%rip), %rsi     # 0xb6106
leaq 0x43137(%rip), %rcx     # 0xb6aaa
movl $0x665, %edx            # imm = 0x665
callq 0xc140
leaq 0x4314c(%rip), %rdi     # 0xb6ad0
leaq 0x4277b(%rip), %rsi     # 0xb6106
leaq 0x43118(%rip), %rcx     # 0xb6aaa
movl $0x6c4, %edx            # imm = 0x6C4
callq 0xc140
leaq 0x4314c(%rip), %rdi     # 0xb6aef
leaq 0x4275c(%rip), %rsi     # 0xb6106
leaq 0x430f9(%rip), %rcx     # 0xb6aaa
movl $0x6cc, %edx            # imm = 0x6CC
callq 0xc140