//
// TableView::checkLastCell from 0x140076630 to 0x140076aed (1213 bytes)
//
// 3 xrefs:
// > TableView::checkBoundaryOfContent @ 0x140075e9d
// > TableView::checkBoundaryOfContent @ 0x140075ef0
// > ??> @ 0x1406c64b0
//
// 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
//
// Hidden C++ exception states: #wind=1
void TableView::checkLastCell(TableView *a1, TableViewCell *a2)
{
const struct cocos2d::CCPoint *v4; // rax
const cocos2d::CCSize *v5; // rax
float v6; // xmm6_4
int v7; // edi
int m_section; // ebx
CCIndexPath *v9; // r14
__int64 v10; // rax
double v11; // xmm0_8
float v12; // xmm9_4
TableViewCell *v13; // r13
float y; // xmm6_4
const cocos2d::CCSize *v15; // rax
float v16; // xmm8_4
struct cocos2d::CCObject *v17; // r15
const struct cocos2d::CCSize *v18; // rax
CCContentLayer_vtbl *v19; // rbx
const cocos2d::CCSize *v20; // rax
const cocos2d::CCSize *v21; // rax
signed int i; // ebp
struct cocos2d::CCObject *v23; // rdi
float v24; // xmm6_4
float *v25; // rax
__int64 v26; // rax
float v27; // xmm6_4
float *v28; // rax
__int64 v29; // rax
cocos2d::CCPoint *v30; // rcx
__int64 v31; // rbx
__int64 v32; // rax
float v33; // xmm6_4
float v34; // xmm7_4
float *v35; // rax
TableViewCell_vtbl *v36; // rbx
const cocos2d::CCPoint *v37; // rax
TableViewCell_vtbl *v38; // rbx
const cocos2d::CCSize *v39; // rax
const cocos2d::CCSize *v40; // rax
TableViewDelegate *m_tableDelegate; // rcx
TableViewDelegate *v42; // rcx
cocos2d::CCPoint v43; // [rsp+20h] [rbp-B8h] BYREF
cocos2d::CCPoint v44; // [rsp+28h] [rbp-B0h] BYREF
cocos2d::CCPoint v45; // [rsp+30h] [rbp-A8h] BYREF
cocos2d::CCPoint v46; // [rsp+38h] [rbp-A0h] BYREF
cocos2d::CCPoint v47; // [rsp+40h] [rbp-98h] BYREF
CCIndexPath *v48; // [rsp+F0h] [rbp+18h] BYREF
cocos2d::CCSize v49; // [rsp+F8h] [rbp+20h] BYREF
if ( TableView::checkBoundaryOfCell_1(a1, a2) != 1 )
{
v4 = a2->getPosition_0(a2);
cocos2d::CCPoint::CCPoint(&v44, v4);
v5 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
v6 = v44.y - v5->height;
if ( (float)(v6 + a1->m_contentLayer->getPosition_0(a1->m_contentLayer)->y) > 0.0 )
{
v7 = a2->m_indexPath.m_row + 1;
m_section = a2->m_indexPath.m_section;
v9 = (CCIndexPath *)operator new(0x40u);
v48 = v9;
cocos2d::CCObject::CCObject(v9);
v9->__vftable = (CCIndexPath_vtbl *)&CCIndexPath::`vftable';
v9->m_row = v7;
v9->m_section = m_section;
cocos2d::CCObject::autorelease(v9);
if ( v9->m_row < ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
(unsigned int)a2->m_indexPath.m_section,
a1) )
{
LOBYTE(v10) = TableView::isDuplicateInVisibleCellArray(a1, v9);
if ( !v10 )
{
v11 = ((double (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v9,
a1);
v12 = *(float *)&v11;
v13 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v9, a1);
y = a2->getPosition_0(a2)->y;
v15 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v43, (float)-v15->width * 0.5, y - *(float *)&v11);
v16 = v43.y;
v17 = nullptr;
if ( v43.y < 0.0 && !TableView::isDuplicateIndexPath(a1, v9) )
{
v18 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
cocos2d::CCSize::CCSize(&v49, v18);
v19 = a1->m_contentLayer->CCScrollLayerExt::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v48, v49.width, v49.height - v16);
v19->setContentSize(a1->m_contentLayer, v20);
v21 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
cocos2d::CCSize::operator=(&v49, v21);
for ( i = cocos2d::CCArray::count(a1->m_cellArray) - 1; i >= 0; --i )
{
v23 = cocos2d::CCArray::objectAtIndex(a1->m_cellArray, i);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48);
if ( i == cocos2d::CCArray::count(a1->m_cellArray) - 1 )
{
v24 = a2->getPosition_0(a2)->y;
v25 = (float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v23->__vftable[2].getTag)(v23);
cocos2d::CCPoint::CCPoint(&v45, *v25, v24 - v16);
cocos2d::CCPoint::operator=(&v48, v26);
v27 = *((float *)&v48 + 1) - v12;
v28 = (float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v23->__vftable[2].getTag)(v23);
cocos2d::CCPoint::CCPoint(&v46, *v28, v27);
v30 = &v43;
}
else
{
v31 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v17->__vftable[4].isEqual)(v17);
v32 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v17->__vftable[2].getTag)(v17);
v33 = *(float *)(v31 + 4);
v34 = *(float *)(v32 + 4);
v35 = (float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v23->__vftable[2].getTag)(v23);
cocos2d::CCPoint::CCPoint(&v47, *v35, v34 + v33);
v30 = (cocos2d::CCPoint *)&v48;
}
cocos2d::CCPoint::operator=(v30, v29);
v23->__vftable[2].encodeWithCoder(v23, (DS_Dictionary *)&v48);
v17 = v23;
}
}
if ( v13 )
{
v36 = v13->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48, 0.0, 1.0);
v36->setAnchorPoint(v13, v37);
v38 = v13->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v39 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v48, v39->width, v12);
v38->setContentSize(v13, v40);
v13->setPosition_0(v13, &v43);
cocos2d::CCObject::operator=(&v13->m_indexPath, v9);
v13->m_indexPath.m_row = v9->m_row;
v13->m_indexPath.m_section = v9->m_section;
cocos2d::CCArray::addObject(a1->m_cellArray, v13);
if ( !TableView::isDuplicateIndexPath(a1, v9) )
cocos2d::CCArray::addObject(a1->m_indexPathArray, v9);
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath(m_tableDelegate, v9, v13, a1);
a1->m_contentLayer->addChild_1(a1->m_contentLayer, v13);
v42 = a1->m_tableDelegate;
if ( v42 )
v42->TableViewDidDisplayCellForRowAtIndexPath(v42, v9, v13, a1);
}
}
}
}
}
}