//
// cocos2d::CCTMXLayer::atlasIndexForNewZ from 0x1800af790 to 0x1800af7b3 (35 bytes)
//
// 1 xrefs:
// > ??> @ 0x18014cf68
//
// 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:22:19 +0000
//
__int64 __fastcall cocos2d::CCTMXLayer::atlasIndexForNewZ(cocos2d::CCTMXLayer *this, int a2)
{
__int64 v2; // r9
__int64 result; // rax
unsigned int v4; // r8d
__int64 v5; // r9
v2 = *((_QWORD *)this + 59);
result = 0;
v4 = *(_DWORD *)v2;
if ( *(_DWORD *)v2 )
{
v5 = *(_QWORD *)(v2 + 16);
do
{
if ( a2 < *(_DWORD *)(v5 + 8 * result) )
break;
result = (unsigned int)(result + 1);
}
while ( (unsigned int)result < v4 );
}
return result;
}