//
// NumberInputLayer::init from 0x1404a1250 to 0x1404a181d (1485 bytes)
//
// 3 xrefs:
// > ParentalGateLayer::init @ 0x1404d3ca9
// > ??> @ 0x1407b9ba0
// > ??> @ 0x140929528
//
// 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:32:57 +0000
//
// Hidden C++ exception states: #wind=2
bool __fastcall NumberInputLayer::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
_QWORD *v6; // rdi
__int64 v7; // rdx
void (__fastcall *v8)(_QWORD *, __int64); // r8
__int64 v9; // rbx
__int64 v10; // rax
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rcx
__int64 v15; // rax
int v16; // eax
cocos2d::CCObject *v17; // rsi
__int64 v18; // rdi
__int64 v19; // rbx
__int64 v20; // rax
__int64 v21; // rax
float v22; // xmm6_4
unsigned int v23; // esi
unsigned int v24; // r15d
cocos2d::CCString *v25; // rax
const char *CString; // rdi
__int64 v27; // rax
cocos2d::CCObject *v28; // rbx
__int64 *v29; // r14
float v30; // xmm2_4
float v31; // xmm1_4
__int64 v32; // rdi
__int64 v33; // rbx
__int64 v34; // rax
__int64 v35; // rax
struct cocos2d::CCLabelBMFont *v36; // rdi
__int64 v37; // rbx
__int64 v38; // rax
void *v39; // [rsp+50h] [rbp-E8h] BYREF
_BYTE v40[8]; // [rsp+58h] [rbp-E0h] BYREF
_BYTE v41[16]; // [rsp+60h] [rbp-D8h] BYREF
float v42; // [rsp+148h] [rbp+10h] BYREF
float v43; // [rsp+14Ch] [rbp+14h]
float v44; // [rsp+150h] [rbp+18h] BYREF
float v45; // [rsp+154h] [rbp+1Ch]
void *v46; // [rsp+158h] [rbp+20h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v42);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v41, 0.0, 0.0, 80.0, 80.0);
v6 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
v7 = v6[40];
v8 = *(void (__fastcall **)(_QWORD *, __int64))(v7 + 40);
LOBYTE(v7) = -1;
v8(v6 + 40, v7);
v9 = *v6;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v46, 270.0, 270.0);
(*(void (__fastcall **)(_QWORD *, __int64))(v9 + 312))(v6, v10);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v6,
0xFFFFFFFFLL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v44, v42 * 0.5, v43 * 0.5);
(*(void (__fastcall **)(_QWORD *, float *))(*v6 + 184LL))(v6, &v44);
v11 = cocos2d::CCLabelBMFont::create("Enter Password", "goldFont.fnt");
*(_QWORD *)(a1 + 672) = v11;
v12 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v46, v44, (float)(v45 + 135.0) - 16.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 672));
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 672) + 160LL))(*(_QWORD *)(a1 + 672));
v15 = cocos2d::CCMenu::create(v14);
*(_QWORD *)(a1 + 552) = v15;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v15, 10);
v16 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v17 = CCMenuItemSpriteExtra::create(v16, 0, a1, (__int64)PagedListPopup::onClose);
*((_DWORD *)v17 + 93) = 1070386381;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v17);
v18 = *(_QWORD *)v17;
v19 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v46,
(float)((float)(v42 * 0.5) - 135.0) + 10.0,
(float)((float)(v43 * 0.5) + 135.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v19, &v39, v20);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v18 + 184))(v17, v21);
v22 = (float)(v43 * 0.5) + 50.0;
v23 = 1;
while ( 1 )
{
v24 = v23;
if ( v23 >= 0xA )
{
if ( v23 == 10 )
{
CString = (const char *)&word_140795C7C;
}
else if ( v23 == 11 )
{
CString = "0";
v24 = 0;
}
else
{
CString = "OK";
if ( v23 != 12 )
CString = nullptr;
}
}
else
{
v25 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, v23);
CString = cocos2d::CCString::getCString(v25);
}
v46 = operator new(0x2C8u);
v27 = ButtonSprite::ButtonSprite((__int64)v46);
v28 = (cocos2d::CCObject *)v27;
if ( v27 )
{
if ( ButtonSprite::init_1(
v27,
(__int64)CString,
30,
30,
1065353216,
1,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1109393408) )
{
cocos2d::CCObject::autorelease(v28);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v28 + 8LL))(v28, 1);
v28 = nullptr;
}
}
v39 = operator new(0x208u);
v29 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v39);
if ( !v29 )
goto LABEL_19;
if ( !CCMenuItemSpriteExtra::init(v29, (__int64 *)v28, 0, a1, (__int64)NumberInputLayer::onNumber) )
break;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v29);
LABEL_20:
(*(void (__fastcall **)(__int64 *, _QWORD))(*v29 + 64))(v29, v24);
(*(void (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v29);
v30 = v22;
if ( v23 < 0xA )
{
if ( v23 < 7 )
{
if ( v23 >= 4 )
v30 = v22 - 50.0;
}
else
{
v30 = v22 - 100.0;
}
}
else
{
v30 = v22 - 150.0;
}
v31 = v42 * 0.5;
if ( v23 == 3 * (v23 / 3) )
{
v31 = v31 + 60.0;
}
else if ( v23 % 3 == 1 )
{
v31 = v31 + -60.0;
}
if ( v23 == 12 )
*(_QWORD *)(a1 + 680) = v29;
v32 = *v29;
v33 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, v31, v30);
cocos2d::CCNode::convertToNodeSpace(v33, v41, v34);
(*(void (__fastcall **)(__int64 *, __int64))(v32 + 184))(v29, v35);
if ( (int)++v23 >= 13 )
{
v36 = cocos2d::CCLabelBMFont::create(&byte_1406ED6E0, (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 664) = v36;
v37 = *(_QWORD *)v36;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v46, v44, v45 + 95.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v37 + 184))(v36, v38);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 664));
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 664) + 160LL))(*(_QWORD *)(a1 + 664));
NumberInputLayer::updateNumberState(a1);
return 1;
}
}
(*(void (__fastcall **)(__int64 *, __int64))(*v29 + 8))(v29, 1);
LABEL_19:
v29 = nullptr;
goto LABEL_20;
}
return result;
}