//
// cocos2d::extension::CCControlSwitchSprite::needsLayout from 0xd10d18 to 0xd110b4 (924 bytes)
//
// 5 xrefs:
// > cocos2d::extension::CCControlSwitchSprite::initWithMaskSprite @ 0xd11408
// > cocos2d::extension::CCControlSwitchSprite::setSliderXPosition @ 0xd1144c
// > cocos2d::extension::CCControlSwitchSprite::setSliderXPosition @ 0xd1145c
// > cocos2d::extension::CCControlSwitch::ccTouchBegan @ 0xd11aac
// > ??> @ 0x62398
//
// 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:03 +0000
//
__int64 __fastcall cocos2d::extension::CCControlSwitchSprite::needsLayout(
cocos2d::extension::CCControlSwitchSprite *this)
{
__int64 v2; // x0
void (__fastcall *v3)(__int64, __int64 *); // x24
float *v4; // x0
__int64 v5; // x23
__int64 v6; // x0
void (__fastcall *v7)(__int64, __int64 *); // x24
float v8; // s9
float *v9; // x0
__int64 v10; // x23
__int64 v11; // x0
__int64 v12; // x23
void (__fastcall *v13)(__int64, __int64 *); // x24
__int64 v14; // x23
void (__fastcall *v15)(__int64, __int64 *); // x24
float v16; // s9
__int64 v17; // x0
__int64 v18; // x23
void (__fastcall *v19)(__int64, __int64 *); // x24
float v20; // s8
__int64 v21; // x0
unsigned int v22; // w20
int v23; // w2
cocos2d::CCRenderTexture *v24; // x20
__int64 v25; // x0
__int64 v26; // x0
cocos2d::CCRenderTexture *v27; // x0
__int64 (__fastcall *v28)(cocos2d::CCRenderTexture *); // x1
void (__fastcall *v29)(cocos2d::extension::CCControlSwitchSprite *, __int64); // x20
__int64 v30; // x0
__int64 v31; // x0
float v33; // [xsp+50h] [xbp+50h]
float v34; // [xsp+50h] [xbp+50h]
float v35; // [xsp+50h] [xbp+50h]
float v36; // [xsp+50h] [xbp+50h]
float v37; // [xsp+50h] [xbp+50h]
__int64 v38; // [xsp+68h] [xbp+68h] BYREF
__int64 v39; // [xsp+70h] [xbp+70h] BYREF
v2 = *((_QWORD *)this + 80);
v3 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v2 + 184LL);
v4 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 328LL))(v2);
v5 = *((_QWORD *)this + 80);
v33 = *((float *)this + 152) + (float)(*v4 * 0.5);
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 328LL))(v5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, v33, *(float *)(v6 + 4) * 0.5);
v3(v5, &v39);
v7 = *(void (__fastcall **)(__int64, __int64 *))(**((_QWORD **)this + 81) + 184LL);
v8 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 80) + 328LL))(*((_QWORD *)this + 80));
v9 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 81) + 328LL))(*((_QWORD *)this + 81));
v10 = *((_QWORD *)this + 81);
v34 = (float)(v8 + (float)(*v9 * 0.5)) + *((float *)this + 152);
v11 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 328LL))(v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, v34, *(float *)(v11 + 4) * 0.5);
v7(v10, &v39);
v12 = *((_QWORD *)this + 82);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
v35 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 80) + 328LL))(*((_QWORD *)this + 80))
+ *((float *)this + 152);
(*(void (__fastcall **)(__int64 *__return_ptr, _QWORD))(**((_QWORD **)this + 78) + 144LL))(
&v38,
*((_QWORD *)this + 78));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, v35, *((float *)&v38 + 1) * 0.5);
v13(v12, &v39);
v14 = *((_QWORD *)this + 83);
if ( v14 )
{
v15 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v14 + 184LL);
v16 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 80) + 192LL))(*((_QWORD *)this + 80));
v36 = v16
- (float)(*(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 82) + 328LL))(*((_QWORD *)this + 82))
/ 6.0);
v17 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 80) + 328LL))(*((_QWORD *)this + 80));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, v36, *(float *)(v17 + 4) * 0.5);
v15(v14, &v39);
}
v18 = *((_QWORD *)this + 84);
if ( v18 )
{
v19 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL);
v20 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 81) + 192LL))(*((_QWORD *)this + 81));
v37 = v20
+ (float)(*(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 82) + 328LL))(*((_QWORD *)this + 82))
/ 6.0);
v21 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 81) + 328LL))(*((_QWORD *)this + 81));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, v37, *(float *)(v21 + 4) * 0.5);
v19(v18, &v39);
}
(*(void (__fastcall **)(__int64 *__return_ptr, _QWORD))(**((_QWORD **)this + 78) + 144LL))(
&v38,
*((_QWORD *)this + 78));
v22 = (int)*(float *)&v38;
(*(void (__fastcall **)(__int64 *__return_ptr, _QWORD))(**((_QWORD **)this + 78) + 144LL))(
&v39,
*((_QWORD *)this + 78));
v24 = (cocos2d::CCRenderTexture *)cocos2d::CCRenderTexture::create(
(cocos2d::CCRenderTexture *)v22,
(int)*((float *)&v39 + 1),
v23);
cocos2d::CCRenderTexture::begin(v24);
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 80) + 752LL))(*((_QWORD *)this + 80));
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 81) + 752LL))(*((_QWORD *)this + 81));
v25 = *((_QWORD *)this + 83);
if ( v25 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v25 + 752LL))(v25);
v26 = *((_QWORD *)this + 84);
if ( v26 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v26 + 752LL))(v26);
cocos2d::CCRenderTexture::end(v24);
v27 = v24;
v28 = *(__int64 (__fastcall **)(cocos2d::CCRenderTexture *))(*(_QWORD *)v24 + 896LL);
v29 = *(void (__fastcall **)(cocos2d::extension::CCControlSwitchSprite *, __int64))(*(_QWORD *)this + 1064LL);
v30 = v28(v27);
v31 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v30 + 1072LL))(v30);
v29(this, v31);
cocos2d::CCSprite::setFlipY(this, 1);
return _stack_chk_guard;
}