//
// GameLevelManager::onGetUserSearchCompleted from 0x140253530 to 0x1402538c2 (914 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x14021b29c
// > ??> @ 0x14091c52c
//
// 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 11:28:43 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall GameLevelManager::onGetUserSearchCompleted(_QWORD *a1, const void **a2, _QWORD *a3)
{
_BYTE *v6; // rdx
size_t v7; // r8
void *v8; // rcx
_BYTE *v9; // rcx
unsigned __int64 v10; // rdi
unsigned __int64 v11; // rbx
size_t v12; // r8
__int64 v13; // rcx
const char *v14; // rcx
__int64 v15; // rcx
__int64 v16; // rcx
cocos2d::CCArray *v17; // r13
_BYTE *v18; // rdx
size_t v19; // r8
cocos2d::CCArray *v20; // r14
unsigned int i; // edi
cocos2d::CCString *v22; // rax
const char *CString; // rax
size_t v24; // r8
__int64 v25; // rax
__int64 v26; // rax
int *v27; // rax
int *v28; // rbx
void *v29; // rcx
unsigned int v30; // eax
__int64 v31; // rcx
void *v32[4]; // [rsp+38h] [rbp-71h] BYREF
_BYTE v33[32]; // [rsp+58h] [rbp-51h] BYREF
const void **v34; // [rsp+78h] [rbp-31h]
_QWORD *v35; // [rsp+80h] [rbp-29h]
void *Block[2]; // [rsp+88h] [rbp-21h] BYREF
__int128 v37; // [rsp+98h] [rbp-11h]
_OWORD v38[2]; // [rsp+A8h] [rbp-1h] BYREF
v34 = a2;
v35 = a3;
v6 = a3;
if ( a3[3] > 0xFu )
v6 = (_BYTE *)*a3;
*(_OWORD *)Block = 0;
v37 = 0;
v7 = -1;
do
++v7;
while ( v6[v7] );
sub_14003D230(Block, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(a1[150], Block);
if ( *((_QWORD *)&v37 + 1) > 0xFu )
{
v8 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v37 + 1) + 1LL) >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
*(_OWORD *)Block = 0;
*(_QWORD *)&v37 = 2;
*((_QWORD *)&v37 + 1) = 15;
strcpy((char *)Block, "-1");
v9 = a2;
v10 = (unsigned __int64)a2[3];
if ( v10 > 0xF )
v9 = *a2;
v11 = (unsigned __int64)a2[2];
v12 = v11;
if ( v11 > 2 )
v12 = 2;
if ( !memcmp(v9, Block, v12) && v11 == 2 )
{
v13 = a1[187];
if ( v13 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v13 + 8LL))(v13, 2, 0xFFFFFFFFLL);
}
else
{
v14 = (const char *)a2;
if ( v10 > 0xF )
v14 = (const char *)*a2;
if ( atoi(v14) >= 0 )
{
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create(v15);
v18 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v18 = *a2;
memset(v38, 0, sizeof(v38));
v19 = -1;
do
++v19;
while ( v18[v19] );
sub_14003D230(v38, v18, v19);
v20 = sub_1400D2840((__int64 *)v38, (unsigned __int8 *)&word_14070D07C);
sub_14003D310((__int64)v38);
for ( i = 0; i < cocos2d::CCArray::count(v20); ++i )
{
v22 = cocos2d::CCArray::objectAtIndex(v20, i);
CString = cocos2d::CCString::getCString(v22);
*(_OWORD *)Block = 0;
v37 = 0;
v24 = -1;
do
++v24;
while ( CString[v24] );
sub_14003D230(Block, CString, v24);
v25 = sub_14003F4F0((__int64)v33, (__int64)Block);
v26 = GameLevelManager::responseToDict(v25, 0);
v27 = (int *)GJUserScore::create(v26);
v28 = v27;
if ( v27 && v27[98] > 0 && v27[97] > 0 )
{
cocos2d::CCArray::addObject(v17, (struct cocos2d::CCObject *)v27);
sub_14003F4F0((__int64)v32, (__int64)(v28 + 80));
GameLevelManager::storeUserName(a1, v28[97], v28[98], v32);
}
if ( *((_QWORD *)&v37 + 1) > 0xFu )
{
v29 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v37 + 1) + 1LL) >= 0x1000 )
{
v29 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v29 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v29);
}
}
v30 = cocos2d::CCArray::count(v17);
v31 = a1[187];
if ( v30 )
{
if ( v31 )
(**(void (__fastcall ***)(__int64, cocos2d::CCArray *, __int64))v31)(v31, v17, 2);
}
else if ( v31 )
{
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v31 + 8LL))(v31, 2, 4294967294LL);
}
}
else
{
v16 = a1[187];
if ( v16 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v16 + 8LL))(v16, 2, 4294967294LL);
}
}
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
}