//
// sub_1003524F0 from 0x1003524f0 to 0x100352596 (166 bytes)
//
// 10 xrefs:
// > ??> @ 0x100915bb0
// > ??> @ 0x100916350
// > ??> @ 0x100916ab8
// > ??> @ 0x1009171a8
// > ??> @ 0x1009180f0
// > ??> @ 0x10091b610
// > ??> @ 0x100924cd0
// > ??> @ 0x100927158
// > ??> @ 0x1009288f8
// > ??> @ 0x100947ab8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_QWORD *__fastcall sub_1003524F0(__int64 a1, unsigned __int8 a2)
{
_QWORD *result; // rax
const void **v3; // r12
unsigned __int64 v4; // r13
*(_BYTE *)(a1 + 18) = a2;
result = (_QWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 - 408) + 472LL))(a1 - 408);
if ( result )
{
result = (_QWORD *)result[7];
if ( *(_DWORD *)result )
{
v3 = (const void **)result[2];
v4 = (unsigned __int64)&v3[*(unsigned int *)result - 1];
do
{
if ( !*v3 )
break;
result = __dynamic_cast(
*v3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCRGBAProtocol,
-2);
if ( result )
result = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD *, _QWORD))(*result + 48LL))(result, a2);
++v3;
}
while ( (unsigned __int64)v3 <= v4 );
}
}
return result;
}