//
// ParentalOptionsLayer::applyPrivacyPushEdge from 0x1404d3030 to 0x1404d36a2 (1650 bytes)
//
// 2 xrefs:
// > ParentalOptionsLayer::onToggle @ 0x1404d2f9f
// > ??> @ 0x1409297e0
//
// 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=8
void __fastcall ParentalOptionsLayer::applyPrivacyPushEdge(__int64 a1, char a2)
{
__int64 v3; // rbx
bool v4; // si
__int64 v5; // rbx
cocos2d::CCString *v6; // rax
int v7; // ebx
void *v8; // r8
__int64 v9; // rbx
__int64 v10; // rbx
struct cocos2d::CCString *v11; // rax
void *v12; // rcx
__int64 v13; // rbx
__int64 v14; // rbx
struct cocos2d::CCString *v15; // rax
void *v16; // rcx
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rbx
__int64 v20; // rbx
struct cocos2d::CCString *v21; // rax
void *v22; // rcx
__int64 v23; // rax
__int64 v24; // rcx
__int64 v25; // rax
__int64 v26; // rbx
__int64 v27; // rbx
struct cocos2d::CCString *v28; // rax
void *v29; // [rsp+30h] [rbp-50h]
void *v30; // [rsp+30h] [rbp-50h]
void *v31; // [rsp+30h] [rbp-50h]
void *v32; // [rsp+30h] [rbp-50h]
void *v33; // [rsp+30h] [rbp-50h]
void *v34; // [rsp+30h] [rbp-50h]
void *Src[2]; // [rsp+38h] [rbp-48h] BYREF
__int64 v36; // [rsp+48h] [rbp-38h]
unsigned __int64 v37; // [rsp+50h] [rbp-30h]
void *Block[2]; // [rsp+58h] [rbp-28h] BYREF
__int64 v39; // [rsp+68h] [rbp-18h]
unsigned __int64 v40; // [rsp+70h] [rbp-10h]
v3 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v29 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v29);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v3 = qword_14090BFD0;
}
v4 = GameManager::getGameVariable(v3, "0218")
|| GameManager::getGameVariable(v3, "0219")
|| GameManager::getGameVariable(v3, "0243");
v5 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v30 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v30);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v5 = qword_14090BFD0;
}
*(_OWORD *)Block = 0;
v39 = 3;
v40 = 15;
LODWORD(Block[0]) = 6256231;
sub_140044D80(Block, "0227", 4u);
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v5 + 432), Block);
v7 = cocos2d::CCString::intValue(v6);
if ( v40 > 0xF )
{
v8 = Block[0];
if ( v40 + 1 >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
v39 = 0;
v40 = 15;
LOBYTE(Block[0]) = 0;
if ( v4 )
{
if ( a2 )
return;
if ( v7 == 3 )
{
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v36 = 3;
v37 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0227", 4u);
v10 = *(_QWORD *)(v9 + 432);
v11 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 2);
cocos2d::CCDictionary::setObject(v10, v11, Src);
if ( v37 > 0xF )
{
v12 = Src[0];
if ( v37 + 1 >= 0x1000 )
{
v12 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
LABEL_52:
j_j_free(v12);
}
}
else if ( v7 != 2 )
{
v13 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v32 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v13 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v36 = 3;
v37 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0227", 4u);
v14 = *(_QWORD *)(v13 + 432);
v15 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 1);
cocos2d::CCDictionary::setObject(v14, v15, Src);
if ( v37 > 0xF )
{
v16 = Src[0];
if ( v37 + 1 >= 0x1000 )
{
v16 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
v17 = GJAccountManager::sharedState();
if ( *(_DWORD *)(v17 + 360) - *(_DWORD *)(v17 + 364) > 0 )
{
v18 = ParentalPrivacyPopup::create(0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v18 + 1064LL))(v18);
}
}
}
else
{
if ( !a2 )
return;
if ( ((v7 - 2) & 0xFFFFFFFD) != 0 || (unsigned __int8)ParentalPrivacyPopup::snapshotIsForOtherAccount() )
{
v26 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v34 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v34);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v26 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v36 = 3;
v37 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0227", 4u);
v27 = *(_QWORD *)(v26 + 432);
v28 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 0);
cocos2d::CCDictionary::setObject(v27, v28, Src);
if ( v37 > 0xF )
{
v12 = Src[0];
if ( v37 + 1 >= 0x1000 )
{
v12 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
goto LABEL_52;
}
}
else
{
v19 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v33 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v19 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v36 = 3;
v37 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0227", 4u);
v20 = *(_QWORD *)(v19 + 432);
v21 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 3);
cocos2d::CCDictionary::setObject(v20, v21, Src);
if ( v37 > 0xF )
{
v22 = Src[0];
if ( v37 + 1 >= 0x1000 )
{
v22 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v22 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v22);
}
v23 = GJAccountManager::sharedState();
v24 = (unsigned int)(*(_DWORD *)(v23 + 360) - *(_DWORD *)(v23 + 364));
if ( *(_DWORD *)(v23 + 360) - *(_DWORD *)(v23 + 364) > 0 )
{
LOBYTE(v24) = 1;
v25 = ParentalPrivacyPopup::create(v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v25 + 1064LL))(v25);
}
}
}
}