//
// TOSPopup::init from 0x10029d200 to 0x10029d7ca (1482 bytes)
//
// 2 xrefs:
// > TOSPopup::create @ 0x10029d1a8
// > ??> @ 0x100b085d8
//
// 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:27:53 +0000
//
__int64 __fastcall TOSPopup::init(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rax
__int64 v4; // r15
__int64 v5; // r14
__int64 v6; // r14
__int64 v7; // r14
__int64 v8; // rax
__int64 v9; // rdi
__int64 v10; // r14
__int64 v11; // rax
void *v12; // r15
__int64 v13; // r14
double v14; // xmm0_8
char *v15; // r15
_BYTE *v16; // r15
__int64 v17; // r12
double v18; // xmm0_8
char *v19; // r14
_BYTE *v20; // r14
__int64 v21; // rbx
unsigned int v22; // [rsp+0h] [rbp-70h] BYREF
_QWORD v23[2]; // [rsp+8h] [rbp-68h] BYREF
void *__p; // [rsp+18h] [rbp-58h]
float v25[2]; // [rsp+24h] [rbp-4Ch] BYREF
double v26[2]; // [rsp+2Ch] [rbp-44h] BYREF
float v27; // [rsp+3Ch] [rbp-34h] BYREF
float v28; // [rsp+40h] [rbp-30h]
unsigned __int8 v29; // [rsp+47h] [rbp-29h]
result = FLAlertLayer::init_1(a1, 150);
if ( (_BYTE)result )
{
v29 = result;
*(_BYTE *)(a1 + 596) = 1;
v3 = cocos2d::CCDirector::sharedDirector(a1, 150);
cocos2d::CCDirector::getWinSize(&v27, v3);
sub_100278270((__int64)v26, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v4 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", v26);
sub_100278260((float *)v26, 350.0, 200.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v4 + 320LL))(v4, v26);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v4,
4294967294LL);
sub_100278250(v25, v27 * 0.5, v28 * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v4 + 184LL))(v4, v25);
sub_100278270((__int64)v26, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v5 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", v26);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v5 + 960LL))(v5, &unk_100A073CC);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 912LL))(v5, 60);
sub_100278260((float *)v26, 320.0, 100.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v5 + 320LL))(v5, v26);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v5,
0xFFFFFFFFLL);
sub_100278250((float *)v26, v27 * 0.5, (float)(v28 * 0.5) + 6.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v5 + 184LL))(v5, v26);
v6 = cocos2d::CCLabelBMFont::create_3("Notice", "goldFont.fnt");
sub_100278250((float *)v26, v25[0], (float)(v25[1] + 100.0) + -16.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v6 + 184LL))(v6, v26);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v6);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v6 + 160LL))(v6, 0.80000001);
__p = operator new(0x70u);
v23[0] = 113;
v23[1] = 111;
strcpy(
(char *)__p,
"By tapping \"OK\", you accept the\n"
"Terms of Use and confirm that\n"
"you have read the Privacy Policy.");
sub_100278250((float *)v26, 0.5, 1.0);
v7 = TextArea::create(v23, "bigFont.fnt", v26, 0, 0, 1.0, 1000.0, 42.0);
if ( (v23[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v7, 10);
sub_100278250((float *)v26, v27 * 0.5, (float)(v28 * 0.5) + 15.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v7 + 184LL))(v7, v26);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 160LL))(v7, 0.5);
v8 = cocos2d::CCMenu::create();
*(_QWORD *)(a1 + 552) = v8;
v9 = *(_QWORD *)(a1 + 584);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v9 + 464LL))(v9, v8, 10);
v10 = sub_1007FE900(v9);
v11 = sub_100059E00((__int64)"OK");
v12 = CCMenuItemSpriteExtra::create(v11, 0, a1, (__int64)TOSPopup::onClose, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v12);
sub_1007FEBF0(v10, v12);
v13 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)v26, v27 * 0.5, (float)((float)(v28 * 0.5) + -100.0) + 25.0);
v14 = (*(double (__fastcall **)(__int64, double *))(*(_QWORD *)v13 + 184LL))(v13, v26);
v15 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"whiteSquare60_001.png", v14);
(*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v15 + 912LL))(v15, 0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v15 + 128LL))(v15, 4.0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v15 + 144LL))(v15, 1.2);
v16 = CCMenuItemSpriteExtra::create((__int64)v15, 0, a1, (__int64)TOSPopup::onTOS, 0);
(*(void (__fastcall **)(_QWORD, _BYTE *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v16);
v16[408] = 0;
v17 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v22, (float)(v27 * 0.5) + -80.0, (float)(v28 * 0.5) + 6.0);
cocos2d::CCNode::convertToNodeSpace(v26, v17, &v22);
v18 = (*(double (__fastcall **)(_BYTE *, double *))(*(_QWORD *)v16 + 184LL))(v16, v26);
v19 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"whiteSquare60_001.png", v18);
(*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v19 + 912LL))(v19, 0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v19 + 128LL))(v19, 4.0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v19 + 144LL))(v19, 1.2);
v20 = CCMenuItemSpriteExtra::create((__int64)v19, 0, a1, (__int64)TOSPopup::onPrivacy, 0);
(*(void (__fastcall **)(_QWORD, _BYTE *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v20);
v20[408] = 0;
v21 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v22, (float)(v27 * 0.5) + 80.0, (float)(0.5 * v28) + -14.0);
cocos2d::CCNode::convertToNodeSpace(v26, v21, &v22);
(*(void (__fastcall **)(_BYTE *, double *))(*(_QWORD *)v20 + 184LL))(v20, v26);
return v29;
}
return result;
}