//
// cocos2d::CCTMXTiledMap::layerNamed from 0x1800ae280 to 0x1800ae33c (188 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8394
//
// 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
//
struct cocos2d::CCTMXLayer *__fastcall cocos2d::CCTMXTiledMap::layerNamed(cocos2d::CCTMXTiledMap *this, const char *a2)
{
cocos2d::CCArray *m_pChildren; // rax
cocos2d::ccArray *data; // rbx
__int64 num; // rax
cocos2d::CCObject **arr; // rbx
cocos2d::CCObject **v7; // rdi
__int64 v8; // rax
__int64 v9; // r9
const char *v10; // rcx
const char *v11; // r8
int v12; // eax
int v13; // edx
m_pChildren = this->m_pChildren;
if ( m_pChildren )
{
data = m_pChildren->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v7 = &arr[num - 1];
if ( arr <= v7 )
{
while ( *arr )
{
v8 = _RTDynamicCast(
*arr,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCTMXLayer `RTTI Type Descriptor',
0);
v9 = v8;
if ( v8 )
{
v10 = (const char *)(v8 + 408);
if ( *(_QWORD *)(v8 + 432) > 0xFu )
v10 = *(const char **)v10;
v11 = (const char *)(a2 - v10);
do
{
v12 = (unsigned __int8)v11[(_QWORD)v10];
v13 = *(unsigned __int8 *)v10 - v12;
if ( v13 )
break;
++v10;
}
while ( v12 );
if ( !v13 )
return (struct cocos2d::CCTMXLayer *)v9;
}
if ( ++arr > v7 )
return nullptr;
}
}
}
}
return nullptr;
}