//
// cocos2d::extension::CCTableView::_indexFromOffset from 0x180015ba0 to 0x180015c2f (143 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCTableView::scrollViewDidScroll @ 0x180016219
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004a860
//
// 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
//
__int64 __fastcall cocos2d::extension::CCTableView::_indexFromOffset(__int64 a1, float *a2)
{
int v4; // esi
__int64 v5; // rax
__int64 result; // rax
char v7; // [rsp+30h] [rbp+8h] BYREF
v4 = (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 640) + 32LL))(*(_QWORD *)(a1 + 640), a1) - 1;
if ( !*(_DWORD *)(a1 + 584) )
a2[1] = *(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 448) + 304LL))(*(_QWORD *)(a1 + 448)) + 4)
- a2[1];
v5 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v7, (const struct cocos2d::CCPoint *)a2);
result = cocos2d::extension::CCTableView::__indexFromOffset(a1, v5);
if ( (_DWORD)result != -1 )
{
if ( (int)result < 0 )
result = 0;
if ( (int)result > v4 )
return 0xFFFFFFFFLL;
}
return result;
}