//
// cocos2d::CCDirector::levelForSceneInStack from 0x7ca9e8 to 0x7caa22 (58 bytes)
//
// 1 xrefs:
// > cocos2d::CCDirector::popToSceneInStack @ 0x7cab56
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:30 +0000
//
int __fastcall cocos2d::CCDirector::levelForSceneInStack(int a1, int a2)
{
int result; // r0
int *v3; // r3
int *v4; // r2
int *v5; // r4
int v6; // r3
int v7; // t1
result = *(_DWORD *)(a1 + 232);
if ( result )
{
v3 = *(int **)(result + 52);
result = *v3;
if ( *v3 )
{
v4 = (int *)v3[3];
v5 = &v4[result - 1];
v6 = 0;
do
{
if ( v4 > v5 )
return 0;
v7 = *v4++;
result = v7;
if ( !v7 )
return result;
++v6;
}
while ( result != a2 );
return v6;
}
}
return result;
}