//
// cocos2d::CCTMXTiledMap::objectGroupNamed from 0x1800ae340 to 0x1800ae470 (304 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b83a0
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCTMXObjectGroup *__fastcall cocos2d::CCTMXTiledMap::objectGroupNamed(
cocos2d::CCTMXTiledMap *this,
char *a2)
{
cocos2d::CCArray *v3; // rcx
void *v4; // r15
void **v5; // rbp
__int64 v6; // rax
unsigned int *v7; // rbx
__int64 v8; // rax
__int64 *v9; // rbx
__int64 *v10; // rsi
void *v11; // r14
__int64 v12; // rdi
_QWORD *v13; // rdx
__int64 v14; // rax
void **v15; // rcx
void **v16; // rax
void *Buf1[4]; // [rsp+20h] [rbp-58h] BYREF
sub_180005910(Buf1, a2);
v3 = *((cocos2d::CCArray **)this + 43);
v4 = Buf1[3];
v5 = (void **)Buf1[0];
if ( v3 )
{
if ( (unsigned int)cocos2d::CCArray::count(v3) )
{
v6 = *((_QWORD *)this + 43);
if ( v6 )
{
v7 = *(unsigned int **)(v6 + 56);
v8 = *v7;
if ( (_DWORD)v8 )
{
v9 = *((__int64 **)v7 + 2);
v10 = &v9[v8 - 1];
if ( v9 <= v10 )
{
v11 = Buf1[2];
do
{
v12 = *v9;
if ( !*v9 )
break;
v13 = (_QWORD *)(v12 + 80);
if ( *(_QWORD *)(v12 + 104) > 0xFu )
v13 = (_QWORD *)*v13;
v14 = -1;
do
++v14;
while ( *((_BYTE *)v13 + v14) );
v15 = Buf1;
if ( (unsigned __int64)v4 > 0xF )
v15 = v5;
if ( v11 == (void *)v14 && !memcmp(v15, v13, (size_t)v11) )
goto LABEL_18;
++v9;
}
while ( v9 <= v10 );
}
}
}
}
}
v12 = 0;
LABEL_18:
if ( (unsigned __int64)v4 > 0xF )
{
v16 = v5;
if ( (unsigned __int64)v4 + 1 >= 0x1000 )
{
v5 = (void **)*(v5 - 1);
if ( (unsigned __int64)((char *)v16 - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v5);
}
return (struct cocos2d::CCTMXObjectGroup *)v12;
}