//
// sub_100536FB0 from 0x100536fb0 to 0x10053714f (415 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x1005200be
//
// 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:53 +0000
//
char __fastcall sub_100536FB0(__int64 a1, unsigned __int8 *a2, const std::string *a3)
{
__int64 v4; // r14
const char *data; // r13
size_t v6; // rax
size_t v7; // rbx
char *v8; // r12
size_t v9; // r14
unsigned int v10; // r12d
std::string::size_type v11; // rax
std::string::pointer v12; // r15
const void *v13; // rbx
unsigned __int64 v14; // rcx
size_t v15; // rdx
bool v16; // r15
int v17; // eax
__int64 v18; // r14
char result; // al
unsigned int v20; // eax
__int64 v21; // [rsp+8h] [rbp-58h]
_QWORD __dst[2]; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v4 = a1;
if ( (*(_BYTE *)&a3->__r_.__value_.__s.0 & 1) != 0 )
data = a3->__r_.__value_.__l.__data_;
else
data = a3->__r_.__value_.__s.__data_;
v21 = *(_QWORD *)(a1 + 1088);
v6 = strlen(data);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
__dst[0] = v9 + 1;
v4 = a1;
__dst[1] = v7;
goto LABEL_11;
}
v8 = (char *)__dst + 1;
LOBYTE(__dst[0]) = 2 * v6;
if ( v6 )
LABEL_11:
memmove(v8, data, v7);
v8[v7] = 0;
cocos2d::CCDictionary::removeObjectForKey(v21, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
v10 = 0;
v11 = std::string::find(a3, 95, 0);
if ( v11 != -1 )
{
if ( (*(_BYTE *)&a3->__r_.__value_.__s.0 & 1) != 0 )
v12 = a3->__r_.__value_.__l.__data_;
else
v12 = a3->__r_.__value_.__s.__data_;
v10 = atoi(&v12[v11 + 1]);
}
*(_WORD *)((char *)__dst + 1) = 12589;
BYTE3(__dst[0]) = 0;
v13 = a2 + 1;
v14 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v13 = *((const void **)a2 + 2);
v14 = *((_QWORD *)a2 + 1);
}
v15 = 2;
if ( v14 < 2 )
v15 = v14;
v16 = v14 != 2;
v17 = memcmp(v13, (char *)__dst + 1, v15);
v18 = *(_QWORD *)(v4 + 1256);
result = v16 || v17 != 0;
if ( result )
{
if ( v18 )
{
v20 = atoi((const char *)v13);
return (*(__int64 (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)v18 + 272LL))(v18, v10, v20);
}
}
else if ( v18 )
{
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v18 + 280LL))(v18, v10);
}
return result;
}