//
// GameLevelManager::onDownloadUserMessageCompleted from 0x10008e488 to 0x10008e5a8 (288 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x100088e18
//
// 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
//
__int64 __fastcall GameLevelManager::onDownloadUserMessageCompleted(GameLevelManager *a1, char *a2, __int64 a3)
{
const char *v3; // x22
__int64 SplitIntFromKey; // x20
_BOOL4 v7; // w0
_BOOL4 v8; // w22
cocos2d::CCDictionary *v9; // x0
GJUserMessage *v10; // x0
cocos2d::CCObject *v11; // x21
__int64 result; // x0
void *v13[2]; // [xsp+0h] [xbp-50h] BYREF
char v14; // [xsp+17h] [xbp-39h]
void *__p[2]; // [xsp+18h] [xbp-38h] BYREF
char v16; // [xsp+2Fh] [xbp-21h]
v3 = (const char *)a3;
if ( *(char *)(a3 + 23) < 0 )
v3 = *(const char **)a3;
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(a1, v3, 1);
GameLevelManager::removeDLFromActive(a1, v3);
sub_100009900(__p, "-1");
v7 = sub_1000045BC(a2, __p);
v8 = v7;
if ( v16 < 0 )
{
operator delete(__p[0]);
if ( v8 )
goto LABEL_14;
}
else if ( v7 )
{
LABEL_14:
result = (__int64)a1->m_downloadMessageDelegate;
if ( result )
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)result + 8LL))(result, SplitIntFromKey);
return result;
}
if ( a2[23] < 0 )
a2 = *(char **)a2;
sub_100009900(v13, a2);
v9 = (cocos2d::CCDictionary *)GameLevelManager::responseToDict(v13, 0);
v10 = GJUserMessage::create(v9);
v11 = v10;
if ( v14 < 0 )
{
operator delete(v13[0]);
if ( !v11 )
goto LABEL_14;
}
else if ( !v10 )
{
goto LABEL_14;
}
cocos2d::CCDictionary::setObject(a1->m_userMessages, v11, v11[5].m_uUnknown);
result = (__int64)a1->m_downloadMessageDelegate;
if ( result )
return (**(__int64 (__fastcall ***)(__int64, cocos2d::CCObject *))result)(result, v11);
return result;
}