//
// sub_1005CE850 from 0x1005ce850 to 0x1005cf13e (2286 bytes)
//
// 2 xrefs:
// > processFMODAudioState @ 0x1005ef8c6
// > processFMODAudioState @ 0x1005ef8d5
//
// This function is hookable on this platform (idp: pc, 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:32:51 +0000
//
void __fastcall sub_1005CE850(__int64 *a1, float *a2)
{
float *v2; // r12
__int64 v3; // rax
__int64 v4; // rcx
__int64 v5; // rax
void **v6; // r13
int v7; // r14d
char *v8; // rdi
const char *v9; // rdi
void **v10; // r15
__int64 v11; // rsi
signed int v12; // eax
void **v13; // rsi
void **v14; // rbx
char *v15; // rdi
const char *v16; // rdi
const std::string *v17; // rsi
std::string *v18; // rdi
char *v19; // r13
__int64 v20; // rax
__int64 v21; // rax
std::string::pointer data; // rdx
char *v23; // r12
char *v24; // r13
signed int v25; // r14d
signed int v26; // ebx
__int64 v27; // rax
char *v28; // rdi
const char *v29; // rdi
float v30; // xmm0_4
signed int v31; // r15d
char *v32; // rdi
const char *v33; // rdi
signed int v34; // r14d
signed int v35; // r15d
signed int v36; // r14d
signed int v37; // r15d
signed int v38; // r14d
signed int v39; // eax
signed int v40; // r14d
char *v41; // rdi
float v42; // xmm0_4
char *v43; // rdi
const char *v44; // rdi
signed int v45; // eax
signed int v46; // r14d
char *v47; // rdi
float v48; // xmm0_4
char *v49; // rdi
signed int v50; // ecx
signed int v51; // r14d
char *v52; // rdi
char *v53; // rdi
char *v54; // rdi
const char *v55; // rdi
char *v56; // rcx
_BYTE *v57; // rcx
char *v58; // rcx
_BYTE *v59; // rcx
char *v60; // rax
_BYTE *v61; // rax
char *v62; // rdi
char *v63; // rcx
int v64; // r14d
_BYTE *v65; // rcx
void **v66; // rbx
void *v67; // rdi
__int128 v68; // [rsp+0h] [rbp-C0h] BYREF
__int64 v69; // [rsp+10h] [rbp-B0h]
float *v70; // [rsp+18h] [rbp-A8h]
std::string v71; // [rsp+20h] [rbp-A0h] BYREF
void **v72; // [rsp+38h] [rbp-88h]
std::string v73; // [rsp+40h] [rbp-80h] BYREF
int v74; // [rsp+64h] [rbp-5Ch] BYREF
void *__p; // [rsp+68h] [rbp-58h] BYREF
void **v76; // [rsp+70h] [rbp-50h]
signed int v77; // [rsp+80h] [rbp-40h]
int v78; // [rsp+94h] [rbp-2Ch]
v2 = a2;
memset(&v71, 0, sizeof(v71));
v3 = *((int *)a1 + 6);
v4 = *a1;
if ( (int)v3 < (int)(-1431655765 * ((unsigned __int64)(a1[1] - *a1) >> 3)) )
{
*((_DWORD *)a1 + 6) = v3 + 1;
std::string::operator=(&v71, (const std::string *)(v4 + 24 * v3));
}
sub_1005C67B0((__int64)&__p, (unsigned __int8 *)&v71, ":", a1[4]);
v5 = v77;
v6 = (void **)__p;
v7 = 0;
if ( v77 < (int)(-1431655765 * ((unsigned __int64)((char *)v76 - (_BYTE *)__p) >> 3)) )
{
++v77;
v8 = (char *)__p + 24 * v5;
if ( (*v8 & 1) != 0 )
v9 = *((const char **)v8 + 2);
else
v9 = v8 + 1;
v7 = atoi(v9);
}
if ( *((_QWORD *)a2 + 3) )
{
v10 = *((void ***)a2 + 2);
if ( v10 )
{
do
{
v14 = (void **)*v10;
if ( ((_BYTE)v10[3] & 1) != 0 )
operator delete(v10[5]);
operator delete(v10);
v10 = v14;
}
while ( v14 );
}
*((_QWORD *)a2 + 2) = 0;
v11 = *((_QWORD *)a2 + 1);
if ( v11 )
__bzero(*(_QWORD *)v2, 8 * v11);
*((_QWORD *)v2 + 3) = 0;
v6 = (void **)__p;
}
if ( v7 > 0 )
{
v12 = v77;
v13 = v76;
v70 = v2;
while ( 1 )
{
v74 = 0;
if ( v12 < (int)(-1431655765 * ((unsigned __int64)((char *)v13 - (char *)v6) >> 3)) )
{
v77 = v12 + 1;
v15 = (char *)&v6[3 * v12];
if ( (*v15 & 1) != 0 )
v16 = *((const char **)v15 + 2);
else
v16 = v15 + 1;
v74 = atoi(v16);
}
v17 = (const std::string *)&v74;
v73.__r_.__value_.__r.__words[0] = (std::string::size_type)&v74;
v18 = (std::string *)v2;
v19 = sub_1003D9640(v2, &v74, (__int64)&unk_100A0D5BE, &v73);
memset(&v73, 0, sizeof(v73));
v20 = v77;
if ( v77 < (int)(-1431655765 * ((unsigned __int64)((char *)v76 - (_BYTE *)__p) >> 3)) )
{
++v77;
v17 = (const std::string *)((char *)__p + 24 * v20);
v18 = &v73;
std::string::operator=(&v73, v17);
}
v21 = cocos2d::CCFileUtils::sharedFileUtils(v18, v17);
data = v73.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) != 0 )
data = v73.__r_.__value_.__l.__data_;
(*(void (__fastcall **)(__int128 *, __int64, std::string::pointer, _QWORD))(*(_QWORD *)v21 + 48LL))(
&v68,
v21,
data,
0);
v23 = v19;
v24 = v19 + 24;
if ( (*v24 & 1) != 0 )
operator delete(*((void **)v23 + 5));
v78 = v7;
*((_QWORD *)v24 + 2) = v69;
*(_OWORD *)v24 = v68;
if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v73.__r_.__value_.__l.__data_);
v25 = v77;
v6 = (void **)__p;
v72 = v76;
v26 = -1431655765 * ((unsigned __int64)((char *)v76 - (_BYTE *)__p) >> 3);
if ( v77 < v26 )
{
v27 = v77;
v25 = ++v77;
v28 = (char *)__p + 24 * v27;
if ( (*v28 & 1) != 0 )
v29 = *((const char **)v28 + 2);
else
v29 = v28 + 1;
v30 = atof(v29);
*((float *)v23 + 12) = v30;
}
if ( v25 >= v26 )
break;
v31 = v25 + 1;
v77 = v25 + 1;
v32 = (char *)&v6[3 * v25];
if ( (*v32 & 1) != 0 )
v33 = *((const char **)v32 + 2);
else
v33 = v32 + 1;
v42 = atof(v33);
*((float *)v23 + 13) = v42;
if ( v31 >= v26 )
goto LABEL_41;
v34 = v25 + 2;
v77 = v31 + 1;
v43 = (char *)&v6[3 * v31];
if ( (*v43 & 1) != 0 )
v44 = *((const char **)v43 + 2);
else
v44 = v43 + 1;
v48 = atof(v44);
*((float *)v23 + 14) = v48;
if ( v34 >= v26 )
{
LABEL_42:
v35 = v34;
if ( v34 >= v26 )
goto LABEL_43;
goto LABEL_69;
}
LABEL_61:
v35 = v34 + 1;
v77 = v34 + 1;
v49 = (char *)&v6[3 * v34];
if ( (*v49 & 1) != 0 )
{
*((_DWORD *)v23 + 15) = atoi(*((const char **)v49 + 2));
if ( v35 >= v26 )
{
LABEL_43:
v36 = v35;
if ( v35 >= v26 )
goto LABEL_44;
goto LABEL_73;
}
}
else
{
*((_DWORD *)v23 + 15) = atoi(v49 + 1);
if ( v35 >= v26 )
goto LABEL_43;
}
LABEL_69:
v36 = v35 + 1;
v77 = v35 + 1;
v52 = (char *)&v6[3 * v35];
if ( (*v52 & 1) != 0 )
{
*((_DWORD *)v23 + 16) = atoi(*((const char **)v52 + 2));
if ( v36 >= v26 )
{
LABEL_44:
v37 = v36;
if ( v36 >= v26 )
goto LABEL_45;
goto LABEL_77;
}
}
else
{
*((_DWORD *)v23 + 16) = atoi(v52 + 1);
if ( v36 >= v26 )
goto LABEL_44;
}
LABEL_73:
v37 = v36 + 1;
v77 = v36 + 1;
v53 = (char *)&v6[3 * v36];
if ( (*v53 & 1) != 0 )
{
*((_DWORD *)v23 + 17) = atoi(*((const char **)v53 + 2));
if ( v37 >= v26 )
{
LABEL_45:
v38 = v37;
if ( v37 >= v26 )
goto LABEL_46;
goto LABEL_81;
}
}
else
{
*((_DWORD *)v23 + 17) = atoi(v53 + 1);
if ( v37 >= v26 )
goto LABEL_45;
}
LABEL_77:
v38 = v37 + 1;
v77 = v37 + 1;
v54 = (char *)&v6[3 * v37];
if ( (*v54 & 1) != 0 )
v55 = *((const char **)v54 + 2);
else
v55 = v54 + 1;
*((_DWORD *)v23 + 18) = atoi(v55);
if ( v38 >= v26 )
{
LABEL_46:
v39 = v38;
if ( v38 >= v26 )
goto LABEL_87;
goto LABEL_47;
}
LABEL_81:
v39 = v38 + 1;
v77 = v38 + 1;
v56 = (char *)&v6[3 * v38];
if ( (*v56 & 1) != 0 )
{
if ( *((_QWORD *)v56 + 1) == 1 )
{
v57 = *((_BYTE **)v56 + 2);
LABEL_86:
v23[76] = *v57 == 49;
if ( v39 >= v26 )
goto LABEL_87;
goto LABEL_47;
}
}
else if ( *v56 == 2 )
{
v57 = v56 + 1;
goto LABEL_86;
}
v23[76] = 0;
if ( v39 >= v26 )
{
LABEL_87:
v40 = v39;
if ( v39 >= v26 )
{
LABEL_55:
v45 = v40;
if ( v40 >= v26 )
goto LABEL_94;
goto LABEL_56;
}
goto LABEL_88;
}
LABEL_47:
v40 = v39 + 1;
v77 = v39 + 1;
v41 = (char *)&v6[3 * v39];
if ( (*v41 & 1) != 0 )
{
*((_DWORD *)v23 + 20) = atoi(*((const char **)v41 + 2));
if ( v40 >= v26 )
goto LABEL_55;
}
else
{
*((_DWORD *)v23 + 20) = atoi(v41 + 1);
if ( v40 >= v26 )
goto LABEL_55;
}
LABEL_88:
v45 = v40 + 1;
v77 = v40 + 1;
v58 = (char *)&v6[3 * v40];
if ( (*v58 & 1) != 0 )
{
if ( *((_QWORD *)v58 + 1) == 1 )
{
v59 = *((_BYTE **)v58 + 2);
LABEL_93:
v23[84] = *v59 == 49;
if ( v45 >= v26 )
goto LABEL_94;
goto LABEL_56;
}
}
else if ( *v58 == 2 )
{
v59 = v58 + 1;
goto LABEL_93;
}
v23[84] = 0;
if ( v45 >= v26 )
{
LABEL_94:
v46 = v45;
if ( v45 >= v26 )
{
LABEL_65:
v50 = v46;
if ( v46 < v26 )
goto LABEL_107;
goto LABEL_66;
}
goto LABEL_95;
}
LABEL_56:
v46 = v45 + 1;
v77 = v45 + 1;
v47 = (char *)&v6[3 * v45];
if ( (*v47 & 1) != 0 )
{
*((_DWORD *)v23 + 22) = atoi(*((const char **)v47 + 2));
if ( v46 >= v26 )
goto LABEL_65;
}
else
{
*((_DWORD *)v23 + 22) = atoi(v47 + 1);
if ( v46 >= v26 )
goto LABEL_65;
}
LABEL_95:
v50 = v46 + 1;
v77 = v46 + 1;
v60 = (char *)&v6[3 * v46];
if ( (*v60 & 1) == 0 )
{
if ( *v60 == 2 )
{
v61 = v60 + 1;
goto LABEL_100;
}
goto LABEL_106;
}
if ( *((_QWORD *)v60 + 1) == 1 )
{
v61 = *((_BYTE **)v60 + 2);
LABEL_100:
v23[92] = *v61 == 49;
if ( v50 >= v26 )
goto LABEL_66;
LABEL_107:
v51 = v50 + 1;
v77 = v50 + 1;
v62 = (char *)&v6[3 * v50];
if ( (*v62 & 1) != 0 )
{
*((_DWORD *)v23 + 24) = atoi(*((const char **)v62 + 2));
if ( v51 >= v26 )
goto LABEL_18;
goto LABEL_111;
}
*((_DWORD *)v23 + 24) = atoi(v62 + 1);
if ( v51 < v26 )
goto LABEL_111;
LABEL_18:
v12 = v51;
v13 = v72;
v7 = v78 - 1;
v2 = v70;
if ( v78 == 1 )
goto LABEL_119;
}
else
{
LABEL_106:
v23[92] = 0;
if ( v50 < v26 )
goto LABEL_107;
LABEL_66:
v51 = v50;
*((_DWORD *)v23 + 24) = 0;
if ( v50 >= v26 )
goto LABEL_18;
LABEL_111:
v12 = v51 + 1;
v77 = v51 + 1;
v63 = (char *)&v6[3 * v51];
v13 = v72;
if ( (*v63 & 1) != 0 )
{
v64 = v78;
if ( *((_QWORD *)v63 + 1) == 1 )
{
v65 = *((_BYTE **)v63 + 2);
goto LABEL_116;
}
LABEL_118:
v23[112] = 0;
v7 = v64 - 1;
v2 = v70;
if ( !v7 )
goto LABEL_119;
}
else
{
v64 = v78;
if ( *v63 != 2 )
goto LABEL_118;
v65 = v63 + 1;
LABEL_116:
v23[112] = *v65 == 49;
v7 = v64 - 1;
v2 = v70;
if ( !v7 )
goto LABEL_119;
}
}
}
v31 = v25;
LABEL_41:
v34 = v31;
if ( v31 >= v26 )
goto LABEL_42;
goto LABEL_61;
}
LABEL_119:
if ( v6 )
{
v66 = v76;
v67 = v6;
if ( v76 != v6 )
{
do
{
if ( (*(_BYTE *)(v66 - 3) & 1) != 0 )
operator delete(*(v66 - 1));
v66 -= 3;
}
while ( v66 != v6 );
v67 = __p;
}
v76 = v6;
operator delete(v67);
}
if ( (*(_BYTE *)&v71.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v71.__r_.__value_.__l.__data_);
}