//
// cocos2d::extension::CCTableView::_indexFromOffset from 0x1800157a0 to 0x18001582f (143 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCTableView::scrollViewDidScroll @ 0x180015e79
// > ??> @ 0x180032408
// > ??> @ 0x18004c794
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:15:41 +0000
//
__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) + 320LL))(*(_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;
}