//
// cocos2d::CCParticleSystem::initWithFile from 0x7e5618 to 0x7e576c (340 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystem::create @ 0x7e578c
// > cocos2d::CCParticleSystemQuad::create @ 0x7e64c6
//
// 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 12:00:53 +0000
//
int __fastcall cocos2d::CCParticleSystem::initWithFile(cocos2d::CCParticleSystem *this, const char *a2, int a3)
{
int *v5; // r8
int v7; // r0
int v8; // r0
int v9; // r1
int v10; // r2
CCContentManager *v11; // r0
CCContentManager *v12; // r0
cocos2d::CCDictionary *v13; // r8
size_t v14; // r0
char *v15; // r10
size_t v16; // r2
_BYTE *v17; // r0
int v18; // r0
int v19; // r0
size_t v20; // r1
void *v21; // r2
cocos2d::CCParticleSystem *v22; // r0
cocos2d::CCDictionary *v23; // r1
const char *v24; // r2
int v25; // r4
int v27; // [sp+Ch] [bp-1Ch] BYREF
size_t v28; // [sp+10h] [bp-18h]
void *v29; // [sp+14h] [bp-14h]
int v30; // [sp+18h] [bp-10h] BYREF
int v31; // [sp+1Ch] [bp-Ch]
void *v32; // [sp+20h] [bp-8h]
v5 = (int *)((char *)this + 268);
v7 = cocos2d::CCFileUtils::sharedFileUtils(this);
(*(void (__fastcall **)(int *, int, const char *, _DWORD))(*(_DWORD *)v7 + 24))(&v30, v7, a2, 0);
if ( (*((_BYTE *)this + 268) & 1) != 0 )
{
**((_BYTE **)this + 69) = 0;
*((_DWORD *)this + 68) = 0;
}
else
{
*((_BYTE *)this + 269) = 0;
*((_BYTE *)this + 268) = 0;
}
std::string::reserve(v5, 0);
v8 = v30;
v9 = v31;
v10 = (int)v32;
v30 = 0;
v31 = 0;
v32 = nullptr;
*v5 = v8;
v5[1] = v9;
v5[2] = v10;
v11 = (CCContentManager *)std::string::~string((int)&v30);
v12 = (CCContentManager *)CCContentManager::sharedManager(v11);
v27 = 0;
v28 = 0;
v29 = nullptr;
v13 = (cocos2d::CCDictionary *)CCContentManager::addDict(v12, a2, 1);
v14 = strlen(a2);
std::string::__init(&v27, a2, v14);
if ( (v27 & 1) != 0 )
{
v15 = (char *)v29;
v16 = v28;
}
else
{
v16 = (int)(unsigned __int8)v27 >> 1;
v15 = (char *)&v27 + 1;
}
if ( v16 && (v17 = memchr(v15, 47, v16)) != nullptr && v17 - v15 != -1 )
{
v18 = std::string::rfind((unsigned __int8 *)&v27, 47, 0xFFFFFFFF);
std::string::basic_string(&v30, (unsigned __int8 *)&v27, 0, v18 + 1);
if ( (v27 & 1) != 0 )
{
*(_BYTE *)v29 = 0;
v28 = 0;
}
else
{
LOWORD(v27) = 0;
}
std::string::reserve(&v27, 0);
v19 = v30;
v20 = v31;
v21 = v32;
v30 = 0;
v31 = 0;
v32 = nullptr;
v27 = v19;
v28 = v20;
v29 = v21;
std::string::~string((int)&v30);
v22 = this;
v23 = v13;
if ( (v27 & 1) != 0 )
v24 = (const char *)v29;
else
v24 = (char *)&v27 + 1;
}
else
{
v22 = this;
v23 = v13;
v24 = (const char *)&unk_B6B226;
}
v25 = cocos2d::CCParticleSystem::initWithDictionary(v22, v23, v24, a3);
std::string::~string((int)&v27);
return v25;
}