//
// cocos2d::extension::CCTableView::__indexFromOffset from 0x7af748 to 0x7af7c8 (128 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCTableView::_indexFromOffset @ 0x7af81c
//
// 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 12:00:05 +0000
//
int __fastcall cocos2d::extension::CCTableView::__indexFromOffset(int a1, float *a2)
{
int v4; // r1
float v5; // s15
int v6; // r3
int v7; // r2
int result; // r0
float v9; // s14
v4 = (*(int (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 484) + 20))(*(_DWORD *)(a1 + 484), a1) - 1;
if ( *(_DWORD *)(a1 + 332) )
v5 = a2[1];
else
v5 = *a2;
v6 = 0;
while ( v4 >= v6 )
{
v7 = *(_DWORD *)(a1 + 464);
result = v6 + (v4 - v6) / 2;
v9 = *(float *)(v7 + 4 * result);
if ( v5 >= v9 && v5 <= *(float *)(v7 + 4 * (result + 1)) )
return result;
if ( v5 >= v9 )
v6 = result + 1;
else
v4 = result - 1;
}
return -(v6 > 0);
}