//
// sub_1008ED2F0 from 0x1008ed2f0 to 0x1008ed440 (336 bytes)
//
// 2 xrefs:
// > sub_1008ED230 @ 0x1008ed2bc
// > sub_1008F8AA0 @ 0x1008f8b28
//
// 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:54 +0000
//
__int64 __fastcall sub_1008ED2F0(_QWORD *a1, __int64 a2, unsigned __int8 a3, std::string *a4)
{
__int128 *v4; // r15
bool v5; // zf
const std::string::value_type *v6; // rsi
unsigned __int8 v7; // r13
__int64 v8; // r12
unsigned __int8 v9; // r13
unsigned int v10; // ebx
int v12; // [rsp+4h] [rbp-4Ch] BYREF
std::string *v13; // [rsp+8h] [rbp-48h]
__int128 v14; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
if ( !a2 )
{
if ( a4 )
{
v6 = "No config to apply.";
LABEL_15:
std::string::assign(a4, v6);
}
return 0;
}
if ( *(_BYTE *)(a2 + 496) != 1 )
{
LABEL_13:
if ( a4 )
{
v6 = "Config has no data.";
goto LABEL_15;
}
return 0;
}
v4 = (__int128 *)(a2 + 472);
v5 = (*(_BYTE *)(a2 + 472) & 1) == 0;
v13 = a4;
if ( v5 )
{
__p = *(void **)(a2 + 488);
v14 = *v4;
}
else
{
v7 = a3;
sub_10001AD30(&v14, *(const void **)(a2 + 488), *(_QWORD *)(a2 + 480));
a3 = v7;
a4 = v13;
}
if ( (v14 & 1) != 0 )
{
v8 = *((_QWORD *)&v14 + 1);
v9 = a3;
operator delete(__p);
a3 = v9;
a4 = v13;
if ( v8 )
goto LABEL_10;
goto LABEL_13;
}
if ( !((unsigned __int8)v14 >> 1) )
goto LABEL_13;
LABEL_10:
v12 = a3;
if ( (*(_BYTE *)v4 & 1) != 0 )
{
sub_10001AD30(&v14, *(const void **)(a2 + 488), *(_QWORD *)(a2 + 480));
a4 = v13;
}
else
{
__p = *(void **)(a2 + 488);
v14 = *v4;
}
v10 = EditorSFXManager::importFromString(a1, (unsigned __int8 *)&v14, &v12, a4);
if ( (v14 & 1) != 0 )
operator delete(__p);
return v10;
}