//
// cocos2d::CCLabelBMFont::initWithString from 0x1006aa030 to 0x1006aa2da (682 bytes)
//
// 8 xrefs:
// > CCCounterLabel::create @ 0x1005126ce
// > CCCounterLabel::init @ 0x100512777
// > cocos2d::CCLabelBMFont::create_1 @ 0x1006a9de8
// > cocos2d::CCLabelBMFont::create @ 0x1006a9e8a
// > cocos2d::CCLabelBMFont::create_2 @ 0x1006a9f32
// > cocos2d::CCLabelBMFont::create_3 @ 0x1006a9fe0
// > cocos2d::CCLabelBMFont::createBatched @ 0x1006aa35d
// > cocos2d::CCLabelBMFont::init @ 0x1006aa3d5
//
// 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:35:21 +0000
//
char __fastcall cocos2d::CCLabelBMFont::initWithString(
__int64 a1,
const char *a2,
char *a3,
int a4,
_QWORD *a5,
float a6)
{
__int64 File; // rax
__int64 v11; // r15
_DWORD *v12; // rdi
__int64 v13; // rax
__int64 v14; // rsi
__int64 v15; // rsi
void *v16; // r14
const char *v17; // r15
__int64 v18; // rax
__int64 v19; // rdi
const char *v20; // rsi
__int64 v21; // rdx
unsigned int v22; // eax
__int64 v23; // rax
void *v24; // r14
__int64 v25; // r12
float v27[4]; // [rsp+8h] [rbp-48h] BYREF
_QWORD *v28; // [rsp+18h] [rbp-38h]
float v29; // [rsp+24h] [rbp-2Ch]
v29 = a6;
v28 = a5;
if ( a3 )
{
File = cocos2d::FNTConfigLoadFile(a3);
if ( !File )
{
cocos2d::CCObject::release((_DWORD *)a1);
return 0;
}
v11 = File;
cocos2d::CCObject::retain(File);
v12 = *(_DWORD **)(a1 + 448);
if ( v12 )
cocos2d::CCObject::release(v12);
*(_QWORD *)(a1 + 448) = v11;
std::string::assign((std::string *)(a1 + 384), a3);
v13 = cocos2d::CCTextureCache::sharedTextureCache(a1 + 384);
v14 = *(_QWORD *)(a1 + 448);
if ( (*(_BYTE *)(v14 + 88) & 1) != 0 )
v15 = *(_QWORD *)(v14 + 104);
else
v15 = v14 + 89;
v16 = (void *)cocos2d::CCTextureCache::addImage(v13, v15, 0);
}
else
{
v16 = operator new(0x68u);
sub_10046C920((__int64)v16);
cocos2d::CCObject::autorelease((__int64)v16);
}
v17 = "";
if ( a2 )
v17 = a2;
if ( *(_BYTE *)(a1 + 491) == 1 )
{
if ( cocos2d::CCNode::init() )
{
*(float *)(a1 + 444) = v29;
*(_DWORD *)(a1 + 440) = a4;
*(_QWORD *)(a1 + 480) = -1;
*(_WORD *)(a1 + 488) = 257;
sub_100278660((_QWORD *)(a1 + 108), &qword_100BE5D08);
*(_BYTE *)(a1 + 490) = 1;
sub_100278250(v27, 0.5, 0.5);
sub_100278300((_QWORD *)(a1 + 100), v27);
sub_100278300((_QWORD *)(a1 + 460), v28);
*(_QWORD *)(a1 + 504) = v16;
v18 = *(_QWORD *)a1;
v19 = a1;
v20 = v17;
v21 = 0;
LABEL_18:
(*(void (__fastcall **)(__int64, const char *, __int64))(v18 + 936))(v19, v20, v21);
return 1;
}
}
else
{
v22 = strlen(v17);
if ( cocos2d::CCSpriteBatchNode::initWithTexture(a1, (__int64)v16, v22) )
{
*(float *)(a1 + 444) = v29;
*(_DWORD *)(a1 + 440) = a4;
*(_QWORD *)(a1 + 480) = -1;
*(_WORD *)(a1 + 488) = 257;
sub_100278660((_QWORD *)(a1 + 108), &qword_100BE5D08);
v23 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 96LL))(*(_QWORD *)(a1 + 328));
*(_BYTE *)(a1 + 490) = cocos2d::CCTexture2D::hasPremultipliedAlpha(v23);
sub_100278250(v27, 0.5, 0.5);
sub_100278300((_QWORD *)(a1 + 100), v27);
sub_100278300((_QWORD *)(a1 + 460), v28);
v24 = operator new(0x258u);
sub_100273700((__int64)v24);
*(_QWORD *)(a1 + 472) = v24;
v25 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 96LL))(*(_QWORD *)(a1 + 328));
sub_100278270((__int64)v27, 0.0, 0.0, (__m128)0LL, (__m128)0LL);
(*(void (__fastcall **)(void *, __int64, float *, _QWORD))(*(_QWORD *)v24 + 1024LL))(v24, v25, v27, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 472) + 1120LL))(*(_QWORD *)(a1 + 472), a1);
v18 = *(_QWORD *)a1;
v19 = a1;
v20 = v17;
v21 = 1;
goto LABEL_18;
}
}
return 0;
}