//
// GManager::loadDataFromFile from 0x10024aad8 to 0x10024ac24 (332 bytes)
//
// 1 xrefs:
// > GManager::setup @ 0x10024a6b0
//
// 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
//
void __fastcall GManager::loadDataFromFile(__int64 a1, char *a2)
{
DS_Dictionary *v4; // x19
DS_Dictionary *v5; // x0
char *v6; // x0
__int64 *v7; // x0
void **v8; // x0
const char *v9; // x1
int Data; // w21
char *v11; // x0
__int64 *v12; // x0
pugi::xml_node *begin; // x0
void *v14; // x0
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
char v16; // [xsp+17h] [xbp-39h]
void *v17[2]; // [xsp+18h] [xbp-38h] BYREF
char v18; // [xsp+2Fh] [xbp-21h]
v4 = (DS_Dictionary *)operator new(0xF0u);
v5 = j_DS_Dictionary::DS_Dictionary(v4);
if ( (GManager::tryLoadData(v5, v4, a2) & 1) != 0 )
goto LABEL_20;
if ( a2[23] >= 0 )
v6 = a2;
else
v6 = *(char **)a2;
v7 = sub_10024ACF4((__int64 *)v17, v6);
if ( (unsigned int)GManager::tryLoadData(v7, v4, v17) )
{
if ( v18 >= 0 )
v8 = v17;
else
v8 = (void **)v17[0];
if ( a2[23] >= 0 )
v9 = a2;
else
v9 = *(const char **)a2;
DS_Dictionary::copyFile((const char *)v8, v9);
Data = 1;
}
else
{
if ( a2[23] >= 0 )
v11 = a2;
else
v11 = *(char **)a2;
v12 = sub_10024ACF4((__int64 *)__p, v11);
Data = GManager::tryLoadData(v12, v4, __p);
if ( v16 < 0 )
operator delete(__p[0]);
}
if ( v18 < 0 )
{
operator delete(v17[0]);
if ( Data )
goto LABEL_20;
}
else if ( Data )
{
LABEL_20:
(*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)a1 + 896LL))(a1, v4);
goto LABEL_23;
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 904LL))(a1);
LABEL_23:
begin = v4->dictTree.__begin_;
if ( begin )
{
v4->dictTree.__end_ = begin;
operator delete(begin);
}
v14 = (void *)pugi::xml_document::dxml_document(v4);
operator delete(v14);
}