//
// InfoLayer::setupCommentsBrowser from 0x90994c to 0x909d30 (996 bytes)
//
// 4 xrefs:
// > InfoLayer::loadCommentsFinished @ 0x909d6c
// > InfoLayer::loadPage @ 0x90ac94
// > InfoLayer::init @ 0x90bafc
// > ??> @ 0x496c0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:57:12 +0000
//
__int64 __fastcall InfoLayer::setupCommentsBrowser(InfoLayer *this, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
__int64 v5; // x0
cocos2d::CCTouchDispatcher *v6; // x0
GJAccountManager *v7; // x0
__int64 v8; // x0
int v9; // w3
int v10; // w5
int v11; // w0
unsigned int *v12; // x1
unsigned __int64 v13; // x0
__int64 v14; // x0
char v15; // w3
__int64 v16; // x0
int v17; // w2
bool v18; // w3
unsigned int *v19; // x1
cocos2d::CCDirector *v20; // x0
GameManager *WinSize; // x0
GameManager *v22; // x0
float v23; // s8
int v24; // w27
unsigned int *v25; // x1
__int64 v26; // x0
GameManager *v27; // x0
int v28; // w3
__int64 v29; // x0
int v30; // w1
char *v31; // x1
__int64 v32; // x0
float v33; // s2
__int64 v34; // x21
void (__fastcall *v35)(__int64, unsigned __int64 *); // x22
char *v37; // x21
char *v38; // x24
__int64 k; // x28
unsigned __int64 v40; // x0
int v41; // w1
__int64 *v42; // x20
__int64 *v43; // x4
__int64 v44; // x1
int i; // w5
unsigned __int64 *v46; // x2
unsigned __int64 *j; // x1
__int64 v48; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v49; // [xsp+78h] [xbp+78h] BYREF
int v50; // [xsp+80h] [xbp+80h]
v4 = *((cocos2d::CCDirector **)this + 97);
if ( v4 )
{
v5 = cocos2d::CCDirector::sharedDirector(v4);
v6 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 160LL))(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v6, *((cocos2d::CCObject **)this + 97));
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 97) + 536LL))(*((_QWORD *)this + 97));
*((_QWORD *)this + 97) = 0;
*((_QWORD *)this + 112) = 0;
}
v7 = *((GJAccountManager **)this + 89);
if ( !v7
|| (v8 = GJAccountManager::sharedState(v7),
v9 = *(_DWORD *)(v8 + 352),
v10 = *(_DWORD *)(v8 + 356),
v11 = *(_DWORD *)(*((_QWORD *)this + 89) + 364LL),
!a2) )
{
v13 = *((_QWORD *)this + 90);
if ( !v13 )
goto LABEL_11;
v16 = GJAccountManager::sharedState((GJAccountManager *)v13);
v17 = *(_DWORD *)(*((_QWORD *)this + 90) + 340LL);
v18 = v17 == *(_DWORD *)(v16 + 352) - *(_DWORD *)(v16 + 356);
v13 = v17 > 0;
v15 = v18 & v13;
if ( !a2 )
goto LABEL_11;
goto LABEL_10;
}
v12 = *((unsigned int **)a2 + 7);
if ( *v12 )
{
v42 = *((__int64 **)v12 + 2);
v43 = &v42[*v12 - 1];
if ( v42 <= v43 )
{
v44 = *v42;
for ( i = v9 - v10; *v42; v44 = *v42 )
{
++v42;
*(_BYTE *)(v44 + 434) = v11 == i && v11 > 0;
if ( v43 < v42 )
break;
}
}
}
v13 = *((_QWORD *)this + 90);
if ( v13 )
{
v14 = GJAccountManager::sharedState((GJAccountManager *)v13);
v15 = *(_DWORD *)(*((_QWORD *)this + 90) + 340LL) == *(_DWORD *)(v14 + 352) - *(_DWORD *)(v14 + 356)
&& *(_DWORD *)(*((_QWORD *)this + 90) + 340LL) > 0;
LABEL_10:
v19 = *((unsigned int **)a2 + 7);
v13 = *v19;
if ( (_DWORD)v13 )
{
v46 = *((unsigned __int64 **)v19 + 2);
for ( j = &v46[(unsigned int)v13 - 1]; j >= v46; *(_BYTE *)(v13 + 434) = v15 )
{
v13 = *v46;
if ( !*v46 )
break;
++v46;
}
}
}
LABEL_11:
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v13);
WinSize = (GameManager *)cocos2d::CCDirector::getWinSize(&v48, v20);
v22 = (GameManager *)GameManager::sharedState(WinSize);
if ( (unsigned __int8)GameManager::getGameVariable(v22, "0089") )
{
if ( !(unsigned __int8)InfoLayer::parentalCommentsDisabled(this) || *((_QWORD *)this + 88) )
{
LABEL_13:
v23 = 234.0;
v24 = 1;
if ( a2 )
goto LABEL_14;
LABEL_43:
v29 = 0;
goto LABEL_19;
}
}
else if ( *((_QWORD *)this + 88) )
{
goto LABEL_13;
}
v24 = 0;
v23 = 140.0;
if ( !a2 )
goto LABEL_43;
LABEL_14:
v25 = *((unsigned int **)a2 + 7);
v26 = *v25;
if ( (_DWORD)v26 )
{
v37 = *((char **)v25 + 2);
v26 = 8LL * (unsigned int)v26 - 8;
v38 = &v37[v26];
if ( v37 <= &v37[v26] )
{
for ( k = *(_QWORD *)v37; *(_QWORD *)v37; k = *(_QWORD *)v37 )
{
v37 += 8;
v40 = sub_907154((_DWORD *)k);
v50 = v41;
v49 = v40;
v26 = (__int64 *)((char *)this + 936) != std::__tree,BulkCommentKey>,std::__map_value_compare,std::__value_type,BulkCommentKey>,std::less>,true>,std::allocator,BulkCommentKey>>>::find>(
(__int64)this + 928,
(int *)&v49);
*(_BYTE *)(k + 440) = v26;
if ( v38 < v37 )
break;
}
}
}
v27 = (GameManager *)GameManager::sharedState((GameManager *)v26);
if ( (unsigned __int8)GameManager::getGameVariable(v27, "0088") )
v28 = 7;
else
v28 = 6;
v29 = CustomListView::create(a2, 0, 0, v28, v23, 340.0, 0.0);
LABEL_19:
v30 = *((unsigned __int8 *)this + 880);
*((_QWORD *)this + 112) = v29;
if ( v30 )
v31 = "Mod Comments";
else
v31 = "Comments";
v32 = GJCommentListLayer::create(v29, v31, 4282282687LL, 0, 340.0, v23);
*((_QWORD *)this + 97) = v32;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v32);
if ( v24 )
v33 = -4.0;
else
v33 = -53.0;
v34 = *((_QWORD *)this + 97);
v35 = *(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v34 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v49,
(float)(*(float *)&v48 - 340.0) * 0.5,
v33 + (float)((float)(*((float *)&v48 + 1) - v23) * 0.5));
v35(v34, &v49);
InfoLayer::refreshBulkUI(this);
return _stack_chk_guard;
}