//
// PlayLayer::spawnFirework from 0x6f26d4 to 0x6f293c (616 bytes)
//
// 3 xrefs:
// > ??> @ 0xb5678
// > PlayLayer::showCompleteText @ 0x6f3b2c
// > ??> @ 0x1545350
//
// 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 12:51:49 +0000
//
__int64 __fastcall PlayLayer::spawnFirework(PlayLayer *this)
{
GameManager *v2; // x19
__int64 v3; // x0
int v4; // w0
GameManager *v5; // x19
__int64 v6; // x0
int v7; // w0
unsigned __int8 *v8; // x19
int v9; // w3
int v10; // w2
int v11; // w1
unsigned __int8 v12; // w24
unsigned __int8 v13; // w25
unsigned __int8 v14; // w26
cocos2d::CCDirector *v15; // x0
float v16; // s8
int v17; // w0
float v18; // s11
int v19; // w0
int v20; // w0
__int64 v21; // x0
__int64 v22; // x2
__int64 v23; // x19
bool v24; // w2
__int64 v25; // x19
float v27; // [xsp+70h] [xbp+70h]
__int64 v28; // [xsp+98h] [xbp+98h] BYREF
_BYTE v29[8]; // [xsp+A0h] [xbp+A0h] BYREF
float v30[4]; // [xsp+A8h] [xbp+A8h] BYREF
v2 = (GameManager *)GameManager::sharedState(_stack_chk_guard);
v3 = GameManager::sharedState(v2);
v4 = GameManager::colorForIdx(v2, *(_DWORD *)(v3 + 824) - *(_DWORD *)(v3 + 828));
v5 = (GameManager *)GameManager::sharedState((GameManager *)v4);
v6 = GameManager::sharedState(v5);
v7 = GameManager::colorForIdx(v5, *(_DWORD *)(v6 + 812) - *(_DWORD *)(v6 + 816));
v8 = *((unsigned __int8 **)this + 407);
v9 = v8[2603];
v10 = v8[2604];
v11 = v8[2602];
v12 = v8[2605];
v13 = v8[2606];
v14 = v8[2607];
v30[3] = 1.0;
v30[1] = (float)v9 / 255.0;
v30[2] = (float)v10 / 255.0;
v30[0] = (float)v11 / 255.0;
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v7);
cocos2d::CCDirector::getWinSize(&v28, v15);
v16 = *(float *)&v28 - 50.0;
v17 = rand();
v18 = *((float *)&v28 + 1) - 50.0;
v27 = (float)(v16 * (float)((float)v17 * 4.6566e-10)) + 50.0;
v19 = rand();
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, v27, (float)(v18 * (float)((float)v19 * 4.6566e-10)) + 50.0);
v20 = rand();
v21 = CCCircleWave::create(
(CCCircleWave *)((char *)&dword_0 + 1),
10.0,
(float)((float)((float)v20 * 4.6566e-10) * 15.0) + 35.0,
0.5);
v22 = *(_QWORD *)v21;
*(_BYTE *)(v21 + 340) = v12;
*(_DWORD *)(v21 + 356) = 4;
*(_BYTE *)(v21 + 341) = v13;
v23 = v21;
*(_BYTE *)(v21 + 342) = v14;
(*(void (__fastcall **)(__int64, _BYTE *))(v22 + 184))(v21, v29);
(*(void (__fastcall **)(PlayLayer *, __int64, __int64))(*(_QWORD *)this + 464LL))(this, v23, 10);
v25 = cocos2d::CCParticleSystemQuad::create((cocos2d::CCParticleSystemQuad *)"firework.plist", nullptr, v24);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v25 + 1584LL))(v25, 1);
(*(void (__fastcall **)(PlayLayer *, __int64, __int64))(*(_QWORD *)this + 464LL))(this, v25, 13);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v25 + 184LL))(v25, v29);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v25 + 1360LL))(v25, v30);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v25 + 1392LL))(v25, v30);
return _stack_chk_guard;
}