//
// cocos2d::extension::CCControlButton::setTitleTTFForState from 0x180006780 to 0x18000687b (251 bytes)
//
// 4 xrefs:
// > ??> @ 0x1800241c8
// > ??> @ 0x180028010
// > ??> @ 0x18002fdf8
// > ??> @ 0x180049678
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::extension::CCControlButton::setTitleTTFForState(
cocos2d::extension::CCControlButton *this,
const char *a2,
unsigned int a3)
{
cocos2d::CCString *v6; // rdi
void *v7; // rcx
__int64 v8; // rbx
const char *CString; // rax
struct cocos2d::CCLabelTTF *v10; // rax
void *Block[2]; // [rsp+20h] [rbp-58h] BYREF
__int64 v12; // [rsp+30h] [rbp-48h]
unsigned __int64 v13; // [rsp+38h] [rbp-40h]
v6 = (cocos2d::CCString *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD))(*(_QWORD *)this + 1192LL))(
this,
a3);
if ( !v6 )
{
*(_OWORD *)Block = 0;
v12 = 0;
v13 = 15;
LOBYTE(Block[0]) = 0;
v6 = (cocos2d::CCString *)cocos2d::CCString::create(Block);
if ( v13 > 0xF )
{
v7 = Block[0];
if ( v13 + 1 >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
v12 = 0;
v13 = 15;
LOBYTE(Block[0]) = 0;
}
v8 = *(_QWORD *)this;
CString = cocos2d::CCString::getCString(v6);
v10 = cocos2d::CCLabelTTF::create(CString, a2, 12.0);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, struct cocos2d::CCLabelTTF *, _QWORD))(v8 + 1232))(
this,
v10,
a3);
}