//
// GameLevelManager::onRequestUserAccessCompleted from 0x100526420 to 0x100526578 (344 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051bb3a
//
// 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::onRequestUserAccessCompleted(__int64 a1, unsigned __int8 *a2)
{
__int64 v3; // rdi
const char *v4; // r15
unsigned __int64 v5; // rax
char v6; // r12
const void *v7; // rdi
size_t v8; // rdx
__int64 v9; // rdi
int v10; // eax
__int64 result; // rax
__int64 (__fastcall ***v12)(_QWORD, _QWORD, __int64); // rdi
int v13; // r14d
GameManager *v14; // r15
char v15; // [rsp+0h] [rbp-40h] BYREF
_DWORD __s2[3]; // [rsp+1h] [rbp-3Fh] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v3 = *(_QWORD *)(a1 + 608);
v15 = 12;
strcpy((char *)__s2, "req_ua");
cocos2d::CCDictionary::removeObjectForKey_1(v3, &v15);
if ( (v15 & 1) != 0 )
operator delete(__p);
strcpy((char *)__s2, "-1");
v4 = (const char *)(a2 + 1);
v5 = *a2 >> 1;
v6 = *a2 & 1;
v7 = *((const void **)a2 + 2);
if ( v6 )
v5 = *((_QWORD *)a2 + 1);
else
v7 = a2 + 1;
v8 = 2;
if ( v5 < 2 )
v8 = v5;
if ( !((v5 != 2) | (memcmp(v7, __s2, v8) != 0)) )
{
v9 = *(_QWORD *)(a1 + 808);
if ( v9 )
{
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v9 + 8LL))(v9, 0, 43);
v6 = *a2 & 1;
}
}
if ( v6 )
v4 = *((const char **)a2 + 2);
v10 = atoi(v4);
if ( v10 == 99 )
{
result = (__int64)GameManager::sharedState();
*(_BYTE *)(result + 992) = 1;
v12 = *(__int64 (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 808);
if ( !v12 )
return result;
return (**v12)(v12, 0, 43);
}
v13 = v10;
result = (unsigned int)(v10 - 1);
if ( (unsigned int)result <= 1 )
{
v14 = GameManager::sharedState();
v14->m_hasRP.value = v13;
result = (unsigned int)(int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
v14->m_hasRP.seed = result;
v14->m_hasRP.random = result + v13;
v12 = *(__int64 (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 808);
if ( v12 )
return (**v12)(v12, 0, 43);
}
return result;
}