//
// DS_Dictionary::stepIntoSubDictWithKey from 0x10017ce10 to 0x10017d01d (525 bytes)
//
// 12 xrefs:
// > DS_Dictionary::getArrayForKey @ 0x100180aab
// > DS_Dictionary::setDictForKey @ 0x100181081
// > DS_Dictionary::setBoolMapForKey @ 0x1001812a2
// > DS_Dictionary::addBoolValuesToMapForKeySpecial @ 0x10018146b
// > DS_Dictionary::addBoolValuesToMapForKey @ 0x1001817ca
// > DS_Dictionary::getDictForKey @ 0x100181994
// > DS_Dictionary::decodeObjectForKey @ 0x100181e74
// > CCAnimateFrameCache::addDict_1 @ 0x10056c405
// > CCAnimateFrameCache::addDict_1 @ 0x10056c469
// > CCAnimateFrameCache::addDict_1 @ 0x10056c528
// > CCAnimateFrameCache::addDict_1 @ 0x10056c667
// > CCAnimateFrameCache::addDict_1 @ 0x10056c73a
//
// 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::stepIntoSubDictWithKey(DS_Dictionary *a1, const char *a2)
{
std::__vector_base
::pointer v3; // rdi
const char *v4; // r13
const char *v5; // rsi
const char *v6; // rsi
const char *v7; // rax
const char *v8; // r12
const char *v9; // r13
const char *v10; // rax
std::__vector_base::pointer end; // r14
pugi::xml_node *value; // rax
pugi::xml_node *v14; // r15
std::__vector_base::pointer begin; // rsi
signed __int64 v16; // r14
__int64 v17; // r13
__int64 v18; // rax
unsigned __int64 v19; // r15
pugi::xml_node *v20; // r12
char *v21; // r13
pugi::xml_node *v22; // [rsp+8h] [rbp-48h]
__int64 v23; // [rsp+10h] [rbp-40h] BYREF
__int64 v24; // [rsp+18h] [rbp-38h] BYREF
char *__s2; // [rsp+20h] [rbp-30h]
__s2 = (char *)a2;
v3 = a1->dictTree.__end_ - 1;
v4 = "key";
v5 = "k";
if ( a1->compatible )
v5 = "key";
v23 = sub_10063B550(v3, v5);
if ( !sub_10063B3F0(&v23) )
return 0;
while ( 1 )
{
v7 = (const char *)sub_10063B880(&v23);
if ( !strcmp(v7, __s2) )
break;
LABEL_5:
v6 = "k";
if ( a1->compatible )
v6 = v4;
v23 = sub_10063B730(&v23, v6);
if ( !sub_10063B3F0(&v23) )
return 0;
}
v8 = v4;
v24 = sub_10063B780(&v23);
v9 = "d";
if ( a1->compatible )
v9 = "dict";
v10 = (const char *)sub_10063B660(&v24);
if ( strcmp(v9, v10) )
{
v4 = v8;
goto LABEL_5;
}
end = a1->dictTree.__end_;
value = a1->dictTree.__end_cap_.__value_;
if ( end >= value )
{
begin = a1->dictTree.__begin_;
v16 = (char *)end - (char *)begin;
v17 = v16 >> 3;
if ( (unsigned __int64)((v16 >> 3) + 1) >> 61 )
sub_100183910();
v18 = (char *)value - (char *)begin;
v19 = v18 >> 2;
if ( v18 >> 2 <= (unsigned __int64)((v16 >> 3) + 1) )
v19 = (v16 >> 3) + 1;
if ( (unsigned __int64)v18 >= 0x7FFFFFFFFFFFFFF8LL )
v19 = 0x1FFFFFFFFFFFFFFFLL;
__s2 = (char *)a1->dictTree.__begin_;
if ( v19 )
{
if ( v19 > 0x1FFFFFFFFFFFFFFFLL )
sub_100054850();
v20 = (pugi::xml_node *)operator new(8 * v19);
}
else
{
v20 = nullptr;
}
v22 = &v20[v19];
v20[v17]._root = (pugi::xml_node_struct *)v24;
v14 = &v20[v17 + 1];
v21 = __s2;
memcpy(v20, __s2, v16);
a1->dictTree.__begin_ = v20;
a1->dictTree.__end_ = v14;
a1->dictTree.__end_cap_.__value_ = v22;
if ( v21 )
operator delete(v21);
}
else
{
end->_root = (pugi::xml_node_struct *)v24;
v14 = end + 1;
}
a1->dictTree.__end_ = v14;
return 1;
}