//
// GameStatsManager::hasCompletedDemonLevel from 0x1000330f0 to 0x100033204 (276 bytes)
//
// 1 xrefs:
// > GameStatsManager::completedDemonLevel @ 0x1000334b7
//
// 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:19:31 +0000
//
bool __fastcall GameStatsManager::hasCompletedDemonLevel(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
char *v3; // rdi
__int64 v4; // rax
const char *CString; // r15
size_t v6; // rax
size_t v7; // r14
char *v8; // r12
size_t v9; // r13
__int64 v10; // rbx
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v2 = *(_QWORD *)(a1 + 608);
if ( *(_DWORD *)(a2 + 920) <= *(_DWORD *)(a2 + 924) )
{
if ( *(_BYTE *)(a2 + 649) == 1 )
v3 = "gdemon_%i";
else
v3 = "demon_%i";
}
else
{
v3 = "ddemon_%i";
}
v4 = sub_10088E820(v3, __dst[0]);
CString = (const char *)cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
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;
__dst[1] = v7;
goto LABEL_13;
}
LOBYTE(__dst[0]) = 2 * v6;
v8 = (char *)__dst + 1;
if ( v6 )
LABEL_13:
memmove(v8, CString, v7);
v8[v7] = 0;
v10 = cocos2d::CCDictionary::objectForKey(v2, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return v10 != 0;
}