//
// cocos2d::CCTMXLayer::atlasIndexForNewZ from 0xdab1a0 to 0xdab1f4 (84 bytes)
//
// 2 xrefs:
// > cocos2d::CCTMXLayer::insertTileForGID @ 0xdabdf8
// > ??> @ 0xf2080
//
// This function is hookable on this platform (idp: arm, 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 13:08:34 +0000
//
__int64 __fastcall cocos2d::CCTMXLayer::atlasIndexForNewZ(cocos2d::CCTMXLayer *this, int a2)
{
unsigned int *v2; // x2
__int64 result; // x0
_QWORD *v4; // x3
__int64 *v5; // x3
unsigned int v6; // w2
__int64 v7; // t1
v2 = *((unsigned int **)this + 58);
result = *v2;
if ( (_DWORD)result )
{
v4 = *((_QWORD **)v2 + 2);
if ( a2 < (int)*v4 )
{
return 0;
}
else
{
v5 = v4 + 1;
v6 = 0;
while ( ++v6 != (_DWORD)result )
{
v7 = *v5++;
if ( (int)v7 > a2 )
return v6;
}
}
}
return result;
}