//
// cocos2d::CCLabelBMFont::initWithString from 0x7d5b80 to 0x7d5da8 (552 bytes)
//
// 4 xrefs:
// > CCCounterLabel::init @ 0x3c572c
// > cocos2d::CCLabelBMFont::create @ 0x7d5e02
// > cocos2d::CCLabelBMFont::createBatched @ 0x7d5f6c
// > cocos2d::CCLabelBMFont::init @ 0x7d5fd2
//
// 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:39 +0000
//
int __fastcall cocos2d::CCLabelBMFont::initWithString(
int *a1,
const char *a2,
cocos2d *this,
int a4,
int a5,
float *a6)
{
cocos2d::CCObject *File; // r0
int v11; // r5
_DWORD *v12; // r0
int *v13; // r0
cocos2d::CCTextureCache *v14; // r0
int v15; // r1
const char *v16; // r1
cocos2d::CCTexture2D *v17; // r7
int v18; // r10
__int16 v19; // r2
int v20; // r3
size_t v21; // r0
__int16 v22; // r2
cocos2d::CCTexture2D *v23; // r0
cocos2d::CCSprite *v24; // r9
int v25; // r11
void (__fastcall *v27)(cocos2d::CCSprite *, int, float *, int); // [sp+8h] [bp-24h]
float v28[4]; // [sp+14h] [bp-18h] BYREF
if ( this )
{
File = cocos2d::FNTConfigLoadFile(this, _stack_chk_guard);
v11 = (int)File;
if ( !File )
{
cocos2d::CCObject::release(a1);
return v11;
}
cocos2d::CCObject::retain((int)File);
v12 = (_DWORD *)a1[84];
if ( v12 )
cocos2d::CCObject::release(v12);
a1[84] = v11;
v13 = std::string::assign(a1 + 75, (char *)this);
v14 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)v13);
v15 = a1[84];
if ( (*(_BYTE *)(v15 + 76) & 1) != 0 )
v16 = *(const char **)(v15 + 84);
else
v16 = (const char *)(v15 + 77);
v17 = (cocos2d::CCTexture2D *)cocos2d::CCTextureCache::addImage(v14, v16, 0);
}
else
{
v17 = (cocos2d::CCTexture2D *)operator new(0x60u);
cocos2d::CCTexture2D::CCTexture2D(v17);
cocos2d::CCObject::autorelease(v17);
}
if ( !a2 )
a2 = (const char *)&unk_B6B226;
v18 = *((unsigned __int8 *)a1 + 367);
if ( *((_BYTE *)a1 + 367) )
{
v11 = cocos2d::CCNode::init((cocos2d::CCNode *)a1);
if ( v11 )
{
*((_BYTE *)a1 + 357) = -1;
*((_BYTE *)a1 + 356) = -1;
a1[83] = a4;
*((_BYTE *)a1 + 365) = 1;
*((_BYTE *)a1 + 364) = 1;
a1[82] = a5;
*(_WORD *)((char *)a1 + 361) = -1;
v19 = *(_WORD *)((char *)a1 + 361);
*((_BYTE *)a1 + 363) = -1;
*((_BYTE *)a1 + 360) = -1;
*((_WORD *)a1 + 179) = v19;
cocos2d::CCSize::operator=((float *)a1 + 26, flt_D2F2C4);
*((_BYTE *)a1 + 366) = 1;
cocos2d::CCPoint::CCPoint(v28, 0.5, 0.5);
cocos2d::CCPoint::operator=((float *)a1 + 24, v28);
cocos2d::CCPoint::operator=((float *)a1 + 86, a6);
v20 = *a1;
a1[93] = (int)v17;
(*(void (__fastcall **)(int *, const char *, _DWORD))(v20 + 468))(a1, a2, 0);
return v11;
}
}
else
{
v21 = strlen(a2);
v11 = cocos2d::CCSpriteBatchNode::initWithTexture((cocos2d::CCSpriteBatchNode *)a1, v17, v21);
if ( v11 )
{
*((_BYTE *)a1 + 357) = -1;
*((_BYTE *)a1 + 356) = -1;
a1[83] = a4;
a1[82] = a5;
*((_BYTE *)a1 + 365) = 1;
*((_BYTE *)a1 + 364) = 1;
*(_WORD *)((char *)a1 + 361) = -1;
v22 = *(_WORD *)((char *)a1 + 361);
*((_BYTE *)a1 + 363) = -1;
*((_BYTE *)a1 + 360) = -1;
*((_WORD *)a1 + 179) = v22;
cocos2d::CCSize::operator=((float *)a1 + 26, flt_D2F2C4);
v23 = (cocos2d::CCTexture2D *)(*(int (__fastcall **)(int))(*(_DWORD *)a1[67] + 48))(a1[67]);
*((_BYTE *)a1 + 366) = cocos2d::CCTexture2D::hasPremultipliedAlpha(v23);
cocos2d::CCPoint::CCPoint(v28, 0.5, 0.5);
cocos2d::CCPoint::operator=((float *)a1 + 24, v28);
cocos2d::CCPoint::operator=((float *)a1 + 86, a6);
v24 = (cocos2d::CCSprite *)operator new(0x1FCu);
cocos2d::CCSprite::CCSprite(v24);
a1[88] = (int)v24;
v27 = *(void (__fastcall **)(cocos2d::CCSprite *, int, float *, int))(*(_DWORD *)v24 + 512);
v25 = (*(int (__fastcall **)(int))(*(_DWORD *)a1[67] + 48))(a1[67]);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v28, 0.0, 0.0, 0.0, 0.0);
v27(v24, v25, v28, v18);
(*(void (__fastcall **)(int, int *))(*(_DWORD *)a1[88] + 560))(a1[88], a1);
(*(void (__fastcall **)(int *, const char *, int))(*a1 + 468))(a1, a2, 1);
return v11;
}
}
return 0;
}