//
// TableView::checkFirstCell from 0x100300444 to 0x1003006dc (664 bytes)
//
// 2 xrefs:
// > TableView::checkBoundaryOfContent @ 0x1002ff918
// > TableView::checkBoundaryOfContent @ 0x1002ff95c
//
// 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::checkFirstCell(TableView *a1, TableViewCell *a2)
{
__int64 *v4; // x0
float v5; // s0
float v6; // s8
float v7; // s8
float v8; // s8
float v9; // s8
CCIndexPath *v10; // x20
int v11; // w0
int m_row; // w8
float v13; // s8
__int64 v14; // x0
__n128 v15; // q0
__n128 v16; // q1
__int64 v17; // x22
float *v18; // x0
float v19; // s8
__n128 v20; // q1
__n128 v21; // q0
__int128 v22; // q0
__int128 v23; // q2
TableViewDelegate *m_tableDelegate; // x0
TableViewDelegate *v25; // x0
int v26; // [xsp+0h] [xbp-40h] BYREF
__int64 v27; // [xsp+8h] [xbp-38h] BYREF
if ( TableView::checkBoundaryOfCell_1(a1, a2) != 1 )
{
v4 = (__int64 *)((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2);
v5 = sub_1000229B8(&v27, v4);
v6 = *((float *)&v27 + 1);
v7 = v6 + *(float *)(((__int64 (__fastcall *)(TableViewCell *, float))a2->getContentSize)(a2, v5) + 4);
v8 = v7
- *(float *)(((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer)
+ 4);
v9 = v8
+ *(float *)(((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getPosition)(a1->m_contentLayer) + 4);
if ( v9 < *(float *)(((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1) + 4) )
{
v10 = CCIndexPath::CCIndexPathWithSectionRow(a2->m_indexPath.m_section, a2->m_indexPath.m_row - 1);
v11 = ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
(unsigned int)a2->m_indexPath.m_section,
a1);
m_row = v10->m_row;
if ( (m_row & 0x80000000) == 0 && m_row < v11 && !TableView::isDuplicateInVisibleCellArray(a1, v10) )
{
v13 = ((float (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v10,
a1);
v14 = ((__int64 (__fastcall *)(TableViewDataSource *, CCIndexPath *, TableView *))a1->m_dataSource->cellForRowAtIndexPath)(
a1->m_dataSource,
v10,
a1);
if ( v14 )
{
v17 = v14;
v15.n128_u32[0] = 0;
v16.n128_u32[0] = 1.0;
sub_100022980(v15, v16, &v26);
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v17 + 280LL))(v17, &v26);
v18 = (float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1);
sub_100022988((float *)&v26, *v18, v13);
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v17 + 304LL))(v17, &v26);
v19 = *(float *)(((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2) + 4);
v20.n128_f32[0] = v19 + *(float *)(((__int64 (__fastcall *)(TableViewCell *))a2->getContentSize)(a2) + 4);
v21.n128_u32[0] = 0;
sub_100022980(v21, v20, &v26);
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v17 + 184LL))(v17, &v26);
v22 = *(_OWORD *)&v10->m_uID;
v23 = *(_OWORD *)&v10->m_unknown2;
*(_OWORD *)(v17 + 448) = *(_OWORD *)&v10->m_uAutoReleaseCount;
*(_OWORD *)(v17 + 464) = v23;
*(_OWORD *)(v17 + 432) = v22;
*(_QWORD *)(v17 + 480) = *(_QWORD *)&v10->m_row;
sub_10024A428((__int64)a1->m_cellArray);
if ( !TableView::isDuplicateIndexPath(a1, v10) )
sub_10024A428((__int64)a1->m_indexPathArray);
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, __int64, TableView *))m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath)(
m_tableDelegate,
v10,
v17,
a1);
((void (__fastcall *)(CCContentLayer *, __int64))a1->m_contentLayer->addChild)(a1->m_contentLayer, v17);
v25 = a1->m_tableDelegate;
if ( v25 )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, __int64, TableView *))v25->TableViewDidDisplayCellForRowAtIndexPath)(
v25,
v10,
v17,
a1);
}
}
}
}
}