//
// TableView::checkLastCell from 0x100623b60 to 0x1006240ee (1422 bytes)
//
// 2 xrefs:
// > TableView::checkBoundaryOfContent @ 0x100622e58
// > TableView::checkBoundaryOfContent @ 0x100622f9a
//
// 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)
{
double *v4; // rsi
__int64 v5; // rax
__int64 v6; // rax
int m_row; // r12d
int m_section; // r14d
char *v9; // r13
cocos2d::CCArray *m_cellArray; // rdi
unsigned int v11; // r14d
__int64 v12; // rax
__int64 v13; // r12
__int64 v14; // rax
cocos2d::CCArray *m_indexPathArray; // rdi
unsigned int v16; // r14d
__int64 v17; // rax
_QWORD *v18; // rax
CCContentLayer *m_contentLayer; // r12
_QWORD *v20; // rax
int v21; // r13d
__int64 v22; // r12
__int64 v23; // rax
float *v24; // rdi
double v25; // xmm0_8
int v26; // eax
__int64 v27; // r14
int v28; // r13d
__int64 v29; // rax
double v30; // xmm0_8
float *v31; // rax
float *v32; // rax
__int128 v33; // xmm0
__int128 v34; // xmm1
cocos2d::CCArray *v35; // rdi
unsigned int v36; // r14d
__int64 v37; // rax
TableViewDelegate *m_tableDelegate; // rdi
TableViewDelegate *v39; // rdi
__int64 v40; // [rsp+0h] [rbp-70h] BYREF
double v41; // [rsp+8h] [rbp-68h] BYREF
char *v42; // [rsp+10h] [rbp-60h]
__int64 v43; // [rsp+18h] [rbp-58h]
float v44; // [rsp+20h] [rbp-50h] BYREF
float v45; // [rsp+24h] [rbp-4Ch]
float v46; // [rsp+28h] [rbp-48h]
__int64 v47; // [rsp+2Ch] [rbp-44h] BYREF
__int64 v48; // [rsp+34h] [rbp-3Ch] BYREF
float v49; // [rsp+3Ch] [rbp-34h]
float v50; // [rsp+40h] [rbp-30h]
float v51; // [rsp+44h] [rbp-2Ch]
if ( TableView::checkBoundaryOfCell_1(a1, a2) != 1 )
{
v4 = (double *)((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2);
sub_10028CC60(&v40, v4);
v51 = *((float *)&v40 + 1);
v5 = ((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
v51 = v51 - *(float *)(v5 + 4);
v6 = ((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getPosition)(a1->m_contentLayer);
if ( (float)(v51 + *(float *)(v6 + 4)) > 0.0 )
{
m_row = a2->m_indexPath.m_row;
m_section = a2->m_indexPath.m_section;
v9 = (char *)operator new(0x40u);
cocos2d::CCObject::CCObject((__int64)v9);
*(_QWORD *)v9 = off_1009829A8;
*((_DWORD *)v9 + 14) = m_row + 1;
*((_DWORD *)v9 + 15) = m_section;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v9);
if ( *((_DWORD *)v9 + 14) < ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
(unsigned int)a2->m_indexPath.m_section,
a1) )
{
m_cellArray = a1->m_cellArray;
if ( m_cellArray && (unsigned int)sub_100720070(m_cellArray) && (unsigned int)sub_100720070(a1->m_cellArray) )
{
v11 = 0;
while ( 1 )
{
v12 = sub_1007200C0(a1->m_cellArray, v11);
if ( *(_DWORD *)(v12 + 484) == *((_DWORD *)v9 + 15) && *(_DWORD *)(v12 + 480) == *((_DWORD *)v9 + 14) )
break;
if ( ++v11 >= (unsigned int)sub_100720070(a1->m_cellArray) )
goto LABEL_12;
}
}
else
{
LABEL_12:
v50 = ((float (__fastcall *)(TableViewDelegate *, char *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v9,
a1);
v13 = ((__int64 (__fastcall *)(TableViewDataSource *, char *, TableView *))a1->m_dataSource->cellForRowAtIndexPath)(
a1->m_dataSource,
v9,
a1);
v51 = *(float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1) * -0.5;
v14 = ((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2);
sub_10028CBE0(&v44, v51, *(float *)(v14 + 4) - v50);
v49 = v45;
if ( v45 < 0.0 )
{
m_indexPathArray = a1->m_indexPathArray;
if ( m_indexPathArray
&& (unsigned int)sub_100720070(m_indexPathArray)
&& (unsigned int)sub_100720070(a1->m_indexPathArray) )
{
v16 = 0;
while ( 1 )
{
v17 = sub_1007200C0(a1->m_indexPathArray, v16);
if ( *(_DWORD *)(v17 + 60) == *((_DWORD *)v9 + 15) && *(_DWORD *)(v17 + 56) == *((_DWORD *)v9 + 14) )
break;
if ( ++v16 >= (unsigned int)sub_100720070(a1->m_indexPathArray) )
goto LABEL_21;
}
}
else
{
LABEL_21:
v43 = v13;
v42 = v9;
v18 = (_QWORD *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_10028CFC0(&v47, v18);
m_contentLayer = a1->m_contentLayer;
sub_10028CBF0((float *)&v48, *(float *)&v47, *((float *)&v47 + 1) - v49);
((void (__fastcall *)(CCContentLayer *, __int64 *))m_contentLayer->setContentSize)(m_contentLayer, &v48);
v20 = (_QWORD *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_10028CFF0(&v47, v20);
v21 = sub_100720070(a1->m_cellArray) - 1;
if ( v21 >= 0 )
{
v22 = 0;
do
{
v27 = sub_1007200C0(a1->m_cellArray, (unsigned int)v21);
sub_10028CC30(&v48);
v28 = v21 + 1;
if ( v28 == (unsigned int)sub_100720070(a1->m_cellArray) )
{
v51 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 192LL))(v27);
v29 = ((__int64 (__fastcall *)(TableViewCell *))a2->getPosition)(a2);
sub_10028CBE0((float *)&v41, v51, *(float *)(v29 + 4) - v49);
v30 = sub_10028CC90(&v48, &v41);
v31 = (float *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v27 + 192LL))(v27, v30);
sub_10028CBE0((float *)&v41, *v31, *((float *)&v48 + 1) - v50);
v24 = &v44;
}
else
{
v51 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 192LL))(v27);
v46 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL))(v22) + 4);
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 312LL))(v22);
sub_10028CBE0((float *)&v41, v51, v46 + *(float *)(v23 + 4));
v24 = (float *)&v48;
}
v25 = sub_10028CC90(v24, &v41);
(*(void (__fastcall **)(__int64, __int64 *, double))(*(_QWORD *)v27 + 184LL))(v27, &v48, v25);
v26 = v28 - 1;
v21 = v28 - 2;
v22 = v27;
}
while ( v26 > 0 );
}
v9 = v42;
v13 = v43;
}
}
if ( v13 )
{
sub_10028CBE0((float *)&v47, 0.0, 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 280LL))(v13, &v47);
v32 = (float *)((__int64 (__fastcall *)(TableView *))a1->getContentSize)(a1);
sub_10028CBF0((float *)&v47, *v32, v50);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 304LL))(v13, &v47);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v13 + 184LL))(v13, &v44);
v33 = *(_OWORD *)(v9 + 8);
v34 = *(_OWORD *)(v9 + 24);
*(_OWORD *)(v13 + 464) = *(_OWORD *)(v9 + 40);
*(_OWORD *)(v13 + 448) = v34;
*(_OWORD *)(v13 + 432) = v33;
*(_QWORD *)(v13 + 480) = *((_QWORD *)v9 + 7);
sub_10071FCD0(a1->m_cellArray, v13);
v35 = a1->m_indexPathArray;
if ( v35 && (unsigned int)sub_100720070(v35) && (unsigned int)sub_100720070(a1->m_indexPathArray) )
{
v36 = 0;
while ( 1 )
{
v37 = sub_1007200C0(a1->m_indexPathArray, v36);
if ( *(_DWORD *)(v37 + 60) == *((_DWORD *)v9 + 15) && *(_DWORD *)(v37 + 56) == *((_DWORD *)v9 + 14) )
break;
if ( ++v36 >= (unsigned int)sub_100720070(a1->m_indexPathArray) )
goto LABEL_37;
}
}
else
{
LABEL_37:
sub_10071FCD0(a1->m_indexPathArray, v9);
}
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
((void (__fastcall *)(TableViewDelegate *, char *, __int64, TableView *))m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath)(
m_tableDelegate,
v9,
v13,
a1);
((void (__fastcall *)(CCContentLayer *, __int64))a1->m_contentLayer->addChild)(a1->m_contentLayer, v13);
v39 = a1->m_tableDelegate;
if ( v39 )
((void (__fastcall *)(TableViewDelegate *, char *, __int64, TableView *))v39->TableViewDidDisplayCellForRowAtIndexPath)(
v39,
v9,
v13,
a1);
}
}
}
}
}
}