//
// sub_100528E70 from 0x100528e70 to 0x1005291a5 (821 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x100520484
//
// 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:47 +0000
//
void __fastcall sub_100528E70(_QWORD *a1, unsigned __int8 *a2, __int64 a3)
{
_QWORD *v3; // r12
const char *v4; // r14
size_t v5; // rax
size_t v6; // r13
char *v7; // rbx
size_t v8; // r12
__int64 v9; // rdi
unsigned int SplitIntFromKey; // r14d
const void *v11; // rdi
unsigned __int64 v12; // rcx
size_t v13; // rdx
__int64 v14; // rdi
__int64 v15; // rax
__int64 v16; // rdi
void (__fastcall ***v17)(_QWORD, _QWORD, __int64); // rdi
__int64 v18; // rdi
__int64 v19; // rdi
__int64 v20; // r15
unsigned int v21; // ebx
__int64 v22; // rdi
__int64 v23; // rdi
__int64 v24; // rdi
__int64 v25; // [rsp+0h] [rbp-50h]
__int128 __dst; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v3 = a1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v4 = *(const char **)(a3 + 16);
else
v4 = (const char *)(a3 + 1);
v5 = strlen(v4);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
v25 = a1[136];
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
v7 = (char *)operator new(v8);
__p = v7;
*(_QWORD *)&__dst = v8 + 1;
v3 = a1;
*((_QWORD *)&__dst + 1) = v6;
goto LABEL_11;
}
v7 = (char *)&__dst + 1;
LOBYTE(__dst) = 2 * v5;
if ( v5 )
LABEL_11:
memmove(v7, v4, v6);
v7[v6] = 0;
v9 = v25;
cocos2d::CCDictionary::removeObjectForKey(v25, (char *)&__dst);
if ( (__dst & 1) != 0 )
{
v9 = (__int64)__p;
operator delete(__p);
}
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v9, v4, 1);
*(_WORD *)((char *)&__dst + 1) = 12589;
BYTE3(__dst) = 0;
v11 = a2 + 1;
v12 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v11 = *((const void **)a2 + 2);
v12 = *((_QWORD *)a2 + 1);
}
v13 = 2;
if ( v12 < 2 )
v13 = v12;
if ( (v12 != 2) | (memcmp(v11, (char *)&__dst + 1, v13) != 0) )
{
v15 = cocos2d::CCDictionary::objectForKey_1(v3[140], (int)SplitIntFromKey);
if ( v15 )
{
*(_DWORD *)(v15 + 688) = 2;
*(_BYTE *)(v15 + 722) = 0;
v16 = v3[169];
if ( v16 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 16LL))(v16, v15);
}
v17 = (void (__fastcall ***)(_QWORD, _QWORD, __int64))v3[170];
if ( v17 )
(**v17)(v17, SplitIntFromKey, 40);
sub_10057ADF0(v3, SplitIntFromKey, 0);
v18 = v3[130];
LOBYTE(__dst) = 22;
strcpy((char *)&__dst + 1, "get_blocked");
cocos2d::CCDictionary::removeObjectForKey(v18, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
sub_100569BF0(v3, 0, 1);
v19 = v3[130];
LOBYTE(__dst) = 22;
strcpy((char *)&__dst + 1, "get_friends");
v20 = cocos2d::CCDictionary::objectForKey(v19, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v20 && (unsigned int)sub_1007FEF90(v20) )
{
v21 = 0;
while ( *(_DWORD *)(sub_1007FEFE0(v20, v21) + 376) != SplitIntFromKey )
{
if ( ++v21 >= (unsigned int)sub_1007FEF90(v20) )
goto LABEL_38;
}
sub_1007FF150(v20, v21, 1);
v22 = v3[171];
if ( v22 )
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v22 + 16LL))(v22, v20, 0);
}
LABEL_38:
sub_10054E850(v3, SplitIntFromKey);
v23 = v3[130];
LOBYTE(__dst) = 26;
strcpy((char *)&__dst + 1, "get_following");
cocos2d::CCDictionary::removeObjectForKey(v23, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
v24 = v3[130];
LOBYTE(__dst) = 18;
strcpy((char *)&__dst + 1, "get_muted");
cocos2d::CCDictionary::removeObjectForKey(v24, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
}
else
{
v14 = v3[170];
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v14 + 8LL))(v14, SplitIntFromKey, 40);
}
}