//
// GameLevelManager::responseToDict from 0x7006d8 to 0x700958 (640 bytes)
//
// 16 xrefs:
// > GameLevelManager::onGetTopArtistsCompleted @ 0x700bd8
// > GameLevelManager::createAndGetLevels @ 0x704c14
// > GameLevelManager::processOnDownloadLevelCompleted @ 0x707730
// > GameLevelManager::createAndGetMapPacks @ 0x70d064
// > GameLevelManager::createAndGetScores @ 0x711364
// > GameLevelManager::onGetUserListCompleted @ 0x7121d8
// > GameLevelManager::onGetGJUserInfoCompleted @ 0x713158
// > GameLevelManager::onGetFriendRequestsCompleted @ 0x7134d8
// > GameLevelManager::onGetUserMessagesCompleted @ 0x714a48
// > GameLevelManager::onDownloadUserMessageCompleted @ 0x715128
// > GameLevelManager::createAndGetCommentsFull @ 0x717b28
// > GameLevelManager::createAndGetCommentsFull @ 0x717b64
// > GameLevelManager::createAndGetCommentsFull @ 0x717d50
// > GameLevelManager::createAndGetLevelLists @ 0x72fc98
// > GJMultiplayerManager::addComment @ 0x981d24
// > ??> @ 0x581b8
//
// 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(char **a1, unsigned __int8 a2)
{
int v3; // w19
cocos2d::CCDictionary *v4; // x24
char *v5; // x1
cocos2d::CCArray *v6; // x0
__int64 v7; // x1
cocos2d::CCArray *v8; // x21
void *v9; // x0
unsigned int v10; // w19
unsigned int v11; // w20
cocos2d::CCString *v12; // x0
char *CString; // x28
__int64 v14; // x0
cocos2d::CCObject *v15; // x20
void *v17; // x0
unsigned int *v18; // x1
int v19; // w2
cocos2d::CCArray *v20; // x0
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
__int64 v24; // [xsp+80h] [xbp+80h] BYREF
v3 = a2;
v4 = cocos2d::CCDictionary::create();
v5 = *a1;
if ( !v3 )
{
sub_D153B8((int)&v24, v5);
v6 = sub_6F004C(&v24, ":");
v7 = v24;
v8 = v6;
v9 = (void *)(v24 - 24);
if ( (__int64 *)(v24 - 24) == &qword_124B6B0 )
goto LABEL_3;
if ( &pthread_create )
{
v23 = (unsigned int *)(v24 - 8);
do
v22 = __ldaxr(v23);
while ( __stlxr(v22 - 1, v23) );
goto LABEL_24;
}
LABEL_26:
v22 = *(_DWORD *)(v7 - 8);
*(_DWORD *)(v7 - 8) = v22 - 1;
goto LABEL_24;
}
sub_D153B8((int)&v24, v5);
v20 = sub_6F004C(&v24, "~");
v7 = v24;
v8 = v20;
v9 = (void *)(v24 - 24);
if ( (__int64 *)(v24 - 24) == &qword_124B6B0 )
goto LABEL_3;
if ( !&pthread_create )
goto LABEL_26;
v21 = (unsigned int *)(v24 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
LABEL_24:
if ( v22 <= 0 )
operator delete(v9);
LABEL_3:
v10 = 0;
v11 = 1;
if ( (unsigned int)cocos2d::CCArray::count(v8) > 1 )
{
do
{
v12 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v8, v10);
CString = (char *)cocos2d::CCString::getCString(v12);
v14 = cocos2d::CCArray::objectAtIndex(v8, v11);
v15 = (cocos2d::CCObject *)v14;
if ( !CString )
goto LABEL_6;
if ( !v14 )
goto LABEL_6;
sub_D153B8((int)&v24, CString);
cocos2d::CCDictionary::setObject((int)v4, v15);
v17 = (void *)(v24 - 24);
if ( (__int64 *)(v24 - 24) == &qword_124B6B0 )
goto LABEL_6;
if ( &pthread_create )
{
v18 = (unsigned int *)(v24 - 8);
do
v19 = __ldaxr(v18);
while ( __stlxr(v19 - 1, v18) );
}
else
{
v19 = *(_DWORD *)(v24 - 8);
*(_DWORD *)(v24 - 8) = v19 - 1;
}
if ( v19 <= 0 )
{
v10 += 2;
operator delete(v17);
}
else
{
LABEL_6:
v10 += 2;
}
v11 = v10 + 1;
}
while ( (unsigned int)cocos2d::CCArray::count(v8) > v10 + 1 );
}
return v4;
}