//
// cocos2d::extension::CCTableView::scrollViewDidScroll from 0x10041a3a0 to 0x10041a643 (675 bytes)
//
// 2 xrefs:
// > sub_10041A650 @ 0x10041a65c
// > ??> @ 0x100b3f6e8
//
// 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:30:13 +0000
//
void __fastcall cocos2d::extension::CCTableView::scrollViewDidScroll(__int64 a1)
{
int v2; // eax
int v3; // r14d
__int64 v4; // rdi
__int64 Container; // rax
float v6; // xmm0_4
unsigned int v7; // r14d
unsigned int v8; // r15d
int v9; // r13d
__int64 v10; // rax
float v11; // xmm0_4
float v12; // xmm1_4
float v13; // xmm0_4
__int64 v14; // rax
float v15; // xmm0_4
unsigned int v16; // r12d
__int64 v17; // r13
__int64 v18; // r13
unsigned int Idx; // eax
unsigned int v20; // eax
__int64 v21; // rax
__int64 v22; // rcx
__int64 v23; // rax
__int64 v24; // rdx
unsigned __int64 v25; // [rsp+8h] [rbp-58h] BYREF
__int128 v26; // [rsp+10h] [rbp-50h]
float v27; // [rsp+2Ch] [rbp-34h]
double v28[6]; // [rsp+30h] [rbp-30h] BYREF
v2 = (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 640) + 40LL))(*(_QWORD *)(a1 + 640), a1);
if ( v2 )
{
v3 = v2;
v4 = *(_QWORD *)(a1 + 648);
if ( v4 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 16LL))(v4, a1);
cocos2d::extension::CCScrollView::getContentOffset(&v25, a1);
sub_1002783B0(v28, &v25, (__m128)0xBF800000);
if ( !*(_DWORD *)(a1 + 584) )
{
LODWORD(v26) = HIDWORD(v28[0]);
v27 = *(float *)(a1 + 508);
Container = cocos2d::extension::CCScrollView::getContainer(a1);
v6 = (*(float (__fastcall **)(__int64))(*(_QWORD *)Container + 152LL))(Container);
*((float *)v28 + 1) = (float)(v27 / v6) + *(float *)&v26;
}
v7 = v3 - 1;
sub_1002782D0(&v25, v28);
v8 = cocos2d::extension::CCTableView::_indexFromOffset(a1, (__int64)&v25);
v9 = *(_DWORD *)(a1 + 584);
v26 = *(unsigned int *)(a1 + 508);
v10 = cocos2d::extension::CCScrollView::getContainer(a1);
v11 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v10 + 152LL))(v10);
v12 = *(float *)&v26 / v11;
v13 = *(float *)&v26 / v11;
if ( !v9 )
v13 = -v12;
if ( v8 == -1 )
v8 = v7;
*((float *)v28 + 1) = v13 + *((float *)v28 + 1);
LODWORD(v26) = *(_DWORD *)(a1 + 504);
v14 = cocos2d::extension::CCScrollView::getContainer(a1);
v15 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v14 + 136LL))(v14);
*(float *)v28 = (float)(*(float *)&v26 / v15) + *(float *)v28;
sub_1002782D0(&v25, v28);
v16 = cocos2d::extension::CCTableView::_indexFromOffset(a1, (__int64)&v25);
if ( v16 == -1 )
v16 = v7;
while ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 624)) )
{
v17 = sub_1007FEFE0(*(_QWORD *)(a1 + 624), 0);
if ( (unsigned int)cocos2d::extension::CCTableViewCell::getIdx(v17) >= v8 )
break;
cocos2d::extension::CCTableView::_moveCellOutOfSight((_QWORD *)a1, v17);
}
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 624)) )
{
v18 = sub_1007FF000(*(_QWORD *)(a1 + 624));
Idx = cocos2d::extension::CCTableViewCell::getIdx(v18);
if ( Idx <= v7 && Idx > v16 )
{
do
{
cocos2d::extension::CCTableView::_moveCellOutOfSight((_QWORD *)a1, v18);
if ( !(unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 624)) )
break;
v18 = sub_1007FF000(*(_QWORD *)(a1 + 624));
v20 = cocos2d::extension::CCTableViewCell::getIdx(v18);
if ( v20 > v7 )
break;
}
while ( v20 > v16 );
}
}
while ( v8 <= v16 )
{
v21 = *(_QWORD *)(a1 + 592);
v22 = *(_QWORD *)(v21 + 8);
if ( !v22 )
goto LABEL_21;
v23 = v21 + 8;
v24 = v23;
do
{
if ( *(_DWORD *)(v22 + 28) >= v8 )
v24 = v22;
v22 = *(_QWORD *)(v22 + 8LL * (*(_DWORD *)(v22 + 28) < v8));
}
while ( v22 );
if ( v24 == v23 || v8 < *(_DWORD *)(v24 + 28) )
LABEL_21:
cocos2d::extension::CCTableView::updateCellAtIndex(a1, v8);
++v8;
}
}
}