//
// cocos2d::CCTMXLayer::atlasIndexForNewZ from 0x1002451d0 to 0x100245205 (53 bytes)
//
// 0 xrefs:
//
// 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 12:27:19 +0000
//
__int64 __fastcall cocos2d::CCTMXLayer::atlasIndexForNewZ(__int64 a1, int a2)
{
unsigned int *v2; // rax
__int64 v3; // rcx
__int64 v4; // rdx
__int64 result; // rax
v2 = *(unsigned int **)(a1 + 464);
v3 = *v2;
if ( !*v2 )
return 0;
v4 = *((_QWORD *)v2 + 2);
result = 0;
while ( *(_DWORD *)(v4 + 8 * result) <= a2 )
{
if ( v3 == ++result )
return (unsigned int)v3;
}
return result;
}