//
// NumberInputLayer::init from 0x568aac to 0x568e66 (954 bytes)
//
// 2 xrefs:
// > ParentalGateLayer::init @ 0x533d74
// > NumberInputLayer::create @ 0x568868
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:29 +0000
//
GameManager *__fastcall NumberInputLayer::init(const cocos2d::CCPoint **this)
{
GameManager *v2; // r0
GameManager *v3; // r8
int v4; // r6
void (__fastcall *v5)(int, _BYTE *); // r7
const char *v6; // r2
const cocos2d::CCPoint *v7; // r0
float v8; // r1
float v9; // s15
const cocos2d::CCPoint *v10; // r6
void (__fastcall *v11)(const cocos2d::CCPoint *, _BYTE *); // r7
cocos2d::CCMenu *v12; // r0
const cocos2d::CCPoint *v13; // r0
const char *v14; // r1
int v15; // r0
int v16; // r6
const cocos2d::CCPoint *v17; // r10
void (__fastcall *v18)(int, _BYTE *); // r9
const char *v19; // r10
float v20; // s19
cocos2d::CCString *v21; // r0
int v22; // r9
char *CString; // r0
ButtonSprite *v24; // r0
int v25; // r6
float v26; // s16
float v27; // s16
float v28; // s18
void (__fastcall *v29)(int, _BYTE *); // r9
const char *v30; // r2
const cocos2d::CCPoint *v31; // r0
float v32; // r1
float v33; // r2
const cocos2d::CCPoint *v34; // r6
void (__fastcall *v35)(const cocos2d::CCPoint *, _BYTE *); // r7
float v37; // [sp+10h] [bp-64h]
cocos2d::CCPoint *v38; // [sp+2Ch] [bp-48h]
float v39; // [sp+34h] [bp-40h] BYREF
float v40; // [sp+38h] [bp-3Ch]
float v41; // [sp+3Ch] [bp-38h] BYREF
float v42; // [sp+40h] [bp-34h]
int (__fastcall *v43)(NumberInputLayer *, cocos2d::CCObject *); // [sp+44h] [bp-30h]
int v44; // [sp+48h] [bp-2Ch]
_DWORD (*v45)(NumberInputLayer *__hidden, cocos2d::CCObject *); // [sp+4Ch] [bp-28h]
int v46; // [sp+50h] [bp-24h]
_BYTE v47[8]; // [sp+54h] [bp-20h] BYREF
_BYTE v48[16]; // [sp+5Ch] [bp-18h] BYREF
v2 = FLAlertLayer::init((FLAlertLayer *)this, 150);
v3 = v2;
if ( v2 )
{
cocos2d::CCDirector::sharedDirector(v2);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v39);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v48, 0.0, 0.0, 80.0, 80.0);
v4 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v48);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v4 + 456))(v4, 255);
v5 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v4 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v48, 270.0, 270.0);
v5(v4, v48);
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v4, -1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, v39 * 0.5, v40 * 0.5);
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v4 + 92))(v4, &v41);
v7 = (const cocos2d::CCPoint *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)"Enter Password",
"goldFont.fnt",
v6);
v8 = v41;
v9 = (float)(v42 + 135.0) - 16.0;
*(this + 131) = v7;
v10 = v7;
v11 = *(void (__fastcall **)(const cocos2d::CCPoint *, _BYTE *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v8, v9);
v11(v10, v48);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), *(this + 131));
v12 = (cocos2d::CCMenu *)(*(int (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 131) + 80))(
*(this + 131),
1058642330);
v13 = (const cocos2d::CCPoint *)cocos2d::CCMenu::create(v12);
*(this + 111) = v13;
(*(void (__fastcall **)(_DWORD, const cocos2d::CCPoint *, int))(*(_DWORD *)*(this + 115) + 232))(
*(this + 115),
v13,
10);
v15 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v14);
v43 = NumberInputLayer::onClose;
v44 = 0;
v16 = CCMenuItemSpriteExtra::create(v15, 0, (int)this, (int)NumberInputLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v16, 1.6);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v16);
v17 = *(this + 111);
v18 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v48,
(float)((float)(v39 * 0.5) - 135.0) + 10.0,
(float)((float)(v40 * 0.5) + 135.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v47, v17);
v18(v16, v47);
v19 = (char *)&dword_0 + 1;
v20 = (float)(v40 * 0.5) + 50.0;
while ( 1 )
{
if ( (int)v19 > 9 )
{
if ( v19 == &byte_9[1] )
{
v22 = 10;
CString = "<";
}
else if ( v19 == &byte_9[2] )
{
CString = "0";
v22 = 0;
}
else
{
v22 = 12;
CString = "OK";
}
}
else
{
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v19);
v22 = (int)v19;
CString = (char *)cocos2d::CCString::getCString(v21);
}
v24 = ButtonSprite::create(
(ButtonSprite *)CString,
(const char *)&dword_1C + 2,
(int)&dword_1C + 2,
1.0,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x42200000,
v37);
v45 = NumberInputLayer::onNumber;
v46 = 0;
v25 = CCMenuItemSpriteExtra::create((int)v24, 0, (int)this, (int)NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 36))(v25, v22);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v25);
if ( (int)v19 <= 9 )
{
if ( (int)v19 <= 6 )
{
if ( (int)v19 <= 3 )
v27 = v20;
else
v27 = v20 - 50.0;
goto LABEL_18;
}
v26 = 100.0;
}
else
{
v26 = 150.0;
}
v27 = v20 - v26;
LABEL_18:
v28 = v39 * 0.5;
if ( (int)v19 % 3 )
{
if ( (int)v19 % 3 == 1 )
v28 = v28 - 60.0;
}
else
{
v28 = v28 + 60.0;
}
if ( v19 == &byte_9[3] )
*(this + 132) = (const cocos2d::CCPoint *)v25;
++v19;
v29 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v25 + 92);
v38 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v28, v27);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v47, v38);
v29(v25, v47);
if ( v19 == &byte_9[4] )
{
v31 = (const cocos2d::CCPoint *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)&unk_B6B226,
"bigFont.fnt",
v30);
v32 = v41;
v33 = v42 + 95.0;
*(this + 130) = v31;
v34 = v31;
v35 = *(void (__fastcall **)(const cocos2d::CCPoint *, _BYTE *))(*(_DWORD *)v31 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v32, v33);
v35(v34, v48);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), *(this + 130));
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 130) + 80))(*(this + 130), 1061997773);
NumberInputLayer::updateNumberState((NumberInputLayer *)this);
return v3;
}
}
}
return v3;
}