//
// GameLevelManager::createAndGetCommentsFull from 0x3cd420 to 0x3cd5fa (474 bytes)
//
// 2 xrefs:
// > GameLevelManager::createAndGetLevelComments @ 0x3cd628
// > GameLevelManager::createAndGetAccountComments @ 0x3cd800
//
// 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
//
cocos2d::CCArray *__fastcall GameLevelManager::createAndGetCommentsFull(
cocos2d::CCArray *a1,
char **a2,
int a3,
int a4)
{
cocos2d::CCArray *v5; // r11
cocos2d::CCArray *v6; // r10
unsigned int i; // r8
cocos2d::CCString *v8; // r0
char *CString; // r0
cocos2d::CCArray *v10; // r6
cocos2d::CCString *v11; // r0
char *v12; // r0
cocos2d::CCString *v13; // r0
char *v14; // r0
GJComment *v15; // r5
GJUserScore *v16; // r6
cocos2d::CCObject *m_userScore; // r0
const char *m_userID; // [sp+8h] [bp-3Ch]
const char *m_accountID; // [sp+Ch] [bp-38h]
char v24; // [sp+24h] [bp-20h] BYREF
_BYTE v25[4]; // [sp+28h] [bp-1Ch] BYREF
char *v26; // [sp+2Ch] [bp-18h] BYREF
char *v27; // [sp+30h] [bp-14h] BYREF
char *v28; // [sp+34h] [bp-10h] BYREF
char *v29; // [sp+38h] [bp-Ch] BYREF
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
sub_776584((int)&v29, *a2);
v6 = sub_3BE530((cocos2d::CCArray *)&v29, "|");
sub_774008(&v29);
for ( i = 0; i < cocos2d::CCArray::count(v6); ++i )
{
v8 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v6, i);
CString = (char *)cocos2d::CCString::getCString(v8);
sub_776584((int)&v24, CString);
if ( a4 )
{
sub_775C20(&v29);
GameLevelManager::responseToDict(&v29, 1);
v15 = GJComment::create();
sub_774008(&v29);
if ( !v15 )
goto LABEL_18;
v15->m_accountID = a3;
goto LABEL_17;
}
v10 = sub_3BE530((cocos2d::CCArray *)&v24, ":");
if ( cocos2d::CCArray::count(v10) > 1u )
{
v11 = cocos2d::CCArray::stringAtIndex(v10, 0);
v12 = (char *)cocos2d::CCString::getCString(v11);
sub_776584((int)v25, v12);
v13 = cocos2d::CCArray::stringAtIndex(v10, 1u);
v14 = (char *)cocos2d::CCString::getCString(v13);
sub_776584((int)&v29, v14);
sub_775C20(&v26);
GameLevelManager::responseToDict(&v26, 1);
v15 = GJComment::create();
sub_774008(&v26);
sub_775C20(&v27);
GameLevelManager::responseToDict(&v27, 1);
v16 = GJUserScore::create();
sub_774008(&v27);
if ( v16 )
{
if ( v15->m_userScore != v16 )
{
cocos2d::CCObject::retain(v16);
m_userScore = v15->m_userScore;
if ( m_userScore )
cocos2d::CCObject::release(m_userScore);
v15->m_userScore = v16;
}
m_userID = (const char *)v15->m_userID;
m_accountID = (const char *)v16->m_accountID;
sub_775C20(&v28);
GameLevelManager::storeUserName(a1, m_userID, m_accountID, &v28);
sub_774008(&v28);
}
sub_774008(&v29);
sub_774008(v25);
if ( v15 )
{
if ( !v15->m_levelID )
v15->m_levelID = a3;
LABEL_17:
cocos2d::CCArray::addObject(v5, v15);
}
}
LABEL_18:
sub_774008(&v24);
}
return v5;
}