//
// NumberInputLayer::init from 0x100489360 to 0x100489cfe (2462 bytes)
//
// 4 xrefs:
// > sub_100489140 @ 0x100489300
// > ParentalGateLayer::create @ 0x10087c07a
// > ParentalGateLayer::init @ 0x100886cea
// > ??> @ 0x100b4d120
//
// 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:30:44 +0000
//
__int64 __fastcall NumberInputLayer::init(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax
__int64 v3; // rax
void *v4; // r14
__int64 v5; // r14
__int64 v6; // rax
double v7; // xmm0_8
char *v8; // rax
void *v9; // r14
__int64 v10; // r12
__int64 v11; // rax
__int64 CString; // rax
char *v13; // rax
void *v14; // r14
__int64 v15; // r12
__int64 v16; // rax
__int64 v17; // rax
char *v18; // rax
void *v19; // r14
__int64 v20; // r12
__int64 v21; // rax
__int64 v22; // rax
char *v23; // rax
void *v24; // r14
__int64 v25; // r12
__int64 v26; // rax
__int64 v27; // rax
char *v28; // rax
void *v29; // r14
__int64 v30; // r12
__int64 v31; // rax
__int64 v32; // rax
char *v33; // rax
void *v34; // r14
__int64 v35; // r12
__int64 v36; // rax
__int64 v37; // rax
char *v38; // rax
void *v39; // r14
__int64 v40; // r12
unsigned int v41; // r12d
__int64 v42; // r14
__int64 v43; // rax
const char *v44; // rdi
unsigned int v45; // r14d
char *v46; // rax
void *v47; // r13
__int64 v48; // rax
float v49; // xmm0_4
__int64 v50; // r14
char v51; // [rsp+0h] [rbp-70h]
char v52; // [rsp+0h] [rbp-70h]
char v53; // [rsp+0h] [rbp-70h]
char v54; // [rsp+0h] [rbp-70h]
char v55; // [rsp+0h] [rbp-70h]
char v56; // [rsp+0h] [rbp-70h]
char v57; // [rsp+0h] [rbp-70h]
unsigned __int64 v59[2]; // [rsp+14h] [rbp-5Ch] BYREF
unsigned int v60; // [rsp+24h] [rbp-4Ch] BYREF
double v61; // [rsp+2Ch] [rbp-44h] BYREF
float v62; // [rsp+34h] [rbp-3Ch]
float v63; // [rsp+38h] [rbp-38h]
__int64 v64; // [rsp+3Ch] [rbp-34h] BYREF
unsigned __int8 v65; // [rsp+47h] [rbp-29h]
v1 = a1;
result = FLAlertLayer::init_1(a1, 150);
if ( (_BYTE)result )
{
v65 = result;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v64, v3);
sub_100278270((__int64)v59, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v4 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square01.png", v59);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v4 + 912LL))(v4, 255);
sub_100278260((float *)v59, 270.0, 270.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v4 + 320LL))(v4, v59);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v4,
0xFFFFFFFFLL);
sub_100278250((float *)v59, *(float *)&v64 * 0.5, *((float *)&v64 + 1) * 0.5);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v4 + 184LL))(v4, v59);
v5 = cocos2d::CCLabelBMFont::create_3("Enter Password", "goldFont.fnt");
*(_QWORD *)(a1 + 672) = v5;
sub_100278250((float *)&v61, *(float *)v59, (float)(*((float *)v59 + 1) + 135.0) + -16.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v5 + 184LL))(v5, &v61);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 672));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 672) + 160LL))(*(_QWORD *)(a1 + 672), 0.60000002);
v6 = cocos2d::CCMenu::create();
*(_QWORD *)(a1 + 552) = v6;
v7 = (*(double (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v6,
10);
v8 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_closeBtn_001.png", v7);
v9 = CCMenuItemSpriteExtra::create((__int64)v8, 0, a1, (__int64)NumberInputLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v9, 1.6);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v9);
v10 = *(_QWORD *)(a1 + 552);
sub_100278250(
(float *)&v60,
(float)((float)(*(float *)&v64 * 0.5) + -135.0) + 10.0,
(float)((float)(*((float *)&v64 + 1) * 0.5) + 135.0) + -10.0);
cocos2d::CCNode::convertToNodeSpace(&v61, v10, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v9 + 184LL))(v9, &v61);
v63 = (float)(*((float *)&v64 + 1) * 0.5) + 50.0;
v11 = sub_10088E820("%i", v51);
CString = cocos2d::CCString::getCString(v11);
v13 = ButtonSprite::create_1(
CString,
0x1Eu,
0x1Eu,
1u,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
1.0,
40.0);
v14 = CCMenuItemSpriteExtra::create((__int64)v13, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v14 + 72LL))(v14, 1);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v14);
v15 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, (float)(*(float *)&v64 * 0.5) + -60.0, v63);
cocos2d::CCNode::convertToNodeSpace(&v61, v15, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v14 + 184LL))(v14, &v61);
v16 = sub_10088E820("%i", v52);
v17 = cocos2d::CCString::getCString(v16);
v18 = ButtonSprite::create_1(v17, 0x1Eu, 0x1Eu, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 1.0, 40.0);
v19 = CCMenuItemSpriteExtra::create((__int64)v18, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v19 + 72LL))(v19, 2);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v19);
v20 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, *(float *)&v64 * 0.5, v63);
cocos2d::CCNode::convertToNodeSpace(&v61, v20, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v19 + 184LL))(v19, &v61);
v21 = sub_10088E820("%i", v53);
v22 = cocos2d::CCString::getCString(v21);
v23 = ButtonSprite::create_1(v22, 0x1Eu, 0x1Eu, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 1.0, 40.0);
v24 = CCMenuItemSpriteExtra::create((__int64)v23, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v24 + 72LL))(v24, 3);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v24);
v25 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, (float)(*(float *)&v64 * 0.5) + 60.0, v63);
cocos2d::CCNode::convertToNodeSpace(&v61, v25, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v24 + 184LL))(v24, &v61);
v26 = sub_10088E820("%i", v54);
v27 = cocos2d::CCString::getCString(v26);
v28 = ButtonSprite::create_1(v27, 0x1Eu, 0x1Eu, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 1.0, 40.0);
v29 = CCMenuItemSpriteExtra::create((__int64)v28, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v29 + 72LL))(v29, 4);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v29);
v62 = v63 + -50.0;
v30 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, (float)(*(float *)&v64 * 0.5) + -60.0, v63 + -50.0);
cocos2d::CCNode::convertToNodeSpace(&v61, v30, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v29 + 184LL))(v29, &v61);
v31 = sub_10088E820("%i", v55);
v32 = cocos2d::CCString::getCString(v31);
v33 = ButtonSprite::create_1(v32, 0x1Eu, 0x1Eu, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 1.0, 40.0);
v34 = CCMenuItemSpriteExtra::create((__int64)v33, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v34 + 72LL))(v34, 5);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v34);
v35 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, *(float *)&v64 * 0.5, v62);
cocos2d::CCNode::convertToNodeSpace(&v61, v35, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v34 + 184LL))(v34, &v61);
v36 = sub_10088E820("%i", v56);
v37 = cocos2d::CCString::getCString(v36);
v38 = ButtonSprite::create_1(v37, 0x1Eu, 0x1Eu, 1u, (__int64)"bigFont.fnt", (__int64)"GJ_button_01.png", 1.0, 40.0);
v39 = CCMenuItemSpriteExtra::create((__int64)v38, 0, a1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v39 + 72LL))(v39, 6);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v39);
v40 = *(_QWORD *)(a1 + 552);
sub_100278250((float *)&v60, (float)(*(float *)&v64 * 0.5) + 60.0, v62);
cocos2d::CCNode::convertToNodeSpace(&v61, v40, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v39 + 184LL))(v39, &v61);
v41 = 7;
while ( 1 )
{
if ( v41 > 9 )
{
if ( v41 == 11 )
{
v45 = 0;
v44 = "0";
}
else if ( v41 == 10 )
{
v45 = 10;
v44 = "<";
}
else
{
v45 = 12;
v44 = "OK";
}
}
else
{
v43 = sub_10088E820("%i", v57);
v44 = (const char *)cocos2d::CCString::getCString(v43);
v45 = v41;
}
v46 = ButtonSprite::create_1(
(__int64)v44,
0x1Eu,
0x1Eu,
1u,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
1.0,
40.0);
v47 = CCMenuItemSpriteExtra::create((__int64)v46, 0, v1, (__int64)&NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v47 + 72LL))(v47, v45);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v1 + 552) + 456LL))(*(_QWORD *)(v1 + 552), v47);
v48 = 0;
v49 = *(float *)&v64 * 0.5;
if ( (unsigned __int8)v41 % 3u != 1 )
break;
v49 = v49 + -60.0;
if ( v41 == 12 )
goto LABEL_17;
LABEL_3:
LOBYTE(v48) = v41 >= 0xA;
v42 = *(_QWORD *)(v1 + 552);
sub_100278250((float *)&v60, v49, flt_100A0B8F8[v48] + v63);
v1 = a1;
cocos2d::CCNode::convertToNodeSpace(&v61, v42, &v60);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v47 + 184LL))(v47, &v61);
if ( ++v41 == 13 )
{
v50 = cocos2d::CCLabelBMFont::create_3("", "bigFont.fnt");
*(_QWORD *)(a1 + 664) = v50;
sub_100278250((float *)&v61, *(float *)v59, *((float *)v59 + 1) + 95.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v50 + 184LL))(v50, &v61);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 664));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 664) + 160LL))(*(_QWORD *)(a1 + 664), 0.80000001);
NumberInputLayer::updateNumberState(a1);
return v65;
}
}
if ( !((unsigned __int8)v41 % 3u) )
v49 = v49 + 60.0;
if ( v41 != 12 )
goto LABEL_3;
LABEL_17:
*(_QWORD *)(v1 + 680) = v47;
goto LABEL_3;
}
return result;
}