//
// AppDelegate::applicationWillEnterForeground from 0x140082e70 to 0x140083035 (453 bytes)
//
// 2 xrefs:
// > ??> @ 0x14053c548
// > ??> @ 0x1406c6a74
//
// 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
//
// Hidden C++ exception states: #wind=4
void AppDelegate::applicationWillEnterForeground(AppDelegate *a1)
{
__int64 v1; // rax
__int64 v2; // rcx
cocos2d::CCDirector *v3; // rax
__int64 v4; // rcx
__int64 v5; // rax
FMODAudioEngine *v6; // rcx
__int64 v7; // rcx
__int64 v8; // rdi
struct cocos2d::CCObject *v9; // rbx
cocos2d::CCActionManager *v10; // rax
struct cocos2d::CCDelayTime *v11; // rbx
__int64 v12; // rcx
__int64 v13; // rax
struct cocos2d::CCSequence *v14; // rsi
__int64 v15; // rcx
__int64 v16; // rdi
struct cocos2d::CCNode *v17; // rbx
cocos2d::CCActionManager *v18; // rax
FMODAudioEngine *v19; // [rsp+38h] [rbp+10h]
void *v20; // [rsp+38h] [rbp+10h]
void *v21; // [rsp+38h] [rbp+10h]
void *v22; // [rsp+38h] [rbp+10h]
v1 = cocos2d::CCDirector::sharedDirector(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v1 + 88LL))(v1);
v3 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v2);
cocos2d::CCDirector::resume(v3);
v5 = cocos2d::CCDirector::sharedDirector(v4);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 96LL))(v5);
v6 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v19 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v6 = (FMODAudioEngine *)qword_1406C2E88;
}
FMODAudioEngine::start(v6);
v8 = cocos2d::CCDirector::sharedDirector(v7);
v9 = (struct cocos2d::CCObject *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v20 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v9 = (struct cocos2d::CCObject *)qword_1406C2ED8;
}
v10 = (cocos2d::CCActionManager *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 128LL))(v8);
cocos2d::CCActionManager::removeActionByTag(v10, 1u, v9);
v11 = cocos2d::CCDelayTime::create(0.0);
v12 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v21 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v12 = qword_1406C2ED8;
}
v13 = cocos2d::CCCallFunc::create(v12, GameManager::applicationWillEnterForeground);
v14 = cocos2d::CCSequence::create(v11, v13, 0);
v14->setTag(v14, 1);
v16 = cocos2d::CCDirector::sharedDirector(v15);
v17 = (struct cocos2d::CCNode *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v22 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v17 = (struct cocos2d::CCNode *)qword_1406C2ED8;
}
v18 = (cocos2d::CCActionManager *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 128LL))(v16);
cocos2d::CCActionManager::addAction(v18, v14, v17, 0);
}