//
// cocos2d::CCRectFromString from 0x1005936b0 to 0x100593ca4 (1524 bytes)
//
// 2 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary @ 0x1003077b1
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary @ 0x100307c9e
//
// 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:32:27 +0000
//
__m128 *__fastcall cocos2d::CCRectFromString(__m128 *a1, const char *a2, double a3, double a4, double a5, __m128 a6)
{
__m128 *v6; // rbx
size_t v7; // rax
std::string::size_type v8; // r15
char *data; // r12
size_t v10; // r13
std::string::size_type v11; // r13
int v12; // eax
std::string::size_type v14; // rax
bool v15; // cl
std::string::size_type v16; // r14
std::string::size_type size; // r15
std::string::pointer v18; // r12
size_t v19; // rax
size_t v20; // r15
char *v21; // rbx
size_t v22; // r13
int v23; // eax
std::string::size_type v24; // r14
std::string::pointer v25; // rbx
char *v26; // rsi
size_t v27; // r12
char *v28; // r13
size_t v29; // r15
std::string::size_type v30; // r14
std::string::size_type v31; // r12
size_t v32; // rax
size_t v33; // r12
char *v34; // r13
size_t v35; // r15
char *v36; // rdi
__m128 *v37; // rbx
char *v38; // rdi
const char *v39; // rdi
const char *v40; // r14
double v41; // xmm0_8
const char *v42; // rdi
float v43; // xmm1_4
float v44; // xmm0_4
float v45; // xmm0_4
const char *v46; // r14
void **v47; // rbx
void **v48; // r14
void *v49; // rdi
void **v50; // rbx
void **v51; // r14
void *v52; // rdi
unsigned __int64 v53[2]; // [rsp+0h] [rbp-E0h] BYREF
void *v54[2]; // [rsp+10h] [rbp-D0h]
__int64 v55; // [rsp+20h] [rbp-C0h]
void *v56[2]; // [rsp+30h] [rbp-B0h]
__int64 v57; // [rsp+40h] [rbp-A0h]
float v58; // [rsp+54h] [rbp-8Ch]
_QWORD v59[2]; // [rsp+58h] [rbp-88h] BYREF
void *v60; // [rsp+68h] [rbp-78h]
__m128 *v61; // [rsp+70h] [rbp-70h]
void *__src; // [rsp+78h] [rbp-68h]
double v63; // [rsp+80h] [rbp-60h]
__int128 v64; // [rsp+88h] [rbp-58h] BYREF
void *v65; // [rsp+98h] [rbp-48h]
std::string __dst[2]; // [rsp+A0h] [rbp-40h] BYREF
v6 = a1;
sub_1002787F0(a1, (unsigned __int64 *)&unk_100BE55F0);
if ( !a2 )
return v6;
v7 = strlen(a2);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v8 = v7;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
data = (char *)operator new(v10);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v10 + 1;
__dst[0].__r_.__value_.__l.__size_ = v8;
}
else
{
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);
data = __dst[0].__r_.__value_.__s.__data_;
if ( !v7 )
goto LABEL_10;
}
memcpy(data, a2, v8);
LABEL_10:
data[v8] = 0;
v11 = std::string::find(__dst, 123, 0);
v12 = std::string::find(__dst, 125, 0);
if ( v12 == -1 )
goto LABEL_11;
v14 = std::string::find(__dst, 125, v12 + 1);
v15 = (_DWORD)v14 == -1;
if ( (_DWORD)v14 != -1 )
{
LODWORD(v14) = std::string::find(__dst, 125, (__int64)((__int64)&_mh_execute_header + (v14 << 32)) >> 32);
v15 = (_DWORD)v14 == -1;
}
if ( (_DWORD)v11 == -1 || v15 )
goto LABEL_11;
v16 = (__int64)((__int64)&_mh_execute_header + (v11 << 32)) >> 32;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
{
size = *(_BYTE *)&__dst[0].__r_.__value_.__l.0 >> 1;
if ( v16 <= size )
{
v18 = __dst[0].__r_.__value_.__s.__data_;
goto LABEL_23;
}
LABEL_107:
sub_100056810();
}
size = __dst[0].__r_.__value_.__l.__size_;
if ( __dst[0].__r_.__value_.__l.__size_ < v16 )
goto LABEL_107;
v18 = __dst[0].__r_.__value_.__l.__data_;
LABEL_23:
v19 = ~(_DWORD)v11 + (int)v14;
v20 = size - v16;
if ( v20 >= v19 )
v20 = v19;
if ( v20 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v61 = a1;
if ( v20 >= 0x17 )
{
v22 = 26;
if ( (v20 | 7) != 0x17 )
v22 = (v20 | 7) + 1;
v21 = (char *)operator new(v22);
v65 = v21;
*(_QWORD *)&v64 = v22 | 1;
*((_QWORD *)&v64 + 1) = v20;
goto LABEL_32;
}
LOBYTE(v64) = 2 * v20;
v21 = (char *)&v64 + 1;
if ( v20 )
LABEL_32:
memmove(v21, &v18[v16], v20);
v21[v20] = 0;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v65;
*(_OWORD *)&__dst[0].__r_.__value_.__l.0 = v64;
v23 = std::string::find(__dst, 125, 0);
v6 = v61;
if ( v23 == -1 )
goto LABEL_11;
v24 = std::string::find(__dst, 44, v23);
if ( (_DWORD)v24 == -1 )
goto LABEL_11;
v25 = __dst[0].__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
{
v26 = __dst[0].__r_.__value_.__l.__data_;
v27 = __dst[0].__r_.__value_.__l.__size_;
}
else
{
v27 = *(_BYTE *)&__dst[0].__r_.__value_.__l.0 >> 1;
v26 = __dst[0].__r_.__value_.__s.__data_;
}
if ( v27 >= (int)v24 )
v27 = (int)v24;
if ( v27 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
*(_QWORD *)&v63 = (int)v24;
if ( v27 >= 0x17 )
{
__src = v26;
v29 = 26;
if ( (v27 | 7) != 0x17 )
v29 = (v27 | 7) + 1;
v28 = (char *)operator new(v29);
v65 = v28;
*(_QWORD *)&v64 = v29 | 1;
*((_QWORD *)&v64 + 1) = v27;
v26 = (char *)__src;
goto LABEL_49;
}
LOBYTE(v64) = 2 * v27;
v28 = (char *)&v64 + 1;
if ( v27 )
LABEL_49:
memmove(v28, v26, v27);
v28[v27] = 0;
v30 = (__int64)((__int64)&_mh_execute_header + (v24 << 32)) >> 32;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
{
v31 = __dst[0].__r_.__value_.__l.__size_;
if ( __dst[0].__r_.__value_.__l.__size_ < v30 )
goto LABEL_110;
v25 = __dst[0].__r_.__value_.__l.__data_;
}
else
{
v31 = *(_BYTE *)&__dst[0].__r_.__value_.__l.0 >> 1;
if ( v30 > v31 )
LABEL_110:
sub_100056810();
}
v32 = v31 - *(_QWORD *)&v63;
v33 = v31 - v30;
if ( v33 >= v32 )
v33 = v32;
if ( v33 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
if ( v33 >= 0x17 )
{
v35 = 26;
if ( (v33 | 7) != 0x17 )
v35 = (v33 | 7) + 1;
v34 = (char *)operator new(v35);
v60 = v34;
v59[0] = v35 | 1;
v59[1] = v33;
}
else
{
LOBYTE(v59[0]) = 2 * v33;
v34 = (char *)v59 + 1;
if ( !v33 )
goto LABEL_65;
}
memmove(v34, &v25[v30], v33);
LABEL_65:
v34[v33] = 0;
*(_OWORD *)v54 = 0;
v55 = 0;
if ( (v64 & 1) != 0 )
v36 = (char *)v65;
else
v36 = (char *)&v64 + 1;
if ( (unsigned __int8)sub_100593D40(v36) )
{
*(_OWORD *)v56 = 0;
v57 = 0;
v37 = v61;
if ( (v59[0] & 1) != 0 )
v38 = (char *)v60;
else
v38 = (char *)v59 + 1;
if ( (unsigned __int8)sub_100593D40(v38) )
{
if ( (*(_BYTE *)v54[0] & 1) != 0 )
v39 = *((const char **)v54[0] + 2);
else
v39 = (char *)v54[0] + 1;
v63 = atof(v39);
if ( (*((_BYTE *)v54[0] + 24) & 1) != 0 )
v40 = *((const char **)v54[0] + 5);
else
v40 = (char *)v54[0] + 25;
v41 = atof(v40);
if ( (*(_BYTE *)v56[0] & 1) != 0 )
v42 = *((const char **)v56[0] + 2);
else
v42 = (char *)v56[0] + 1;
v43 = v63;
*(float *)&v63 = v43;
v44 = v41;
*(float *)&__src = v44;
v45 = atof(v42);
v58 = v45;
if ( (*((_BYTE *)v56[0] + 24) & 1) != 0 )
v46 = *((const char **)v56[0] + 5);
else
v46 = (char *)v56[0] + 25;
a6.f32[0] = atof(v46);
sub_100278270((__int64)v53, *(float *)&v63, *(float *)&__src, (__m128)LODWORD(v58), a6);
sub_100278810(v37, v53);
}
v47 = (void **)v56[0];
if ( v56[0] )
{
v48 = (void **)v56[1];
v49 = v56[0];
if ( v56[1] != v56[0] )
{
do
{
if ( (*(_BYTE *)(v48 - 3) & 1) != 0 )
operator delete(*(v48 - 1));
v48 -= 3;
}
while ( v48 != v47 );
v49 = v56[0];
}
v56[1] = v47;
operator delete(v49);
}
}
v50 = (void **)v54[0];
if ( v54[0] )
{
v51 = (void **)v54[1];
v52 = v54[0];
if ( v54[1] != v54[0] )
{
do
{
if ( (*(_BYTE *)(v51 - 3) & 1) != 0 )
operator delete(*(v51 - 1));
v51 -= 3;
}
while ( v51 != v50 );
v52 = v54[0];
}
v54[1] = v50;
operator delete(v52);
}
if ( (v59[0] & 1) != 0 )
operator delete(v60);
v6 = v61;
if ( (v64 & 1) != 0 )
operator delete(v65);
LABEL_11:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
return v6;
}