//
// SelectArtLayer::selectArt from 0x14045c0b0 to 0x14045c17c (204 bytes)
//
// 3 xrefs:
// > SelectArtLayer::init @ 0x14045bc2c
// > SelectArtLayer::init @ 0x14045b9f0
// > ??> @ 0x140927cec
//
// 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:32:32 +0000
//
unsigned int __fastcall SelectArtLayer::selectArt(__int64 a1, __int64 a2)
{
int v3; // eax
unsigned int v4; // ebx
int v5; // ebp
unsigned int result; // eax
char *v7; // rcx
void (__fastcall *v8)(char *, _BYTE *); // r8
_BYTE *v9; // rdx
_BYTE v10[3]; // [rsp+30h] [rbp+8h] BYREF
if ( a2 )
*(_DWORD *)(a1 + 680) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v3 = *(_DWORD *)(a1 + 688);
v4 = 0;
if ( !v3 || (v5 = 0, v3 == 1) )
v5 = 1;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 664));
if ( result )
{
do
{
v7 = (char *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 664), v4) + 320;
v8 = **(void (__fastcall ***)(char *, _BYTE *))v7;
if ( *(_DWORD *)(a1 + 680) == v4 + v5 )
{
v9 = &unk_1407044BC;
}
else
{
memset(v10, 125, sizeof(v10));
v9 = v10;
}
v8(v7, v9);
++v4;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 664));
}
while ( v4 < result );
}
return result;
}