//
// cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite from 0xd0dba8 to 0xd0df94 (1004 bytes)
//
// 3 xrefs:
// > ??> @ 0xe8f48
// > ??> @ 0x150a9f8
// > ??> @ 0x1510178
//
// This function is hookable on this platform (idp: arm, 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 13:07:01 +0000
//
__int64 __fastcall cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite(
cocos2d::extension::CCControlButton *this,
cocos2d::CCNode *a2,
cocos2d::extension::CCScale9Sprite *a3)
{
unsigned __int8 v6; // w0
unsigned int v7; // w26
void *v8; // x28
void *v9; // x27
cocos2d::CCObject *v10; // x0
cocos2d::CCObject *v11; // x22
cocos2d::CCObject *v12; // x1
cocos2d::CCObject *v13; // x0
cocos2d::CCObject *v14; // x22
cocos2d::CCObject *v15; // x1
cocos2d::CCObject *v16; // x0
cocos2d::CCObject *v17; // x22
cocos2d::CCObject *v18; // x1
cocos2d::CCObject *v19; // x0
cocos2d::CCObject *v20; // x22
cocos2d::CCObject *v21; // x1
void (__fastcall *v22)(cocos2d::extension::CCControlButton *, _BYTE *); // x25
void (__fastcall *v23)(cocos2d::extension::CCControlButton *, _BYTE *); // x24
cocos2d::CCObject *v24; // x0
cocos2d::CCObject *v25; // x0
void (__fastcall *v26)(cocos2d::extension::CCControlButton *, _BYTE *); // x2
const char *v27; // x0
size_t v28; // x0
__int64 v29; // x1
void (__fastcall *v30)(cocos2d::extension::CCControlButton *, _QWORD, __int64); // x24
_QWORD *v31; // x0
void (__fastcall *v32)(cocos2d::extension::CCControlButton *, _BYTE *); // x20
char *v34; // [xsp+68h] [xbp+68h]
__int64 v35; // [xsp+68h] [xbp+68h]
_BYTE v36[8]; // [xsp+78h] [xbp+78h] BYREF
__int64 v37[2]; // [xsp+80h] [xbp+80h] BYREF
void *v38; // [xsp+90h] [xbp+90h]
v6 = cocos2d::extension::CCControl::init(this);
v7 = v6;
if ( v6 )
{
if ( a2 )
{
v8 = _dynamic_cast(
a2,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCLabelProtocol,
-2);
v9 = _dynamic_cast(
a2,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCRGBAProtocol,
-2);
}
else
{
v8 = nullptr;
v9 = nullptr;
}
*((_BYTE *)this + 525) = (unsigned __int8)&dword_0 + 1;
v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::create((cocos2d::CCDictionary *)((char *)&dword_0 + 1));
v11 = v10;
v12 = *((cocos2d::CCObject **)this + 66);
if ( v10 != v12 )
{
if ( v10 )
{
v10 = (cocos2d::CCObject *)cocos2d::CCObject::retain(v10);
v12 = *((cocos2d::CCObject **)this + 66);
}
if ( v12 )
v10 = (cocos2d::CCObject *)cocos2d::CCObject::release(v12);
*((_QWORD *)this + 66) = v11;
}
v13 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v10);
v14 = v13;
v15 = *((cocos2d::CCObject **)this + 67);
if ( v15 != v13 )
{
if ( v13 )
{
v13 = (cocos2d::CCObject *)cocos2d::CCObject::retain(v13);
v15 = *((cocos2d::CCObject **)this + 67);
}
if ( v15 )
v13 = (cocos2d::CCObject *)cocos2d::CCObject::release(v15);
*((_QWORD *)this + 67) = v14;
}
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v13);
v17 = v16;
v18 = *((cocos2d::CCObject **)this + 68);
if ( v18 != v16 )
{
if ( v16 )
{
v16 = (cocos2d::CCObject *)cocos2d::CCObject::retain(v16);
v18 = *((cocos2d::CCObject **)this + 68);
}
if ( v18 )
v16 = (cocos2d::CCObject *)cocos2d::CCObject::release(v18);
*((_QWORD *)this + 68) = v17;
}
v19 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v16);
v20 = v19;
v21 = *((cocos2d::CCObject **)this + 69);
if ( v21 != v19 )
{
if ( v19 )
{
cocos2d::CCObject::retain(v19);
v21 = *((cocos2d::CCObject **)this + 69);
}
if ( v21 )
cocos2d::CCObject::release(v21);
*((_QWORD *)this + 69) = v20;
}
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 1000LL))(this);
*((_BYTE *)this + 512) = 1;
*((_BYTE *)this + 524) = 0;
*((_QWORD *)this + 59) = 0;
cocos2d::extension::CCControlButton::setAdjustBackgroundImage(this, 1);
v22 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_QWORD *)this + 1368LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v36, (const cocos2d::CCSize *)&unk_155F768);
v22(this, v36);
*((_BYTE *)this + 512) = 1;
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD))(*(_QWORD *)this + 440LL))(this, 0);
v23 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_QWORD *)this + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, 0.5, 0.5);
v23(this, v36);
v24 = *((cocos2d::CCObject **)this + 61);
if ( a2 != v24 )
{
if ( a2 )
{
cocos2d::CCObject::retain(a2);
v24 = *((cocos2d::CCObject **)this + 61);
}
if ( v24 )
cocos2d::CCObject::release(v24);
*((_QWORD *)this + 61) = a2;
}
v25 = *((cocos2d::CCObject **)this + 62);
if ( v25 != a3 )
{
if ( a3 )
{
cocos2d::CCObject::retain(a3);
v25 = *((cocos2d::CCObject **)this + 62);
}
if ( v25 )
cocos2d::CCObject::release(v25);
*((_QWORD *)this + 62) = a3;
}
v26 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_QWORD *)this + 1216LL);
v36[0] = -1;
v36[1] = -1;
v36[2] = -1;
v26(this, v36);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, __int64))(*(_QWORD *)this + 1168LL))(
this,
0xFFFFFFFFLL);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, __int64))(*(_QWORD *)this + 1248LL))(this, 1);
v27 = (const char *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v8 + 8LL))(v8);
v37[0] = 0;
v34 = (char *)v27;
v37[1] = 0;
v38 = nullptr;
v28 = strlen(v27);
std::string::__init(v37, v34, v28);
v29 = cocos2d::CCString::create(v37);
if ( (v37[0] & 1) != 0 )
{
v35 = v29;
operator delete(v38);
v29 = v35;
}
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, __int64, __int64))(*(_QWORD *)this + 1448LL))(
this,
v29,
1);
v30 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD, __int64))(*(_QWORD *)this + 1464LL);
v31 = (_QWORD *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 8LL))(v9);
v30(this, *v31, 1);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, cocos2d::CCNode *, __int64))(*(_QWORD *)this + 1480LL))(
this,
a2,
1);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, cocos2d::extension::CCScale9Sprite *, __int64))(*(_QWORD *)this + 1544LL))(
this,
a3,
1);
v32 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_QWORD *)this + 1400LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, 0.5, 0.5);
v32(this, v36);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 1312LL))(this);
}
return v7;
}