//
// TableView::checkBoundaryOfContent from 0x57c584 to 0x57ccbc (1848 bytes)
//
// 5 xrefs:
// > ??> @ 0x75bd0
// > TableView::ccTouchBegan @ 0x57cd88
// > TableView::ccTouchEnded @ 0x57cde0
// > TableView::ccTouchCancelled @ 0x57ce4c
// > ??> @ 0x122beb8
//
// 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 TableView::checkBoundaryOfContent(TableView *a1, float a2)
{
int v3; // w0
bool v4; // cc
int v5; // w21
cocos2d::CCArray *m_cellArray; // x0
__int64 v7; // x22
__int64 v8; // x23
int v9; // w21
const cocos2d::CCPoint *v10; // x0
float y; // s8
__int64 v12; // x22
float v13; // s8
TableViewCell *v14; // x0
cocos2d::CCNode *v15; // x23
void (__fastcall *v16)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x26
const cocos2d::CCSize *v18; // x0
void (__fastcall *v19)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
float v20; // w14
float v21; // w13
float v22; // w12
float v23; // w11
float v24; // w10
float v25; // w9
float v26; // w8
float v27; // w7
float v28; // w6
float v29; // w5
float v30; // w4
float v31; // w3
float v32; // w2
cocos2d::CCArray *v33; // x0
TableViewDelegate *v34; // x0
TableViewDelegate *v35; // x0
unsigned int v36; // w26
float v37; // s8
__int64 v38; // x22
int v39; // w0
float v40; // s8
TableViewCell *v41; // x0
cocos2d::CCNode *v42; // x21
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x24
const cocos2d::CCSize *v45; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
const cocos2d::CCSize *v47; // x0
float v48; // w16
float v49; // w15
float v50; // w14
float v51; // w13
float v52; // w12
float v53; // w11
float v54; // w10
float v55; // w9
float v56; // w8
float v57; // w7
float v58; // w6
float v59; // w5
float v60; // w4
cocos2d::CCArray *v61; // x0
TableViewDelegate *m_tableDelegate; // x0
TableViewDelegate *v63; // x0
cocos2d::CCPoint v64; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCObject v65; // [xsp+68h] [xbp+68h] BYREF
__int64 v66; // [xsp+A0h] [xbp+A0h]
cocos2d::CCObject v67; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v68; // [xsp+E0h] [xbp+E0h]
v3 = cocos2d::CCArray::count(a1->m_cellArray);
v4 = v3 <= 0;
v5 = v3;
m_cellArray = a1->m_cellArray;
if ( v4 || !m_cellArray )
{
v9 = a1->m_dataSource->numberOfRowsInSection(a1->m_dataSource, 0, a1);
if ( v9 )
{
v10 = a1->m_contentLayer->getPosition(a1->m_contentLayer);
cocos2d::CCPoint::CCPoint(&v64, v10);
y = v64.y;
if ( (float)(y - a1->m_contentLayer->getContentSize(a1->m_contentLayer)->height) < 0.0 )
{
v37 = v64.y;
if ( v37 <= a1->getContentSize(a1)->height )
{
v38 = operator new(0x40u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v38);
*(_DWORD *)(v38 + 56) = 0;
*(_DWORD *)(v38 + 60) = 0;
*(_QWORD *)v38 = &off_113AA70;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v38);
v39 = *(_DWORD *)(v38 + 56);
if ( v9 > v39 && (v39 & 0x80000000) == 0 && !TableView::isDuplicateInVisibleCellArray(a1, (CCIndexPath *)v38) )
{
v40 = a1->m_tableDelegate->cellHeightForRowAtIndexPath(a1->m_tableDelegate, (CCIndexPath *)v38, a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, &a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (TableViewCell *)&v65) != 1 )
{
v41 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v38, a1);
v42 = v41;
if ( v41 )
{
setAnchorPoint = v41->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 0.0, 1.0);
setAnchorPoint(v42, (const cocos2d::CCPoint *)&v67);
setContentSize = v42->setContentSize;
v45 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v67, v45->width, v40);
setContentSize(v42, (const cocos2d::CCSize *)&v67);
setPosition = v42->setPosition;
v47 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 0.0, v47->height - v40);
setPosition(v42, (const cocos2d::CCPoint *)&v67);
v48 = *(float *)(v38 + 12);
v49 = *(float *)(v38 + 16);
v50 = *(float *)(v38 + 20);
v51 = *(float *)(v38 + 24);
v52 = *(float *)(v38 + 28);
v53 = *(float *)(v38 + 32);
v54 = *(float *)(v38 + 36);
v55 = *(float *)(v38 + 40);
v56 = *(float *)(v38 + 44);
v57 = *(float *)(v38 + 48);
v58 = *(float *)(v38 + 52);
v59 = *(float *)(v38 + 56);
v60 = *(float *)(v38 + 60);
v61 = a1->m_cellArray;
v42[1].m_obContentSize.height = *(float *)(v38 + 8);
v42[1].m_sAdditionalTransform.a = v48;
v42[1].m_sAdditionalTransform.b = v49;
v42[1].m_sAdditionalTransform.c = v50;
v42[1].m_sAdditionalTransform.d = v51;
v42[1].m_sAdditionalTransform.tx = v52;
v42[1].m_sAdditionalTransform.ty = v53;
v42[1].m_sTransform.a = v54;
v42[1].m_sTransform.b = v55;
v42[1].m_sTransform.c = v56;
v42[1].m_sTransform.d = v57;
v42[1].m_sTransform.tx = v58;
v42[1].m_sTransform.ty = v59;
v42[1].m_sInverse.a = v60;
cocos2d::CCArray::insertObject(v61, v42, 0);
if ( !TableView::isDuplicateIndexPath(a1, (CCIndexPath *)v38) )
cocos2d::CCArray::insertObject(a1->m_indexPathArray, (cocos2d::CCObject *)v38, 0);
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath(
m_tableDelegate,
(CCIndexPath *)v38,
(TableViewCell *)v42,
a1);
a1->m_contentLayer->addChild(a1->m_contentLayer, v42);
v63 = a1->m_tableDelegate;
if ( v63 )
v63->TableViewDidDisplayCellForRowAtIndexPath(v63, (CCIndexPath *)v38, (TableViewCell *)v42, a1);
}
}
}
}
}
else
{
v12 = operator new(0x40u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v12);
*(_DWORD *)(v12 + 56) = v9 - 1;
*(_DWORD *)(v12 + 60) = 0;
*(_QWORD *)v12 = &off_113AA70;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v12);
if ( v9 > *(_DWORD *)(v12 + 56) && !TableView::isDuplicateInVisibleCellArray(a1, (CCIndexPath *)v12) )
{
v13 = a1->m_tableDelegate->cellHeightForRowAtIndexPath(a1->m_tableDelegate, (CCIndexPath *)v12, a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, &a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (TableViewCell *)&v65) != 1 )
{
v14 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v12, a1);
v15 = v14;
if ( v14 )
{
v16 = v14->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 0.0, 1.0);
v16(v15, (const cocos2d::CCPoint *)&v67);
v17 = v15->setContentSize;
v18 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v67, v18->width * 0.5, v13);
v17(v15, (const cocos2d::CCSize *)&v67);
v19 = v15->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, &a1->m_lastCellPos);
v19(v15, (const cocos2d::CCPoint *)&v67);
v20 = *(float *)(v12 + 8);
v21 = *(float *)(v12 + 12);
v22 = *(float *)(v12 + 16);
v23 = *(float *)(v12 + 20);
v24 = *(float *)(v12 + 24);
v25 = *(float *)(v12 + 28);
v26 = *(float *)(v12 + 32);
v27 = *(float *)(v12 + 36);
v28 = *(float *)(v12 + 40);
v29 = *(float *)(v12 + 44);
v30 = *(float *)(v12 + 48);
v31 = *(float *)(v12 + 52);
v32 = *(float *)(v12 + 56);
v15[1].m_sInverse.a = *(float *)(v12 + 60);
v15[1].m_obContentSize.height = v20;
v15[1].m_sAdditionalTransform.a = v21;
v15[1].m_sAdditionalTransform.b = v22;
v15[1].m_sAdditionalTransform.c = v23;
v15[1].m_sAdditionalTransform.d = v24;
v15[1].m_sAdditionalTransform.tx = v25;
v15[1].m_sAdditionalTransform.ty = v26;
v15[1].m_sTransform.a = v27;
v15[1].m_sTransform.b = v28;
v15[1].m_sTransform.c = v29;
v15[1].m_sTransform.d = v30;
v15[1].m_sTransform.tx = v31;
v15[1].m_sTransform.ty = v32;
v33 = a1->m_cellArray;
if ( v9 == 1 )
{
cocos2d::CCArray::insertObject(v33, v15, 0);
if ( !TableView::isDuplicateIndexPath(a1, (CCIndexPath *)v12) )
cocos2d::CCArray::insertObject(a1->m_indexPathArray, (cocos2d::CCObject *)v12, 0);
}
else
{
cocos2d::CCArray::addObject(v33, v15);
if ( !TableView::isDuplicateIndexPath(a1, (CCIndexPath *)v12) )
cocos2d::CCArray::addObject(a1->m_indexPathArray, (cocos2d::CCObject *)v12);
}
v34 = a1->m_tableDelegate;
if ( v34 )
v34->TableViewWillDisplayCellForRowAtIndexPath(v34, (CCIndexPath *)v12, (TableViewCell *)v15, a1);
a1->m_contentLayer->addChild(a1->m_contentLayer, v15);
v35 = a1->m_tableDelegate;
if ( v35 )
v35->TableViewDidDisplayCellForRowAtIndexPath(v35, (CCIndexPath *)v12, (TableViewCell *)v15, a1);
}
}
}
}
}
}
else
{
v7 = cocos2d::CCArray::objectAtIndex(m_cellArray, 0);
v8 = cocos2d::CCArray::objectAtIndex(a1->m_cellArray, v5 - 1);
if ( v5 == 1 )
{
v36 = ((__int64 (__fastcall *)(TableViewDataSource *, _QWORD, TableView *))a1->m_dataSource->numberOfRowsInSection)(
a1->m_dataSource,
*(unsigned int *)(v7 + 484),
a1)
- 1;
cocos2d::CCObject::CCObject(&v65);
v66 = 0;
v65.__vftable = (cocos2d::CCObject_vtbl *)&off_113AA70;
cocos2d::CCObject::CCObject(&v67);
v68 = v36;
v67.__vftable = (cocos2d::CCObject_vtbl *)&off_113AA70;
if ( *(_QWORD *)(v7 + 480) == v66 )
{
TableView::checkLastCell(a1, (TableViewCell *)v8);
}
else if ( *(_QWORD *)(v8 + 480) == v68 )
{
TableView::checkFirstCell(a1, (TableViewCell *)v7);
}
v67.__vftable = (cocos2d::CCObject_vtbl *)&off_113AA70;
cocos2d::CCObject::~CCObject(&v67);
v65.__vftable = (cocos2d::CCObject_vtbl *)&off_113AA70;
cocos2d::CCObject::~CCObject(&v65);
}
else
{
TableView::checkFirstCell(a1, (TableViewCell *)v7);
TableView::checkLastCell(a1, (TableViewCell *)v8);
}
}
}