//
// GameToolbox::particleStringToStruct from 0x583854 to 0x584060 (2060 bytes)
//
// 3 xrefs:
// > GameToolbox::particleFromString @ 0x584204
// > ParticleGameObject::updateParticleStruct @ 0x754a58
// > ??> @ 0xb2a28
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall GameToolbox::particleStringToStruct(_QWORD *a1, __int64 a2)
{
const char **v5; // x20
const char **v6; // x23
signed __int64 v7; // x21
void *v8; // x0
const char *v9; // x1
__int64 *v10; // x0
unsigned int *v11; // x1
int v12; // w2
float v13; // s0
const char *v14; // x0
float v15; // s0
const char *v16; // x0
double v17; // d0
const char **v18; // x20
const char *v19; // x0
float v20; // s0
const char *v21; // x0
float v22; // s0
const char *v23; // x0
float v24; // s0
const char *v25; // x0
float v26; // s0
const char *v27; // x0
float v28; // s0
const char *v29; // x0
float v30; // s0
const char *v31; // x0
float v32; // s0
const char *v33; // x0
double v34; // d0
const char **v35; // x20
const char *v36; // x0
float v37; // s0
const char *v38; // x0
float v39; // s0
const char *v40; // x0
float v41; // s0
const char *v42; // x0
float v43; // s0
const char *v44; // x0
float v45; // s0
const char *v46; // x0
float v47; // s0
const char *v48; // x0
float v49; // s0
const char *v50; // x0
float v51; // s0
const char *v52; // x0
float v53; // s0
const char *v54; // x0
float v55; // s0
const char *v56; // x0
float v57; // s0
const char *v58; // x0
double v59; // d0
const char **v60; // x20
const char *v61; // x0
bool v62; // zf
const char *v63; // x0
char v64; // w1
const char *v65; // x0
char v66; // w1
const char *v67; // x0
char v68; // w1
const char *v69; // x0
char v70; // w1
unsigned int v71; // w0
cocos2d::CCString *v72; // x0
size_t v73; // x0
void *v74; // x20
const char *v75; // x0
char v76; // w1
float v77; // s0
const char *v78; // x0
float v79; // s0
const char *v80; // x0
float v81; // s0
const char *v82; // x0
double v83; // d0
const char **v84; // x20
int v85; // w0
char v86; // w1
float v87; // s0
float v88; // s0
float v89; // s0
double v90; // d0
float v91; // s0
const char **v92; // x23
const char *v93; // x1
__int64 *v94; // x0
unsigned int *v95; // x1
int v96; // w2
const char *CString; // [xsp+68h] [xbp+68h]
void *v98; // [xsp+80h] [xbp+80h] BYREF
void *p; // [xsp+88h] [xbp+88h]
char *v100; // [xsp+90h] [xbp+90h]
if ( !*(_QWORD *)(*a1 - 24LL) )
return _stack_chk_guard;
v98 = (void *)operator new(0x280u);
p = v98;
v100 = (char *)v98 + 640;
sub_583398(a1, &byte_F7A380, (__int64)&v98);
v5 = (const char **)v98;
v6 = (const char **)p;
v7 = ((_BYTE *)p - (_BYTE *)v98) >> 3;
if ( (int)v7 <= 62 )
{
v8 = v98;
if ( v98 != p )
{
do
{
v9 = *v5;
v10 = (__int64 *)(*v5 - 24);
if ( v10 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v9 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v10);
}
++v5;
}
while ( v6 != v5 );
v8 = v98;
}
if ( v8 )
operator delete(v8);
return _stack_chk_guard;
}
*(_DWORD *)a2 = atoi(*(const char **)v98);
v13 = atof(v5[1]);
v14 = *((const char **)v98 + 2);
*(float *)(a2 + 4) = v13;
v15 = atof(v14);
v16 = *((const char **)v98 + 3);
*(float *)(a2 + 8) = v15;
v17 = atof(v16);
v18 = (const char **)v98;
*(float *)&v17 = v17;
v19 = *((const char **)v98 + 4);
*(_DWORD *)(a2 + 12) = LODWORD(v17);
*(_DWORD *)(a2 + 16) = atoi(v19);
*(_DWORD *)(a2 + 20) = atoi(v18[5]);
*(_DWORD *)(a2 + 24) = atoi(v18[6]);
*(_DWORD *)(a2 + 28) = atoi(v18[7]);
*(_DWORD *)(a2 + 32) = atoi(v18[8]);
*(_DWORD *)(a2 + 36) = atoi(v18[9]);
*(_DWORD *)(a2 + 40) = atoi(v18[10]);
*(_DWORD *)(a2 + 44) = atoi(v18[11]);
*(_DWORD *)(a2 + 48) = atoi(v18[12]);
*(_DWORD *)(a2 + 52) = atoi(v18[13]);
*(_DWORD *)(a2 + 56) = atoi(v18[14]);
*(_DWORD *)(a2 + 60) = atoi(v18[15]);
*(_DWORD *)(a2 + 64) = atoi(v18[16]);
*(_DWORD *)(a2 + 68) = atoi(v18[17]);
*(_DWORD *)(a2 + 72) = atoi(v18[18]);
*(_DWORD *)(a2 + 76) = atoi(v18[19]);
*(_DWORD *)(a2 + 80) = atoi(v18[20]);
v20 = atof(v18[21]);
v21 = *((const char **)v98 + 22);
*(float *)(a2 + 84) = v20;
v22 = atof(v21);
v23 = *((const char **)v98 + 23);
*(float *)(a2 + 88) = v22;
v24 = atof(v23);
v25 = *((const char **)v98 + 24);
*(float *)(a2 + 92) = v24;
v26 = atof(v25);
v27 = *((const char **)v98 + 25);
*(float *)(a2 + 96) = v26;
v28 = atof(v27);
v29 = *((const char **)v98 + 26);
*(float *)(a2 + 100) = v28;
v30 = atof(v29);
v31 = *((const char **)v98 + 27);
*(float *)(a2 + 104) = v30;
v32 = atof(v31);
v33 = *((const char **)v98 + 28);
*(float *)(a2 + 108) = v32;
v34 = atof(v33);
v35 = (const char **)v98;
*(float *)&v34 = v34;
v36 = *((const char **)v98 + 29);
*(_DWORD *)(a2 + 112) = LODWORD(v34);
*(_DWORD *)(a2 + 116) = atoi(v36);
*(_DWORD *)(a2 + 120) = atoi(v35[30]);
*(_DWORD *)(a2 + 124) = atoi(v35[31]);
*(_DWORD *)(a2 + 128) = atoi(v35[32]);
v37 = atof(v35[33]);
v38 = *((const char **)v98 + 34);
*(float *)(a2 + 132) = v37;
v39 = atof(v38);
v40 = *((const char **)v98 + 35);
*(float *)(a2 + 136) = v39;
v41 = atof(v40);
v42 = *((const char **)v98 + 36);
*(float *)(a2 + 140) = v41;
v43 = atof(v42);
v44 = *((const char **)v98 + 37);
*(float *)(a2 + 144) = v43;
v45 = atof(v44);
v46 = *((const char **)v98 + 38);
*(float *)(a2 + 148) = v45;
v47 = atof(v46);
v48 = *((const char **)v98 + 39);
*(float *)(a2 + 152) = v47;
v49 = atof(v48);
v50 = *((const char **)v98 + 40);
*(float *)(a2 + 156) = v49;
v51 = atof(v50);
v52 = *((const char **)v98 + 41);
*(float *)(a2 + 160) = v51;
v53 = atof(v52);
v54 = *((const char **)v98 + 42);
*(float *)(a2 + 164) = v53;
v55 = atof(v54);
v56 = *((const char **)v98 + 43);
*(float *)(a2 + 168) = v55;
v57 = atof(v56);
v58 = *((const char **)v98 + 44);
*(float *)(a2 + 172) = v57;
v59 = atof(v58);
v60 = (const char **)v98;
*(float *)&v59 = v59;
v61 = *((const char **)v98 + 45);
*(_DWORD *)(a2 + 176) = LODWORD(v59);
*(_DWORD *)(a2 + 180) = atoi(v61);
*(_DWORD *)(a2 + 184) = atoi(v60[46]);
*(_DWORD *)(a2 + 188) = atoi(v60[47]);
*(_DWORD *)(a2 + 192) = atoi(v60[48]);
*(_DWORD *)(a2 + 196) = atoi(v60[49]);
*(_DWORD *)(a2 + 200) = atoi(v60[50]);
*(_DWORD *)(a2 + 204) = atoi(v60[51]);
*(_DWORD *)(a2 + 208) = atoi(v60[52]);
v62 = atoi(v60[53]) == 0;
v63 = v60[54];
v64 = !v62;
*(_BYTE *)(a2 + 212) = v64;
v62 = atoi(v63) == 0;
v65 = v60[55];
v66 = !v62;
*(_BYTE *)(a2 + 213) = v66;
v62 = atoi(v65) == 0;
v67 = v60[56];
v68 = !v62;
*(_BYTE *)(a2 + 214) = v68;
v62 = atoi(v67) == 0;
v69 = v60[57];
v70 = !v62;
*(_BYTE *)(a2 + 215) = v70;
v71 = atoi(v69);
*(_DWORD *)(a2 + 216) = v71;
v72 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"particle_%02d_001.png",
(const char *)v71);
CString = cocos2d::CCString::getCString(v72);
v73 = strlen(CString);
sub_D1798C(a2 + 264, CString, v73);
v74 = v98;
v62 = atoi(*((const char **)v98 + 58)) == 0;
v75 = *((const char **)v74 + 59);
v76 = !v62;
*(_BYTE *)(a2 + 220) = v76;
v77 = atof(v75);
v78 = *((const char **)v98 + 60);
*(float *)(a2 + 224) = v77;
v79 = atof(v78);
v80 = *((const char **)v98 + 61);
*(float *)(a2 + 228) = v79;
v81 = atof(v80);
v82 = *((const char **)v98 + 62);
*(float *)(a2 + 232) = v81;
v83 = atof(v82);
v84 = (const char **)v98;
*(float *)&v83 = v83;
*(_DWORD *)(a2 + 236) = LODWORD(v83);
if ( (_DWORD)v7 == 63 || (v85 = atoi(v84[63]), v86 = 1, !v85) )
v86 = 0;
*(_BYTE *)(a2 + 240) = v86;
if ( (int)v7 <= 64 )
{
*(_BYTE *)(a2 + 241) = 0;
goto LABEL_44;
}
*(_BYTE *)(a2 + 241) = atoi(v84[64]) != 0;
if ( (int)v7 <= 65 )
{
LABEL_44:
*(_BYTE *)(a2 + 242) = 0;
goto LABEL_45;
}
*(_BYTE *)(a2 + 242) = atoi(v84[65]) != 0;
if ( (int)v7 <= 66 )
{
LABEL_45:
*(_BYTE *)(a2 + 243) = 0;
goto LABEL_46;
}
*(_BYTE *)(a2 + 243) = atoi(v84[66]) != 0;
if ( (int)v7 <= 67 )
{
LABEL_46:
*(_BYTE *)(a2 + 244) = 0;
goto LABEL_47;
}
*(_BYTE *)(a2 + 244) = atoi(v84[67]) != 0;
if ( (int)v7 <= 68 )
{
LABEL_47:
*(_DWORD *)(a2 + 248) = 0;
LABEL_48:
*(_DWORD *)(a2 + 252) = 0;
goto LABEL_49;
}
v87 = atof(v84[68]);
*(float *)(a2 + 248) = v87;
if ( (_DWORD)v7 == 69 )
{
v84 = (const char **)v98;
goto LABEL_48;
}
v88 = atof(*((const char **)v98 + 69));
*(float *)(a2 + 252) = v88;
if ( (_DWORD)v7 != 70 )
{
v89 = atof(*((const char **)v98 + 70));
*(float *)(a2 + 256) = v89;
if ( (_DWORD)v7 == 71 )
{
v84 = (const char **)v98;
v91 = 0.0;
}
else
{
v90 = atof(*((const char **)v98 + 71));
v84 = (const char **)v98;
v91 = v90;
}
goto LABEL_50;
}
v84 = (const char **)v98;
LABEL_49:
v91 = 0.0;
*(_DWORD *)(a2 + 256) = 0;
LABEL_50:
v92 = (const char **)p;
*(float *)(a2 + 260) = v91;
if ( v92 != v84 )
{
do
{
v93 = *v84;
v94 = (__int64 *)(*v84 - 24);
if ( v94 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v95 = (unsigned int *)(v93 - 8);
do
v96 = __ldaxr(v95);
while ( __stlxr(v96 - 1, v95) );
}
else
{
v96 = *((_DWORD *)v93 - 2);
*((_DWORD *)v93 - 2) = v96 - 1;
}
if ( v96 <= 0 )
operator delete(v94);
}
++v84;
}
while ( v92 != v84 );
v92 = (const char **)v98;
}
if ( v92 )
operator delete(v92);
return _stack_chk_guard;
}