//
// TOSPopup::init from 0x1403a9290 to 0x1403a98f6 (1638 bytes)
//
// 5 xrefs:
// > MenuLayer::showTOS @ 0x14047424e
// > MenuLayer::showTOS @ 0x140474255
// > MenuLayer::showTOS @ 0x14047423f
// > ??> @ 0x14077b9c0
// > ??> @ 0x140923948
//
// 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:31:20 +0000
//
// Hidden C++ exception states: #wind=1
bool __fastcall TOSPopup::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rdi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rdi
__int64 v11; // rdx
void (__fastcall *v12)(__int64, __int64); // r8
__int64 v13; // rbx
__int64 v14; // rax
__int64 v15; // rbx
__int64 v16; // rax
struct cocos2d::CCLabelBMFont *v17; // rdi
__int64 v18; // rbx
__int64 v19; // rax
const struct cocos2d::CCPoint *v20; // rax
char *v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
__int64 v24; // rcx
__int64 v25; // rax
__int64 v26; // rcx
cocos2d::CCArray *v27; // rdi
int v28; // eax
struct cocos2d::CCObject *v29; // rbx
__int64 *v30; // rdi
__int64 v31; // rbx
__int64 v32; // rax
struct cocos2d::CCSprite *v33; // rbx
cocos2d::CCObject *v34; // rsi
__int64 v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
__int64 v38; // rax
struct cocos2d::CCSprite *v39; // rbx
cocos2d::CCObject *v40; // rsi
__int64 v41; // rdi
__int64 v42; // rbx
__int64 v43; // rax
__int64 v44; // rax
_BYTE v45[16]; // [rsp+48h] [rbp-49h] BYREF
__int128 v46; // [rsp+58h] [rbp-39h] BYREF
__int64 v47; // [rsp+68h] [rbp-29h]
__int64 v48; // [rsp+70h] [rbp-21h]
float v49; // [rsp+100h] [rbp+6Fh] BYREF
float v50; // [rsp+104h] [rbp+73h]
float v51; // [rsp+108h] [rbp+77h] BYREF
float v52; // [rsp+10Ch] [rbp+7Bh]
__int128 *v53; // [rsp+110h] [rbp+7Fh] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
*(_BYTE *)(a1 + 596) = 1;
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v49);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v45, 0.0, 0.0, 80.0, 80.0);
v6 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
v7 = *(_QWORD *)v6;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v53, 350.0, 200.0);
(*(void (__fastcall **)(__int64, __int64))(v7 + 312))(v6, v8);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v6,
4294967294LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, v49 * 0.5, v50 * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v6 + 184LL))(v6, &v51);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v45, 0.0, 0.0, 80.0, 80.0);
v10 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v9);
(**(void (__fastcall ***)(__int64, void *))(v10 + 320))(v10 + 320, &unk_1407034A8);
v11 = *(_QWORD *)(v10 + 320);
v12 = *(void (__fastcall **)(__int64, __int64))(v11 + 40);
LOBYTE(v11) = 60;
v12(v10 + 320, v11);
v13 = *(_QWORD *)v10;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v53, 320.0, 100.0);
(*(void (__fastcall **)(__int64, __int64))(v13 + 312))(v10, v14);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v10,
0xFFFFFFFFLL);
v15 = *(_QWORD *)v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, v49 * 0.5, (float)(v50 * 0.5) + 6.0);
(*(void (__fastcall **)(__int64, __int64))(v15 + 184))(v10, v16);
v17 = cocos2d::CCLabelBMFont::create("Notice", "goldFont.fnt");
v18 = *(_QWORD *)v17;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, v51, (float)(v52 + 100.0) - 16.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v18 + 184))(v17, v19);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v17);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v17 + 160LL))(v17);
v53 = &v46;
v46 = 0;
v47 = 0;
v48 = 0;
*(_QWORD *)&v46 = sub_14003D460(0x70u);
v47 = 111;
v48 = 111;
strcpy(
(char *)v46,
"By tapping \"OK\", you accept the\n"
"Terms of Use and confirm that\n"
"you have read the Privacy Policy.");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 0.5, 1.0);
v21 = TextArea::create((__int64)&v46, &qword_140704F78, 1.0, 1000.0, v20, 1109917696, 0, 0);
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v21, 10);
v22 = *(_QWORD *)v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, v49 * 0.5, (float)(v50 * 0.5) + 15.0);
(*(void (__fastcall **)(char *, __int64))(v22 + 184))(v21, v23);
(*(void (__fastcall **)(char *))(*(_QWORD *)v21 + 160LL))(v21);
v25 = cocos2d::CCMenu::create(v24);
*(_QWORD *)(a1 + 552) = v25;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v25, 10);
v27 = (cocos2d::CCArray *)cocos2d::CCArray::create(v26);
v28 = (unsigned int)ButtonSprite::create_1(
(int)"OK",
0,
0,
1.0,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v29 = CCMenuItemSpriteExtra::create(v28, 0, a1, (__int64)TOSPopup::onClose);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v29);
cocos2d::CCArray::addObject(v27, v29);
v30 = *(__int64 **)(a1 + 552);
v31 = *v30;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, v49 * 0.5, (float)((float)(v50 * 0.5) - 100.0) + 25.0);
(*(void (__fastcall **)(__int64 *, __int64))(v31 + 184))(v30, v32);
v33 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v33 + 40) + 40LL))((__int64)v33 + 320, 0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v33 + 120LL))(v33);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v33 + 136LL))(v33);
v34 = CCMenuItemSpriteExtra::create((int)v33, 0, a1, (__int64)SupportLayer::onTOS);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v34);
*((_BYTE *)v34 + 408) = 0;
v35 = *(_QWORD *)v34;
v36 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, (float)(v49 * 0.5) - 80.0, (float)(v50 * 0.5) + 6.0);
cocos2d::CCNode::convertToNodeSpace(v36, v45, v37);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v35 + 184))(v34, v38);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v39 + 40) + 40LL))((__int64)v39 + 320, 0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v39 + 120LL))(v39);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v39 + 136LL))(v39);
v40 = CCMenuItemSpriteExtra::create((int)v39, 0, a1, (__int64)SupportLayer::onPrivacy);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v40);
*((_BYTE *)v40 + 408) = 0;
v41 = *(_QWORD *)v40;
v42 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v53, (float)(v49 * 0.5) + 80.0, (float)(v50 * 0.5) - 14.0);
cocos2d::CCNode::convertToNodeSpace(v42, v45, v43);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v41 + 184))(v40, v44);
return 1;
}
return result;
}