//
// PlayLayer::spawnFirework from 0x3ff1d4 to 0x3ff394 (448 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:23 +0000
//
int __fastcall PlayLayer::spawnFirework(PlayLayer *this)
{
GameManager *v2; // r4
int v3; // r0
int v4; // r0
GameManager *v5; // r4
int v6; // r0
int v7; // r0
int v8; // r3
char v9; // r11
char v10; // r10
char v11; // r9
float *v12; // r0
float v13; // s20
int v14; // r0
float v15; // s19
int v16; // s16
int v17; // r0
int v18; // r0
CCCircleWave *v19; // r0
CCCircleWave *v20; // r4
int v21; // r3
bool v22; // r2
int v23; // r4
bool v25; // [sp+0h] [bp-34h]
unsigned int v26; // [sp+4h] [bp-30h]
unsigned int v27; // [sp+8h] [bp-2Ch]
float v28[2]; // [sp+Ch] [bp-28h] BYREF
_BYTE v29[8]; // [sp+14h] [bp-20h] BYREF
float v30[4]; // [sp+1Ch] [bp-18h] BYREF
v2 = (GameManager *)GameManager::sharedState(this);
v3 = GameManager::sharedState(v2);
v4 = GameManager::colorForIdx(v2, *(_DWORD *)(v3 + 624) - *(_DWORD *)(v3 + 628));
v25 = v4;
v5 = (GameManager *)GameManager::sharedState((GameManager *)BYTE2(v4));
v6 = GameManager::sharedState(v5);
v7 = GameManager::colorForIdx(v5, *(_DWORD *)(v6 + 612) - *(_DWORD *)(v6 + 616));
LOWORD(v26) = v7;
BYTE2(v26) = BYTE2(v7);
sub_3FED44(v30, v26);
v8 = *((_DWORD *)this + 519);
v9 = *(_BYTE *)(v8 + 2109);
v10 = *(_BYTE *)(v8 + 2110);
v11 = *(_BYTE *)(v8 + 2111);
BYTE2(v27) = *(_BYTE *)(v8 + 2108);
LOWORD(v27) = *(_WORD *)(v8 + 2106);
v12 = sub_3FED44(v30, v27);
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v12);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v28);
v13 = v28[0];
v14 = rand();
v15 = v28[1] - 50.0;
v16 = v14;
v17 = rand();
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v29,
(float)((float)(v13 - 50.0) * (float)((float)v16 * 4.6566e-10)) + 50.0,
(float)(v15 * (float)((float)v17 * 4.6566e-10)) + 50.0);
v18 = rand();
v19 = CCCircleWave::create(
(CCCircleWave *)0x41200000,
COERCE__BOOL4((float)((float)((float)v18 * 4.6566e-10) * 15.0) + 35.0),
(cocos2d::CCActionTween *)0x3F000000,
COERCE_FLOAT(1),
v25);
*((_DWORD *)v19 + 74) = 4;
v20 = v19;
v21 = *(_DWORD *)v19;
*((_BYTE *)v19 + 280) = v9;
*((_BYTE *)v19 + 281) = v10;
*((_BYTE *)v19 + 282) = v11;
(*(void (__fastcall **)(CCCircleWave *, _BYTE *))(v21 + 92))(v19, v29);
(*(void (__fastcall **)(PlayLayer *, CCCircleWave *, int))(*(_DWORD *)this + 232))(this, v20, 10);
v23 = cocos2d::CCParticleSystemQuad::create((cocos2d::CCParticleSystemQuad *)"firework.plist", nullptr, v22);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 792))(v23, 1);
(*(void (__fastcall **)(PlayLayer *, int, int))(*(_DWORD *)this + 232))(this, v23, 13);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v23 + 92))(v23, v29);
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v23 + 680))(v23, v30);
return (*(int (__fastcall **)(int, float *))(*(_DWORD *)v23 + 696))(v23, v30);
}