//
// sub_1002126D0 from 0x1002126d0 to 0x100212800 (304 bytes)
//
// 3 xrefs:
// > MessagesProfilePage::keyBackClicked @ 0x1002138b5
// > sub_1002138C0 @ 0x1002138cc
// > MessagesProfilePage::init @ 0x100211f7f
//
// 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:26:58 +0000
//
__int64 __fastcall sub_1002126D0(__int64 a1, __int64 a2, double a3)
{
__int64 v3; // rbx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 StoredOnlineLevels; // rax
unsigned int *v10; // rax
__int64 v11; // rcx
unsigned __int64 v12; // rax
unsigned __int64 v13; // rcx
void *v14; // r14
v3 = a1;
if ( *(_QWORD *)(a1 + 744) )
{
v4 = cocos2d::CCDirector::sharedDirector(a1, a2);
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 160LL))(v4);
a2 = *(_QWORD *)(a1 + 744);
a1 = v5;
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a2);
}
v6 = cocos2d::CCDirector::sharedDirector(a1, a2);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 160LL))(v6);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v7, v3);
v8 = GameLevelManager::sharedState(a3);
if ( (*(_BYTE *)(v3 + 704) & 1) != 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v8, *(_QWORD *)(v3 + 720));
if ( !StoredOnlineLevels )
goto LABEL_11;
}
else
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v8, v3 + 705);
if ( !StoredOnlineLevels )
goto LABEL_11;
}
v10 = *(unsigned int **)(StoredOnlineLevels + 56);
v11 = *v10;
if ( *v10 )
{
v12 = *((_QWORD *)v10 + 2);
v13 = v12 + 8 * v11 - 8;
do
{
if ( !*(_QWORD *)v12 )
break;
*(_BYTE *)(*(_QWORD *)v12 + 426LL) = 0;
v12 += 8LL;
}
while ( v12 <= v13 );
}
LABEL_11:
if ( *(_BYTE *)(v3 + 696) )
{
v14 = operator new(0x340u);
sub_100214450(v14);
if ( !(unsigned __int8)MessagesProfilePage::init((__int64)v14, 0) )
sub_1009A64D0(v14);
cocos2d::CCObject::autorelease(v14);
}
else
{
v14 = (void *)MessageThreadsPage::create();
}
(*(void (__fastcall **)(void *))(*(_QWORD *)v14 + 1312LL))(v14);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v3 + 1072LL))(v3, 0);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 528LL))(v3, 1);
}