//
// cocos2d::CCDirector::levelForSceneInStack from 0x1800c2270 to 0x1800c22c0 (80 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:25 +0000
//
__int64 __fastcall cocos2d::CCDirector::levelForSceneInStack(cocos2d::CCDirector *this, struct cocos2d::CCScene *a2)
{
__int64 v2; // rax
unsigned int v3; // r8d
unsigned int *v5; // rax
__int64 v6; // rcx
struct cocos2d::CCScene **v7; // rax
struct cocos2d::CCScene **v8; // rdx
v2 = *((_QWORD *)this + 37);
v3 = 0;
if ( v2 )
{
v5 = *(unsigned int **)(v2 + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((struct cocos2d::CCScene ***)v5 + 2);
v8 = &v7[v6 - 1];
if ( v7 <= v8 )
{
while ( *v7 )
{
++v3;
if ( *v7 == a2 )
return v3;
if ( ++v7 > v8 )
return 0;
}
}
}
}
return 0;
}