//
// GauntletSelectLayer::unlockAnimationStep3 from 0x1403009b0 to 0x1403010ae (1790 bytes)
//
// 2 xrefs:
// > GauntletSelectLayer::unlockAnimationFinished @ 0x14030120c
// > ??> @ 0x14091e494
//
// 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 11:30:08 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GauntletSelectLayer::unlockAnimationStep3(__int64 a1)
{
struct cocos2d::CCObject *v2; // r12
__int64 v3; // rcx
__int64 v4; // rax
char *v5; // rdx
struct cocos2d::CCParticleSystemQuad *v6; // r14
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rsi
__int64 (__fastcall *v10)(struct cocos2d::CCObject *); // rdi
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
unsigned __int64 v15; // rdi
__int64 v16; // rbx
__int64 v17; // rdx
unsigned __int64 v18; // rcx
__int64 v19; // rbx
char *v20; // rsi
void *v21; // rcx
struct cocos2d::CCParticleSystemQuad *v22; // r14
__int64 v23; // rsi
__int64 (__fastcall *v24)(struct cocos2d::CCObject *); // rdi
__int64 v25; // rbx
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // rbx
__int64 v30; // rax
int v31; // ecx
int v32; // ecx
__int64 v33; // rcx
void *v34; // rcx
__int16 v35; // [rsp+38h] [rbp-D0h]
__int16 v36; // [rsp+38h] [rbp-D0h]
__int16 v37; // [rsp+38h] [rbp-D0h]
__int16 v38; // [rsp+38h] [rbp-D0h]
_BYTE v39[8]; // [rsp+48h] [rbp-C0h] BYREF
__int64 v40; // [rsp+50h] [rbp-B8h] BYREF
void *v41; // [rsp+58h] [rbp-B0h] BYREF
_QWORD Block[3]; // [rsp+60h] [rbp-A8h] BYREF
__int64 v43; // [rsp+78h] [rbp-90h]
unsigned __int64 v44; // [rsp+80h] [rbp-88h]
float v45[3]; // [rsp+88h] [rbp-80h] BYREF
int v46; // [rsp+94h] [rbp-74h]
float v47[4]; // [rsp+98h] [rbp-70h] BYREF
unsigned int v48[66]; // [rsp+A8h] [rbp-60h] BYREF
_BYTE v49[40]; // [rsp+1B0h] [rbp+A8h] BYREF
v2 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 496), *(int *)(a1 + 508));
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v40);
*(_OWORD *)&Block[1] = 0;
v43 = 0;
v44 = 0;
v5 = (char *)sub_14003D460(0xD0u);
Block[1] = v5;
v43 = 194;
v44 = 207;
strcpy(
v5,
"100a0a0.88a0.21a-1a90a180a5a5a48a82a0a0a0a0a0a0a7a2a0a360a0.411765a1a1a1a0a1a1a0a3a2a0a60a0a0a0.737255a0a0.160784a0a"
"1a0a0.16a0.1a0.51a0.12a0a0a0a0a0a0a0a2a1a1a0a0a166a0a0a0a0a0a0a0a0a1a1a0a0a0a0");
if ( v43 )
{
sub_14006BF90((__int64)v48);
GameToolbox::particleStringToStruct(&Block[1], (__int64)v48);
v6 = GameToolbox::particleFromStruct(v48, nullptr, 0);
sub_14003D310((__int64)v49);
}
else
{
v6 = nullptr;
}
LOBYTE(v5) = 1;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, char *))(*(_QWORD *)v6 + 1544LL))(v6, v5);
(*(void (__fastcall **)(__int64, struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v6, 15);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v6 + 160LL))(v6);
v7 = *(_QWORD *)v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, 30.0, 70.0);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v7 + 952))(v6, v8);
cocos2d::CCParticleSystem::resetSystem(v6);
v9 = *(_QWORD *)v6;
v10 = *(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v2 + 504LL);
v11 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v2 + 200LL))(v2);
v12 = v10(v2);
cocos2d::CCNode::convertToWorldSpace(v12, v39, v11);
cocos2d::CCNode::convertToNodeSpace(a1, &v41, v13);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v9 + 184))(v6, v14);
v35 = *((_WORD *)v2 + 168);
*(float *)&v41 = (float)(unsigned __int8)v35 / 255.0;
*((float *)&v41 + 1) = (float)HIBYTE(v35) / 255.0;
*(float *)Block = (float)*((unsigned __int8 *)v2 + 338) / 255.0;
HIDWORD(Block[0]) = 1065353216;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, void **))(*(_QWORD *)v6 + 1352LL))(v6, &v41);
v36 = *((_WORD *)v2 + 168);
*(float *)&v41 = (float)(unsigned __int8)v36 / 255.0;
*((float *)&v41 + 1) = (float)HIBYTE(v36) / 255.0;
*(float *)Block = (float)*((unsigned __int8 *)v2 + 338) / 255.0;
HIDWORD(Block[0]) = 1065353216;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, void **))(*(_QWORD *)v6 + 1384LL))(v6, &v41);
v15 = v44;
if ( v44 < 0xC4 )
{
v18 = v44 >> 1;
v19 = 0x7FFFFFFFFFFFFFFFLL;
if ( v44 <= 0x7FFFFFFFFFFFFFFFLL - (v44 >> 1) )
{
v19 = 207;
if ( v18 + v44 > 0xCF )
v19 = v18 + v44;
}
v20 = (char *)sub_14003D460(v19 + 1);
v43 = 196;
v44 = v19;
strcpy(
v20,
"30a0a1.15a0.3a-1a110a97a0a8a44a71a0a0a0a0a0a0a75a12a0a0a1a0.4a0.890196a0.4a0a0.4a0.51a0.22a-5a1a0a0a1a0a0a0a0.0784"
"314a0a0a0a0.16a0a0.25a0a0a0a0a0a0a0a0a2a0a0a0a0a159a0a0.35a0a0a0a0a1a0a1a0a0a0a0a0");
if ( v15 > 0xF )
{
v21 = (void *)Block[1];
if ( v15 + 1 >= 0x1000 )
{
v21 = *(void **)(Block[1] - 8LL);
if ( (unsigned __int64)(Block[1] - (_QWORD)v21 - 8LL) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v21);
}
Block[1] = v20;
}
else
{
v16 = Block[1];
v43 = 196;
memmove(
(void *)Block[1],
"30a0a1.15a0.3a-1a110a97a0a8a44a71a0a0a0a0a0a0a75a12a0a0a1a0.4a0.890196a0.4a0a0.4a0.51a0.22a-5a1a0a0a1a0a0a0a0.0784"
"314a0a0a0a0.16a0a0.25a0a0a0a0a0a0a0a0a2a0a0a0a0a159a0a0.35a0a0a0a0a1a0a1a0a0a0a0a0",
0xC4u);
*(_BYTE *)(v16 + 196) = 0;
}
if ( v43 )
{
sub_14006BF90((__int64)v48);
GameToolbox::particleStringToStruct(&Block[1], (__int64)v48);
v22 = GameToolbox::particleFromStruct(v48, nullptr, 0);
sub_14003D310((__int64)v49);
}
else
{
v22 = nullptr;
}
LOBYTE(v17) = 1;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)v22 + 1544LL))(v22, v17);
(*(void (__fastcall **)(__int64, struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v22,
16);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v22 + 160LL))(v22);
cocos2d::CCParticleSystem::resetSystem(v22);
v23 = *(_QWORD *)v22;
v24 = *(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v2 + 504LL);
v25 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v2 + 200LL))(v2);
v26 = v24(v2);
cocos2d::CCNode::convertToWorldSpace(v26, &v41, v25);
cocos2d::CCNode::convertToNodeSpace(a1, v39, v27);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v23 + 184))(v22, v28);
v29 = *(_QWORD *)v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, 10.0, 40.0);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v29 + 952))(v22, v30);
v37 = *((_WORD *)v2 + 168);
v31 = *((unsigned __int8 *)v2 + 338);
v45[0] = (float)(unsigned __int8)v37 / 255.0;
v45[1] = (float)HIBYTE(v37) / 255.0;
v45[2] = (float)v31 / 255.0;
v46 = 1065353216;
v38 = *((_WORD *)v2 + 168);
v32 = *((unsigned __int8 *)v2 + 338);
v47[0] = (float)(unsigned __int8)v38 / 255.0;
v47[1] = (float)HIBYTE(v38) / 255.0;
v47[2] = (float)v32 / 255.0;
v46 = 1008981770;
v47[3] = 0.0;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, float *))(*(_QWORD *)v22 + 1352LL))(v22, v45);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, float *))(*(_QWORD *)v22 + 1384LL))(v22, v47);
v33 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v41 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v33 = qword_14090BFD0;
}
GameManager::fadeInMenuMusic(v33);
if ( v44 > 0xF )
{
v34 = (void *)Block[1];
if ( v44 + 1 >= 0x1000 )
{
v34 = *(void **)(Block[1] - 8LL);
if ( (unsigned __int64)(Block[1] - (_QWORD)v34 - 8LL) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v34);
}
}