//
// AccountLoginLayer::init from 0x140090b00 to 0x140091449 (2377 bytes)
//
// 2 xrefs:
// > AccountLoginLayer::create @ 0x140090ab1
// > ??> @ 0x140912a34
//
// 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:26:01 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall AccountLoginLayer::init(__int64 a1, _QWORD *a2)
{
__int64 v5; // rdx
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
_QWORD *v11; // rdi
__int64 v12; // rdx
void (__fastcall *v13)(_QWORD *, __int64); // r8
__int64 v14; // rbx
__int64 v15; // rax
size_t v16; // r14
struct cocos2d::CCLabelBMFont *v17; // rdi
__int64 v18; // rbx
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rcx
cocos2d::CCArray *v22; // rdi
int v23; // eax
struct cocos2d::CCObject *v24; // rbx
int v25; // eax
struct cocos2d::CCObject *v26; // rbx
__int64 v27; // rax
__int64 v28; // rbx
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
__int64 v32; // rbx
__int64 v33; // rax
__int64 v34; // r8
__int64 v35; // rax
__int64 v36; // rbx
__int64 v37; // rax
int v38; // eax
int v39; // eax
_BYTE *v40; // rdx
__int64 v41; // rax
__int64 v42; // rax
__int64 v43; // rbx
__int64 v44; // rax
__int64 v45; // r8
__int64 v46; // rax
__int64 v47; // rbx
__int64 v48; // rax
int v49; // eax
int v50; // eax
__int64 TextInput; // rax
__int64 v52; // rcx
cocos2d::CCObject *v53; // rbx
struct cocos2d::CCObject *v54; // r14
cocos2d::CCObject *v55; // rbx
struct cocos2d::CCObject *v56; // rbx
__int64 v57; // rax
__int64 v58; // rbx
__int64 v59; // rax
__int64 v60; // rax
cocos2d::CCLayerColor *v61; // rax
__int64 *v62; // rdi
__int64 v63; // rbx
__int64 v64; // rax
int v65; // [rsp+58h] [rbp-89h] BYREF
float v66; // [rsp+60h] [rbp-81h] BYREF
float v67; // [rsp+64h] [rbp-7Dh]
__int128 v68; // [rsp+68h] [rbp-79h] BYREF
__int64 v69; // [rsp+78h] [rbp-69h]
__int64 v70; // [rsp+80h] [rbp-61h]
_BYTE v71[8]; // [rsp+88h] [rbp-59h] BYREF
_BYTE v72[8]; // [rsp+90h] [rbp-51h] BYREF
float v73; // [rsp+98h] [rbp-49h] BYREF
float v74; // [rsp+9Ch] [rbp-45h]
_BYTE v75[8]; // [rsp+A0h] [rbp-41h] BYREF
_QWORD *v76; // [rsp+A8h] [rbp-39h]
v76 = a2;
v65 = -1778384896;
if ( cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v65) )
{
FLAlertLayer::incrementForcePrio((struct cocos2d::CCObject *)a1);
LOBYTE(v5) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 920LL))(a1, v5);
LOBYTE(v6) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v6);
*(_BYTE *)(a1 + 596) = 1;
v8 = cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8, &v73);
v9 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 584) = v9;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v9);
v10 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v68, 0.0, 0.0, 80.0, 80.0);
v11 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v10);
v12 = v11[40];
v13 = *(void (__fastcall **)(_QWORD *, __int64))(v12 + 40);
LOBYTE(v12) = -1;
v13(v11 + 40, v12);
v14 = *v11;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v65, 400.0, 300.0);
(*(void (__fastcall **)(_QWORD *, __int64))(v14 + 312))(v11, v15);
v16 = -1;
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v11,
0xFFFFFFFFLL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v66, v73 * 0.5, v74 * 0.5);
(*(void (__fastcall **)(_QWORD *, float *))(*v11 + 184LL))(v11, &v66);
v17 = cocos2d::CCLabelBMFont::create("Login", (const char *)&qword_140704F78);
v18 = *(_QWORD *)v17;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, v66, (float)(v67 + 150.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);
*(_DWORD *)(a1 + 640) = -1;
v20 = cocos2d::CCMenu::create();
*(_QWORD *)(a1 + 552) = v20;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v20, 10);
v22 = (cocos2d::CCArray *)cocos2d::CCArray::create(v21);
v23 = (unsigned int)ButtonSprite::create_1(
(int)"Cancel",
0,
0,
1.0,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v24 = CCMenuItemSpriteExtra::create(v23, 0, a1, (__int64)AccountLoginLayer::onClose);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v24);
cocos2d::CCArray::addObject(v22, v24);
v25 = (unsigned int)ButtonSprite::create_1(
(int)"Login",
0,
0,
1.0,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v26 = CCMenuItemSpriteExtra::create(v25, 0, a1, (__int64)AccountLoginLayer::onSubmit);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v26);
cocos2d::CCArray::addObject(v22, v26);
v27 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 584) + 200LL))(*(_QWORD *)(a1 + 584));
v28 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, v66, (float)((float)(v67 - 150.0) + 22.0) + *(float *)(v27 + 4));
cocos2d::CCNode::convertToNodeSpace(v28, &v68, v29);
GameToolbox::alignItemsHorisontally((__int64)v22, 15.0, v30, 0);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v71, 300.0, 30.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v66, v67 + 80.0);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
v32 = v31;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v72);
AccountLoginLayer::createTextBackground(a1, v33, v34, v32);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
v36 = v35;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v72);
*(_QWORD *)(a1 + 696) = AccountLoginLayer::createTextLabel(a1, v37, "Username:", v36);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
LODWORD(v36) = v38;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v72);
*(_QWORD *)(a1 + 680) = AccountLoginLayer::createTextInput(a1, v39, v36, (unsigned int)"Username", 1);
v68 = 0;
v69 = 0;
v70 = 0;
*(_QWORD *)&v68 = sub_14003D460(0x40u);
v69 = 63;
v70 = 63;
strcpy((char *)v68, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 680), (void **)&v68);
*(_DWORD *)(*(_QWORD *)(a1 + 680) + 608LL) = 16;
if ( a2[2] )
{
v40 = a2;
if ( a2[3] > 0xFu )
v40 = (_BYTE *)*a2;
v68 = 0;
v69 = 0;
v70 = 0;
do
++v16;
while ( v40[v16] );
sub_14003D230(&v68, v40, v16);
CCTextInputNode::setString(*(_QWORD **)(a1 + 680), &v68);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 0.0, -50.0);
cocos2d::CCPoint::operator+(v72, v75, v41);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
v43 = v42;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v75);
AccountLoginLayer::createTextBackground(a1, v44, v45, v43);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
v47 = v46;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v75);
*(_QWORD *)(a1 + 704) = AccountLoginLayer::createTextLabel(a1, v48, &qword_140716968, v47);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, (const struct cocos2d::CCSize *)v71);
LODWORD(v47) = v49;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, (const struct cocos2d::CCPoint *)v75);
TextInput = AccountLoginLayer::createTextInput(a1, v50, v47, (unsigned int)"Password", 2);
*(_QWORD *)(a1 + 688) = TextInput;
v68 = 0;
v69 = 0;
v70 = 15;
LOBYTE(v68) = 0;
CCTextInputNode::setAllowedChars(TextInput, (void **)&v68);
*(_DWORD *)(*(_QWORD *)(a1 + 688) + 608LL) = 64;
*(_BYTE *)(*(_QWORD *)(a1 + 688) + 625LL) = 1;
v52 = *(_QWORD *)(a1 + 688);
*(_DWORD *)(v52 + 564) = 1065353216;
CCTextInputNode::refreshLabel(v52);
cocos2d::CCArray::removeAllObjects(v22);
*(_QWORD *)&v68 = operator new(0x2C8u);
v53 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite(v68);
if ( v53 )
{
if ( ButtonSprite::init_1(
(__int64)v53,
(__int64)"Forgot Username",
120,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_05.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v53);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v53 + 8LL))(v53, 1);
LODWORD(v53) = 0;
}
}
v54 = CCMenuItemSpriteExtra::create((int)v53, 0, a1, (__int64)AccountLoginLayer::onForgotUser);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v54);
*(_QWORD *)&v68 = operator new(0x2C8u);
v55 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite(v68);
if ( v55 )
{
if ( ButtonSprite::init_1(
(__int64)v55,
(__int64)"Forgot Password",
120,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_05.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v55);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v55 + 8LL))(v55, 1);
LODWORD(v55) = 0;
}
}
v56 = CCMenuItemSpriteExtra::create((int)v55, 0, a1, (__int64)AccountLoginLayer::onForgotPassword);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v56);
cocos2d::CCArray::addObject(v22, v56);
cocos2d::CCArray::addObject(v22, v54);
v57 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 584) + 200LL))(*(_QWORD *)(a1 + 584));
v58 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, v66, (float)(v67 - 45.0) + *(float *)(v57 + 4));
cocos2d::CCNode::convertToNodeSpace(v58, &v65, v59);
GameToolbox::alignItemsVertically((__int64)v22, 15.0, v60);
v61 = LoadingCircle::create();
*(_QWORD *)(a1 + 712) = v61;
*((_QWORD *)v61 + 69) = *(_QWORD *)(a1 + 584);
*(_BYTE *)(*(_QWORD *)(a1 + 712) + 560LL) = 1;
cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 712));
LoadingCircle::show(*(_QWORD *)(a1 + 712));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 712) + 336LL))(*(_QWORD *)(a1 + 712), 0);
v62 = *(__int64 **)(*(_QWORD *)(a1 + 712) + 544LL);
v63 = *v62;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, v73 * 0.5, v74 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v63 + 184))(v62, v64);
sub_14003D310((__int64)a2);
return 1;
}
else
{
sub_14003D310((__int64)a2);
return 0;
}
}