//
// cocos2d::CCParticleGalaxy::initWithTotalParticles from 0xd6bf9c to 0xd6c1e8 (588 bytes)
//
// 4 xrefs:
// > cocos2d::CCParticleGalaxy::create @ 0xd6d9c8
// > cocos2d::CCParticleGalaxy::createWithTotalParticles @ 0xd6da54
// > ??> @ 0x65f68
// > ??> @ 0x15295d0
//
// 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:07:57 +0000
//
__int64 __fastcall cocos2d::CCParticleGalaxy::initWithTotalParticles(cocos2d::CCParticleGalaxy *this, unsigned int a2)
{
unsigned __int8 v3; // w0
unsigned int v4; // w21
__int64 v6; // x2
void (__fastcall *v7)(cocos2d::CCParticleGalaxy *, float *); // x23
cocos2d::CCDirector *v8; // x0
void (__fastcall *v9)(cocos2d::CCParticleGalaxy *, float *); // x23
float v10; // s1
__int64 v11; // x1
__int64 v12; // [xsp+58h] [xbp+58h] BYREF
float v13; // [xsp+60h] [xbp+60h] BYREF
v3 = cocos2d::CCParticleSystemQuad::initWithTotalParticles(this, a2, 0);
v4 = v3;
if ( v3 )
{
v6 = *(_QWORD *)this;
*((float *)this + 115) = -1.0;
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, _QWORD))(v6 + 1600))(this, 0);
v7 = *(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float *))(*(_QWORD *)this + 1048LL);
cocos2d::CCPoint::CCPoint(&v13, 0.0, 0.0);
v7(this, &v13);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1064LL))(this, 60.0);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1080LL))(this, 10.0);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1128LL))(this, -80.0);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1144LL))(this, 0.0);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1096LL))(this, 80.0);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float))(*(_QWORD *)this + 1112LL))(this, 0.0);
*((_DWORD *)this + 122) = 1119092736;
*((_DWORD *)this + 123) = 1135869952;
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)0x43B40000);
cocos2d::CCDirector::getWinSize(&v12, v8);
v9 = *(void (__fastcall **)(cocos2d::CCParticleGalaxy *, float *))(*(_QWORD *)this + 184LL);
cocos2d::CCPoint::CCPoint(&v13, *(float *)&v12 * 0.5, *((float *)&v12 + 1) * 0.5);
v9(this, &v13);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, void *))(*(_QWORD *)this + 960LL))(this, &unk_1560510);
v10 = (float)*((unsigned int *)this + 165) * 0.25;
*((_DWORD *)this + 140) = 1108606976;
*((float *)this + 121) = 1.0;
*((float *)this + 120) = 4.0;
*((float *)this + 141) = 10.0;
*((_DWORD *)this + 144) = 1039516303;
*((float *)this + 142) = -1.0;
*((float *)this + 164) = v10;
*((float *)this + 145) = 0.25;
*((_DWORD *)this + 146) = 1061326684;
*((float *)this + 147) = 1.0;
*((_DWORD *)this + 148) = 0;
*((_DWORD *)this + 149) = 0;
*((_DWORD *)this + 150) = 0;
*((_DWORD *)this + 151) = 0;
*((_DWORD *)this + 152) = 0;
*((_DWORD *)this + 153) = 0;
*((_DWORD *)this + 154) = 0;
*((float *)this + 155) = 1.0;
*((_DWORD *)this + 156) = 0;
*((_DWORD *)this + 157) = 0;
*((_DWORD *)this + 158) = 0;
*((_DWORD *)this + 159) = 0;
v11 = sub_D6B8F8((cocos2d::CCTextureCache *)0x3F428F5C);
if ( v11 )
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, __int64))(*(_QWORD *)this + 1520LL))(this, v11);
(*(void (__fastcall **)(cocos2d::CCParticleGalaxy *, __int64))(*(_QWORD *)this + 1280LL))(this, 1);
}
return v4;
}