//
// GameLevelManager::onGetGJUserInfoCompleted from 0x713018 to 0x713290 (632 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x7327a4
// > ??> @ 0xa82a0
//
// 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::onGetGJUserInfoCompleted(GameLevelManager *a1, const void **a2, const char **a3)
{
const char *v3; // x19
unsigned int SplitIntFromKey; // w25
_DWORD *v7; // x26
unsigned __int64 v8; // x27
unsigned __int64 v9; // x20
size_t v10; // x2
int v11; // w19
__int64 v12; // x20
__int64 *v13; // x0
UserInfoDelegate *v14; // x0
char *v16; // x19
GJUserScore *v17; // x19
UserInfoDelegate *m_userInfoDelegate; // x0
unsigned int *v19; // x26
int v20; // w1
GJFriendRequest *v21; // x0
unsigned int *v22; // x26
int v23; // w0
void *v24; // [xsp+70h] [xbp+70h] BYREF
v3 = *a3;
GameLevelManager::removeDLFromActive(a1, *a3);
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(a1, v3, 1);
sub_D153B8((int)&v24, "-1");
v7 = v24;
v8 = *((_QWORD *)v24 - 3);
v9 = *((_QWORD *)*a2 - 3);
if ( v8 > v9 )
v10 = *((_QWORD *)*a2 - 3);
else
v10 = *((_QWORD *)v24 - 3);
v11 = memcmp(*a2, v24, v10);
if ( v11 || (v11 = 0x7FFFFFFF, v12 = v9 - v8, v12 > 0x7FFFFFFF) )
{
v13 = (__int64 *)(v7 - 6);
if ( v7 - 6 == (_DWORD *)&qword_124B6B0 )
goto LABEL_7;
}
else
{
v13 = (__int64 *)(v7 - 6);
if ( v12 >= (__int64)0xFFFFFFFF80000000LL )
v11 = v12;
else
v11 = 0x80000000;
if ( v13 == &qword_124B6B0 )
goto LABEL_7;
}
if ( &pthread_create )
{
v19 = v7 - 2;
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(v7 - 2);
*(v7 - 2) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v13);
LABEL_7:
if ( !v11 )
goto LABEL_8;
sub_D18D28(&v24, a2);
GameLevelManager::responseToDict((char **)&v24, 0);
v16 = (char *)v24 - 24;
if ( (char *)v24 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)((char *)v24 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *((_DWORD *)v24 - 2);
*((_DWORD *)v24 - 2) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v16);
}
v17 = GJUserScore::create();
if ( v17 )
{
GameLevelManager::storeUserInfo(a1, v17);
if ( v17->m_friendReqStatus == 3 )
{
v21 = GJFriendRequest::create();
v21->m_accountID = SplitIntFromKey;
GameLevelManager::storeFriendRequest(a1, v21);
}
m_userInfoDelegate = a1->m_userInfoDelegate;
if ( m_userInfoDelegate )
m_userInfoDelegate->getUserInfoFinished(m_userInfoDelegate, v17);
}
else
{
LABEL_8:
v14 = a1->m_userInfoDelegate;
if ( v14 )
v14->getUserInfoFailed(v14, SplitIntFromKey);
}
return _stack_chk_guard;
}