//
// cocos2d::CCLabelTTF::setFontName from 0x1003a73a0 to 0x1003a74c5 (293 bytes)
//
// 0 xrefs:
//
// 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:29:22 +0000
//
char __fastcall cocos2d::CCLabelTTF::setFontName(__int64 a1, const std::string::value_type *a2)
{
const std::string::value_type *v2; // r14
__int64 v3; // rax
void **v4; // r15
_QWORD *v5; // r15
size_t v6; // rax
size_t v7; // r12
void *v8; // r13
size_t v9; // r14
unsigned int v10; // eax
v2 = a2;
LODWORD(v3) = std::string::compare(*(const std::string **)(a1 + 624), a2);
if ( !(_DWORD)v3 )
return v3;
v4 = *(void ***)(a1 + 624);
if ( v4 )
{
if ( (*(_BYTE *)v4 & 1) != 0 )
operator delete(v4[2]);
operator delete(v4);
}
v5 = operator new(0x18u);
v6 = strlen(a2);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = operator new(v9);
v5[2] = v8;
*v5 = v9 | 1;
v5[1] = v7;
v2 = a2;
}
else
{
*(_BYTE *)v5 = 2 * v6;
v8 = (char *)v5 + 1;
if ( !v6 )
goto LABEL_14;
}
a2 = v2;
memcpy(v8, v2, v7);
LABEL_14:
*((_BYTE *)v8 + v7) = 0;
*(_QWORD *)(a1 + 624) = v5;
v10 = *(unsigned __int8 *)(a1 + 640);
if ( (v10 & 1) != 0 )
{
v3 = *(_QWORD *)(a1 + 648);
if ( !v3 )
return v3;
}
else
{
v3 = v10 >> 1;
if ( !v3 )
return v3;
}
LOBYTE(v3) = cocos2d::CCLabelTTF::updateTexture(a1, (__int64)a2);
return v3;
}