//
// cocos2d::CCDirector::levelForSceneInStack from 0x100478fe0 to 0x10047902e (78 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:30:36 +0000
//
__int64 __fastcall cocos2d::CCDirector::levelForSceneInStack(__int64 a1, __int64 a2)
{
__int64 v2; // rcx
__int64 result; // rax
unsigned int *v4; // rcx
__int64 v5; // rdx
_QWORD *v6; // rcx
unsigned __int64 v7; // rdi
unsigned int v8; // edx
v2 = *(_QWORD *)(a1 + 296);
result = 0;
if ( v2 )
{
v4 = *(unsigned int **)(v2 + 56);
v5 = *v4;
if ( *v4 )
{
v6 = *((_QWORD **)v4 + 2);
v7 = (unsigned __int64)&v6[v5 - 1];
v8 = 1;
while ( *v6 )
{
if ( *v6 == a2 )
return v8;
++v6;
++v8;
if ( (unsigned __int64)v6 > v7 )
return result;
}
}
}
return result;
}