//
// cocos2d::extension::CCTableView::__indexFromOffset from 0x5a9b70 to 0x5a9bf0 (128 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCTableView::_indexFromOffset @ 0x5a9c44
//
// 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 cocos2d::extension::CCTableView::__indexFromOffset(cocos2d::extension::CCTableView *a1, cocos2d::CCPoint a2)
{
float x; // r5
int v4; // r1
float v5; // s15
int v6; // r3
int m_nTag; // r2
int result; // r0
float v9; // s14
x = a2.x;
v4 = (*(int (__fastcall **)(int, cocos2d::extension::CCTableView *, _DWORD))(*(_DWORD *)a1[1].m_uUnknown + 20))(
a1[1].m_uUnknown,
a1,
LODWORD(a2.y))
- 1;
if ( a1->m_eDirection )
v5 = *(float *)(LODWORD(x) + 4);
else
v5 = *(float *)LODWORD(x);
v6 = 0;
while ( v4 >= v6 )
{
m_nTag = a1[1].m_nTag;
result = v6 + (v4 - v6) / 2;
v9 = *(float *)(m_nTag + 4 * result);
if ( v5 >= v9 && v5 <= *(float *)(m_nTag + 4 * (result + 1)) )
return result;
if ( v5 >= v9 )
v6 = result + 1;
else
v4 = result - 1;
}
return -(v6 > 0);
}