//
// cocos2d::CCDirector::levelForSceneInStack from 0xad6e78 to 0xad6ee0 (104 bytes)
//
// 2 xrefs:
// > cocos2d::CCDirector::popToSceneInStack @ 0xad7120
// > ??> @ 0xb3868
//
// 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
//
int cocos2d::CCDirector::levelForSceneInStack(cocos2d::CCDirector *a1, cocos2d::CCScene *a2)
{
cocos2d::CCArray *m_pobScenesStack; // x0
cocos2d::ccArray *data; // x2
int result; // w0
unsigned int num; // w3
cocos2d::CCScene **arr; // x2
cocos2d::CCScene **v7; // x3
bool v8; // zf
m_pobScenesStack = a1->m_pobScenesStack;
if ( !m_pobScenesStack )
return 0;
data = m_pobScenesStack->data;
result = 0;
num = data->num;
if ( data->num )
{
arr = (cocos2d::CCScene **)data->arr;
v7 = &arr[num - 1];
if ( arr <= v7 )
{
if ( *arr )
{
result = 1;
v8 = a2 == *arr;
while ( !v8 )
{
++arr;
++result;
if ( v7 >= arr )
{
v8 = *arr == a2;
if ( *arr )
continue;
}
return 0;
}
}
}
}
return result;
}