//
// DS_Dictionary::setStringForKey from 0x10017f230 to 0x10017f404 (468 bytes)
//
// 2 xrefs:
// > DS_Dictionary::setStringForKey_1 @ 0x10017f227
// > DS_Dictionary::setObjectForKey @ 0x1001809bf
//
// 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
//
__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_10063B550(v11, v12);
if ( sub_10063B3F0(v21) )
{
while ( 1 )
{
v13 = (char *)sub_10063B880(v21);
if ( !sub_1001796D0(v13, a2) )
break;
v14 = "key";
if ( !*(_BYTE *)(a1 + 232) )
v14 = "k";
v21[0] = sub_10063B730(v21, v14);
if ( !sub_10063B3F0(v21) )
goto LABEL_14;
}
v18 = "k";
if ( *(_BYTE *)(a1 + 232) )
v18 = "key";
v15 = sub_10063C8D0(*(_QWORD *)(a1 + 216) - 8LL, v18, v21);
}
else
{
LABEL_14:
if ( *(_BYTE *)(a1 + 232) )
v10 = "key";
v15 = sub_10063C660(*(_QWORD *)(a1 + 216) - 8LL, v10);
}
v20 = v15;
v21[0] = sub_10063C150(&v20, 3);
sub_10063BA40(v21, a2);
v16 = "s";
if ( *(_BYTE *)(a1 + 232) )
v16 = "string";
v19 = sub_10063C7D0(*(_QWORD *)(a1 + 216) - 8LL, v16, &v20);
v21[0] = sub_10063C150(&v19, 3);
if ( (*a3 & 1) != 0 )
v17 = *((unsigned __int8 **)a3 + 2);
else
v17 = a3 + 1;
return sub_10063BA40(v21, v17);
}