//
// sub_1008E9C40 from 0x1008e9c40 to 0x1008ea35d (1821 bytes)
//
// 3 xrefs:
// > EditorSFXManager::deserializeAll @ 0x1008e1fe5
// > EditorSFXManager::serializeAll @ 0x1008eaeb9
// > EditorSFXManager::serializeAll @ 0x1008eaf44
//
// 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
//
std::string *__fastcall sub_1008E9C40(std::string *this, __int64 a2, __int64 a3)
{
int v4; // r8d
unsigned int v5; // eax
int v6; // r15d
unsigned int v7; // eax
int v8; // r15d
unsigned int v9; // eax
int v10; // r15d
unsigned int v11; // eax
int v12; // r15d
unsigned int v13; // eax
int v14; // r15d
unsigned int v15; // eax
int v16; // r15d
unsigned int v17; // eax
unsigned int v18; // eax
int v19; // r15d
unsigned int v20; // eax
int v21; // r15d
unsigned int v22; // eax
unsigned int v23; // eax
unsigned int v24; // eax
unsigned int v25; // eax
int v26; // r15d
unsigned int v27; // eax
unsigned int v28; // eax
unsigned __int8 v29; // al
unsigned int v30; // edx
std::string::size_type v31; // rdx
const std::string::value_type *v32; // r14
float v34; // [rsp+0h] [rbp-70h]
float v35; // [rsp+0h] [rbp-70h]
float v36; // [rsp+0h] [rbp-70h]
char __str[56]; // [rsp+10h] [rbp-60h] BYREF
if ( !a3 )
{
*(_WORD *)&this->__r_.__value_.__l.0 = 0;
return this;
}
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
v4 = *(_DWORD *)(a3 + 1864);
if ( v4 )
{
snprintf(__str, 0x20u, "%d,%d", 1, v4);
std::string::append(this, __str);
}
v34 = *(float *)(a3 + 1884);
if ( fabs(v34 + -1.0) >= 0.000099999997 )
{
v5 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v5 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_11;
}
else if ( !(v5 >> 1) )
{
LABEL_11:
snprintf(__str, 0x30u, "%d,%g", 2, v34);
std::string::append(this, __str);
goto LABEL_12;
}
std::string::push_back(this, 44);
goto LABEL_11;
}
LABEL_12:
v6 = *(_DWORD *)(a3 + 1876);
if ( !v6 )
goto LABEL_19;
v7 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v7 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_18;
goto LABEL_17;
}
if ( v7 >> 1 )
LABEL_17:
std::string::push_back(this, 44);
LABEL_18:
snprintf(__str, 0x20u, "%d,%d", 3, v6);
std::string::append(this, __str);
LABEL_19:
v8 = *(_DWORD *)(a3 + 1880);
if ( !v8 )
goto LABEL_26;
v9 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v9 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_25;
goto LABEL_24;
}
if ( v9 >> 1 )
LABEL_24:
std::string::push_back(this, 44);
LABEL_25:
snprintf(__str, 0x20u, "%d,%d", 4, v8);
std::string::append(this, __str);
LABEL_26:
v10 = *(_DWORD *)(a3 + 1888);
if ( !v10 )
goto LABEL_33;
v11 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v11 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_32;
goto LABEL_31;
}
if ( v11 >> 1 )
LABEL_31:
std::string::push_back(this, 44);
LABEL_32:
snprintf(__str, 0x20u, "%d,%d", 5, v10);
std::string::append(this, __str);
LABEL_33:
v12 = *(_DWORD *)(a3 + 1896);
if ( !v12 )
goto LABEL_40;
v13 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v13 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_39;
goto LABEL_38;
}
if ( v13 >> 1 )
LABEL_38:
std::string::push_back(this, 44);
LABEL_39:
snprintf(__str, 0x20u, "%d,%d", 6, v12);
std::string::append(this, __str);
LABEL_40:
v14 = *(_DWORD *)(a3 + 1892);
if ( !v14 )
goto LABEL_47;
v15 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v15 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_46;
goto LABEL_45;
}
if ( v15 >> 1 )
LABEL_45:
std::string::push_back(this, 44);
LABEL_46:
snprintf(__str, 0x20u, "%d,%d", 7, v14);
std::string::append(this, __str);
LABEL_47:
v16 = *(_DWORD *)(a3 + 1900);
if ( !v16 )
goto LABEL_54;
v17 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v17 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_53;
goto LABEL_52;
}
if ( v17 >> 1 )
LABEL_52:
std::string::push_back(this, 44);
LABEL_53:
snprintf(__str, 0x20u, "%d,%d", 8, v16);
std::string::append(this, __str);
LABEL_54:
v35 = *(float *)(a3 + 1948);
if ( fabs(v35) < 0.000099999997 )
goto LABEL_61;
v18 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v18 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_60;
goto LABEL_59;
}
if ( v18 >> 1 )
LABEL_59:
std::string::push_back(this, 44);
LABEL_60:
snprintf(__str, 0x30u, "%d,%g", 9, v35);
std::string::append(this, __str);
LABEL_61:
v19 = *(_DWORD *)(a3 + 1984);
if ( !v19 )
goto LABEL_68;
v20 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v20 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_67;
goto LABEL_66;
}
if ( v20 >> 1 )
LABEL_66:
std::string::push_back(this, 44);
LABEL_67:
snprintf(__str, 0x20u, "%d,%d", 10, v19);
std::string::append(this, __str);
LABEL_68:
v21 = *(_DWORD *)(a3 + 1988);
if ( !v21 )
goto LABEL_75;
v22 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v22 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_74;
goto LABEL_73;
}
if ( v22 >> 1 )
LABEL_73:
std::string::push_back(this, 44);
LABEL_74:
snprintf(__str, 0x20u, "%d,%d", 11, v21);
std::string::append(this, __str);
LABEL_75:
v36 = *(float *)(a3 + 1992);
if ( fabs(v36) < 0.000099999997 )
goto LABEL_82;
v23 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v23 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_81;
goto LABEL_80;
}
if ( v23 >> 1 )
LABEL_80:
std::string::push_back(this, 44);
LABEL_81:
snprintf(__str, 0x30u, "%d,%g", 12, v36);
std::string::append(this, __str);
LABEL_82:
if ( *(_BYTE *)(a3 + 1996) != 1 )
goto LABEL_89;
v24 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v24 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_88;
goto LABEL_87;
}
if ( v24 >> 1 )
LABEL_87:
std::string::push_back(this, 44);
LABEL_88:
snprintf(__str, 0x10u, "%d,%d", 13, 1);
std::string::append(this, __str);
LABEL_89:
if ( *(_BYTE *)(a3 + 1905) != 1 )
goto LABEL_96;
v25 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v25 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_95;
goto LABEL_94;
}
if ( v25 >> 1 )
LABEL_94:
std::string::push_back(this, 44);
LABEL_95:
snprintf(__str, 0x10u, "%d,%d", 14, 1);
std::string::append(this, __str);
LABEL_96:
v26 = *(_DWORD *)(a3 + 1868);
if ( !v26 )
goto LABEL_103;
v27 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v27 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_102;
goto LABEL_101;
}
if ( v27 >> 1 )
LABEL_101:
std::string::push_back(this, 44);
LABEL_102:
snprintf(__str, 0x20u, "%d,%d", 15, v26);
std::string::append(this, __str);
LABEL_103:
if ( *(_BYTE *)(a3 + 1904) == 1 )
{
v28 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v28 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_109;
}
else if ( !(v28 >> 1) )
{
LABEL_109:
snprintf(__str, 0x10u, "%d,%d", 16, 1);
std::string::append(this, __str);
goto LABEL_110;
}
std::string::push_back(this, 44);
goto LABEL_109;
}
LABEL_110:
v29 = *(_BYTE *)(a3 + 2000);
if ( (v29 & 1) == 0 )
{
if ( !(v29 >> 1) )
return this;
LABEL_114:
v30 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v30 & 1) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_116;
}
else if ( !(v30 >> 1) )
{
LABEL_116:
if ( (v29 & 1) != 0 )
{
LABEL_117:
v31 = *(_QWORD *)(a3 + 2008);
v32 = *(const std::string::value_type **)(a3 + 2016);
LABEL_121:
std::string::append(this, v32, v31);
return this;
}
LABEL_120:
v32 = (const std::string::value_type *)(a3 + 2001);
v31 = v29 >> 1;
goto LABEL_121;
}
std::string::push_back(this, 44);
v29 = *(_BYTE *)(a3 + 2000);
if ( (v29 & 1) != 0 )
goto LABEL_117;
goto LABEL_120;
}
if ( *(_QWORD *)(a3 + 2008) )
goto LABEL_114;
return this;
}