//
// cocos2d::extension::CCControlButton::needsLayout from 0x1800067e0 to 0x180006de3 (1539 bytes)
//
// 6 xrefs:
// > ??> @ 0x180026660
// > ??> @ 0x18002a5d8
// > ??> @ 0x18002fee4
// > ??> @ 0x18002ff2c
// > ??> @ 0x180032408
// > ??> @ 0x18004b630
//
// 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:15:36 +0000
//
void __fastcall cocos2d::extension::CCControlButton::needsLayout(cocos2d::extension::CCControlButton *this)
{
__int64 v2; // rcx
__int64 v3; // rcx
__int64 v4; // rbx
__int64 v5; // rax
cocos2d::CCObject *v6; // rcx
cocos2d::CCObject *v7; // rax
__int64 v8; // rax
__int64 v9; // rdx
cocos2d::CCObject *v10; // rax
cocos2d::CCObject *v11; // rcx
cocos2d::CCObject *v12; // rbx
cocos2d::CCObject *v13; // rcx
void (__fastcall ***v14)(_QWORD, const char *); // rax
void (__fastcall ***v15)(_QWORD, const char *); // rdi
cocos2d::CCString *v16; // rcx
void (__fastcall **v17)(_QWORD, const char *); // rbx
const char *CString; // rax
void (__fastcall ***v19)(_QWORD, char *); // rax
float *v20; // rbx
__int64 *v21; // rsi
__int64 v22; // rdi
__int64 v23; // rax
__int64 v24; // rax
cocos2d::CCObject *v25; // rbx
cocos2d::CCObject *v26; // rax
cocos2d::CCObject *v27; // rcx
float *v28; // rbx
__int64 *v29; // rsi
__int64 v30; // rdi
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rcx
__int64 v34; // rax
__int64 *v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
__int64 v38; // rcx
__int64 v39; // rax
__int64 v40; // rcx
__int64 v41; // rax
float MinX; // xmm0_4
float v43; // xmm9_4
float MinY; // xmm0_4
float v45; // xmm8_4
float MaxX; // xmm0_4
float v47; // xmm7_4
float MaxY; // xmm0_4
float v49; // xmm6_4
__int64 v50; // rax
__int64 v51; // rax
__int64 v52; // rbx
__int64 v53; // rax
float *v54; // rbx
__int64 *v55; // rsi
__int64 v56; // rdi
__int64 v57; // rax
__int64 v58; // rax
__int64 v59; // rdx
float *v60; // rbx
__int64 *v61; // rsi
__int64 v62; // rdi
__int64 v63; // rax
__int64 v64; // rax
__int64 v65; // rdx
_BYTE v66[16]; // [rsp+38h] [rbp-49h] BYREF
_BYTE v67[16]; // [rsp+48h] [rbp-39h] BYREF
_BYTE v68[8]; // [rsp+58h] [rbp-29h] BYREF
float v69[2]; // [rsp+60h] [rbp-21h] BYREF
_BYTE v70[8]; // [rsp+68h] [rbp-19h] BYREF
float v71; // [rsp+E8h] [rbp+67h] BYREF
float v72; // [rsp+ECh] [rbp+6Bh]
float v73; // [rsp+F0h] [rbp+6Fh] BYREF
float v74; // [rsp+F4h] [rbp+73h]
if ( *((_BYTE *)this + 525) )
{
v2 = *((_QWORD *)this + 61);
if ( v2 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v2 + 336LL))(v2, 0);
v3 = *((_QWORD *)this + 62);
if ( v3 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v3 + 336LL))(v3, 0);
v4 = *(_QWORD *)this;
v5 = cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v71,
(cocos2d::extension::CCControlButton *)((char *)this + 516));
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, __int64))(v4 + 1168))(this, v5);
v6 = *((cocos2d::CCObject **)this + 59);
if ( v6 )
cocos2d::CCObject::release(v6);
v7 = (cocos2d::CCObject *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD))(*(_QWORD *)this + 1208LL))(
this,
*((unsigned int *)this + 109));
*((_QWORD *)this + 59) = v7;
if ( v7 )
cocos2d::CCObject::retain(v7);
v8 = (*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, float *, _QWORD))(*(_QWORD *)this + 1224LL))(
this,
&v71,
*((unsigned int *)this + 109));
v9 = *((unsigned int *)this + 109);
*((_WORD *)this + 240) = *(_WORD *)v8;
*((_BYTE *)this + 482) = *(_BYTE *)(v8 + 2);
v10 = (cocos2d::CCObject *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, __int64))(*(_QWORD *)this + 1240LL))(
this,
v9);
v11 = *((cocos2d::CCObject **)this + 61);
v12 = v10;
if ( v11 != v10 )
{
if ( v10 )
cocos2d::CCObject::retain(v10);
v13 = *((cocos2d::CCObject **)this + 61);
if ( v13 )
cocos2d::CCObject::release(v13);
*((_QWORD *)this + 61) = v12;
v11 = v12;
}
v14 = (void (__fastcall ***)(_QWORD, const char *))_RTDynamicCast(
v11,
0,
&cocos2d::CCNode `RTTI Type Descriptor',
&cocos2d::CCLabelProtocol `RTTI Type Descriptor',
0);
v15 = v14;
if ( v14 )
{
v16 = *((cocos2d::CCString **)this + 59);
if ( v16 )
{
v17 = *v14;
CString = cocos2d::CCString::getCString(v16);
(*v17)(v15, CString);
}
}
v19 = (void (__fastcall ***)(_QWORD, char *))_RTDynamicCast(
*((_QWORD *)this + 61),
0,
&cocos2d::CCNode `RTTI Type Descriptor',
&cocos2d::CCRGBAProtocol `RTTI Type Descriptor',
0);
if ( v19 )
(**v19)(v19, (char *)this + 480);
if ( *((_QWORD *)this + 61) )
{
v20 = (float *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v21 = *((__int64 **)this + 61);
v22 = *v21;
v23 = (*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v24 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, *v20 * 0.5, *(float *)(v23 + 4) * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v22 + 184))(v21, v24);
}
v25 = (cocos2d::CCObject *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD))(*(_QWORD *)this + 1304LL))(
this,
*((unsigned int *)this + 109));
v26 = *((cocos2d::CCObject **)this + 62);
if ( v26 != v25 )
{
if ( v25 )
cocos2d::CCObject::retain(v25);
v27 = *((cocos2d::CCObject **)this + 62);
if ( v27 )
cocos2d::CCObject::release(v27);
*((_QWORD *)this + 62) = v25;
v26 = v25;
}
if ( v26 )
{
v28 = (float *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v29 = *((__int64 **)this + 62);
v30 = *v29;
v31 = (*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v32 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, *v28 * 0.5, *(float *)(v31 + 4) * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v30 + 184))(v29, v32);
}
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v73);
v33 = *((_QWORD *)this + 61);
if ( v33 )
{
v34 = cocos2d::CCNode::boundingBox(v33, v70);
cocos2d::CCSize::operator=(&v73, v34 + 8);
}
v35 = *((__int64 **)this + 62);
if ( *((_BYTE *)this + 483) )
{
if ( v35 )
{
v36 = *v35;
v37 = cocos2d::CCSize::CCSize(
(cocos2d::CCSize *)&v71,
(float)(2 * *((_DWORD *)this + 141)) + v73,
(float)(2 * *((_DWORD *)this + 140)) + v74);
(*(void (__fastcall **)(__int64 *, __int64))(v36 + 312))(v35, v37);
}
}
else if ( v35 )
{
(*(void (__fastcall **)(_QWORD, float *))(*v35 + 888))(*((_QWORD *)this + 62), &v71);
if ( v71 <= 0.0 )
v71 = v73;
if ( v72 <= 0.0 )
v72 = v74;
(*(void (__fastcall **)(_QWORD, float *))(**((_QWORD **)this + 62) + 312LL))(*((_QWORD *)this + 62), &v71);
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v66);
v38 = *((_QWORD *)this + 61);
if ( v38 )
{
v39 = cocos2d::CCNode::boundingBox(v38, v70);
cocos2d::CCRect::operator=(v66, v39);
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v67);
v40 = *((_QWORD *)this + 62);
if ( v40 )
{
v41 = cocos2d::CCNode::boundingBox(v40, v70);
cocos2d::CCRect::operator=(v67, v41);
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v68);
MinX = cocos2d::CCRect::getMinX((cocos2d::CCRect *)v66);
v43 = fminf(MinX, cocos2d::CCRect::getMinX((cocos2d::CCRect *)v67));
MinY = cocos2d::CCRect::getMinY((cocos2d::CCRect *)v66);
v45 = fminf(MinY, cocos2d::CCRect::getMinY((cocos2d::CCRect *)v67));
MaxX = cocos2d::CCRect::getMaxX((cocos2d::CCRect *)v66);
v47 = fmaxf(MaxX, cocos2d::CCRect::getMaxX((cocos2d::CCRect *)v67));
MaxY = cocos2d::CCRect::getMaxY((cocos2d::CCRect *)v66);
v49 = fmaxf(MaxY, cocos2d::CCRect::getMaxY((cocos2d::CCRect *)v67));
v50 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, v43, v47);
cocos2d::CCPoint::operator=(v68, v50);
v51 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v71, v47 - v43, v49 - v45);
cocos2d::CCSize::operator=(v69, v51);
v52 = *(_QWORD *)this;
v53 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v71, v69[0], v69[1]);
(*(void (__fastcall **)(cocos2d::extension::CCControlButton *, __int64))(v52 + 312))(this, v53);
if ( *((_QWORD *)this + 61) )
{
v54 = (float *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v55 = *((__int64 **)this + 61);
v56 = *v55;
v57 = (*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v58 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, *v54 * 0.5, *(float *)(v57 + 4) * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v56 + 184))(v55, v58);
LOBYTE(v59) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 61) + 336LL))(*((_QWORD *)this + 61), v59);
}
if ( *((_QWORD *)this + 62) )
{
v60 = (float *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v61 = *((__int64 **)this + 62);
v62 = *v61;
v63 = (*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *))(*(_QWORD *)this + 320LL))(this);
v64 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, *v60 * 0.5, *(float *)(v63 + 4) * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v62 + 184))(v61, v64);
LOBYTE(v65) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 62) + 336LL))(*((_QWORD *)this + 62), v65);
}
}
}