//
// DS_Dictionary::setSubDictForKey from 0x80d240 to 0x80d364 (292 bytes)
//
// 6 xrefs:
// > GameLevelManager::writePlatformerSaveJournal @ 0x4caf1c
// > EditorSFXManager::encodeDataTo @ 0x781172
// > EditorSFXManager::encodeDataTo @ 0x781210
// > DS_Dictionary::setSubDictForKey @ 0x80d394
// > DS_Dictionary::setArrayForKey @ 0x80d432
// > DS_Dictionary::setObjectForKey @ 0x80d55a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:01:33 +0000
//
void __fastcall DS_Dictionary::setSubDictForKey(DS_Dictionary *this, const char *a2, int a3, int a4)
{
const char *v8; // r1
const char *v9; // r1
const char *v10; // r0
const char *v11; // r1
int inserted; // r0
const char *v13; // r1
const char *v14; // r1
int v15; // r0
int *v16; // r3
int v17; // [sp+4h] [bp+0h] BYREF
int i; // [sp+8h] [bp+4h] BYREF
pugi::xml_node::xml_node((pugi::xml_node *)&v17);
if ( a3 )
{
if ( *((_BYTE *)this + 212) )
v9 = "key";
else
v9 = "k";
for ( i = pugi::xml_node::child((pugi::xml_node *)(*((_DWORD *)this + 51) - 4), v9);
pugi::xml_node::operator void (*)(pugi::xml_node***)(&i);
i = pugi::xml_node::next_sibling((pugi::xml_node *)&i, v13) )
{
v10 = (const char *)pugi::xml_node::child_value((pugi::xml_node *)&i);
if ( !alphaNumericallyLessThan(v10, a2) )
{
if ( *((_BYTE *)this + 212) )
v11 = "key";
else
v11 = "k";
inserted = pugi::xml_node::insert_child_before(
(pugi::xml_node *)(*((_DWORD *)this + 51) - 4),
v11,
(const pugi::xml_node *)&i);
goto LABEL_20;
}
if ( *((_BYTE *)this + 212) )
v13 = "key";
else
v13 = "k";
}
}
if ( *((_BYTE *)this + 212) )
v8 = "key";
else
v8 = "k";
inserted = pugi::xml_node::append_child((pugi::xml_node *)(*((_DWORD *)this + 51) - 4), v8);
LABEL_20:
v17 = inserted;
i = pugi::xml_node::append_child(&v17, 3);
pugi::xml_node::set_value((pugi::xml_node *)&i, a2);
if ( *((_BYTE *)this + 212) )
v14 = "dict";
else
v14 = "d";
v15 = pugi::xml_node::insert_child_after(
(pugi::xml_node *)(*((_DWORD *)this + 51) - 4),
v14,
(const pugi::xml_node *)&v17);
i = v15;
if ( a4 )
{
v16 = *((int **)this + 51);
if ( v16 == *((int **)this + 52) )
{
std::vector
::__push_back_slow_path((int *)this + 50, &i);
}
else
{
if ( v16 )
*v16 = v15;
*((_DWORD *)this + 51) += 4;
}
}
}