//
// SecretLayer5::onSubmit from 0xbc79c0 to 0xbc7e90 (1232 bytes)
//
// 3 xrefs:
// > ??> @ 0xdd800
// > SecretLayer5::init @ 0xbc87b8
// > ??> @ 0x1546a38
//
// 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:03:32 +0000
//
__int64 __fastcall SecretLayer5::onSubmit(SecretLayer5 *this, cocos2d::CCObject *a2)
{
CCTextInputNode *v4; // x0
_QWORD *v5; // x23
__int64 v6; // x22
MusicDownloadManager *v7; // x0
MusicDownloadManager *v8; // x22
unsigned int v9; // w1
__int64 *v10; // x0
__int64 v11; // x23
int v12; // w0
__int64 v13; // x21
void (__fastcall *v14)(__int64, __int64 *); // x24
__int64 v15; // x25
cocos2d::CCDelayTime *v16; // x0
cocos2d::CCSequence *v17; // x21
cocos2d::CCFiniteTimeAction *v18; // x0
cocos2d::CCAction *v19; // x0
cocos2d::CCDelayTime *v20; // x0
cocos2d::CCSequence *v21; // x21
cocos2d::CCFiniteTimeAction *v22; // x0
cocos2d::CCAction *v23; // x0
long double v24; // q0
GameLevelManager *v25; // x0
GameLevelManager *v26; // x22
cocos2d::CCDelayTime *v27; // x0
cocos2d::CCSequence *v28; // x21
cocos2d::CCFiniteTimeAction *v29; // x0
cocos2d::CCAction *v30; // x0
_BYTE v31[8]; // [xsp+50h] [xbp+50h] BYREF
__int64 v32; // [xsp+58h] [xbp+58h] BYREF
cocos2d::CCDelayTime *v33; // [xsp+60h] [xbp+60h] BYREF
size_t v34; // [xsp+68h] [xbp+68h]
void *v35; // [xsp+70h] [xbp+70h]
__int64 v36[2]; // [xsp+78h] [xbp+78h] BYREF
void *v37; // [xsp+88h] [xbp+88h]
MusicDownloadManager *v38[2]; // [xsp+90h] [xbp+90h] BYREF
void *v39; // [xsp+A0h] [xbp+A0h]
__int64 v40; // [xsp+A8h] [xbp+A8h] BYREF
size_t v41; // [xsp+B0h] [xbp+B0h]
void *v42; // [xsp+B8h] [xbp+B8h]
__int64 v43; // [xsp+C0h] [xbp+C0h] BYREF
size_t v44; // [xsp+C8h] [xbp+C8h]
void *v45; // [xsp+D0h] [xbp+D0h]
__int64 v46[2]; // [xsp+D8h] [xbp+D8h] BYREF
void *v47; // [xsp+E8h] [xbp+E8h]
cocos2d::CCDelayTime *v48; // [xsp+F0h] [xbp+F0h] BYREF
size_t v49; // [xsp+F8h] [xbp+F8h]
void *v50; // [xsp+100h] [xbp+100h]
if ( !*((_BYTE *)this + 512) && !*((_BYTE *)this + 544) )
{
*((_DWORD *)this + 129) = 0;
std::string::assign((__int64 *)this + 65, &byte_11B8890, 0);
v4 = *((CCTextInputNode **)this + 58);
*((_BYTE *)this + 512) = 1;
CCTextInputNode::getString(v4, (__int64 *)&v33);
v5 = *((_QWORD **)this + 58);
v36[0] = 0;
v36[1] = 0;
v37 = nullptr;
std::string::__init(v36, &byte_11B8890, 0);
CCTextInputNode::setString(v5, (char *)v36);
if ( (v36[0] & 1) != 0 )
operator delete(v37);
v6 = *((_QWORD *)this + 58);
v38[0] = nullptr;
v38[1] = nullptr;
v39 = nullptr;
std::string::__init((__int64 *)v38, &byte_11E1A70, 1u);
CCTextInputNode::updateLabel(v6, (__int64)v38);
v7 = (MusicDownloadManager *)LOBYTE(v38[0]);
if ( ((__int64)v38[0] & 1) != 0 )
operator delete(v39);
v8 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v7);
if ( (float)((float)rand() * 4.6566e-10) <= 0.5 )
v9 = 9983;
else
v9 = 9982;
v10 = MusicDownloadManager::pathForSFX(&v40, v8, v9);
v11 = FMODAudioEngine::sharedEngine((FMODAudioEngine *)v10);
v43 = 0;
v44 = 0;
v45 = nullptr;
if ( (v40 & 1) != 0 )
{
std::string::__init(&v43, v42, v41);
}
else
{
v45 = v42;
v43 = v40;
v44 = v41;
}
v12 = rand();
FMODAudioEngine::playEffect(v11, (char *)&v43, (float)((float)((float)v12 * 4.6566e-10) * 0.1) + 0.9, 0.0, 0.5);
if ( (v43 & 1) != 0 )
operator delete(v45);
v46[0] = 0;
v46[1] = 0;
v47 = nullptr;
std::string::__init(
v46,
"40a0.21a0.81a0.2a180a90a10a12a6a90a12a0a0a0a0a0a0a25a10a0a10a0a0a0.815686a0a1a0a1a0a4a1a0a0a0.733333a0a0a0a1a0a1a0"
"a0a0a0.2a0a0a0a0a0a0a0a0a2a1a1a0a0a26a0a0a0a0a0a0a0a0a0a0a0a0a0a0",
0xB3u);
v13 = GameToolbox::particleFromString((__int64)v46, 0, 0);
if ( (v46[0] & 1) != 0 )
operator delete(v47);
(*(void (__fastcall **)(SecretLayer5 *, __int64, __int64))(*(_QWORD *)this + 464LL))(this, v13, 30);
v14 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 184LL);
v15 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 58) + 192LL))(*((_QWORD *)this + 58));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v32, v15);
v14(v13, &v32);
v16 = (cocos2d::CCDelayTime *)SecretLayer5::incrementChatIdx(this);
v17 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v16, 0.3);
v18 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, SecretLayer5::fadeInSubmitMessage, 0);
v19 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v17, v18, 0);
v20 = (cocos2d::CCDelayTime *)cocos2d::CCNode::runAction(this, v19);
v21 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v20, 0.0);
v22 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, SecretLayer5::animateHead, 0);
v23 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v21, v22, 0);
cocos2d::CCNode::runAction(this, v23);
SecretLayer5::hideTextInput(this);
LODWORD(v24) = 1061997773;
LoadingCircleSprite::fadeInCircle(*((LoadingCircleSprite **)this + 79), 0, v24, 150.0);
v25 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 60) + 1056LL))(
*((_QWORD *)this + 60),
0);
v26 = (GameLevelManager *)GameLevelManager::sharedState(v25);
v48 = nullptr;
v49 = 0;
v50 = nullptr;
if ( ((unsigned __int8)v33 & 1) != 0 )
{
std::string::__init((__int64 *)&v48, v35, v34);
}
else
{
v48 = v33;
v49 = v34;
v50 = v35;
}
GameLevelManager::getGJSecretReward(v26, (__int64)&v48);
v27 = (cocos2d::CCDelayTime *)(unsigned __int8)v48;
if ( ((unsigned __int8)v48 & 1) != 0 )
operator delete(v50);
v28 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v27, 4.0);
v29 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, SecretLayer5::finishLoadingState, 0);
v30 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v28, v29, 0);
cocos2d::CCNode::runAction(this, v30);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( ((unsigned __int8)v33 & 1) != 0 )
operator delete(v35);
}
return _stack_chk_guard;
}