//
// cocos2d::extension::CCTableView::__indexFromOffset from 0x10042d690 to 0x10042d723 (147 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall cocos2d::extension::CCTableView::__indexFromOffset(
cocos2d::extension::CCTableView *a1,
cocos2d::CCPoint a2)
{
__int64 v2; // rsi
int v3; // eax
__int64 v4; // rcx
int v5; // eax
float v6; // xmm0_4
__int64 v7; // rsi
int v8; // edx
int v9; // edi
int v10; // ecx
float v11; // xmm1_4
v3 = (*(__int64 (__fastcall **)(_QWORD, cocos2d::extension::CCTableView *, double))(**(_QWORD **)&a1[1].m_fScaleX
+ 40LL))(
*(_QWORD *)&a1[1].m_fScaleX,
a1,
*(double *)&a2);
v4 = 0;
v5 = v3 - 1;
if ( v5 < 0 )
return 0;
LOBYTE(v4) = a1->m_eDirection != kCCScrollViewDirectionHorizontal;
v6 = *(float *)(v2 + 4 * v4);
v7 = *(_QWORD *)&a1[1].m_uAutoReleaseCount;
v8 = 0;
while ( 1 )
{
v9 = (v5 - v8) / 2;
v10 = v9 + v8;
v11 = *(float *)(v7 + 4LL * (v9 + v8));
if ( v6 >= v11 && *(float *)(v7 + 4LL * v10 + 4) >= v6 )
break;
if ( v11 <= v6 )
{
v8 += v9 + 1;
if ( v5 < v8 )
return -(v8 > 0);
}
else
{
v5 = v10 - 1;
if ( v10 - 1 < v8 )
return -(v8 > 0);
}
}
return v10;
}