//
// cocos2d::extension::CCScrollView::relocateContainer from 0x5a86b4 to 0x5a87c2 (270 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCScrollView::deaccelerateScrolling @ 0x5a89f4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void cocos2d::extension::CCScrollView::relocateContainer(cocos2d::extension::CCScrollView *a1, bool a2)
{
_BOOL4 v3; // r8
int v4; // r2
bool v5; // r3
int v6; // r2
bool v7; // r3
float v8; // r0
int v9; // r2
bool v10; // r3
cocos2d::CCScrollViewDirection m_eDirection; // r3
float v12; // s15
float x; // s14
float v14; // s13
float y; // s15
cocos2d::CCPoint v16; // r1
bool v17; // r3
cocos2d::CCPoint v18; // [sp+4h] [bp+0h] BYREF
cocos2d::CCPoint v19; // [sp+Ch] [bp+8h] BYREF
cocos2d::CCPoint v20; // [sp+14h] [bp+10h] BYREF
cocos2d::CCPoint v21; // [sp+1Ch] [bp+18h] BYREF
v3 = a2;
cocos2d::CCPoint::CCPoint(&v18);
cocos2d::CCPoint::CCPoint(&v19);
cocos2d::CCPoint::CCPoint(&v20);
cocos2d::extension::CCScrollView::minContainerOffset(&v21, a1);
cocos2d::CCPoint::operator=((PlayerObject *)&v19, COERCE_FLOAT(&v21), v4, v5);
cocos2d::extension::CCScrollView::maxContainerOffset(&v21, a1);
cocos2d::CCPoint::operator=((PlayerObject *)&v20, COERCE_FLOAT(&v21), v6, v7);
v8 = ((float (__fastcall *)(cocos2d::CCNode *))a1->m_pContainer->getPosition)(a1->m_pContainer);
cocos2d::CCPoint::operator=((PlayerObject *)&v18, v8, v9, v10);
m_eDirection = a1->m_eDirection;
if ( (m_eDirection & 0xFFFFFFFD) != 0 )
{
x = v18.x;
}
else
{
v12 = v19.x;
x = v20.x;
if ( v18.x >= v19.x )
v12 = v18.x;
if ( v12 <= v20.x )
x = v12;
}
if ( (unsigned int)(m_eDirection - 1) > 1 )
{
y = v18.y;
}
else
{
v14 = v20.y;
y = v19.y;
if ( v18.y <= v20.y )
v14 = v18.y;
if ( v14 >= v19.y )
y = v14;
}
if ( y != v18.y || x != v18.x )
{
cocos2d::CCPoint::CCPoint(&v21, x, y);
LODWORD(v16.x) = &v21;
LODWORD(v16.y) = v3;
cocos2d::extension::CCScrollView::setContentOffset(a1, v16, v17);
}
}