//
// GameLevelManager::responseToDict from 0x100531090 to 0x10053132d (669 bytes)
//
// 15 xrefs:
// > GameLevelManager::onGetGJUserInfoCompleted @ 0x100522f10
// > GameLevelManager::onGetUserListCompleted @ 0x10052421d
// > GameLevelManager::onGetFriendRequestsCompleted @ 0x100524991
// > GameLevelManager::onGetUserMessagesCompleted @ 0x1005251e1
// > GameLevelManager::onDownloadUserMessageCompleted @ 0x10052578d
// > GameLevelManager::onGetTopArtistsCompleted @ 0x10052a271
// > GameLevelManager::createAndGetLevels @ 0x10052eefa
// > GameLevelManager::createAndGetLevelLists @ 0x10053182a
// > GameLevelManager::createAndGetMapPacks @ 0x10053229a
// > GameLevelManager::createAndGetScores @ 0x100532efd
// > GameLevelManager::processOnDownloadLevelCompleted @ 0x100544d43
// > GameLevelManager::createAndGetCommentsFull @ 0x10055049b
// > GameLevelManager::createAndGetCommentsFull @ 0x100550778
// > GameLevelManager::createAndGetCommentsFull @ 0x1005507f0
// > GJMultiplayerManager::addComment @ 0x10065af7b
//
// 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::CCDictionary *__fastcall GameLevelManager::responseToDict(__int64 a1, int a2, double a3)
{
cocos2d::CCDictionary *v3; // r13
const char *v4; // r14
const char *v5; // r14
size_t v6; // rax
size_t v7; // rbx
char *v8; // r15
size_t v9; // rax
size_t v10; // rbx
char *v11; // r15
size_t v12; // r12
__int64 v13; // rax
size_t v14; // r12
__int64 v15; // rbx
unsigned int v16; // r15d
unsigned int v17; // eax
unsigned int v18; // ecx
cocos2d::CCString *v19; // rax
const char *CString; // r12
unsigned int v21; // r15d
__int64 v22; // r14
size_t v23; // rax
size_t v24; // rbx
char *v25; // r14
__int64 v26; // rax
size_t v27; // r13
cocos2d::CCObject *v29; // [rsp+8h] [rbp-58h]
__int64 v30; // [rsp+10h] [rbp-50h]
cocos2d::CCDictionary *v31; // [rsp+18h] [rbp-48h]
size_t __dst; // [rsp+20h] [rbp-40h] BYREF
size_t v33; // [rsp+28h] [rbp-38h]
void *__p; // [rsp+30h] [rbp-30h]
v3 = cocos2d::CCDictionary::create();
if ( a2 )
{
if ( (*(_BYTE *)a1 & 1) != 0 )
v4 = *(const char **)(a1 + 16);
else
v4 = (const char *)(a1 + 1);
v6 = strlen(v4);
if ( v6 < 0xFFFFFFFFFFFFFFF8LL )
{
v7 = v6;
if ( v6 >= 0x17 )
{
v12 = 26;
if ( (v6 | 7) != 0x17 )
v12 = (v6 | 7) + 1;
v8 = (char *)operator new(v12);
__p = v8;
__dst = v12 + 1;
v33 = v7;
}
else
{
LOBYTE(__dst) = 2 * v6;
v8 = (char *)&__dst + 1;
if ( !v6 )
goto LABEL_20;
}
memmove(v8, v4, v7);
LABEL_20:
v8[v7] = 0;
v13 = sub_10052DD30((unsigned __int8 *)&__dst, "~", a3);
goto LABEL_26;
}
LABEL_43:
sub_100006BF0(a3);
}
if ( (*(_BYTE *)a1 & 1) != 0 )
v5 = *(const char **)(a1 + 16);
else
v5 = (const char *)(a1 + 1);
v9 = strlen(v5);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_43;
v10 = v9;
if ( v9 >= 0x17 )
{
v14 = 26;
if ( (v9 | 7) != 0x17 )
v14 = (v9 | 7) + 1;
v11 = (char *)operator new(v14);
__p = v11;
__dst = v14 + 1;
v33 = v10;
}
else
{
LOBYTE(__dst) = 2 * v9;
v11 = (char *)&__dst + 1;
if ( !v9 )
goto LABEL_25;
}
memmove(v11, v5, v10);
LABEL_25:
v11[v10] = 0;
v13 = sub_10052DD30((unsigned __int8 *)&__dst, ":", a3);
LABEL_26:
v15 = v13;
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( (unsigned int)sub_100720070(v15) >= 2 )
{
v16 = 0;
v30 = v15;
v31 = v3;
while ( 1 )
{
v19 = (cocos2d::CCString *)sub_1007200C0(v15, v16);
CString = cocos2d::CCString::getCString(v19);
v21 = v16 + 1;
v22 = sub_1007200C0(v15, v21);
if ( v22 != 0 && CString != nullptr )
break;
LABEL_30:
v17 = sub_100720070(v15);
v18 = v21 + 2;
v16 = v21 + 1;
if ( v18 >= v17 )
return v3;
}
v23 = strlen(CString);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_43;
v24 = v23;
v29 = (cocos2d::CCObject *)v22;
if ( v23 >= 0x17 )
{
v26 = v23 | 7;
v27 = 26;
if ( (v24 | 7) != 0x17 )
v27 = v26 + 1;
v25 = (char *)operator new(v27);
__p = v25;
__dst = v27 + 1;
v33 = v24;
v3 = v31;
}
else
{
LOBYTE(__dst) = 2 * v23;
v25 = (char *)&__dst + 1;
if ( !v23 )
{
LABEL_40:
v25[v24] = 0;
cocos2d::CCDictionary::setObject_1((__int64)v3, v29, (char *)&__dst);
v15 = v30;
if ( (__dst & 1) != 0 )
operator delete(__p);
goto LABEL_30;
}
}
memmove(v25, CString, v24);
goto LABEL_40;
}
return v3;
}