//
// DS_Dictionary::rectFromString from 0x80c2cc to 0x80c552 (646 bytes)
//
// 2 xrefs:
// > DS_Dictionary::getRectForKey @ 0x80c622
// > DS_Dictionary::getRectArrayForKey @ 0x80c708
//
// 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:31 +0000
//
int __fastcall DS_Dictionary::rectFromString(int a1, int a2, float *a3)
{
int v5; // r9
int v6; // r8
int v7; // r2
int v8; // r6
int v9; // r0
bool v10; // zf
int v11; // r3
int v12; // r0
unsigned int v13; // r3
unsigned int v14; // r0
char *v15; // r8
int v16; // r6
char *v17; // r0
int v18; // r2
int v19; // r0
unsigned int v20; // r1
char *v21; // r2
unsigned int v22; // r2
size_t v23; // r6
int v24; // r3
const char *v25; // r0
float v26; // s18
const char *v27; // r0
float v28; // s17
const char *v29; // r0
double v30; // d7
float v31; // s16
const char *v32; // r0
float v33; // s15
int v35; // [sp+10h] [bp-54h] BYREF
unsigned int v36; // [sp+14h] [bp-50h]
char *v37; // [sp+18h] [bp-4Ch]
int v38[3]; // [sp+1Ch] [bp-48h] BYREF
int v39; // [sp+28h] [bp-3Ch] BYREF
unsigned int v40; // [sp+2Ch] [bp-38h]
char *v41; // [sp+30h] [bp-34h]
unsigned __int8 *v42[3]; // [sp+34h] [bp-30h] BYREF
unsigned __int8 *v43[3]; // [sp+40h] [bp-24h] BYREF
float v44[4]; // [sp+4Ch] [bp-18h] BYREF
v5 = 2;
DS_Dictionary::cleanStringWhiteSpace(&v35, a1, a2);
v6 = std::string::find((unsigned __int8 *)&v35, 123, 0);
v7 = std::string::find((unsigned __int8 *)&v35, 125, 0);
while ( 1 )
{
if ( v7 == -1 )
goto LABEL_3;
v9 = std::string::find((unsigned __int8 *)&v35, 125, v7 + 1);
v7 = v9;
if ( v5 == 1 )
break;
v5 = 1;
}
if ( v6 == -1 || v9 == -1 )
{
LABEL_3:
v8 = 0;
goto LABEL_51;
}
std::string::basic_string(&v39, (unsigned __int8 *)&v35, v6 + 1, v9 - v6 - 1);
v11 = v35 & 1;
v10 = v11 == 0;
if ( (v35 & 1) != 0 )
{
v11 = 0;
*v37 = 0;
}
else
{
LOBYTE(v35) = v11;
BYTE1(v35) = v11;
}
if ( !v10 )
v36 = v11;
if ( (v35 & 1) != 0 )
{
v12 = v36;
v13 = (v35 & 0xFFFFFFFE) - 1;
if ( v36 <= 0xA )
{
if ( (v35 & 0xFFFFFFFE) == 0xB )
goto LABEL_29;
goto LABEL_20;
}
}
else
{
v12 = (int)(unsigned __int8)v35 >> 1;
if ( v12 <= 10 )
goto LABEL_29;
v13 = 10;
}
v14 = (v12 + 16) & 0xFFFFFFF0;
if ( v14 - 1 == v13 )
goto LABEL_29;
if ( v14 != 11 )
{
v17 = (char *)operator new(v14);
v16 = v35 & 1;
if ( (v35 & 1) != 0 )
v15 = v37;
else
v15 = (char *)&v35 + 1;
goto LABEL_24;
}
LABEL_20:
v15 = v37;
v16 = 1;
v17 = (char *)&v35 + 1;
LABEL_24:
if ( (v35 & 1) != 0 )
v18 = v36;
else
v18 = (int)(unsigned __int8)v35 >> 1;
std::char_traits::copy(v17, v15, v18 + 1);
if ( v16 )
operator delete(v15);
LABEL_29:
v19 = v39;
v20 = v40;
v21 = v41;
v39 = 0;
v40 = 0;
v41 = nullptr;
v35 = v19;
v36 = v20;
v37 = v21;
std::string::~string((int)&v39);
v22 = std::string::find((unsigned __int8 *)&v35, 125, 0);
if ( v22 == -1 )
goto LABEL_3;
v23 = std::string::find((unsigned __int8 *)&v35, 44, v22);
if ( v23 == -1 )
goto LABEL_3;
std::string::basic_string(v38, (unsigned __int8 *)&v35, 0, v23);
if ( (v35 & 1) != 0 )
v24 = v36;
else
v24 = (int)(unsigned __int8)v35 >> 1;
std::string::basic_string(&v39, (unsigned __int8 *)&v35, v23 + 1, v24 - v23);
memset(v42, 0, sizeof(v42));
v8 = DS_Dictionary::splitWithForm(a1, (unsigned __int8 *)v38, v42);
if ( v8 )
{
memset(v43, 0, sizeof(v43));
v8 = DS_Dictionary::splitWithForm(a1, (unsigned __int8 *)&v39, v43);
if ( v8 )
{
if ( (*v42[0] & 1) != 0 )
v25 = *((const char **)v42[0] + 2);
else
v25 = (const char *)(v42[0] + 1);
v26 = atof(v25);
if ( (v42[0][(unsigned int)&byte_9[3]] & 1) != 0 )
v27 = *((const char **)v42[0] + 5);
else
v27 = (const char *)(v42[0] + 13);
v28 = atof(v27);
if ( (*v43[0] & 1) != 0 )
v29 = *((const char **)v43[0] + 2);
else
v29 = (const char *)(v43[0] + 1);
v30 = atof(v29);
if ( (v43[0][12] & 1) != 0 )
v32 = *((const char **)v43[0] + 5);
else
v32 = (const char *)(v43[0] + 13);
v31 = v30;
v33 = atof(v32);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v44, v26, v28, v31, v33);
cocos2d::CCRect::operator=(a3, v44);
}
std::__vector_base::~__vector_base((int)v43);
}
std::__vector_base::~__vector_base((int)v42);
std::string::~string((int)&v39);
std::string::~string((int)v38);
LABEL_51:
std::string::~string((int)&v35);
return v8;
}