//
// GameLevelManager::onGetAccountCommentsCompleted from 0x4d2dbc to 0x4d2f78 (444 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4da88a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:50:49 +0000
//
int __fastcall GameLevelManager::onGetAccountCommentsCompleted(GameLevelManager *a1, int a2, int a3)
{
char *v5; // r4
_BOOL4 v6; // r8
bool v7; // nf
size_t v8; // r0
cocos2d::CCArray *v9; // r9
int result; // r0
cocos2d::CCString *v11; // r0
const char *CString; // r10
size_t v13; // r0
cocos2d::CCString *v14; // r0
const char *v15; // r9
size_t v16; // r0
int v17; // r10
cocos2d::CCObject *AccountComments; // r10
void (__fastcall ***v19)(_DWORD, cocos2d::CCObject *, char *); // r0
int v20; // [sp+0h] [bp-4Ch]
void (__fastcall *v21)(int, int *, char *); // [sp+4h] [bp-48h]
int v22[3]; // [sp+8h] [bp-44h] BYREF
int v23[3]; // [sp+14h] [bp-38h] BYREF
int v24[3]; // [sp+20h] [bp-2Ch] BYREF
int v25[3]; // [sp+2Ch] [bp-20h] BYREF
int v26; // [sp+38h] [bp-14h] BYREF
int v27; // [sp+3Ch] [bp-10h]
int v28; // [sp+40h] [bp-Ch]
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(char **)(a3 + 8);
else
v5 = (char *)(a3 + 1);
v20 = GameLevelManager::levelIDFromCommentKey(a1, v5, a3, (int)&_stack_chk_guard);
GameLevelManager::removeDLFromActive(a1, v5);
v26 = 0;
v27 = 0;
v28 = 0;
std::string::__init(&v26, "-1", 2u);
v6 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v26);
std::string::~string((int)&v26);
if ( v6 )
goto LABEL_10;
v7 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v26 = 0;
if ( v7 )
a2 = *(_DWORD *)(a2 + 8);
v27 = 0;
v28 = 0;
v8 = strlen((const char *)a2);
std::string::__init(&v26, (const void *)a2, v8);
v9 = sub_4C1A88(&v26, "#");
std::string::~string((int)&v26);
if ( cocos2d::CCArray::count(v9) <= 1u )
{
LABEL_10:
result = *((_DWORD *)a1 + 207);
if ( result )
return (*(int (__fastcall **)(int, char *))(*(_DWORD *)result + 4))(result, v5);
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 0);
memset(v22, 0, sizeof(v22));
CString = (const char *)cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
std::string::__init(v22, CString, v13);
v14 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 1u);
v15 = (const char *)cocos2d::CCString::getCString(v14);
memset(v23, 0, sizeof(v23));
v16 = strlen(v15);
std::string::__init(v23, v15, v16);
v17 = *((_DWORD *)a1 + 207);
if ( v17 )
{
v21 = *(void (__fastcall **)(int, int *, char *))(*(_DWORD *)v17 + 12);
std::string::basic_string(v24, (int)v23);
v21(v17, v24, v5);
std::string::~string((int)v24);
}
std::string::basic_string(v25, (int)v22);
AccountComments = GameLevelManager::createAndGetAccountComments(a1, (int)v25, v20);
std::string::~string((int)v25);
std::string::basic_string(&v26, (int)v23);
GameLevelManager::storeCommentsResult(a1, AccountComments, COERCE_FLOAT(&v26), v5);
std::string::~string((int)&v26);
v19 = *((void (__fastcall ****)(_DWORD, cocos2d::CCObject *, char *))a1 + 207);
if ( v19 )
(**v19)(v19, AccountComments, v5);
std::string::~string((int)v23);
return std::string::~string((int)v22);
}
return result;
}