//
// GauntletSelectLayer::unlockAnimationStep2 from 0x1403005e0 to 0x1403009a2 (962 bytes)
//
// 2 xrefs:
// > GauntletSelectLayer::playUnlockAnimation @ 0x1403004e4
// > ??> @ 0x14091e488
//
// 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=2
void __fastcall GauntletSelectLayer::unlockAnimationStep2(__int64 a1)
{
struct cocos2d::CCObject *v2; // r12
__int64 v3; // rcx
__int64 v4; // rax
struct cocos2d::CCParticleSystemQuad *v5; // r14
__int64 v6; // rbx
__int64 v7; // rbx
__int64 v8; // rdx
__int64 v9; // rsi
__int64 (__fastcall *v10)(struct cocos2d::CCObject *); // rdi
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
void *v15; // rcx
__int16 v16; // [rsp+38h] [rbp-D0h]
__int16 v17; // [rsp+38h] [rbp-D0h]
_BYTE v18[8]; // [rsp+48h] [rbp-C0h] BYREF
int v19; // [rsp+50h] [rbp-B8h] BYREF
float v20; // [rsp+58h] [rbp-B0h] BYREF
float v21; // [rsp+5Ch] [rbp-ACh]
_QWORD Block[3]; // [rsp+60h] [rbp-A8h] BYREF
__int64 v23; // [rsp+78h] [rbp-90h]
unsigned __int64 v24; // [rsp+80h] [rbp-88h]
unsigned int v25[66]; // [rsp+88h] [rbp-80h] BYREF
_BYTE v26[40]; // [rsp+190h] [rbp+88h] BYREF
v2 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 496), *(int *)(a1 + 508));
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, v18);
*(_OWORD *)&Block[1] = 0;
v23 = 0;
v24 = 0;
Block[1] = sub_14003D460(0xB0u);
v23 = 170;
v24 = 175;
strcpy(
(char *)Block[1],
"84a0.97a1a0.16a72a180a180a29a0a11a0a0a0a0a0a0a0a2a1a0a0a1a0a0a0a0a0a1a0a1a1a0a0a1a0a0.568627a0a0a0a1a0a0.8a0a0.2a0a1"
"50a0a0a0a0a0a1a2a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0");
if ( v23 )
{
sub_14006BF90((__int64)v25);
GameToolbox::particleStringToStruct(&Block[1], (__int64)v25);
v5 = GameToolbox::particleFromStruct(v25, nullptr, 0);
sub_14003D310((__int64)v26);
}
else
{
v5 = nullptr;
}
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v5 + 1200LL))(v5);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v5 + 1216LL))(v5);
v6 = *(_QWORD *)v5;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v5 + 960LL))(v5);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(v6 + 968))(v5);
v7 = *(_QWORD *)v5;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v5 + 912LL))(v5);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(v7 + 920))(v5);
LOBYTE(v8) = 1;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)v5 + 1544LL))(v5, v8);
(*(void (__fastcall **)(__int64, struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v5, 11);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v5 + 160LL))(v5);
cocos2d::CCParticleSystem::resetSystem(v5);
v9 = *(_QWORD *)v5;
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, &v19, v11);
cocos2d::CCNode::convertToNodeSpace(a1, &v20, v13);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v9 + 184))(v5, v14);
v16 = *((_WORD *)v2 + 168);
v20 = (float)(unsigned __int8)v16 / 255.0;
v21 = (float)HIBYTE(v16) / 255.0;
*(float *)Block = (float)*((unsigned __int8 *)v2 + 338) / 255.0;
HIDWORD(Block[0]) = 1065353216;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, float *))(*(_QWORD *)v5 + 1352LL))(v5, &v20);
v17 = *((_WORD *)v2 + 168);
v20 = (float)(unsigned __int8)v17 / 255.0;
v21 = (float)HIBYTE(v17) / 255.0;
*(float *)Block = (float)*((unsigned __int8 *)v2 + 338) / 255.0;
HIDWORD(Block[0]) = 1065353216;
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, float *))(*(_QWORD *)v5 + 1384LL))(v5, &v20);
if ( v24 > 0xF )
{
v15 = (void *)Block[1];
if ( v24 + 1 >= 0x1000 )
{
v15 = *(void **)(Block[1] - 8LL);
if ( (unsigned __int64)(Block[1] - (_QWORD)v15 - 8LL) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
}