//
// cocos2d::CCLabelAtlas::initWithString from 0x7d2574 to 0x7d27f8 (644 bytes)
//
// 1 xrefs:
// > cocos2d::CCLabelAtlas::create @ 0x7d2832
//
// 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:00:36 +0000
//
int __fastcall cocos2d::CCLabelAtlas::initWithString(cocos2d::CCLabelAtlas *this, const char *a2, const char *a3)
{
int v4; // r0
int v5; // r7
int v6; // r5
_BYTE *v7; // r9
int v8; // r4
_BYTE *v9; // r4
int v10; // t1
unsigned int v11; // r3
size_t v12; // r2
_BYTE *v13; // r1
int *v14; // r0
size_t v15; // r1
char *v16; // r2
CCContentManager *v17; // r0
CCContentManager *v18; // r0
int v19; // r0
int v20; // r6
cocos2d::CCString *v21; // r0
cocos2d::CCString *v22; // r0
char *CString; // r0
size_t v24; // r11
char *v25; // r10
size_t v26; // r0
size_t v27; // r9
char *v28; // r1
char *v29; // r3
int v30; // r5
char *v31; // r0
cocos2d::CCObject *v32; // r0
cocos2d::CCString *v33; // r9
cocos2d::CCString *v34; // r0
cocos2d::CCDirector *v35; // s17
cocos2d::CCDirector *v36; // r0
float v37; // s19
cocos2d::CCString *v38; // r0
cocos2d::CCDirector *v39; // s16
cocos2d::CCDirector *v40; // r0
float v41; // s18
cocos2d::CCString *v42; // r0
unsigned int v43; // r5
char *v44; // r0
char *v48; // [sp+14h] [bp-40h]
char *v49; // [sp+14h] [bp-40h]
unsigned __int8 v50; // [sp+1Ch] [bp-38h] BYREF
_BYTE v51[3]; // [sp+1Dh] [bp-37h] BYREF
size_t v52; // [sp+20h] [bp-34h]
_BYTE *v53; // [sp+24h] [bp-30h]
int v54; // [sp+28h] [bp-2Ch] BYREF
size_t v55; // [sp+2Ch] [bp-28h]
char *v56; // [sp+30h] [bp-24h]
unsigned int v57; // [sp+34h] [bp-20h] BYREF
size_t v58; // [sp+38h] [bp-1Ch]
char *v59; // [sp+3Ch] [bp-18h]
int v60; // [sp+40h] [bp-14h] BYREF
int v61; // [sp+44h] [bp-10h]
int v62; // [sp+48h] [bp-Ch]
v4 = cocos2d::CCFileUtils::sharedFileUtils(this);
(*(void (__fastcall **)(unsigned __int8 *, int, const char *, _DWORD))(*(_DWORD *)v4 + 24))(&v50, v4, a3, 0);
v5 = v50;
v6 = v50 & 1;
if ( v6 )
{
v7 = v53;
v8 = v52;
}
else
{
v8 = (int)v50 >> 1;
v7 = v51;
}
v9 = &v7[v8];
while ( v9 != v7 )
{
v10 = (unsigned __int8)*--v9;
if ( memchr("/", v10, 1u) )
{
v11 = v9 - v7;
goto LABEL_8;
}
}
v11 = -1;
LABEL_8:
v60 = 0;
v61 = 0;
v62 = 0;
if ( v6 )
{
v12 = v52;
v13 = v53;
}
else
{
v12 = v5 >> 1;
v13 = v51;
}
if ( v12 >= v11 )
v12 = v11;
std::string::__init(&v60, v13, v12);
v14 = std::string::append(&v60, "/", 1u);
v15 = v14[1];
v16 = (char *)v14[2];
v54 = *v14;
v55 = v15;
v56 = v16;
*v14 = 0;
v14[1] = 0;
v14[2] = 0;
v17 = (CCContentManager *)std::string::~string((int)&v60);
v18 = (CCContentManager *)CCContentManager::sharedManager(v17);
v19 = CCContentManager::addDict(v18, a3, 0);
v60 = 0;
v61 = 0;
v62 = 0;
v20 = v19;
std::string::__init(&v60, "version", 7u);
v21 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, (int)&v60);
cocos2d::CCString::intValue(v21);
std::string::~string((int)&v60);
v60 = 0;
v61 = 0;
v62 = 0;
std::string::__init(&v60, "textureFilename", 0xFu);
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, (int)&v60);
CString = cocos2d::CCString::getCString(v22);
v57 = 0;
v58 = 0;
v59 = nullptr;
if ( (v54 & 1) != 0 )
v24 = v55;
else
v24 = (int)(unsigned __int8)v54 >> 1;
v25 = CString;
v26 = strlen(CString);
v27 = v26;
if ( (v54 & 1) != 0 )
v28 = v56;
else
v28 = (char *)&v54 + 1;
if ( v26 + v24 > 0xA )
{
v30 = v26 + v24 + 16;
v48 = v28;
v31 = (char *)operator new(v30 & 0xFFFFFFF0);
v28 = v48;
v57 = v30 & 0xFFFFFFF0 | 1;
v58 = v24;
v29 = v31;
v59 = v31;
}
else
{
v29 = (char *)&v57 + 1;
LOBYTE(v57) = 2 * v24;
}
v49 = v29;
std::char_traits::copy(v29, v28, v24);
v49[v24] = 0;
std::string::append(&v57, v25, v27);
std::string::~string((int)&v60);
v32 = cocos2d::CCString::create((int)&v57);
v60 = 0;
v61 = 0;
v62 = 0;
v33 = v32;
std::string::__init(&v60, "itemWidth", 9u);
v34 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, (int)&v60);
v35 = (cocos2d::CCDirector *)cocos2d::CCString::intValue(v34);
v36 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v35);
v37 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v36));
std::string::~string((int)&v60);
v60 = 0;
v61 = 0;
v62 = 0;
std::string::__init(&v60, "itemHeight", 0xAu);
v38 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, (int)&v60);
v39 = (cocos2d::CCDirector *)cocos2d::CCString::intValue(v38);
v40 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v39);
v41 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v40));
std::string::~string((int)&v60);
v60 = 0;
v61 = 0;
v62 = 0;
std::string::__init(&v60, "firstChar", 9u);
v42 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, (int)&v60);
v43 = cocos2d::CCString::intValue(v42);
std::string::~string((int)&v60);
v44 = cocos2d::CCString::getCString(v33);
cocos2d::CCLabelAtlas::initWithString(
this,
a2,
v44,
(unsigned int)(float)((float)(int)v35 / v37),
(unsigned int)(float)((float)(int)v39 / v41),
v43);
std::string::~string((int)&v57);
std::string::~string((int)&v54);
std::string::~string((int)&v50);
return 1;
}