//
// cocos2d::extension::CCControlSwitchSprite::needsLayout from 0x7aa05c to 0x7aa2d8 (636 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCControlSwitchSprite::initWithMaskSprite @ 0x7aa504
// > cocos2d::extension::CCControlSwitchSprite::setSliderXPosition @ 0x7aa574
// > cocos2d::extension::CCControlSwitch::ccTouchBegan @ 0x7aa916
//
// 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:01 +0000
//
int __fastcall cocos2d::extension::CCControlSwitchSprite::needsLayout(cocos2d::extension::CCControlSwitchSprite *this)
{
int v2; // r0
void (__fastcall *v3)(int, _BYTE *); // r8
float *v4; // r0
int v5; // r7
float v6; // s17
int v7; // r0
void (__fastcall *v8)(int, _BYTE *); // r8
float v9; // s17
float *v10; // r0
int v11; // r7
float v12; // s17
float v13; // s15
int v14; // r0
int v15; // r7
void (__fastcall *v16)(int, _BYTE *); // r9
float v17; // s17
int v18; // r7
void (__fastcall *v19)(int, _BYTE *); // r9
float v20; // s18
float v21; // s17
int v22; // r0
int v23; // r7
void (__fastcall *v24)(int, _BYTE *); // r9
float v25; // s18
float v26; // s17
int v27; // r0
cocos2d::CCRenderTexture *v28; // s16
int v29; // r2
cocos2d::CCRenderTexture *v30; // r5
int v31; // r0
int v32; // r0
void (__fastcall *v33)(cocos2d::extension::CCControlSwitchSprite *, int); // r7
int v34; // r0
int v35; // r0
float v37[2]; // [sp+4h] [bp-18h] BYREF
_BYTE v38[4]; // [sp+Ch] [bp-10h] BYREF
float v39; // [sp+10h] [bp-Ch]
v2 = *((_DWORD *)this + 134);
v3 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v2 + 92);
v4 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v2 + 164))(v2);
v5 = *((_DWORD *)this + 134);
v6 = *((float *)this + 128) + (float)(*v4 * 0.5);
v7 = (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 164))(v5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v6, *(float *)(v7 + 4) * 0.5);
v3(v5, v38);
v8 = *(void (__fastcall **)(int, _BYTE *))(**((_DWORD **)this + 135) + 92);
v9 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 134) + 164))(*((_DWORD *)this + 134));
v10 = (float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 164))(*((_DWORD *)this + 135));
v11 = *((_DWORD *)this + 135);
v12 = v9 + (float)(*v10 * 0.5);
v13 = *((float *)this + 128);
v14 = (*(int (__fastcall **)(int))(*(_DWORD *)v11 + 164))(v11);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v12 + v13, *(float *)(v14 + 4) * 0.5);
v8(v11, v38);
v15 = *((_DWORD *)this + 136);
v16 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v15 + 92);
v17 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 134) + 164))(*((_DWORD *)this + 134))
+ *((float *)this + 128);
(*(void (__fastcall **)(float *))(**((_DWORD **)this + 131) + 72))(v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v17, v37[1] * 0.5);
v16(v15, v38);
v18 = *((_DWORD *)this + 137);
if ( v18 )
{
v19 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 92);
v20 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 134) + 96))(*((_DWORD *)this + 134));
v21 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 136) + 164))(*((_DWORD *)this + 136)) / 6.0;
v22 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 134) + 164))(*((_DWORD *)this + 134));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v20 - v21, *(float *)(v22 + 4) * 0.5);
v19(v18, v38);
}
v23 = *((_DWORD *)this + 138);
if ( v23 )
{
v24 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v23 + 92);
v25 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 96))(*((_DWORD *)this + 135));
v26 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 136) + 164))(*((_DWORD *)this + 136)) / 6.0;
v27 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 164))(*((_DWORD *)this + 135));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v25 + v26, *(float *)(v27 + 4) * 0.5);
v24(v23, v38);
}
(*(void (__fastcall **)(float *))(**((_DWORD **)this + 131) + 72))(v37);
v28 = (cocos2d::CCRenderTexture *)(int)v37[0];
(*(void (__fastcall **)(_BYTE *))(**((_DWORD **)this + 131) + 72))(v38);
v30 = (cocos2d::CCRenderTexture *)cocos2d::CCRenderTexture::create(v28, (int)v39, v29);
cocos2d::CCRenderTexture::begin(v30);
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 134) + 376))(*((_DWORD *)this + 134));
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 376))(*((_DWORD *)this + 135));
v31 = *((_DWORD *)this + 137);
if ( v31 )
(*(void (__fastcall **)(int))(*(_DWORD *)v31 + 376))(v31);
v32 = *((_DWORD *)this + 138);
if ( v32 )
(*(void (__fastcall **)(int))(*(_DWORD *)v32 + 376))(v32);
cocos2d::CCRenderTexture::end(v30);
v33 = *(void (__fastcall **)(cocos2d::extension::CCControlSwitchSprite *, int))(*(_DWORD *)this + 532);
v34 = (*(int (__fastcall **)(cocos2d::CCRenderTexture *))(*(_DWORD *)v30 + 448))(v30);
v35 = (*(int (__fastcall **)(int))(*(_DWORD *)v34 + 536))(v34);
v33(this, v35);
return cocos2d::CCSprite::setFlipY(this, 1);
}