// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableSetBgColor(int, unsigned int, int)
void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n)
{
    ImGuiContext& g = *GImGui;
    ImGuiTable* table = g.CurrentTable;
    IM_ASSERT(target != ImGuiTableBgTarget_None);

    if (color == IM_COL32_DISABLE)
        color = 0;

    // We cannot draw neither the cell or row background immediately as we don't know the row height at this point in time.
    switch (target)
    {
    case ImGuiTableBgTarget_CellBg:
    {
        if (table->RowPosY1 > table->InnerClipRect.Max.y) // Discard
            return;
        if (column_n == -1)
            column_n = table->CurrentColumn;
        if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
            return;
        if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n)
            table->RowCellDataCurrent++;
        ImGuiTableCellData* cell_data = &table->RowCellData[table->RowCellDataCurrent];
        cell_data->BgColor = color;
        cell_data->Column = (ImGuiTableColumnIdx)column_n;
        break;
    }
    case ImGuiTableBgTarget_RowBg0:
    case ImGuiTableBgTarget_RowBg1:
    {
        if (table->RowPosY1 > table->InnerClipRect.Max.y) // Discard
            return;
        IM_ASSERT(column_n == -1);
        int bg_idx = (target == ImGuiTableBgTarget_RowBg1) ? 1 : 0;
        table->RowBgColor[bg_idx] = color;
        break;
    }
    default:
        IM_ASSERT(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edi, %edi
je 0x8b7b1
leaq 0x705e5(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq 0x20a8(%rax), %rcx
xorl %eax, %eax
cmpl $0x1000000, %esi        # imm = 0x1000000
cmovnel %esi, %eax
leal -0x1(%rdi), %esi
cmpl $0x2, %esi
jae 0x8b734
movss 0x7c(%rcx), %xmm0
ucomiss 0x128(%rcx), %xmm0
ja 0x8b7af
cmpl $-0x1, %edx
jne 0x8b7ef
xorl %edx, %edx
cmpl $0x2, %edi
sete %dl
movl %eax, 0x98(%rcx,%rdx,4)
jmp 0x8b7af
cmpl $0x3, %edi
jne 0x8b7d0
movss 0x7c(%rcx), %xmm0
ucomiss 0x128(%rcx), %xmm0
ja 0x8b7af
cmpl $-0x1, %edx
jne 0x8b753
movl 0x74(%rcx), %edx
movq 0x50(%rcx), %rsi
btq %rdx, %rsi
jae 0x8b7af
movsbq 0x244(%rcx), %rsi
movq 0x30(%rcx), %rdi
testq %rsi, %rsi
js 0x8b78b
leaq (%rdi,%rsi,8), %r9
movq 0x38(%rcx), %r8
cmpq %r8, %r9
jae 0x8b80e
movsbl 0x4(%r9), %r9d
cmpl %r9d, %edx
jne 0x8b78f
jmp 0x8b798
movq 0x38(%rcx), %r8
incl %esi
movb %sil, 0x244(%rcx)
testb %sil, %sil
js 0x8b80e
movsbq %sil, %rcx
leaq (%rdi,%rcx,8), %rcx
cmpq %r8, %rcx
jae 0x8b80e
movl %eax, (%rcx)
movb %dl, 0x4(%rcx)
popq %rbp
retq
leaq 0x43fb0(%rip), %rdi     # 0xcf768
leaq 0x436cb(%rip), %rsi     # 0xcee8a
leaq 0x43fc4(%rip), %rcx     # 0xcf78a
movl $0x5ec, %edx            # imm = 0x5EC
callq 0xc140
leaq 0x2c915(%rip), %rdi     # 0xb80ec
leaq 0x436ac(%rip), %rsi     # 0xcee8a
leaq 0x43fa5(%rip), %rcx     # 0xcf78a
movl $0x60e, %edx            # imm = 0x60E
callq 0xc140
leaq 0x43fd0(%rip), %rdi     # 0xcf7c6
leaq 0x4368d(%rip), %rsi     # 0xcee8a
leaq 0x43f86(%rip), %rcx     # 0xcf78a
movl $0x608, %edx            # imm = 0x608
callq 0xc140
leaq 0x2eea3(%rip), %rdi     # 0xba6b8
leaq 0x2de23(%rip), %rsi     # 0xb963f
leaq 0x4531b(%rip), %rcx     # 0xd0b3e
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140