//
// TableView::checkFirstCell from 0x140076380 to 0x140076625 (677 bytes)
//
// 3 xrefs:
// > TableView::checkBoundaryOfContent @ 0x140075ebf
// > TableView::checkBoundaryOfContent @ 0x140075ee5
// > ??> @ 0x1406c64a4
//
// 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::checkFirstCell(TableView *a1, TableViewCell *a2)
{
const struct cocos2d::CCPoint *v4; // rax
const cocos2d::CCSize *v5; // rax
float v6; // xmm6_4
float v7; // xmm6_4
float v8; // xmm6_4
int v9; // edi
int m_section; // ebx
CCIndexPath *v11; // r14
int v12; // eax
int m_row; // ecx
__int64 v14; // rax
double v15; // xmm0_8
float v16; // xmm6_4
TableViewCell *v17; // rax
TableViewCell *v18; // rbp
TableViewCell_vtbl *v19; // rbx
const cocos2d::CCPoint *v20; // rax
TableViewCell_vtbl *v21; // rbx
const cocos2d::CCSize *v22; // rax
const cocos2d::CCSize *v23; // rax
TableViewCell_vtbl *v24; // rdi
const cocos2d::CCSize *v25; // rbx
const cocos2d::CCPoint *v26; // rax
const cocos2d::CCPoint *v27; // rax
TableViewDelegate *m_tableDelegate; // rcx
TableViewDelegate *v29; // rcx
cocos2d::CCPoint v30; // [rsp+70h] [rbp+18h] BYREF
CCIndexPath *v31; // [rsp+78h] [rbp+20h] BYREF
if ( TableView::checkBoundaryOfCell_1(a1, a2) != 1 )
{
v4 = a2->getPosition_0(a2);
cocos2d::CCPoint::CCPoint(&v30, v4);
v5 = a2->getContentSize(a2);
v6 = v30.y + v5->height;
v7 = v6 - a1->m_contentLayer->getContentSize(a1->m_contentLayer)->height;
v8 = v7 + a1->m_contentLayer->getPosition_0(a1->m_contentLayer)->y;
if ( a1->getContentSize(a1)->height > v8 )
{
v9 = a2->m_indexPath.m_row - 1;
m_section = a2->m_indexPath.m_section;
v11 = (CCIndexPath *)operator new(0x40u);
v31 = v11;
cocos2d::CCObject::CCObject(v11);
v11->__vftable = (CCIndexPath_vtbl *)&CCIndexPath::`vftable';
v11->m_row = v9;
v11->m_section = m_section;
cocos2d::CCObject::autorelease(v11);
v12 = a1->m_dataSource->numberOfRowsInSection(a1->m_dataSource, a2->m_indexPath.m_section, a1);
m_row = v11->m_row;
if ( m_row >= 0 && m_row < v12 )
{
LOBYTE(v14) = TableView::isDuplicateInVisibleCellArray(a1, v11);
if ( !v14 )
{
v15 = ((double (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v11,
a1);
v16 = *(float *)&v15;
v17 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v11, a1);
v18 = v17;
if ( v17 )
{
v19 = v17->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 0.0, 1.0);
v19->setAnchorPoint(v18, v20);
v21 = v18->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v31, v22->width, v16);
v21->setContentSize(v18, v23);
v24 = v18->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v25 = a2->getContentSize(a2);
v26 = a2->getPosition_0(a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 0.0, v25->height + v26->y);
v24->setPosition_0(v18, v27);
cocos2d::CCObject::operator=(&v18->m_indexPath, v11);
v18->m_indexPath.m_row = v11->m_row;
v18->m_indexPath.m_section = v11->m_section;
cocos2d::CCArray::insertObject(a1->m_cellArray, v18, 0);
if ( !TableView::isDuplicateIndexPath(a1, v11) )
cocos2d::CCArray::insertObject(a1->m_indexPathArray, v11, 0);
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath(m_tableDelegate, v11, v18, a1);
a1->m_contentLayer->addChild_1(a1->m_contentLayer, v18);
v29 = a1->m_tableDelegate;
if ( v29 )
v29->TableViewDidDisplayCellForRowAtIndexPath(v29, v11, v18, a1);
}
}
}
}
}
}