//
// DS_Dictionary::loadRootSubDictFromCompressedFile from 0x10017ae90 to 0x10017b18f (767 bytes)
//
// 0 xrefs:
//
// 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
//
bool __fastcall DS_Dictionary::loadRootSubDictFromCompressedFile(DS_Dictionary *a1, const char *a2)
{
const char *v2; // r14
DS_Dictionary *v3; // r13
std::__vector_base
::pointer end; // r15
pugi::xml_node *value; // rax
__int64 v6; // rbx
std::__vector_base::pointer begin; // r12
signed __int64 v8; // r15
__int64 v9; // r14
__int64 v10; // rax
unsigned __int64 v11; // rbx
pugi::xml_node *v12; // r13
DS_Dictionary *v13; // rax
const std::string::value_type *data; // rsi
cocos2d::CCFileUtils *v15; // rax
std::string::pointer v16; // rsi
std::string::value_type *v17; // r14
std::string::pointer v18; // rdx
std::string::size_type size; // rcx
bool v20; // r15
__int128 v22; // [rsp+0h] [rbp-C0h] BYREF
int v23; // [rsp+10h] [rbp-B0h]
__int128 v24; // [rsp+18h] [rbp-A8h] BYREF
int v25; // [rsp+28h] [rbp-98h]
DS_Dictionary *v26; // [rsp+30h] [rbp-90h]
pugi::xml_node *v27; // [rsp+38h] [rbp-88h]
std::string v28; // [rsp+40h] [rbp-80h] BYREF
__int64 v29; // [rsp+58h] [rbp-68h] BYREF
const char *v30; // [rsp+60h] [rbp-60h]
std::string v31; // [rsp+68h] [rbp-58h] BYREF
std::string v32; // [rsp+80h] [rbp-40h] BYREF
v2 = a2;
v3 = a1;
a1->dictTree.__end_ = a1->dictTree.__begin_;
pugi::xml_node::xml_node(&v31);
end = a1->dictTree.__end_;
value = a1->dictTree.__end_cap_.__value_;
if ( end >= value )
{
v30 = a2;
begin = a1->dictTree.__begin_;
v8 = (char *)end - (char *)begin;
v9 = v8 >> 3;
if ( (unsigned __int64)((v8 >> 3) + 1) >> 61 )
sub_100183910();
v10 = (char *)value - (char *)begin;
v11 = v10 >> 2;
if ( v10 >> 2 <= (unsigned __int64)((v8 >> 3) + 1) )
v11 = (v8 >> 3) + 1;
if ( (unsigned __int64)v10 >= 0x7FFFFFFFFFFFFFF8LL )
v11 = 0x1FFFFFFFFFFFFFFFLL;
v26 = a1;
if ( v11 )
{
if ( v11 > 0x1FFFFFFFFFFFFFFFLL )
sub_100054850();
v12 = (pugi::xml_node *)operator new(8 * v11);
}
else
{
v12 = nullptr;
}
v27 = &v12[v11];
v12[v9] = (pugi::xml_node)v31.__r_.__value_.__l.0;
v6 = (__int64)&v12[v9 + 1];
memcpy(v12, begin, v8);
v13 = v26;
v26->dictTree.__begin_ = v12;
v3 = v13;
v13->dictTree.__end_ = (std::__vector_base::pointer)v6;
v13->dictTree.__end_cap_.__value_ = v27;
if ( begin )
operator delete(begin);
v2 = v30;
}
else
{
end->_root = (pugi::xml_node_struct *)v31.__r_.__value_.__l.0;
v6 = (__int64)&end[1];
}
v3->dictTree.__end_ = (std::__vector_base::pointer)v6;
*(_WORD *)&v31.__r_.__value_.__l.0 = 0;
FileOperation::getFilePath(&v28);
std::string::append(&v28, v2);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
data = v28.__r_.__value_.__l.__data_;
else
data = v28.__r_.__value_.__s.__data_;
std::string::assign(&v31, data);
v29 = 0;
v15 = cocos2d::CCFileUtils::sharedFileUtils();
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
v16 = v31.__r_.__value_.__l.__data_;
else
v16 = v31.__r_.__value_.__s.__data_;
v17 = (std::string::value_type *)((__int64 (__fastcall *)(cocos2d::CCFileUtils *, std::string::pointer, const char *, __int64 *))v15->addSearchResolutionsOrder)(
v15,
v16,
"r",
&v29);
sub_100641100(&v22);
if ( v17 )
{
cocos2d::ZipUtils::decompressString2(&v32, v17);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
{
v18 = v32.__r_.__value_.__l.__data_;
size = v32.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v32.__r_.__value_.__l.0 >> 1;
v18 = v32.__r_.__value_.__s.__data_;
}
sub_1006422B0(&v24, v3, v18, size, 116, 0);
v23 = v25;
v22 = v24;
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v32.__r_.__value_.__l.__data_);
}
v20 = sub_100641120(&v22) & (v17 != nullptr);
if ( v20 )
{
v32.__r_.__value_.__r.__words[0] = sub_10063B550(v3, "plist");
v3->dictTree.__end_[-1]._root = (pugi::xml_node_struct *)sub_10063B550(&v32, "dict");
operator delete[](v17);
*(_QWORD *)&v24 = sub_10063B550(v3, "plist");
v32.__r_.__value_.__r.__words[0] = sub_10063B6E0(&v24, "gjver");
v3->compatible = (int)sub_10063A7C0(&v32, 0) < 2;
}
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v28.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v31.__r_.__value_.__l.__data_);
return v20;
}