//
// BoomScrollLayer::ccTouchEnded from 0x3c1d58 to 0x3c1eb4 (348 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'BoomScrollLayer::ccTouchEnded @ 0x3c1ecc
//
// 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 11:46:31 +0000
//
cocos2d::CCArray **__fastcall BoomScrollLayer::ccTouchEnded(cocos2d::CCArray **result, cocos2d::CCArray *a2)
{
int v2; // r4
cocos2d::CCDirector *LocationInView; // r0
const cocos2d::CCPoint *v4; // r0
cocos2d::CCArray *v5; // r5
float v6; // s16
double v7; // d7
double v8; // d6
float v9; // s11
float v10; // s15
const cocos2d::CCPoint *v11; // r0
float v12[2]; // [sp+4h] [bp-14h] BYREF
float v13[2]; // [sp+Ch] [bp-Ch] BYREF
v2 = (int)result;
if ( result[90] == a2 )
{
result[90] = nullptr;
LocationInView = (cocos2d::CCDirector *)cocos2d::CCTouch::getLocationInView((cocos2d::CCTouch *)v12);
v4 = (const cocos2d::CCPoint *)cocos2d::CCDirector::sharedDirector(LocationInView);
cocos2d::CCDirector::convertToGL((cocos2d::CCDirector *)v13, v4);
cocos2d::CCPoint::operator=(v12, v13);
v5 = *(cocos2d::CCArray **)(v2 + 460);
v6 = v12[0] - *(float *)(v2 + 328);
clock_gettime(0, (struct timespec *)v13);
v7 = (double)SLODWORD(v13[0]) + (double)SLODWORD(v13[1]) / 1000000000.0;
v8 = v7 - *(double *)(v2 + 368);
v9 = fabsf(v6);
if ( v8 == 0.0 )
LODWORD(v7) = *(_DWORD *)(v2 + 408);
else
v7 = v9;
if ( v8 == 0.0 )
{
HIDWORD(v7) = 1.0;
*(float *)&v7 = *(float *)&v7 + 1.0;
}
else
{
v7 = v7 / v8;
}
if ( v8 != 0.0 )
*(float *)&v7 = v7;
v10 = *(float *)(v2 + 432);
*(_DWORD *)(v2 + 332) = LODWORD(v7);
if ( v9 >= v10 || *(float *)&v7 > *(float *)(v2 + 404) && v9 >= (float)(v10 * 0.25) )
{
v11 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 384) + 96))(*(_DWORD *)(v2 + 384));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v13, v11);
v5 = (cocos2d::CCArray *)BoomScrollLayer::pageNumberForPosition(v2);
if ( v5 == *(cocos2d::CCArray **)(v2 + 460) )
{
if ( v6 < 0.0 && (*(_BYTE *)(v2 + 336) || (int)v5 < BoomScrollLayer::getTotalPages((cocos2d::CCArray **)v2) - 1) )
{
v5 = (cocos2d::CCArray *)((char *)v5 + 1);
}
else if ( v6 > 0.0 && (*(_BYTE *)(v2 + 336) || (int)v5 > 0) )
{
v5 = (cocos2d::CCArray *)((char *)v5 - 1);
}
}
}
return BoomScrollLayer::moveToPage((cocos2d::CCArray **)v2, v5);
}
return result;
}