//
// TableView::initTableViewCells from 0x57a9ac to 0x57ad70 (964 bytes)
//
// 1 xrefs:
// > ??> @ 0xa2918
//
// 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::initTableViewCells(TableView *a1)
{
TableViewDataSource *m_dataSource; // x0
unsigned int v3; // w26
cocos2d::CCNode *v4; // x23
int v5; // w27
int v6; // w25
__int64 v7; // x19
float v8; // s8
__int64 v9; // x0
float v10; // s0
float v11; // s1
float y; // s0
const cocos2d::CCSize *v13; // x0
TableViewCell *v14; // x0
cocos2d::CCNode *v15; // x21
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x23
const cocos2d::CCSize *v18; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float v20; // w15
float v21; // w14
float v22; // w13
float v23; // w12
float v24; // w11
float v25; // w10
float v26; // w9
float v27; // w8
float v28; // w7
float v29; // w6
float v30; // w5
float v31; // w4
float v32; // w3
cocos2d::CCArray *m_cellArray; // x0
TableViewDelegate *m_tableDelegate; // x0
TableViewDelegate *v35; // x0
int v36; // [xsp+7Ch] [xbp+7Ch]
float x; // [xsp+80h] [xbp+80h]
cocos2d::CCPoint v38; // [xsp+98h] [xbp+98h] BYREF
cocos2d::CCPoint v39; // [xsp+A0h] [xbp+A0h] BYREF
if ( a1->m_tableDelegate )
{
m_dataSource = a1->m_dataSource;
if ( m_dataSource )
{
v36 = m_dataSource->numberOfSectionsInTableView(m_dataSource, a1);
if ( v36 > 0 )
{
v3 = 0;
v4 = nullptr;
while ( 1 )
{
v5 = a1->m_dataSource->numberOfRowsInSection(a1->m_dataSource, v3, a1);
if ( v5 > 0 )
break;
LABEL_17:
if ( v36 == ++v3 )
return;
}
v6 = 0;
while ( 1 )
{
while ( 1 )
{
v7 = operator new(0x40u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v7);
*(_DWORD *)(v7 + 56) = v6;
*(_DWORD *)(v7 + 60) = v3;
*(_QWORD *)v7 = &off_113AA70;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v7);
v8 = a1->m_tableDelegate->cellHeightForRowAtIndexPath(a1->m_tableDelegate, (CCIndexPath *)v7, a1);
cocos2d::CCPoint::CCPoint(&v38);
if ( v4 )
{
x = v4->getPosition(v4)->x;
v9 = (__int64)v4->getPosition(v4);
cocos2d::CCPoint::CCPoint(&v39, x, *(float *)(v9 + 4) - v8);
cocos2d::CCPoint::operator=(&v38, v10, v11);
y = v38.y;
}
else
{
y = (float)(a1->m_contentLayer->getContentSize(a1->m_contentLayer)->height - (float)(v8 * (float)v6)) - v8;
v38.y = y;
}
printf("pos = %f \n", y);
if ( v38.y < 0.0 )
return;
v13 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
printf("content height =%f \n", v13->height);
v14 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v7, a1);
v15 = v14;
if ( v14 )
break;
LABEL_8:
if ( v5 == ++v6 )
goto LABEL_17;
}
setAnchorPoint = v14->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v39, 0.0, 1.0);
setAnchorPoint(v15, &v39);
setContentSize = v15->setContentSize;
v18 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v39, v18->width * 0.5, v8);
setContentSize(v15, (const cocos2d::CCSize *)&v39);
setPosition = v15->setPosition;
cocos2d::CCPoint::CCPoint(&v39, 0.0, v38.y);
setPosition(v15, &v39);
v20 = *(float *)(v7 + 12);
v21 = *(float *)(v7 + 16);
v22 = *(float *)(v7 + 20);
v23 = *(float *)(v7 + 24);
v24 = *(float *)(v7 + 28);
v25 = *(float *)(v7 + 32);
v26 = *(float *)(v7 + 36);
v27 = *(float *)(v7 + 40);
v28 = *(float *)(v7 + 44);
v29 = *(float *)(v7 + 48);
v30 = *(float *)(v7 + 52);
v31 = *(float *)(v7 + 56);
v32 = *(float *)(v7 + 60);
m_cellArray = a1->m_cellArray;
v15[1].m_obContentSize.height = *(float *)(v7 + 8);
v15[1].m_sAdditionalTransform.a = v20;
v15[1].m_sAdditionalTransform.b = v21;
v15[1].m_sAdditionalTransform.c = v22;
v15[1].m_sAdditionalTransform.d = v23;
v15[1].m_sAdditionalTransform.tx = v24;
v15[1].m_sAdditionalTransform.ty = v25;
v15[1].m_sTransform.a = v26;
v15[1].m_sTransform.b = v27;
v15[1].m_sTransform.c = v28;
v15[1].m_sTransform.d = v29;
v15[1].m_sTransform.tx = v30;
v15[1].m_sTransform.ty = v31;
v15[1].m_sInverse.a = v32;
cocos2d::CCArray::addObject(m_cellArray, v15);
cocos2d::CCArray::addObject(a1->m_indexPathArray, (cocos2d::CCObject *)v7);
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath(
m_tableDelegate,
(CCIndexPath *)v7,
(TableViewCell *)v15,
a1);
a1->m_contentLayer->addChild(a1->m_contentLayer, v15);
v35 = a1->m_tableDelegate;
if ( v35 )
{
v4 = v15;
v35->TableViewDidDisplayCellForRowAtIndexPath(v35, (CCIndexPath *)v7, (TableViewCell *)v15, a1);
goto LABEL_8;
}
++v6;
v4 = v15;
if ( v5 == v6 )
goto LABEL_17;
}
}
}
}
}