//
// GameLevelManager::onUpdateUserScoreCompleted from 0x1005250a0 to 0x1005251fe (350 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051f87d
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:31:45 +0000
//
__int64 __fastcall GameLevelManager::onUpdateUserScoreCompleted(__int64 a1, unsigned __int8 *a2)
{
unsigned int v3; // r12d
unsigned __int64 v4; // r12
const void *v5; // r14
size_t v6; // r15
_QWORD *v7; // rdi
__int64 result; // rax
__int64 v9; // rax
int v10; // r14d
_DWORD *v11; // r15
float v12; // xmm0_4
void (__fastcall ***v13)(_QWORD); // rdi
_WORD __s2[31]; // [rsp+1h] [rbp-3Fh] BYREF
GameLevelManager::removeDLFromActive(a1, "user_score");
strcpy((char *)__s2, "-1");
v3 = *a2;
if ( (v3 & 1) != 0 )
{
v4 = *((_QWORD *)a2 + 1);
v5 = *((const void **)a2 + 2);
}
else
{
v4 = v3 >> 1;
v5 = a2 + 1;
}
v6 = 2;
if ( v4 < 2 )
v6 = v4;
if ( !((v4 != 2) | (memcmp(v5, __s2, v6) != 0)) )
{
v7 = *(_QWORD **)(a1 + 1296);
result = 8;
if ( !v7 )
return result;
return (*(__int64 (**)(void))(*v7 + result))();
}
strcpy((char *)__s2, "-9");
if ( (v4 != 2) | (memcmp(v5, __s2, v6) != 0) )
{
v10 = atoi((const char *)v5);
v11 = (_DWORD *)GameManager::sharedState();
v11[167] = v10;
v12 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
v11[166] = (int)v12;
v11[165] = (int)v12 + v10;
}
else
{
v9 = GameLevelManager::sharedState();
GameLevelManager::submitUserInfo(v9);
}
*(_BYTE *)(GameManager::sharedState() + 656) = 1;
v13 = *(void (__fastcall ****)(_QWORD))(a1 + 1296);
if ( v13 )
(**v13)(v13);
v7 = *(_QWORD **)(a1 + 1240);
result = 16;
if ( v7 )
return (*(__int64 (**)(void))(*v7 + result))();
return result;
}