//
// cocos2d::CCDirector::levelForSceneInStack from 0x1800bea90 to 0x1800beae0 (80 bytes)
//
// 1 xrefs:
// > ??> @ 0x1801438a8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall cocos2d::CCDirector::levelForSceneInStack(cocos2d::CCDirector *this, struct cocos2d::CCScene *a2)
{
cocos2d::CCArray *m_pobScenesStack; // rax
unsigned int v3; // r8d
cocos2d::ccArray *data; // rax
__int64 num; // rcx
struct cocos2d::CCScene **arr; // rax
struct cocos2d::CCScene **v8; // rdx
m_pobScenesStack = this->m_pobScenesStack;
v3 = 0;
if ( m_pobScenesStack )
{
data = m_pobScenesStack->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (struct cocos2d::CCScene **)data->arr;
v8 = &arr[num - 1];
if ( arr <= v8 )
{
while ( *arr )
{
++v3;
if ( *arr == a2 )
return v3;
if ( ++arr > v8 )
return 0;
}
}
}
}
return 0;
}