// File: /workspace/github_cpp_makefile_star2_O1/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 0x8d47f
leaq 0x7091a(%rip), %rax     # 0xfdcd0
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 0x8d3ff
movss 0x7c(%rcx), %xmm0
ucomiss 0x128(%rcx), %xmm0
ja 0x8d47d
cmpl $-0x1, %edx
jne 0x8d4bd
xorl %edx, %edx
cmpl $0x2, %edi
sete %dl
movl %eax, 0x98(%rcx,%rdx,4)
jmp 0x8d47d
cmpl $0x3, %edi
jne 0x8d49e
movss 0x7c(%rcx), %xmm0
ucomiss 0x128(%rcx), %xmm0
ja 0x8d47d
cmpl $-0x1, %edx
jne 0x8d41e
movl 0x74(%rcx), %edx
movq 0x50(%rcx), %rsi
btq %rdx, %rsi
jae 0x8d47d
movsbq 0x244(%rcx), %rsi
testq %rsi, %rsi
js 0x8d453
leaq (,%rsi,8), %rdi
addq 0x30(%rcx), %rdi
cmpq 0x38(%rcx), %rdi
jae 0x8d4dc
movsbl 0x4(%rdi), %edi
cmpl %edi, %edx
je 0x8d45d
incb %sil
movb %sil, 0x244(%rcx)
movsbq 0x244(%rcx), %rsi
testq %rsi, %rsi
js 0x8d4dc
shlq $0x3, %rsi
addq 0x30(%rcx), %rsi
cmpq 0x38(%rcx), %rsi
jae 0x8d4dc
movl %eax, (%rsi)
movb %dl, 0x4(%rsi)
popq %rbp
retq
leaq 0x44312(%rip), %rdi     # 0xd1798
leaq 0x43a2d(%rip), %rsi     # 0xd0eba
leaq 0x44326(%rip), %rcx     # 0xd17ba
movl $0x5ec, %edx            # imm = 0x5EC
callq 0xc140
leaq 0x2cc47(%rip), %rdi     # 0xba0ec
leaq 0x43a0e(%rip), %rsi     # 0xd0eba
leaq 0x44307(%rip), %rcx     # 0xd17ba
movl $0x60e, %edx            # imm = 0x60E
callq 0xc140
leaq 0x44332(%rip), %rdi     # 0xd17f6
leaq 0x439ef(%rip), %rsi     # 0xd0eba
leaq 0x442e8(%rip), %rcx     # 0xd17ba
movl $0x608, %edx            # imm = 0x608
callq 0xc140
leaq 0x2f1d5(%rip), %rdi     # 0xbc6b8
leaq 0x2e155(%rip), %rsi     # 0xbb63f
leaq 0x4577b(%rip), %rcx     # 0xd2c6c
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140