//
// cocos2d::CCDirector::setNextScene from 0x100477c10 to 0x100477d32 (290 bytes)
//
// 1 xrefs:
// > cocos2d::CCDirector::drawScene @ 0x1004777c1
//
// This function is hookable on this platform (idp: pc, 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 12:30:36 +0000
//
__int64 __fastcall cocos2d::CCDirector::setNextScene(__int64 a1)
{
__int64 v2; // r14
bool v3; // r15
const void *v4; // rdi
__int64 v5; // rdi
__int64 result; // rax
__int64 v7; // rdi
v2 = *(_QWORD *)(a1 + 272);
if ( !v2 )
{
v3 = 1;
v4 = *(const void **)(a1 + 280);
if ( !v4 )
goto LABEL_6;
LABEL_5:
if ( __dynamic_cast(
v4,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCScene,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCTransitionScene,
0) )
{
goto LABEL_10;
}
goto LABEL_6;
}
v3 = __dynamic_cast(
*(const void **)(a1 + 272),
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCScene,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCTransitionScene,
0) == nullptr;
v4 = *(const void **)(a1 + 280);
if ( v4 )
goto LABEL_5;
LABEL_6:
if ( !v2 )
goto LABEL_12;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 728LL))(v2);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 272) + 720LL))(*(_QWORD *)(a1 + 272));
v2 = *(_QWORD *)(a1 + 272);
if ( *(_BYTE *)(a1 + 288) == 1 )
{
if ( !v2 )
goto LABEL_12;
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)v2 + 736LL))(*(_QWORD *)(a1 + 272));
v2 = *(_QWORD *)(a1 + 272);
}
LABEL_10:
if ( v2 )
cocos2d::CCObject::release(v2);
LABEL_12:
v5 = *(_QWORD *)(a1 + 280);
*(_QWORD *)(a1 + 272) = v5;
result = cocos2d::CCObject::retain(v5);
*(_QWORD *)(a1 + 280) = 0;
if ( v3 )
{
v7 = *(_QWORD *)(a1 + 272);
if ( v7 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 704LL))(v7);
return (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 272) + 712LL))(*(_QWORD *)(a1 + 272));
}
}
return result;
}