//
// ParentalPrivacyPopup::create from 0x1404d4010 to 0x1404d42a2 (658 bytes)
//
// 4 xrefs:
// > ParentalOptionsLayer::applyPrivacyPushEdge @ 0x1404d3419
// > ParentalOptionsLayer::applyPrivacyPushEdge @ 0x1404d356a
// > ParentalPrivacyPopup::checkPending @ 0x1404d453a
// > ??> @ 0x140929864
//
// 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:33:01 +0000
//
// Hidden C++ exception states: #wind=4
_QWORD *__fastcall ParentalPrivacyPopup::create(char a1)
{
_QWORD *v2; // rdi
const char *v3; // rdx
size_t v4; // r8
__int64 v5; // rax
int v6; // ebx
__int64 v7; // rcx
struct cocos2d::CCObject *v8; // rax
__int64 v10; // rax
__int64 v11; // rax
int v12; // ebx
cocos2d::CCActionManager **v13; // rcx
__int128 v14; // [rsp+20h] [rbp-28h] BYREF
__int64 v15; // [rsp+30h] [rbp-18h]
__int64 v16; // [rsp+38h] [rbp-10h]
void *v17; // [rsp+58h] [rbp+10h]
void *v18; // [rsp+58h] [rbp+10h]
void *v19; // [rsp+58h] [rbp+10h]
v2 = operator new(0x2D8u);
UploadActionPopup::UploadActionPopup((__int64)v2);
*v2 = &ParentalPrivacyPopup::`vftable';
v2[40] = &ParentalPrivacyPopup::`vftable';
v2[41] = &ParentalPrivacyPopup::`vftable';
v2[42] = &ParentalPrivacyPopup::`vftable';
v2[43] = &ParentalPrivacyPopup::`vftable';
v2[44] = &ParentalPrivacyPopup::`vftable';
v2[51] = &ParentalPrivacyPopup::`vftable';
v2[54] = &ParentalPrivacyPopup::`vftable';
v2[68] = &ParentalPrivacyPopup::`vftable';
v2[88] = &ParentalPrivacyPopup::`vftable';
v2[89] = &ParentalPrivacyPopup::`vftable';
*((_BYTE *)v2 + 720) = a1;
v3 = "Updating privacy settings...";
if ( a1 )
v3 = "Restoring privacy settings...";
v14 = 0;
v15 = 0;
v16 = 0;
v4 = -1;
do
++v4;
while ( v3[v4] );
sub_14003D230(&v14, v3, v4);
if ( UploadActionPopup::init((__int64)v2, 0, &v14) )
{
v5 = GJAccountManager::sharedState();
v6 = *(_DWORD *)(v5 + 360) - *(_DWORD *)(v5 + 364);
v7 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v17 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v17);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v7 = *(_QWORD *)&qword_14090BFB0;
}
v8 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v7 + 1232), v6);
if ( v8 )
{
ParentalPrivacyPopup::startWithScore(v2, v8);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v2);
return v2;
}
else
{
v10 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v18 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v18);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v10 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v10 + 1480) = v2 + 89;
v11 = GJAccountManager::sharedState();
v12 = *(_DWORD *)(v11 + 360) - *(_DWORD *)(v11 + 364);
v13 = *(cocos2d::CCActionManager ***)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v19 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v19);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v13 = *(cocos2d::CCActionManager ***)&qword_14090BFB0;
}
GameLevelManager::getGJUserInfo(v13, v12);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v2);
return v2;
}
}
else
{
(*(void (__fastcall **)(_QWORD *, __int64))(*v2 + 8LL))(v2, 1);
return nullptr;
}
}