//
// SmartTemplateCell::updateBGColor from 0x14015e040 to 0x14015e125 (229 bytes)
//
// 3 xrefs:
// > CustomListView::loadCell @ 0x140146049
// > CustomListView::reloadAll @ 0x140146e30
// > ??> @ 0x140917c3c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:27:23 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall SmartTemplateCell::updateBGColor(__int64 a1, char a2)
{
__int64 v4; // rax
__int64 v5; // rdx
__int64 v6; // rbx
__int64 v7; // rdx
void *v9; // [rsp+30h] [rbp+8h] BYREF
v4 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v9 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v9);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v4 = *(_QWORD *)&qword_14090BFB0;
}
v5 = *(_QWORD *)(v4 + 1664);
if ( v5 && *(_DWORD *)(v5 + 200) == *(_DWORD *)(*(_QWORD *)(a1 + 560) + 200LL) )
{
LOWORD(v9) = -26906;
BYTE2(v9) = 10;
v6 = a1 + 536;
}
else
{
v6 = a1 + 536;
if ( (a2 & 1) != 0 )
{
LOWORD(v9) = 29378;
BYTE2(v9) = 62;
}
else
{
LOWORD(v9) = 22689;
BYTE2(v9) = 44;
}
}
(**(void (__fastcall ***)(__int64, void **))(*(_QWORD *)v6 + 408LL))(*(_QWORD *)v6 + 408LL, &v9);
LOBYTE(v7) = -1;
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)v6 + 408LL) + 40LL))(
*(_QWORD *)v6 + 408LL,
v7);
}