//
// GameLevelManager::onUnblockUserCompleted from 0x100523c20 to 0x100523e41 (545 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051bf83
//
// 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
//
void __fastcall GameLevelManager::onUnblockUserCompleted(__int64 a1, unsigned __int8 *a2, __int64 a3, double a4)
{
__int64 v4; // r12
const char *v5; // r14
size_t v6; // rax
size_t v7; // r13
char *v8; // rbx
size_t v9; // r12
GameLevelManager *v10; // rdi
unsigned int SplitIntFromKey; // r14d
const void *v12; // rdi
unsigned __int64 v13; // rcx
size_t v14; // rdx
bool v15; // bl
int v16; // eax
__int64 v17; // rdi
__int64 v18; // rdi
__int64 v19; // r15
unsigned int v20; // ebx
__int64 v21; // rdi
__int64 v22; // [rsp+0h] [rbp-50h]
__int128 __dst; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v4 = a1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(const char **)(a3 + 16);
else
v5 = (const char *)(a3 + 1);
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a4);
v7 = v6;
v22 = *(_QWORD *)(a1 + 608);
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
*(_QWORD *)&__dst = v9 + 1;
v4 = a1;
*((_QWORD *)&__dst + 1) = v7;
goto LABEL_11;
}
v8 = (char *)&__dst + 1;
LOBYTE(__dst) = 2 * v6;
if ( v6 )
LABEL_11:
memmove(v8, v5, v7);
v8[v7] = 0;
v10 = (GameLevelManager *)v22;
cocos2d::CCDictionary::removeObjectForKey_1(v22, (char *)&__dst);
if ( (__dst & 1) != 0 )
{
v10 = (GameLevelManager *)__p;
operator delete(__p);
}
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v10, v5, 1);
*(_WORD *)((char *)&__dst + 1) = 12589;
BYTE3(__dst) = 0;
v12 = a2 + 1;
v13 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v12 = *((const void **)a2 + 2);
v13 = *((_QWORD *)a2 + 1);
}
v14 = 2;
if ( v13 < 2 )
v14 = v13;
v15 = v13 != 2;
v16 = memcmp(v12, (char *)&__dst + 1, v14);
v17 = *(_QWORD *)(v4 + 808);
if ( v15 || v16 != 0 )
{
if ( v17 )
(**(void (__fastcall ***)(__int64, _QWORD, __int64))v17)(v17, SplitIntFromKey, 35);
cocos2d::CCDictionary::removeObjectForKey(*(cocos2d::CCDictionary **)(v4 + 616), (int)SplitIntFromKey);
v18 = *(_QWORD *)(v4 + 560);
LOBYTE(__dst) = 22;
strcpy((char *)&__dst + 1, "get_blocked");
v19 = cocos2d::CCDictionary::objectForKey_1(v18, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v19 && (unsigned int)sub_100720070(v19) )
{
v20 = 0;
while ( *(_DWORD *)(sub_1007200C0(v19, v20) + 376) != SplitIntFromKey )
{
if ( ++v20 >= (unsigned int)sub_100720070(v19) )
return;
}
sub_100720230(v19, v20, 1);
v21 = *(_QWORD *)(v4 + 816);
if ( v21 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v21 + 16LL))(v21, v19, 1);
}
}
else if ( v17 )
{
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v17 + 8LL))(v17, SplitIntFromKey, 35);
}
}