//
// EditorSFXManager::decodeSound from 0x1008ea380 to 0x1008ea8c4 (1348 bytes)
//
// 1 xrefs:
// > EditorSFXManager::deserializeAll @ 0x1008e1dbb
//
// 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:37:53 +0000
//
char *__fastcall EditorSFXManager::decodeSound(__int64 a1, const std::string *a2)
{
char *result; // rax
std::string::size_type v4; // r13
std::string::size_type size; // r15
unsigned int v6; // r15d
std::string::size_type v7; // r15
unsigned int v8; // eax
unsigned int v9; // eax
std::string::size_type v10; // r13
unsigned int v11; // r13d
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v12; // bl
char v13; // r12
const std::string::value_type *data; // r15
const char *v15; // rdi
const char *v16; // rdi
int v17; // eax
const char *v18; // rdi
int v19; // eax
const char *v20; // rdi
float v21; // xmm0_4
const char *v22; // rdi
std::string::pointer v23; // rcx
const char *v24; // rdi
int v25; // eax
const char *v26; // rdi
int v27; // eax
std::string::pointer v28; // rcx
const char *v29; // rdi
int v30; // eax
const char *v31; // rdi
int v32; // eax
const char *v33; // rdi
float v34; // xmm0_4
const char *v35; // rdi
int v36; // eax
std::string::pointer v37; // rcx
const char *v38; // rdi
int v39; // eax
const char *v40; // rdi
int v41; // eax
const char *v42; // rdi
float v43; // xmm0_4
unsigned int v44; // eax
std::string::size_type v45; // rdx
bool v46; // al
bool v47; // al
bool v48; // al
const std::string::value_type *v49; // rsi
std::string::size_type v50; // rdx
char *v51; // rbx
int *v52; // [rsp+8h] [rbp-78h]
std::string v53; // [rsp+10h] [rbp-70h] BYREF
std::string *v54; // [rsp+30h] [rbp-50h]
char *v55; // [rsp+38h] [rbp-48h]
std::string v56; // [rsp+40h] [rbp-40h] BYREF
result = SFXTriggerGameObject::create((__int64)"GJ_sfxIcon_001.png");
if ( !result )
return result;
*((_DWORD *)result + 466) = 0;
*((_DWORD *)result + 471) = 1065353216;
*(_QWORD *)(result + 1876) = 0;
v52 = (int *)(result + 1888);
result[1906] = 0;
*((_DWORD *)result + 487) = 0;
*((_OWORD *)result + 118) = 0;
result[1904] = 0;
memset(&v53, 0, sizeof(v53));
memset(&v56, 0, sizeof(v56));
v55 = result;
v54 = (std::string *)(result + 2000);
v4 = 0;
while ( 1 )
{
size = std::string::find(a2, 44, v4);
if ( size == -1 )
{
v6 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v6 & 1) != 0 )
size = a2->__r_.__value_.__l.__size_;
else
size = v6 >> 1;
}
std::string::assign(&v53, a2, v4, size - v4);
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) != 0 )
{
v7 = size + 1;
if ( !v53.__r_.__value_.__l.__size_ )
goto LABEL_10;
}
else
{
v7 = size + 1;
if ( !(*(_BYTE *)&v53.__r_.__value_.__l.0 >> 1) )
{
LABEL_10:
v4 = v7;
goto LABEL_11;
}
}
v9 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v9 & 1) == 0 )
break;
if ( v7 > a2->__r_.__value_.__l.__size_ )
goto LABEL_100;
LABEL_19:
v10 = std::string::find(a2, 44, v7);
if ( v10 == -1 )
{
v11 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v11 & 1) != 0 )
v10 = a2->__r_.__value_.__l.__size_;
else
v10 = v11 >> 1;
}
std::string::assign(&v56, a2, v7, v10 - v7);
v4 = v10 + 1;
v12 = v53.__r_.__value_.__s.0;
v13 = *(_BYTE *)&v53.__r_.__value_.__s.0 & 1;
data = v53.__r_.__value_.__l.__data_;
v15 = v53.__r_.__value_.__l.__data_;
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) == 0 )
v15 = v53.__r_.__value_.__s.__data_;
switch ( atoi(v15) )
{
case 1:
v16 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v16 = v56.__r_.__value_.__l.__data_;
v17 = atoi(v16);
*((_DWORD *)v55 + 466) = v17;
break;
case 2:
v33 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v33 = v56.__r_.__value_.__l.__data_;
v34 = atof(v33);
*((float *)v55 + 471) = v34;
break;
case 3:
v26 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v26 = v56.__r_.__value_.__l.__data_;
v27 = atoi(v26);
*((_DWORD *)v55 + 469) = v27;
break;
case 4:
v29 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v29 = v56.__r_.__value_.__l.__data_;
v30 = atoi(v29);
*((_DWORD *)v55 + 470) = v30;
break;
case 5:
v22 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v22 = v56.__r_.__value_.__l.__data_;
*v52 = atoi(v22);
break;
case 6:
v35 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v35 = v56.__r_.__value_.__l.__data_;
v36 = atoi(v35);
*((_DWORD *)v55 + 474) = v36;
break;
case 7:
v38 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v38 = v56.__r_.__value_.__l.__data_;
v39 = atoi(v38);
*((_DWORD *)v55 + 473) = v39;
break;
case 8:
v31 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v31 = v56.__r_.__value_.__l.__data_;
v32 = atoi(v31);
*((_DWORD *)v55 + 475) = v32;
break;
case 9:
v42 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v42 = v56.__r_.__value_.__l.__data_;
v43 = atof(v42);
*((float *)v55 + 487) = v43;
break;
case 10:
v24 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v24 = v56.__r_.__value_.__l.__data_;
v25 = atoi(v24);
*((_DWORD *)v55 + 496) = v25;
break;
case 11:
v40 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v40 = v56.__r_.__value_.__l.__data_;
v41 = atoi(v40);
*((_DWORD *)v55 + 497) = v41;
break;
case 12:
v20 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v20 = v56.__r_.__value_.__l.__data_;
v21 = atof(v20);
*((float *)v55 + 498) = v21;
break;
case 13:
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
{
if ( v56.__r_.__value_.__l.__size_ == 1 )
{
v23 = v56.__r_.__value_.__l.__data_;
LABEL_80:
v46 = *v23 == 49;
goto LABEL_82;
}
}
else
{
v23 = v56.__r_.__value_.__s.__data_;
if ( *(_BYTE *)&v56.__r_.__value_.__s.0 == 2 )
goto LABEL_80;
}
v46 = 0;
LABEL_82:
v55[1996] = v46;
break;
case 14:
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
{
if ( v56.__r_.__value_.__l.__size_ == 1 )
{
v37 = v56.__r_.__value_.__l.__data_;
LABEL_90:
v48 = *v37 == 49;
goto LABEL_92;
}
}
else
{
v37 = v56.__r_.__value_.__s.__data_;
if ( *(_BYTE *)&v56.__r_.__value_.__s.0 == 2 )
goto LABEL_90;
}
v48 = 0;
LABEL_92:
v55[1905] = v48;
break;
case 15:
v18 = v56.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
v18 = v56.__r_.__value_.__l.__data_;
v19 = atoi(v18);
*((_DWORD *)v55 + 467) = v19;
break;
case 16:
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
{
if ( v56.__r_.__value_.__l.__size_ == 1 )
{
v28 = v56.__r_.__value_.__l.__data_;
LABEL_85:
v47 = *v28 == 49;
goto LABEL_87;
}
}
else
{
v28 = v56.__r_.__value_.__s.__data_;
if ( *(_BYTE *)&v56.__r_.__value_.__s.0 == 2 )
goto LABEL_85;
}
v47 = 0;
LABEL_87:
v55[1904] = v47;
break;
default:
v44 = (unsigned int)v54->__r_.__value_.__l.0;
if ( (v44 & 1) != 0 )
{
if ( *((_QWORD *)v55 + 251) )
{
LABEL_76:
std::string::push_back(v54, 44);
v12 = v53.__r_.__value_.__s.0;
data = v53.__r_.__value_.__l.__data_;
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_77;
goto LABEL_95;
}
}
else if ( v44 >> 1 )
{
goto LABEL_76;
}
if ( !v13 )
{
LABEL_77:
v45 = *(unsigned __int8 *)&v12 >> 1;
data = v53.__r_.__value_.__s.__data_;
goto LABEL_96;
}
LABEL_95:
v45 = v53.__r_.__value_.__l.__size_;
LABEL_96:
std::string::append(v54, data, v45);
std::string::push_back(v54, 44);
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
{
v49 = v56.__r_.__value_.__l.__data_;
v50 = v56.__r_.__value_.__l.__size_;
}
else
{
v50 = *(_BYTE *)&v56.__r_.__value_.__l.0 >> 1;
v49 = v56.__r_.__value_.__s.__data_;
}
std::string::append(v54, v49, v50);
break;
}
LABEL_11:
v8 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v8 & 1) != 0 )
{
if ( v4 > a2->__r_.__value_.__l.__size_ )
goto LABEL_100;
}
else if ( v4 > v8 >> 1 )
{
goto LABEL_100;
}
}
if ( v7 <= v9 >> 1 )
goto LABEL_19;
LABEL_100:
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v56.__r_.__value_.__l.__data_);
result = v55;
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) != 0 )
{
v51 = v55;
operator delete(v53.__r_.__value_.__l.__data_);
return v51;
}
return result;
}