//
// cocos2d::extension::CCScrollView::setZoomScale from 0xd171e4 to 0xd173cc (488 bytes)
//
// 4 xrefs:
// > cocos2d::extension::CCScrollView::setZoomScaleInDuration @ 0xd17428
// > cocos2d::extension::CCScrollView::setZoomScale @ 0xd17478
// > cocos2d::extension::CCScrollView::ccTouchMoved @ 0xd18274
// > ??> @ 0x423d0
//
// 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:06 +0000
//
__int64 __fastcall cocos2d::extension::CCScrollView::setZoomScale(cocos2d::extension::CCScrollView *this, float a2)
{
float v5; // s1
long double v6; // q0
float v7; // s2
long double v8; // q0
__int64 v9; // x0
__int64 v10; // x0
_BYTE v11[8]; // [xsp+50h] [xbp+50h] BYREF
_BYTE v12[8]; // [xsp+58h] [xbp+58h] BYREF
_BYTE v13[8]; // [xsp+60h] [xbp+60h] BYREF
__int64 v14; // [xsp+68h] [xbp+68h] BYREF
__int64 v15; // [xsp+70h] [xbp+70h] BYREF
if ( (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 55) + 168LL))(*((_QWORD *)this + 55)) != a2 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v11);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v13);
if ( *((float *)this + 122) == 0.0 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v15, *((float *)this + 126) * 0.5, *((float *)this + 127) * 0.5);
cocos2d::CCPoint::operator=(v13, &v15);
cocos2d::CCNode::convertToWorldSpace(&v15, this, (const cocos2d::CCPoint *)v13);
cocos2d::CCPoint::operator=(v13, &v15);
}
else
{
cocos2d::CCPoint::operator=(v13, (char *)this + 480);
}
cocos2d::CCNode::convertToNodeSpace(&v15, *((cocos2d::CCNode **)this + 55), (const cocos2d::CCPoint *)v13);
*(__n128 *)&v6 = cocos2d::CCPoint::operator=(v11, &v15);
v5 = *((float *)this + 129);
LODWORD(v6) = *((_DWORD *)this + 128);
v7 = a2;
if ( a2 >= v5 )
v7 = *((float *)this + 129);
if ( *(float *)&v6 < v7 )
{
*(float *)&v6 = a2;
if ( a2 >= v5 )
LODWORD(v6) = *((_DWORD *)this + 129);
}
(*(void (__fastcall **)(_QWORD, long double))(**((_QWORD **)this + 55) + 160LL))(*((_QWORD *)this + 55), v6);
cocos2d::CCNode::convertToWorldSpace(&v15, *((cocos2d::CCNode **)this + 55), (const cocos2d::CCPoint *)v11);
*(__n128 *)&v8 = cocos2d::CCPoint::operator=(v12, &v15);
cocos2d::CCPoint::operator-(&v14, v13, v12, v8);
v9 = *((_QWORD *)this + 52);
if ( v9 )
(*(void (__fastcall **)(__int64, cocos2d::extension::CCScrollView *))(*(_QWORD *)v9 + 24LL))(v9, this);
v10 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 55) + 192LL))(*((_QWORD *)this + 55));
cocos2d::CCPoint::operator+(&v15, v10);
cocos2d::extension::CCScrollView::setContentOffset((__int64)this, (float *)&v15, 0);
}
return _stack_chk_guard;
}