//
// cocos2d::CCLayerMultiplex::switchToAndReleaseMe from 0xd5e0a8 to 0xd5e134 (140 bytes)
//
// 1 xrefs:
// > ??> @ 0x9cc40
//
// 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 13:07:49 +0000
//
__int64 __fastcall cocos2d::CCLayerMultiplex::switchToAndReleaseMe(cocos2d::CCLayerMultiplex *this, unsigned int a2)
{
void (__fastcall *v4)(cocos2d::CCLayerMultiplex *, __int64, __int64); // x21
__int64 v5; // x0
unsigned int v6; // w1
__int64 (__fastcall *v7)(cocos2d::CCLayerMultiplex *, __int64); // x20
__int64 v8; // x0
cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 51));
v4 = *(void (__fastcall **)(cocos2d::CCLayerMultiplex *, __int64, __int64))(*(_QWORD *)this + 552LL);
v5 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 51), *((_DWORD *)this + 101));
v4(this, v5, 1);
cocos2d::CCArray::replaceObjectAtIndex(*((cocos2d::CCArray **)this + 51), *((_DWORD *)this + 101), nullptr);
*((_DWORD *)this + 101) = a2;
v6 = a2;
v7 = *(__int64 (__fastcall **)(cocos2d::CCLayerMultiplex *, __int64))(*(_QWORD *)this + 456LL);
v8 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 51), v6);
return v7(this, v8);
}