//
// DS_Dictionary::setStringForKey from 0x10015e620 to 0x10015e7f4 (468 bytes)
//
// 2 xrefs:
// > DS_Dictionary::setStringForKey_1 @ 0x10015e617
// > DS_Dictionary::setObjectForKey @ 0x10015fdaf
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:25:07 +0000
//
__int64 __fastcall DS_Dictionary::setStringForKey(__int64 a1, char *a2, unsigned __int8 *a3, char a4)
{
unsigned int v8; // eax
__int64 result; // rax
const char *v10; // r12
__int64 v11; // rdi
const char *v12; // rsi
char *v13; // rax
const char *v14; // rsi
__int64 v15; // rax
const char *v16; // rsi
unsigned __int8 *v17; // rbx
const char *v18; // rsi
__int64 v19; // [rsp+0h] [rbp-40h] BYREF
__int64 v20; // [rsp+8h] [rbp-38h] BYREF
_QWORD v21[6]; // [rsp+10h] [rbp-30h] BYREF
v8 = *a3;
if ( (v8 & 1) != 0 )
{
result = *((_QWORD *)a3 + 1);
if ( !result )
return result;
}
else
{
result = v8 >> 1;
if ( !result )
return result;
}
pugi::xml_node::xml_node(&v20);
v10 = "k";
if ( !a4 )
goto LABEL_14;
v11 = *(_QWORD *)(a1 + 216) - 8LL;
v12 = "k";
if ( *(_BYTE *)(a1 + 232) )
v12 = "key";
v21[0] = sub_100718180(v11, v12);
if ( sub_100718020(v21) )
{
while ( 1 )
{
v13 = (char *)sub_1007184B0(v21);
if ( !sub_100158A80(v13, a2) )
break;
v14 = "key";
if ( !*(_BYTE *)(a1 + 232) )
v14 = "k";
v21[0] = sub_100718360(v21, v14);
if ( !sub_100718020(v21) )
goto LABEL_14;
}
v18 = "k";
if ( *(_BYTE *)(a1 + 232) )
v18 = "key";
v15 = sub_100719500(*(_QWORD *)(a1 + 216) - 8LL, v18, v21);
}
else
{
LABEL_14:
if ( *(_BYTE *)(a1 + 232) )
v10 = "key";
v15 = sub_100719290(*(_QWORD *)(a1 + 216) - 8LL, v10);
}
v20 = v15;
v21[0] = sub_100718D80(&v20, 3);
sub_100718670(v21, a2);
v16 = "s";
if ( *(_BYTE *)(a1 + 232) )
v16 = "string";
v19 = sub_100719400(*(_QWORD *)(a1 + 216) - 8LL, v16, &v20);
v21[0] = sub_100718D80(&v19, 3);
if ( (*a3 & 1) != 0 )
v17 = *((unsigned __int8 **)a3 + 2);
else
v17 = a3 + 1;
return sub_100718670(v21, v17);
}