//
// TableView::checkBoundaryOfContent from 0x1002ff5f8 to 0x1002ffb68 (1392 bytes)
//
// 3 xrefs:
// > TableView::ccTouchBegan @ 0x1002ff5bc
// > TableView::ccTouchEnded @ 0x1002ffbc4
// > TableView::ccTouchCancelled @ 0x1002ffce4
//
// 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
//
void __fastcall TableView::checkBoundaryOfContent(TableView *a1, float a2)
{
int v3; // w22
cocos2d::CCArray *m_cellArray; // x0
bool v5; // cc
int v6; // w0
int v7; // w21
__int64 *v8; // x0
float v9; // s0
float v10; // s8
float v11; // s8
CCIndexPath *v12; // x0
int m_row; // w8
CCIndexPath *v14; // x20
float v15; // s8
__int64 v16; // x0
__n128 v17; // q0
__n128 v18; // q1
__int64 v19; // x21
float *v20; // x0
__n128 v21; // q1
__n128 v22; // q0
__int128 v23; // q0
__int128 v24; // q2
TableViewDelegate *v25; // x0
TableViewDelegate *v26; // x0
void (*TableViewDidDisplayCellForRowAtIndexPath)(void); // x8
__int64 v28; // x20
TableViewCell *v29; // x21
int v30; // w22
CCIndexPath *v31; // x0
CCIndexPath *v32; // x20
float v33; // s8
__int64 v34; // x0
__n128 v35; // q0
__n128 v36; // q1
__int64 v37; // x22
float *v38; // x0
float v39; // s0
__int128 v40; // q0
__int128 v41; // q2
cocos2d::CCArray *v42; // x0
TableViewDelegate *m_tableDelegate; // x0
TableViewDelegate *v44; // x0
__int64 v45; // [xsp+8h] [xbp-C8h] BYREF
cocos2d::CCObject v46; // [xsp+10h] [xbp-C0h] BYREF
int v47; // [xsp+48h] [xbp-88h]
int v48; // [xsp+4Ch] [xbp-84h]
cocos2d::CCObject v49; // [xsp+50h] [xbp-80h] BYREF
__int64 v50; // [xsp+88h] [xbp-48h]
v3 = sub_10024A36C((__int64)a1->m_cellArray);
m_cellArray = a1->m_cellArray;
if ( m_cellArray )
v5 = v3 < 1;
else
v5 = 1;
if ( !v5 )
{
v28 = sub_10024A388((__int64)m_cellArray, 0);
v29 = (TableViewCell *)sub_10024A388((__int64)a1->m_cellArray, v3 - 1);
if ( v3 == 1 )
{
v30 = ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
*(unsigned int *)(v28 + 484),
a1);
cocos2d::CCObject::CCObject((__int64)&v49);
v49.__vftable = (cocos2d::CCObject_vtbl *)&off_100769118;
v50 = 0;
cocos2d::CCObject::CCObject((__int64)&v46);
v46.__vftable = (cocos2d::CCObject_vtbl *)&off_100769118;
v47 = v30 - 1;
v48 = 0;
if ( *(_QWORD *)(v28 + 480) == v50 )
{
TableView::checkLastCell(a1, v29);
}
else if ( !v29->m_indexPath.m_section && v29->m_indexPath.m_row == v30 - 1 )
{
TableView::checkFirstCell(a1, (TableViewCell *)v28);
}
cocos2d::CCObject::dCCObject(&v46);
cocos2d::CCObject::dCCObject(&v49);
}
else
{
TableView::checkFirstCell(a1, (TableViewCell *)v28);
TableView::checkLastCell(a1, v29);
}
return;
}
v6 = ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
0,
a1);
if ( !v6 )
return;
v7 = v6;
v8 = (__int64 *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getPosition)(a1->m_contentLayer);
v9 = sub_1000229B8((__int64 *)&v49, v8);
v10 = *((float *)&v49.__vftable + 1);
if ( (float)(v10
- *(float *)(((__int64 (__fastcall *)(CCContentLayer *, float))a1->m_contentLayer->getContentSize)(
a1->m_contentLayer,
v9)
+ 4)) >= 0.0 )
{
v31 = CCIndexPath::CCIndexPathWithSectionRow(0, v7 - 1);
if ( v31->m_row < v7 )
{
v32 = v31;
if ( !TableView::isDuplicateInVisibleCellArray(a1, v31) )
{
v33 = ((float (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v32,
a1);
sub_1000229B8((__int64 *)&v46, (__int64 *)&a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (cocos2d::CCPoint *)&v46, v33) != 1 )
{
v34 = ((__int64 (__fastcall *)(TableViewDataSource *, CCIndexPath *, TableView *))a1->m_dataSource->cellForRowAtIndexPath)(
a1->m_dataSource,
v32,
a1);
if ( v34 )
{
v37 = v34;
v35.n128_u32[0] = 0;
v36.n128_u32[0] = 1.0;
sub_100022980(v35, v36, &v45);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v37 + 280LL))(v37, &v45);
v38 = (float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1);
sub_100022988((float *)&v45, *v38 * 0.5, v33);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v37 + 304LL))(v37, &v45);
v39 = sub_1000229B8(&v45, (__int64 *)&a1->m_lastCellPos);
(*(void (__fastcall **)(__int64, __int64 *, float))(*(_QWORD *)v37 + 184LL))(v37, &v45, v39);
v40 = *(_OWORD *)&v32->m_uID;
v41 = *(_OWORD *)&v32->m_unknown2;
*(_OWORD *)(v37 + 448) = *(_OWORD *)&v32->m_uAutoReleaseCount;
*(_OWORD *)(v37 + 464) = v41;
*(_OWORD *)(v37 + 432) = v40;
*(_QWORD *)(v37 + 480) = *(_QWORD *)&v32->m_row;
v42 = a1->m_cellArray;
if ( v7 == 1 )
{
sub_10024A428((__int64)v42);
if ( !TableView::isDuplicateIndexPath(a1, v32) )
sub_10024A428((__int64)a1->m_indexPathArray);
}
else
{
sub_10024A2D0((__int64)v42);
if ( !TableView::isDuplicateIndexPath(a1, v32) )
sub_10024A2D0((__int64)a1->m_indexPathArray);
}
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, __int64, TableView *))m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath)(
m_tableDelegate,
v32,
v37,
a1);
((void (__fastcall *)(CCContentLayer *, __int64))a1->m_contentLayer->addChild)(a1->m_contentLayer, v37);
v44 = a1->m_tableDelegate;
if ( v44 )
{
TableViewDidDisplayCellForRowAtIndexPath = (void (*)(void))v44->TableViewDidDisplayCellForRowAtIndexPath;
goto LABEL_41;
}
}
}
}
}
}
else
{
v11 = *((float *)&v49.__vftable + 1);
if ( v11 <= *(float *)(((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1) + 4) )
{
v12 = CCIndexPath::CCIndexPathWithSectionRow(0, 0);
m_row = v12->m_row;
if ( (m_row & 0x80000000) == 0 && m_row < v7 )
{
v14 = v12;
if ( !TableView::isDuplicateInVisibleCellArray(a1, v12) )
{
v15 = ((float (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v14,
a1);
sub_1000229B8((__int64 *)&v46, (__int64 *)&a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (cocos2d::CCPoint *)&v46, v15) != 1 )
{
v16 = ((__int64 (__fastcall *)(TableViewDataSource *, CCIndexPath *, TableView *))a1->m_dataSource->cellForRowAtIndexPath)(
a1->m_dataSource,
v14,
a1);
if ( v16 )
{
v19 = v16;
v17.n128_u32[0] = 0;
v18.n128_u32[0] = 1.0;
sub_100022980(v17, v18, &v45);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 280LL))(v19, &v45);
v20 = (float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1);
sub_100022988((float *)&v45, *v20, v15);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 304LL))(v19, &v45);
v21.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer)
+ 4)
- v15;
v22.n128_u32[0] = 0;
sub_100022980(v22, v21, &v45);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 184LL))(v19, &v45);
v23 = *(_OWORD *)&v14->m_uID;
v24 = *(_OWORD *)&v14->m_unknown2;
*(_OWORD *)(v19 + 448) = *(_OWORD *)&v14->m_uAutoReleaseCount;
*(_OWORD *)(v19 + 464) = v24;
*(_OWORD *)(v19 + 432) = v23;
*(_QWORD *)(v19 + 480) = *(_QWORD *)&v14->m_row;
sub_10024A428((__int64)a1->m_cellArray);
if ( !TableView::isDuplicateIndexPath(a1, v14) )
sub_10024A428((__int64)a1->m_indexPathArray);
v25 = a1->m_tableDelegate;
if ( v25 )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, __int64, TableView *))v25->TableViewWillDisplayCellForRowAtIndexPath)(
v25,
v14,
v19,
a1);
((void (__fastcall *)(CCContentLayer *, __int64))a1->m_contentLayer->addChild)(a1->m_contentLayer, v19);
v26 = a1->m_tableDelegate;
if ( v26 )
{
TableViewDidDisplayCellForRowAtIndexPath = (void (*)(void))v26->TableViewDidDisplayCellForRowAtIndexPath;
LABEL_41:
TableViewDidDisplayCellForRowAtIndexPath();
}
}
}
}
}
}
}
}