// File: /workspace/github_cpp_makefile_star2_O3/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 0x7212c(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %r13
cmpq 0x1d0(%rdi), %r13
jne 0x8a1a9
movq %rdi, %rbx
cmpb $0x0, 0x249(%rdi)
je 0x8a1c8
cmpl $-0x1, 0x74(%rbx)
je 0x89bd9
movq %rbx, %rdi
callq 0x8ba2c
movss 0x80(%rbx), %xmm1
movss %xmm1, 0xdc(%r13)
movss 0x7c(%rbx), %xmm2
movl 0x70(%rbx), %eax
testl %eax, %eax
jne 0x89c05
movaps %xmm1, %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0xd0(%rbx)
leal 0x1(%rax), %r14d
movsbl 0x241(%rbx), %r15d
movsbl 0x240(%rbx), %r12d
ucomiss 0x120(%rbx), %xmm1
jb 0x89fe0
movss 0x128(%rbx), %xmm0
ucomiss %xmm2, %xmm0
jb 0x89fe0
movl %r12d, -0x50(%rbp)
movl 0x98(%rbx), %r12d
cmpl $0x1000000, %r12d       # imm = 0x1000000
movss %xmm1, -0x44(%rbp)
movaps %xmm2, -0x70(%rbp)
movl %r15d, -0x48(%rbp)
jne 0x89c80
xorl %r12d, %r12d
testb $0x40, 0x4(%rbx)
je 0x89c80
movl 0x94(%rbx), %edi
andl $0x1, %edi
addl $0x2d, %edi
movss 0x2b36f(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movl %eax, %r12d
movl 0x70(%rbx), %eax
movl 0x9c(%rbx), %r15d
xorl %edx, %edx
cmpl $0x1000000, %r15d       # imm = 0x1000000
cmovel %edx, %r15d
testl %eax, %eax
jle 0x89cb3
testb $-0x80, 0x4(%rbx)
je 0x89cc3
xorl %eax, %eax
testb $0x1, 0x92(%rbx)
sete %al
movl 0xa0(%rbx,%rax,4), %edx
jmp 0x89cc3
movq 0x1d0(%rbx), %rax
cmpq 0x1c8(%rbx), %rax
je 0x89c98
movl %r14d, -0x54(%rbp)
cmpl -0x48(%rbp), %r14d
sete %al
movb 0x244(%rbx), %cl
movb %cl, -0x29(%rbp)
testb %cl, %cl
setns %cl
movl %r15d, %r14d
orl %r12d, %r14d
movl %edx, -0x4c(%rbp)
orl %r14d, %edx
setne %dl
orb %al, %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x89d24
testb $0x10, 0x6(%rbx)
jne 0x89d0f
movups 0x13c(%rbx), %xmm0
movq 0x2b8(%r13), %rax
movups %xmm0, 0x88(%rax)
leaq 0x1e8(%rbx), %rdi
movq 0x2b8(%r13), %rsi
xorl %edx, %edx
callq 0x7a998
testl %r14d, %r14d
je 0x89df6
movss 0x10c(%rbx), %xmm0
movss 0x114(%rbx), %xmm2
leaq -0x38(%rbp), %r14
movss 0x12c(%rbx), %xmm1
movss 0x130(%rbx), %xmm3
movaps %xmm1, %xmm4
cmpless %xmm0, %xmm4
andps %xmm4, %xmm0
andnps %xmm1, %xmm4
orps %xmm0, %xmm4
movaps %xmm3, %xmm0
movaps -0x70(%rbp), %xmm5
cmpless %xmm5, %xmm0
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
andnps %xmm3, %xmm0
orps %xmm1, %xmm0
unpcklps %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1]
movlps %xmm4, -0x8(%r14)
minss 0x134(%rbx), %xmm2
movss -0x44(%rbp), %xmm1
minss 0x138(%rbx), %xmm1
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movlps %xmm2, (%r14)
testl %r12d, %r12d
je 0x89dc7
ucomiss %xmm0, %xmm1
jbe 0x89dc7
movq 0x2b8(%r13), %rdi
leaq -0x40(%rbp), %rsi
xorps %xmm0, %xmm0
movq %r14, %rdx
movl %r12d, %ecx
movl $0xf, %r8d
callq 0x785e6
testl %r15d, %r15d
je 0x89df6
movss -0x34(%rbp), %xmm0
ucomiss -0x3c(%rbp), %xmm0
jbe 0x89df6
movq 0x2b8(%r13), %rdi
leaq -0x40(%rbp), %rsi
xorps %xmm0, %xmm0
movq %r14, %rdx
movl %r15d, %ecx
movl $0xf, %r8d
callq 0x785e6
movq %r13, %r12
cmpb $0x0, -0x29(%rbp)
js 0x89f0e
movsbq 0x244(%rbx), %rax
testq %rax, %rax
js 0x8a225
movq 0x30(%rbx), %r14
leaq (%r14,%rax,8), %r13
cmpq 0x38(%rbx), %r13
jae 0x8a225
movsbq 0x4(%r14), %rsi
testq %rsi, %rsi
js 0x8a18a
imulq $0x68, %rsi, %r15
addq 0x10(%rbx), %r15
cmpq 0x18(%rbx), %r15
jae 0x8a18a
movq %rbx, %rdi
callq 0x8b63c
movaps %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
movss 0x12c(%rbx), %xmm4
movss 0x130(%rbx), %xmm5
movaps %xmm4, %xmm2
cmpless %xmm0, %xmm2
andps %xmm2, %xmm0
andnps %xmm4, %xmm2
orps %xmm0, %xmm2
movaps %xmm5, %xmm0
cmpless %xmm3, %xmm0
andps %xmm0, %xmm3
andnps %xmm5, %xmm0
orps %xmm3, %xmm0
movaps %xmm2, %xmm3
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movlps %xmm3, -0x40(%rbp)
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movss 0x134(%rbx), %xmm3
minss %xmm3, %xmm1
minss 0x138(%rbx), %xmm0
movaps %xmm1, %xmm3
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movlps %xmm3, -0x38(%rbp)
movss 0x20(%r15), %xmm0
movaps %xmm0, %xmm3
cmpless %xmm2, %xmm3
movaps %xmm3, %xmm4
andps %xmm2, %xmm4
andnps %xmm0, %xmm3
orps %xmm4, %xmm3
movss %xmm3, -0x40(%rbp)
minss 0xc(%r15), %xmm1
movss %xmm1, -0x38(%rbp)
movq 0x2b8(%r12), %rdi
movl (%r14), %ecx
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movl $0xf, %r8d
callq 0x785e6
addq $0x8, %r14
cmpq %r13, %r14
jbe 0x89e26
movl -0x4c(%rbp), %ecx
testl %ecx, %ecx
movq %r12, %r13
movaps -0x70(%rbp), %xmm1
je 0x89f70
ucomiss 0x130(%rbx), %xmm1
jb 0x89f70
movss 0x138(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x89f70
movq 0x2b8(%r13), %rdi
movss 0xa8(%rbx), %xmm0
leaq -0x40(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss 0xac(%rbx), %xmm0
leaq -0x5c(%rbp), %rdx
movss %xmm0, (%rdx)
movss %xmm1, 0x4(%rdx)
movss 0x2b079(%rip), %xmm0    # 0xb4fe4
callq 0x78368
movl -0x54(%rbp), %r14d
movl -0x48(%rbp), %r15d
cmpl %r15d, %r14d
movss -0x44(%rbp), %xmm1
movl -0x50(%rbp), %r12d
jne 0x89fe0
ucomiss 0x130(%rbx), %xmm1
jb 0x89fe0
movss 0x138(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x89fe0
movq 0x2b8(%r13), %rdi
movss 0xa8(%rbx), %xmm0
leaq -0x40(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss 0xac(%rbx), %xmm0
leaq -0x5c(%rbp), %rdx
movss %xmm0, (%rdx)
movss %xmm1, 0x4(%rdx)
movl 0xa0(%rbx), %ecx
movss 0x2b009(%rip), %xmm0    # 0xb4fe4
callq 0x78368
cmpl %r12d, %r14d
jne 0x8a019
movslq 0x6c(%rbx), %rax
testq %rax, %rax
jle 0x8a019
movq 0x10(%rbx), %rcx
xorl %edx, %edx
cmpq 0x18(%rbx), %rcx
jae 0x8a18a
movsbq 0x243(%rbx), %rsi
cmpq %rsi, %rdx
setl 0x61(%rcx)
incq %rdx
addq $0x68, %rcx
cmpq %rdx, %rax
jne 0x89ff4
cmpl %r15d, %r14d
jne 0x8a165
cmpb $0x0, 0x253(%rbx)
jne 0x8a1e7
movb $0x1, 0x253(%rbx)
movss 0x80(%rbx), %xmm1
movss 0x2af9e(%rip), %xmm2    # 0xb4fe4
addss %xmm1, %xmm2
movss 0x22c(%r13), %xmm3
movss 0x234(%r13), %xmm4
movaps %xmm3, %xmm0
cmpless %xmm2, %xmm0
andps %xmm0, %xmm2
andnps %xmm3, %xmm0
orps %xmm2, %xmm0
minss %xmm4, %xmm0
movss %xmm0, 0x150(%rbx)
movss %xmm0, 0x130(%rbx)
movss %xmm4, 0x158(%rbx)
movss %xmm4, 0x138(%rbx)
movb 0x247(%rbx), %al
movb %al, 0x246(%rbx)
ucomiss %xmm0, %xmm4
jb 0x8a206
movaps %xmm1, %xmm2
subss 0x7c(%rbx), %xmm2
addss 0x110(%rbx), %xmm1
subss 0xf0(%rbx), %xmm1
movss %xmm1, 0xdc(%r13)
movss %xmm1, 0x80(%rbx)
subss %xmm2, %xmm1
movss %xmm1, 0x7c(%rbx)
movslq 0x6c(%rbx), %rcx
movq 0x10(%rbx), %rax
testq %rcx, %rcx
jle 0x8a108
movq %rax, %rdx
cmpq 0x18(%rbx), %rdx
jae 0x8a18a
movb 0x59(%rdx), %sil
movb %sil, 0x57(%rdx)
movss %xmm0, 0x24(%rdx)
addq $0x68, %rdx
decq %rcx
jne 0x8a0e8
cmpq 0x18(%rbx), %rax
jae 0x8a18a
movups 0x20(%rax), %xmm0
movups 0x20(%rax), %xmm1
movups %xmm1, 0x258(%r13)
movq 0x2b8(%r13), %rax
movups %xmm0, 0x88(%rax)
movq 0x2b8(%r13), %rax
movq 0x60(%rax), %rcx
movslq 0x58(%rax), %rax
shlq $0x4, %rax
movups %xmm0, -0x10(%rcx,%rax)
movq 0x10(%rbx), %rax
cmpq 0x18(%rbx), %rax
jae 0x8a18a
movq 0x2b8(%r13), %rsi
leaq 0x1e8(%rbx), %rdi
movzbl 0x57(%rax), %edx
callq 0x7a998
testb $0x1, 0x90(%rbx)
jne 0x8a174
incl 0x94(%rbx)
movb $0x0, 0x249(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30527(%rip), %rdi     # 0xba6b8
leaq 0x2f4a7(%rip), %rsi     # 0xb963f
leaq 0x30532(%rip), %rcx     # 0xba6d1
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x45661(%rip), %rdi     # 0xcf811
leaq 0x44cd3(%rip), %rsi     # 0xcee8a
leaq 0x45670(%rip), %rcx     # 0xcf82e
movl $0x664, %edx            # imm = 0x664
callq 0xc140
leaq 0x45607(%rip), %rdi     # 0xcf7d6
leaq 0x44cb4(%rip), %rsi     # 0xcee8a
leaq 0x45651(%rip), %rcx     # 0xcf82e
movl $0x665, %edx            # imm = 0x665
callq 0xc140
leaq 0x45666(%rip), %rdi     # 0xcf854
leaq 0x44c95(%rip), %rsi     # 0xcee8a
leaq 0x45632(%rip), %rcx     # 0xcf82e
movl $0x6c4, %edx            # imm = 0x6C4
callq 0xc140
leaq 0x45666(%rip), %rdi     # 0xcf873
leaq 0x44c76(%rip), %rsi     # 0xcee8a
leaq 0x45613(%rip), %rcx     # 0xcf82e
movl $0x6cc, %edx            # imm = 0x6CC
callq 0xc140
leaq 0x3048c(%rip), %rdi     # 0xba6b8
leaq 0x2f40c(%rip), %rsi     # 0xb963f
leaq 0x46904(%rip), %rcx     # 0xd0b3e
jmp 0x8a19f