//
// GManager::loadDataFromFile from 0x1004ac4f0 to 0x1004ac6f7 (519 bytes)
//
// 2 xrefs:
// > GManager::setup @ 0x1004ac013
// > GManager::load @ 0x1004ac02c
//
// 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, __int64 a2)
{
DS_Dictionary *v3; // rbx
char *v4; // r12
__int64 v5; // rdi
char RootSubDictFromString; // r13
char *v7; // rsi
const char *data; // r13
std::string::pointer v9; // rdi
char v10; // r14
char v11; // r15
std::string::pointer v12; // rdi
pugi::xml_node *begin; // rdi
std::string v14; // [rsp+8h] [rbp-78h] BYREF
__int64 v15; // [rsp+20h] [rbp-60h]
std::string v16; // [rsp+28h] [rbp-58h] BYREF
__int128 v17; // [rsp+40h] [rbp-40h] BYREF
void *__p; // [rsp+50h] [rbp-30h]
v15 = a1;
v3 = (DS_Dictionary *)operator new(0xF0u);
sub_100179B00(v3);
v17 = 0;
__p = nullptr;
v4 = (char *)(a2 + 1);
v5 = a2 + 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v5 = *(_QWORD *)(a2 + 16);
PlatformToolbox::loadAndDecryptFileToString(v5, "/data/data/com.robtopx.geometryjump/", &v17);
RootSubDictFromString = DS_Dictionary::loadRootSubDictFromString((__int64)v3, (unsigned __int8 *)&v17);
if ( (v17 & 1) != 0 )
operator delete(__p);
if ( !RootSubDictFromString )
{
v7 = (char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v7 = *(char **)(a2 + 16);
sub_1004AC7E0(&v16, v7, "2.dat");
v17 = 0;
__p = nullptr;
data = v16.__r_.__value_.__s.__data_;
v9 = v16.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
v9 = v16.__r_.__value_.__l.__data_;
PlatformToolbox::loadAndDecryptFileToString(v9, "/data/data/com.robtopx.geometryjump/", &v17);
v10 = DS_Dictionary::loadRootSubDictFromString((__int64)v3, (unsigned __int8 *)&v17);
if ( (v17 & 1) != 0 )
operator delete(__p);
if ( v10 )
{
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
data = v16.__r_.__value_.__l.__data_;
if ( (*(_BYTE *)a2 & 1) != 0 )
v4 = *(char **)(a2 + 16);
v11 = 1;
DS_Dictionary::copyFile(data, v4);
}
else
{
if ( (*(_BYTE *)a2 & 1) != 0 )
v4 = *(char **)(a2 + 16);
sub_1004AC7E0(&v14, v4, ".dat.bak");
v17 = 0;
__p = nullptr;
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
v12 = v14.__r_.__value_.__l.__data_;
else
v12 = v14.__r_.__value_.__s.__data_;
PlatformToolbox::loadAndDecryptFileToString(v12, "/data/data/com.robtopx.geometryjump/", &v17);
v11 = DS_Dictionary::loadRootSubDictFromString((__int64)v3, (unsigned __int8 *)&v17);
if ( (v17 & 1) != 0 )
operator delete(__p);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
}
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v16.__r_.__value_.__l.__data_);
if ( !v11 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v15 + 904LL))(v15);
begin = v3->dictTree.__begin_;
if ( !begin )
goto LABEL_32;
goto LABEL_31;
}
}
(*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)v15 + 896LL))(v15, v3);
begin = v3->dictTree.__begin_;
if ( begin )
{
LABEL_31:
v3->dictTree.__end_ = begin;
operator delete(begin);
}
LABEL_32:
pugi::xml_document::dxml_document(v3);
operator delete(v3);
}