//
// MultilineBitmapFont::createWithFont from 0x58b35c to 0x58b564 (520 bytes)
//
// 2 xrefs:
// > TextArea::setString @ 0x592088
// > ??> @ 0x6c7f8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall MultilineBitmapFont::createWithFont(
const char *a1,
__int64 a2,
const cocos2d::CCPoint *a3,
int a4,
bool a5,
float a6,
float a7)
{
__int64 v14; // x19
_BOOL4 v15; // w22
void *v16; // x0
unsigned int *v18; // x2
int v19; // w1
__int64 v20; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v21; // [xsp+70h] [xbp+70h] BYREF
v14 = operator new(0x748u);
cocos2d::CCSprite::CCSprite((cocos2d::CCSprite *)v14);
*(_QWORD *)(v14 + 1800) = 0;
*(_QWORD *)v14 = &off_113D1A0;
*(_QWORD *)(v14 + 320) = &off_113D678;
*(_QWORD *)(v14 + 344) = &off_113D6F8;
*(_QWORD *)(v14 + 1808) = 0;
*(_QWORD *)(v14 + 1816) = 0;
*(_DWORD *)(v14 + 1824) = 0;
*(_BYTE *)(v14 + 1828) = 0;
*(_QWORD *)(v14 + 1832) = 0;
*(_DWORD *)(v14 + 1840) = 0;
*(_DWORD *)(v14 + 1844) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v14 + 1848));
*(_BYTE *)(v14 + 1860) = 0;
*(_DWORD *)(v14 + 1856) = 0;
sub_D18D28(&v20, a2);
cocos2d::CCPoint::CCPoint(&v21, a3);
v15 = MultilineBitmapFont::initWithFont((MultilineBitmapFont *)v14, a1, &v20, (float *)&v21, a4, a5, a6, a7);
v16 = (void *)(v20 - 24);
if ( (__int64 *)(v20 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v18 = (unsigned int *)(v20 - 8);
do
v19 = __ldaxr(v18);
while ( __stlxr(v19 - 1, v18) );
}
else
{
v19 = *(_DWORD *)(v20 - 8);
*(_DWORD *)(v20 - 8) = v19 - 1;
}
if ( v19 <= 0 )
operator delete(v16);
}
if ( v15 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v14);
return v14;
}
else
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 16LL))(v14);
return 0;
}
}