//
// cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite from 0x7a7d94 to 0x7a802e (666 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:00 +0000
//
cocos2d::CCDictionary *__fastcall cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite(
cocos2d::extension::CCControlButton *this,
cocos2d::CCNode *a2,
cocos2d::extension::CCScale9Sprite *a3)
{
cocos2d::CCDictionary *v6; // r0
cocos2d::CCDictionary *v7; // r11
void *v8; // r9
cocos2d::CCDictionary *v9; // r10
cocos2d::CCObject *v10; // r0
cocos2d::CCObject *v11; // r6
cocos2d::CCObject *v12; // r0
cocos2d::CCObject *v13; // r6
cocos2d::CCObject *v14; // r0
cocos2d::CCObject *v15; // r6
cocos2d::CCObject *v16; // r0
cocos2d::CCObject *v17; // r6
cocos2d::CCObject *v18; // r0
int v19; // r2
cocos2d::CCObject *v20; // r0
cocos2d::CCObject *v21; // r0
void (__fastcall *v22)(cocos2d::extension::CCControlButton *, _BYTE *); // r2
const char *v23; // r0
size_t v24; // r0
void (__fastcall *v25)(cocos2d::extension::CCControlButton *, int, int); // r9
unsigned __int8 *v26; // r0
void (__fastcall *v27)(cocos2d::extension::CCControlButton *, _BYTE *); // r5
void (__fastcall *v29)(cocos2d::extension::CCControlButton *, _BYTE *); // [sp+4h] [bp-28h]
void (__fastcall *v30)(cocos2d::extension::CCControlButton *, _BYTE *); // [sp+4h] [bp-28h]
const char *v31; // [sp+4h] [bp-28h]
int v32; // [sp+4h] [bp-28h]
_BYTE v33[8]; // [sp+10h] [bp-1Ch] BYREF
int v34[3]; // [sp+18h] [bp-14h] BYREF
v6 = (cocos2d::CCDictionary *)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);
v6 = (cocos2d::CCDictionary *)_dynamic_cast(
a2,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCRGBAProtocol,
-2);
v9 = v6;
}
else
{
v8 = nullptr;
v9 = nullptr;
}
*((_BYTE *)this + 393) = 1;
v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v6);
v11 = v10;
if ( *((cocos2d::CCObject **)this + 99) != v10 )
{
if ( v10 )
cocos2d::CCObject::retain(v10);
v10 = *((cocos2d::CCObject **)this + 99);
if ( v10 )
v10 = (cocos2d::CCObject *)cocos2d::CCObject::release(v10);
*((_DWORD *)this + 99) = v11;
}
v12 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v10);
v13 = v12;
if ( *((cocos2d::CCObject **)this + 100) != v12 )
{
if ( v12 )
cocos2d::CCObject::retain(v12);
v12 = *((cocos2d::CCObject **)this + 100);
if ( v12 )
v12 = (cocos2d::CCObject *)cocos2d::CCObject::release(v12);
*((_DWORD *)this + 100) = v13;
}
v14 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v12);
v15 = v14;
if ( *((cocos2d::CCObject **)this + 101) != v14 )
{
if ( v14 )
cocos2d::CCObject::retain(v14);
v14 = *((cocos2d::CCObject **)this + 101);
if ( v14 )
v14 = (cocos2d::CCObject *)cocos2d::CCObject::release(v14);
*((_DWORD *)this + 101) = v15;
}
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v14);
v17 = v16;
if ( *((cocos2d::CCObject **)this + 102) != v16 )
{
if ( v16 )
cocos2d::CCObject::retain(v16);
v18 = *((cocos2d::CCObject **)this + 102);
if ( v18 )
cocos2d::CCObject::release(v18);
*((_DWORD *)this + 102) = v17;
}
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, int))(*(_DWORD *)this + 500))(this, 1);
*((_BYTE *)this + 392) = 0;
*((_BYTE *)this + 380) = 1;
*((_DWORD *)this + 89) = 0;
cocos2d::extension::CCControlButton::setAdjustBackgroundImage(this, 1);
v29 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_DWORD *)this + 684);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v33, (const cocos2d::CCSize *)&unk_D2E804);
v29(this, v33);
v19 = *(_DWORD *)this;
*((_BYTE *)this + 380) = 1;
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, _DWORD))(v19 + 220))(this, 0);
v30 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_DWORD *)this + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.5, 0.5);
v30(this, v33);
if ( *((cocos2d::CCNode **)this + 91) != a2 )
{
if ( a2 )
cocos2d::CCObject::retain(a2);
v20 = *((cocos2d::CCObject **)this + 91);
if ( v20 )
cocos2d::CCObject::release(v20);
*((_DWORD *)this + 91) = a2;
}
if ( *((cocos2d::extension::CCScale9Sprite **)this + 92) != a3 )
{
if ( a3 )
cocos2d::CCObject::retain(a3);
v21 = *((cocos2d::CCObject **)this + 92);
if ( v21 )
cocos2d::CCObject::release(v21);
*((_DWORD *)this + 92) = a3;
}
v22 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_DWORD *)this + 608);
v33[0] = -1;
v33[1] = -1;
v33[2] = -1;
v22(this, v33);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, int))(*(_DWORD *)this + 584))(this, 255);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, int))(*(_DWORD *)this + 624))(this, 1);
v23 = (const char *)(*(int (__fastcall **)(void *))(*(_DWORD *)v8 + 4))(v8);
memset(v34, 0, sizeof(v34));
v31 = v23;
v24 = strlen(v23);
std::string::__init(v34, v31, v24);
v32 = cocos2d::CCString::create(v34);
std::string::~string((int)v34);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, int, int))(*(_DWORD *)this + 724))(this, v32, 1);
v25 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, int, int))(*(_DWORD *)this + 732);
v26 = (unsigned __int8 *)(*(int (__fastcall **)(cocos2d::CCDictionary *))(*(_DWORD *)v9 + 4))(v9);
v25(this, *v26 | (v26[1] << 8) | (v26[2] << 16), 1);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, cocos2d::CCNode *, int))(*(_DWORD *)this + 740))(
this,
a2,
1);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, cocos2d::extension::CCScale9Sprite *, int))(*(_DWORD *)this + 772))(
this,
a3,
1);
v27 = *(void (__fastcall **)(cocos2d::extension::CCControlButton *, _BYTE *))(*(_DWORD *)this + 700);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.5, 0.5);
v27(this, v33);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_DWORD *)this + 656))(this);
}
return v7;
}