//
// cocos2d::CCDirector::popToSceneInStack from 0x100176334 to 0x100176384 (80 bytes)
//
// 3 xrefs:
// > GJScoreCell::onViewProfile @ 0x100111120
// > ProfilePage::onMyLevels @ 0x10019b2d0
// > ProfilePage::onMyLists @ 0x10019b428
//
// 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
//
void __fastcall cocos2d::CCDirector::popToSceneInStack(cocos2d::CCDirector *a1, cocos2d::CCScene *a2)
{
cocos2d::CCArray *m_pobScenesStack; // x8
cocos2d::ccArray *data; // x9
__int64 num; // x8
cocos2d::CCScene **arr; // x9
unsigned __int64 v6; // x10
int v7; // w8
m_pobScenesStack = a1->m_pobScenesStack;
if ( m_pobScenesStack )
{
data = m_pobScenesStack->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (cocos2d::CCScene **)data->arr;
v6 = (unsigned __int64)&arr[num - 1];
v7 = 1;
while ( *arr )
{
if ( *arr == a2 )
{
cocos2d::CCDirector::popToSceneStackLevel(a1, v7);
return;
}
++arr;
++v7;
if ( (unsigned __int64)arr > v6 )
return;
}
}
}
}