//
// cocos2d::extension::CCControlButton::getTitleForState from 0xa9b9e0 to 0xa9bb08 (296 bytes)
//
// 3 xrefs:
// > ??> @ 0xb9a00
// > ??> @ 0x11f5260
// > ??> @ 0x11fa870
//
// 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
//
cocos2d::CCString *cocos2d::extension::CCControlButton::getTitleForState(
cocos2d::extension::CCControlButton *a1,
unsigned int a2)
{
cocos2d::CCDictionary *v3; // x0
cocos2d::CCString *v4; // x20
const std::string *v6; // x1
void *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+40h] [xbp+40h] BYREF
v3 = *(cocos2d::CCDictionary **)&a1[1].m_fRotationX;
if ( v3 )
{
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v3, a2);
if ( !v4 )
return (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)&a1[1].m_fRotationX, 1);
}
else
{
sub_D153B8((int)&v10, &byte_F288A0);
v4 = (cocos2d::CCString *)cocos2d::CCString::create((cocos2d::CCString *)&v10, v6);
v7 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
}
return v4;
}