//
// cocos2d::CCDirector::popToSceneInStack from 0x1002078b4 to 0x100207904 (80 bytes)
//
// 3 xrefs:
// > GJScoreCell::onViewProfile @ 0x100138d94
// > sub_10022EFE8 @ 0x10022f080
// > sub_10022F12C @ 0x10022f1d8
//
// This function is hookable on this platform (idp: arm, 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:00:57 +0000
//
_QWORD *__fastcall cocos2d::CCDirector::popToSceneInStack(_QWORD *result, __int64 a2)
{
__int64 v2; // x8
unsigned int *v3; // x9
__int64 v4; // x8
_QWORD *v5; // x9
unsigned __int64 v6; // x10
int v7; // w8
v2 = result[37];
if ( v2 )
{
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( (_DWORD)v4 )
{
v5 = *((_QWORD **)v3 + 2);
v6 = (unsigned __int64)&v5[v4 - 1];
v7 = 1;
while ( *v5 )
{
if ( *v5 == a2 )
return (_QWORD *)cocos2d::CCDirector::popToSceneStackLevel(result, v7);
++v5;
++v7;
if ( (unsigned __int64)v5 > v6 )
return result;
}
}
}
return result;
}