//
// cocos2d::extension::CCTableView::ccTouchBegan from 0x10041a770 to 0x10041a8cb (347 bytes)
//
// 2 xrefs:
// > sub_10041A8D0 @ 0x10041a8dc
// > ??> @ 0x100b3f5e0
//
// 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
//
__int64 __fastcall cocos2d::extension::CCTableView::ccTouchBegan(_QWORD *a1, __int64 a2, __m128 a3)
{
unsigned int v4; // ebx
__int64 Container; // rax
unsigned int v6; // eax
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rcx
__int64 v10; // rsi
char *v11; // rax
char *v12; // rax
__int64 v13; // rdi
__int64 v14; // rdi
__int64 v16; // [rsp+8h] [rbp-38h] BYREF
double v17[6]; // [rsp+10h] [rbp-30h] BYREF
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 352LL))(a1) )
return 0;
v4 = cocos2d::extension::CCScrollView::ccTouchBegan((__int64)a1, a2, a3);
if ( (unsigned int)sub_1007FEF90(a1[62]) != 1 )
{
if ( !a1[72] )
return v4;
v14 = a1[81];
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v14 + 48LL))(v14, a1);
LABEL_18:
a1[72] = 0;
return v4;
}
sub_1002782A0(&v16);
Container = cocos2d::extension::CCScrollView::getContainer((__int64)a1);
cocos2d::CCNode::convertTouchToNodeSpace(v17, Container, a2);
sub_100278300(&v16, v17);
sub_1002782D0(v17, &v16);
v6 = cocos2d::extension::CCTableView::_indexFromOffset((__int64)a1, (__int64)v17);
if ( v6 == -1 )
goto LABEL_18;
v7 = a1[74];
v8 = *(_QWORD *)(v7 + 8);
if ( !v8 )
goto LABEL_18;
v9 = v7 + 8;
v10 = v9;
do
{
if ( *(_DWORD *)(v8 + 28) >= v6 )
v10 = v8;
v8 = *(_QWORD *)(v8 + 8LL * (*(_DWORD *)(v8 + 28) < v6));
}
while ( v8 );
if ( v10 == v9 )
goto LABEL_18;
if ( *(_DWORD *)(v10 + 28) > v6 )
goto LABEL_18;
v11 = (char *)cocos2d::extension::CCArrayForObjectSorting::objectWithObjectID(a1[78], v6);
if ( !v11 )
goto LABEL_18;
v12 = v11 - 320;
a1[72] = v12;
v13 = a1[81];
if ( v13 )
(*(void (__fastcall **)(__int64, _QWORD *, char *))(*(_QWORD *)v13 + 40LL))(v13, a1, v12);
return v4;
}