//
// GManager::loadDataFromFile from 0x2f0418 to 0x2f04fa (226 bytes)
//
// 1 xrefs:
// > GManager::load @ 0x2f050c
//
// 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(int a1, DS_Dictionary *a2, const char *a3, const char *a4)
{
DS_Dictionary *v6; // r4
int v7; // r3
int v8; // r3
_BOOL4 Data; // r10
DS_Dictionary *v10; // [sp+4h] [bp-Ch] BYREF
const char *v11[2]; // [sp+8h] [bp-8h] BYREF
v10 = a2;
v11[0] = a3;
v11[1] = a4;
v6 = (DS_Dictionary *)operator new(0xD8u);
DS_Dictionary::DS_Dictionary(v6);
if ( GManager::tryLoadData(a1, v6, (const char **)a2) )
goto LABEL_2;
sub_2F0144((int)&v10, (char *)a2->doc._root, "2.dat", v7);
Data = GManager::tryLoadData(a1, v6, (const char **)&v10);
if ( Data )
{
DS_Dictionary::copyFile((const char *)v10, (const char *)a2->doc._root);
}
else
{
sub_2F0144((int)v11, (char *)a2->doc._root, ".dat.bak", v8);
Data = GManager::tryLoadData(a1, v6, v11);
sub_774008(v11);
}
sub_774008(&v10);
if ( Data )
LABEL_2:
(*(void (__fastcall **)(int, DS_Dictionary *))(*(_DWORD *)a1 + 448))(a1, v6);
else
(*(void (__fastcall **)(int))(*(_DWORD *)a1 + 452))(a1);
std::_Vector_base
::~_Vector_base((void **)&v6->dictTree.m_start);
pugi::xml_document::~xml_document(&v6->doc);
operator delete(v6);
}