//
// DS_Dictionary::getRectForKey from 0x18001aea0 to 0x18001b0a2 (514 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801aea34
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCRect *__fastcall DS_Dictionary::getRectForKey(
struct cocos2d::CCRect *__return_ptr retstr,
cocos2d::CCRect *a2,
__int64 a3)
{
__int64 v6; // rcx
const char *v7; // r8
unsigned __int8 *v8; // rax
__int64 v9; // r8
int v10; // ecx
int v11; // edx
const char *v12; // r8
__int64 v13; // rbx
__int64 v14; // rax
const char *v15; // r8
cocos2d::CCRect *v16; // rcx
const struct cocos2d::CCRect *v17; // rdx
__int64 v19; // rax
_BYTE *v20; // rax
size_t v21; // r8
char v22; // bl
void *v23; // rcx
__int64 v24; // [rsp+20h] [rbp-78h] BYREF
cocos2d::CCRect v25; // [rsp+28h] [rbp-70h] BYREF
_BYTE v26[8]; // [rsp+38h] [rbp-60h] BYREF
_BYTE v27[8]; // [rsp+40h] [rbp-58h] BYREF
void *Block[2]; // [rsp+48h] [rbp-50h] BYREF
__int128 v29; // [rsp+58h] [rbp-40h]
v6 = *(_QWORD *)&retstr[13].size - 8LL;
v7 = "k";
if ( LOBYTE(retstr[14].size.width) )
v7 = "key";
sub_18007FB10(v6, &v24, v7);
if ( sub_18007F4E0(&v24) )
{
while ( 1 )
{
v8 = (unsigned __int8 *)sub_18007FB70(&v24);
v9 = a3 - (_QWORD)v8;
do
{
v10 = v8[v9];
v11 = *v8 - v10;
if ( v11 )
break;
++v8;
}
while ( v10 );
if ( !v11 )
{
v12 = "s";
if ( LOBYTE(retstr[14].size.width) )
v12 = "string";
v13 = sub_180081A50(&v24, v27, v12);
v14 = sub_180081AB0(&v24, &v25);
if ( (unsigned __int8)std::operator==<_EXCEPTION_RECORD const,_EXCEPTION_RECORD const>(v14, v13) )
break;
}
v15 = "k";
if ( LOBYTE(retstr[14].size.width) )
v15 = "key";
v24 = *(_QWORD *)sub_180081A50(&v24, v26, v15);
if ( !sub_18007F4E0(&v24) )
goto LABEL_14;
}
cocos2d::CCRect::CCRect(&v25);
v19 = sub_180081AB0(&v24, v26);
v20 = (_BYTE *)sub_18007FB70(v19);
*(_OWORD *)Block = 0;
v29 = 0;
v21 = -1;
do
++v21;
while ( v20[v21] );
sub_18000CE60(Block, v20, v21);
v22 = DS_Dictionary::rectFromString(retstr, Block, &v25);
if ( *((_QWORD *)&v29 + 1) > 0xFu )
{
v23 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v29 + 1) + 1LL) >= 0x1000 )
{
v23 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v23 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v23);
}
v16 = a2;
if ( v22 )
{
v17 = &v25;
goto LABEL_16;
}
}
else
{
LABEL_14:
v16 = a2;
}
v17 = &unk_1801A8350;
LABEL_16:
cocos2d::CCRect::CCRect(v16, v17);
return a2;
}