//
// TableView::checkLastCell from 0x100300018 to 0x100300444 (1068 bytes)
//
// 2 xrefs:
// > TableView::checkBoundaryOfContent @ 0x1002ff908
// > TableView::checkBoundaryOfContent @ 0x1002ff93c
//
// 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::checkLastCell(TableView *a1, TableViewCell *a2)
{
__int64 *v4; // x0
float v5; // s0
float v6; // s8
float v7; // s8
CCIndexPath *v8; // x20
float v9; // s8
__int64 v10; // x21
float v11; // s9
__n128 v12; // q1
__n128 v13; // q0
__n128 v14; // q0
__n128 v15; // q1
float v16; // s10
double *v17; // x0
CCContentLayer *m_contentLayer; // x23
double *v19; // x0
signed int v20; // w25
__int64 v21; // x24
__int64 v22; // x23
int v23; // w25
unsigned __int32 v24; // s9
__n128 v25; // q1
__n128 v26; // q0
double v27; // d0
__n128 v28; // q0
__n128 v29; // q1
__int64 *v30; // x0
unsigned __int32 v31; // s9
float v32; // s11
__n128 v33; // q1
__n128 v34; // q0
double v35; // d0
int v36; // w8
float *v37; // x0
__int128 v38; // q0
__int128 v39; // q2
TableViewDelegate *m_tableDelegate; // x0
TableViewDelegate *v41; // x0
double v42; // [xsp+8h] [xbp-88h] BYREF
__int64 v43; // [xsp+10h] [xbp-80h] BYREF
__int64 v44; // [xsp+18h] [xbp-78h] BYREF
int v45; // [xsp+20h] [xbp-70h] BYREF
float v46; // [xsp+24h] [xbp-6Ch]
__int64 v47; // [xsp+28h] [xbp-68h] BYREF
if ( TableView::checkBoundaryOfCell_1(a1, a2) != 1 )
{
v4 = (__int64 *)((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2);
v5 = sub_1000229B8(&v47, v4);
v6 = *((float *)&v47 + 1);
v7 = v6
- *(float *)(((__int64 (__fastcall *)(CCContentLayer *, float))a1->m_contentLayer->getContentSize)(
a1->m_contentLayer,
v5)
+ 4);
if ( (float)(v7
+ *(float *)(((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getPosition)(a1->m_contentLayer)
+ 4)) > 0.0 )
{
v8 = CCIndexPath::CCIndexPathWithSectionRow(a2->m_indexPath.m_section, a2->m_indexPath.m_row + 1);
if ( v8->m_row < ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
(unsigned int)a2->m_indexPath.m_section,
a1)
&& !TableView::isDuplicateInVisibleCellArray(a1, v8) )
{
v9 = ((float (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v8,
a1);
v10 = ((__int64 (__fastcall *)(TableViewDataSource *, CCIndexPath *, TableView *))a1->m_dataSource->cellForRowAtIndexPath)(
a1->m_dataSource,
v8,
a1);
v11 = *(float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1) * -0.5;
v12.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2) + 4) - v9;
v13.n128_f32[0] = v11;
sub_100022980(v13, v12, &v45);
v16 = v46;
if ( v46 < 0.0 && !TableView::isDuplicateIndexPath(a1, v8) )
{
v17 = (double *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_100022AFC(&v44, v17);
m_contentLayer = a1->m_contentLayer;
sub_100022988((float *)&v43, *(float *)&v44, *((float *)&v44 + 1) - v16);
((void (__fastcall *)(CCContentLayer *, __int64 *))m_contentLayer->setContentSize)(m_contentLayer, &v43);
v19 = (double *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_100022B14(&v44, v19);
v20 = sub_10024A36C((__int64)a1->m_cellArray) - 1;
if ( v20 >= 0 )
{
v21 = 0;
do
{
v22 = sub_10024A388((__int64)a1->m_cellArray, v20);
sub_1000229B0(&v43);
v23 = v20 + 1;
if ( v23 == (unsigned int)sub_10024A36C((__int64)a1->m_cellArray) )
{
v24 = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL))(v22);
v25.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2) + 4) - v16;
v26.n128_u32[0] = v24;
sub_100022980(v26, v25, &v42);
v27 = sub_1000229D0(&v43, &v42);
v28.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v22 + 192LL))(
v22,
v27);
v29.n128_f32[0] = *((float *)&v43 + 1) - v9;
sub_100022980(v28, v29, &v42);
v30 = (__int64 *)&v45;
}
else
{
v31 = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL))(v22);
v32 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
v33.n128_f32[0] = v32
+ *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 312LL))(v21) + 4);
v34.n128_u32[0] = v31;
sub_100022980(v34, v33, &v42);
v30 = &v43;
}
v35 = sub_1000229D0(v30, &v42);
(*(void (__fastcall **)(__int64, __int64 *, double))(*(_QWORD *)v22 + 184LL))(v22, &v43, v35);
v36 = v23 - 1;
v20 = v23 - 2;
v21 = v22;
}
while ( v36 > 0 );
}
}
if ( v10 )
{
v14.n128_u32[0] = 0;
v15.n128_u32[0] = 1.0;
sub_100022980(v14, v15, &v44);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 280LL))(v10, &v44);
v37 = (float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1);
sub_100022988((float *)&v44, *v37, v9);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 304LL))(v10, &v44);
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v10 + 184LL))(v10, &v45);
v38 = *(_OWORD *)&v8->m_uID;
v39 = *(_OWORD *)&v8->m_unknown2;
*(_OWORD *)(v10 + 448) = *(_OWORD *)&v8->m_uAutoReleaseCount;
*(_OWORD *)(v10 + 464) = v39;
*(_OWORD *)(v10 + 432) = v38;
*(_QWORD *)(v10 + 480) = *(_QWORD *)&v8->m_row;
sub_10024A2D0((__int64)a1->m_cellArray);
if ( !TableView::isDuplicateIndexPath(a1, v8) )
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,
v8,
v10,
a1);
((void (__fastcall *)(CCContentLayer *, __int64))a1->m_contentLayer->addChild)(a1->m_contentLayer, v10);
v41 = a1->m_tableDelegate;
if ( v41 )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, __int64, TableView *))v41->TableViewDidDisplayCellForRowAtIndexPath)(
v41,
v8,
v10,
a1);
}
}
}
}
}