//
// DS_Dictionary::getKey from 0x10017d250 to 0x10017d36a (282 bytes)
//
// 3 xrefs:
// > DS_Dictionary::getArrayForKey @ 0x100180b71
// > CCAnimateFrameCache::addDict_1 @ 0x10056c452
// > CCAnimateFrameCache::addDict_1 @ 0x10056c708
//
// 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
//
_QWORD *__fastcall DS_Dictionary::getKey(_QWORD *a1, __int64 a2, int a3, double a4)
{
int v5; // r14d
const char *v6; // r15
size_t v7; // rax
size_t v8; // r14
void *v9; // r12
size_t v10; // r13
__int64 v12; // [rsp+8h] [rbp-38h] BYREF
_QWORD v13[6]; // [rsp+10h] [rbp-30h] BYREF
v13[0] = sub_10063B9B0(*(_QWORD *)(a2 + 216) - 8LL);
if ( sub_10063B3F0(v13) )
{
v5 = a3 + 1;
while ( --v5 )
{
v12 = sub_10063B780(v13);
v13[0] = sub_10063B780(&v12);
if ( !sub_10063B3F0(v13) )
goto LABEL_5;
}
v6 = (const char *)sub_10063B880(v13);
v7 = strlen(v6);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a4);
v8 = v7;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
v9 = operator new(v10);
a1[2] = v9;
*a1 = v10 + 1;
a1[1] = v8;
}
else
{
*(_BYTE *)a1 = 2 * v7;
v9 = (char *)a1 + 1;
if ( !v7 )
goto LABEL_14;
}
memmove(v9, v6, v8);
LABEL_14:
*((_BYTE *)v9 + v8) = 0;
return a1;
}
LABEL_5:
*(_OWORD *)a1 = 0;
a1[2] = 0;
return a1;
}