//
// sub_14009D640 from 0x14009d640 to 0x14009d7ab (363 bytes)
//
// 3 xrefs:
// > sub_1400A06F0 @ 0x1400a06f7
// > ??> @ 0x14071bee0
// > ??> @ 0x140912f80
//
// 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:26:05 +0000
//
// Hidden C++ exception states: #wind=1
char *__fastcall sub_14009D640(char *Block, char a2)
{
char *v4; // rdi
__int64 v5; // rax
void *v6; // rax
__int64 v7; // rax
cocos2d::CCObject *v8; // rcx
cocos2d::CCObject *v9; // rcx
*(_QWORD *)Block = &ChallengesPage::`vftable';
*((_QWORD *)Block + 40) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 41) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 42) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 43) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 44) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 51) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 54) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 68) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 83) = &ChallengesPage::`vftable';
v4 = Block + 672;
*((_QWORD *)Block + 84) = &ChallengesPage::`vftable';
*((_QWORD *)Block + 85) = &ChallengesPage::`vftable';
v5 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v6 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v6);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v5 = *(_QWORD *)&qword_14090BFB0;
}
if ( *(char **)(v5 + 1552) == v4 )
*(_QWORD *)(v5 + 1552) = 0;
v7 = *((_QWORD *)Block + 90);
if ( v7 )
*(_QWORD *)(v7 + 408) = 0;
v8 = *((cocos2d::CCObject **)Block + 91);
if ( v8 )
cocos2d::CCObject::release(v8);
v9 = *((cocos2d::CCObject **)Block + 86);
if ( v9 )
cocos2d::CCObject::release(v9);
FLAlertLayer::dFLAlertLayer((__int64)Block);
if ( (a2 & 1) != 0 )
j_j_free(Block);
return Block;
}