//
// AccountLoginLayer::init from 0x14007b910 to 0x14007c4b3 (2979 bytes)
//
// 2 xrefs:
// > AccountLoginLayer::create @ 0x14007b8c1
// > ??> @ 0x1406c67b0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=4
char __fastcall AccountLoginLayer::init(__int64 a1, _QWORD *a2)
{
__int64 v4; // rdx
__int64 v5; // rcx
__int64 v7; // rax
cocos2d::CCTouchDispatcher *v8; // rax
__int64 v9; // rdx
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
__int64 v12; // rax
struct cocos2d::CCRect *v13; // rax
struct cocos2d::extension::CCScale9Sprite *v14; // rdi
__int64 v15; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v16; // rbx
const cocos2d::CCSize *v17; // rax
size_t v18; // r14
struct cocos2d::CCLabelBMFont *v19; // rdi
cocos2d::CCLabelBMFont_vtbl *v20; // rbx
const cocos2d::CCPoint *v21; // rax
__int64 v22; // rcx
__int64 v23; // rax
__int64 v24; // rcx
cocos2d::CCArray *v25; // r13
ButtonSprite *v26; // rax
CCMenuItemSpriteExtra *v27; // rbx
ButtonSprite *v28; // rax
CCMenuItemSpriteExtra *v29; // rbx
__int64 v30; // rax
struct cocos2d::CCPoint v31; // rax
cocos2d::CCSize v32; // rax
cocos2d::CCSize v33; // rbx
cocos2d::CCPoint v34; // rax
const char *v35; // r8
cocos2d::CCSize v36; // rax
cocos2d::CCSize v37; // rbx
cocos2d::CCPoint v38; // rax
cocos2d::CCSize v39; // rax
cocos2d::CCSize v40; // rbx
cocos2d::CCPoint v41; // rax
void **v42; // rcx
void **v43; // rdx
_BYTE *v44; // rdx
cocos2d::CCSize v45; // rax
cocos2d::CCSize v46; // rbx
cocos2d::CCPoint v47; // rax
const char *v48; // r8
cocos2d::CCSize v49; // rax
cocos2d::CCSize v50; // rbx
cocos2d::CCPoint v51; // rax
cocos2d::CCSize v52; // rax
cocos2d::CCSize v53; // rbx
cocos2d::CCPoint v54; // rax
void **v55; // rcx
void **v56; // rdx
__int64 v57; // rcx
ButtonSprite *v58; // rbx
CCMenuItemSpriteExtra *v59; // rdi
ButtonSprite *v60; // rbx
CCMenuItemSpriteExtra *v61; // rbx
__int64 v62; // rax
float v63; // xmm6_4
cocos2d::ccArray *data; // r14
__int64 num; // rax
cocos2d::CCObject **arr; // r14
cocos2d::CCObject **i; // r12
cocos2d::CCObject *v68; // rdi
__int64 v69; // rbx
float v70; // xmm6_4
cocos2d::ccArray *v71; // r14
__int64 v72; // rax
cocos2d::CCObject **v73; // r14
cocos2d::CCObject **v74; // r12
cocos2d::CCPoint v75; // r13
cocos2d::CCObject *v76; // rdi
const struct cocos2d::CCSize *v77; // rax
cocos2d::CCObject_vtbl *v78; // rbx
double v79; // xmm0_8
DS_Dictionary *v80; // rax
float v81; // xmm0_4
LoadingCircle *v82; // rax
__int64 *v83; // rbx
__int64 v84; // rdi
__int64 v85; // rax
cocos2d::CCPoint v86; // [rsp+50h] [rbp-B0h] BYREF
ButtonSprite *v87; // [rsp+58h] [rbp-A8h] BYREF
cocos2d::CCPoint v88; // [rsp+60h] [rbp-A0h] BYREF
cocos2d::CCSize v89; // [rsp+68h] [rbp-98h] BYREF
cocos2d::CCPoint v90; // [rsp+70h] [rbp-90h] BYREF
float v91; // [rsp+78h] [rbp-88h]
float v92; // [rsp+7Ch] [rbp-84h]
struct cocos2d::CCPoint v93; // [rsp+80h] [rbp-80h] BYREF
void *Src[2]; // [rsp+88h] [rbp-78h] BYREF
size_t Size; // [rsp+98h] [rbp-68h]
unsigned __int64 v96; // [rsp+A0h] [rbp-60h]
void *v97[2]; // [rsp+A8h] [rbp-58h] BYREF
size_t v98; // [rsp+B8h] [rbp-48h]
unsigned __int64 v99; // [rsp+C0h] [rbp-40h]
cocos2d::CCRect v100; // [rsp+C8h] [rbp-38h] BYREF
__int64 v101; // [rsp+D8h] [rbp-28h]
__int64 v102; // [rsp+E0h] [rbp-20h]
cocos2d::CCPoint v103; // [rsp+E8h] [rbp-18h] BYREF
struct cocos2d::CCPoint v104[2]; // [rsp+F0h] [rbp-10h] BYREF
v104[1] = (struct cocos2d::CCPoint)a2;
v86.x = -1.0339758e-25;
if ( cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v86) )
{
if ( !*(_BYTE *)(a1 + 628) )
{
*(_BYTE *)(a1 + 628) = 1;
v7 = cocos2d::CCDirector::sharedDirector(v5);
v8 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 144LL))(v7);
cocos2d::CCTouchDispatcher::registerForcePrio(v8, (struct cocos2d::CCObject *)a1, 2);
}
LOBYTE(v4) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 904LL))(a1, v4);
LOBYTE(v9) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 976LL))(a1, v9);
*(_BYTE *)(a1 + 588) = 1;
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
v12 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 576) = v12;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 448LL))(a1, v12);
v13 = (struct cocos2d::CCRect *)cocos2d::CCRect::CCRect(&v100, 0.0, 0.0, 80.0, 80.0);
v14 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v13);
LOBYTE(v15) = -1;
v14->setOpacity(&v14->cocos2d::CCRGBAProtocol, v15);
v16 = v14->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, 400.0, 300.0);
v16->setContentSize(v14, v17);
v18 = -1;
(*(void (__fastcall **)(_QWORD, struct cocos2d::extension::CCScale9Sprite *, __int64))(**(_QWORD **)(a1 + 576)
+ 440LL))(
*(_QWORD *)(a1 + 576),
v14,
0xFFFFFFFFLL);
cocos2d::CCPoint::CCPoint(&v88, v91 * 0.5, v92 * 0.5);
v14->setPosition_0(v14, &v88);
v19 = cocos2d::CCLabelBMFont::create("Login", (const char *)&qword_14052A4D8);
v20 = v19->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v87, v88.x, (float)(v88.y + 150.0) - 16.0);
v20->setPosition_0(v19, v21);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 448LL))(
*(_QWORD *)(a1 + 576),
v19);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v19->setScale_0)(v19);
*(_DWORD *)(a1 + 624) = -1;
v23 = cocos2d::CCMenu::create(v22);
*(_QWORD *)(a1 + 544) = v23;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 440LL))(*(_QWORD *)(a1 + 576), v23, 10);
v25 = (cocos2d::CCArray *)cocos2d::CCArray::create(v24);
v26 = ButtonSprite::create_1("Cancel", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v27 = CCMenuItemSpriteExtra::create(
v26,
nullptr,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)AccountLoginLayer::onClose);
(*(void (__fastcall **)(_QWORD, CCMenuItemSpriteExtra *))(**(_QWORD **)(a1 + 544) + 448LL))(
*(_QWORD *)(a1 + 544),
v27);
cocos2d::CCArray::addObject(v25, v27);
v28 = ButtonSprite::create_1("Login", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v29 = CCMenuItemSpriteExtra::create(
v28,
nullptr,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)AccountLoginLayer::onSubmit);
(*(void (__fastcall **)(_QWORD, CCMenuItemSpriteExtra *))(**(_QWORD **)(a1 + 544) + 448LL))(
*(_QWORD *)(a1 + 544),
v29);
cocos2d::CCArray::addObject(v25, v29);
v30 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 200LL))(*(_QWORD *)(a1 + 576));
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v87,
v88.x,
(float)((float)(v88.y - 150.0) + 22.0) + *(float *)(v30 + 4));
v31 = cocos2d::CCNode::convertToNodeSpace(*(cocos2d::CCNode **)(a1 + 544), &v86);
GameToolbox::alignItemsHorisontally(v25, 15.0, v31, 0);
cocos2d::CCSize::CCSize(&v89, 300.0, 30.0);
cocos2d::CCPoint::CCPoint(&v90, v88.x, v88.y + 80.0);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v33 = v32;
cocos2d::CCPoint::CCPoint(&v86, &v90);
AccountLoginLayer::createTextBackground((AccountLoginLayer *)a1, v34, v35, v33);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v37 = v36;
cocos2d::CCPoint::CCPoint(&v86, &v90);
*(_QWORD *)(a1 + 672) = AccountLoginLayer::createTextLabel((AccountLoginLayer *)a1, v38, "Username:", v37);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v40 = v39;
cocos2d::CCPoint::CCPoint(&v86, &v90);
*(_QWORD *)(a1 + 656) = AccountLoginLayer::createTextInput((AccountLoginLayer *)a1, v41, v40, "Username", 1);
*(_OWORD *)Src = 0;
Size = 0;
v96 = 15;
Src[0] = sub_14003AA10(0x40u);
Size = 63;
v96 = 63;
strcpy((char *)Src[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
v87 = (ButtonSprite *)Src;
v42 = (void **)(*(_QWORD *)(a1 + 656) + 488LL);
if ( v42 != Src )
{
v43 = Src;
if ( v96 > 0xF )
v43 = (void **)Src[0];
sub_14003CCE0(v42, v43, Size);
}
sub_14003A830((__int64)Src);
*(_DWORD *)(*(_QWORD *)(a1 + 656) + 568LL) = 16;
if ( a2[2] )
{
v44 = a2;
if ( a2[3] > 0xFu )
v44 = (_BYTE *)*a2;
v100 = 0;
v101 = 0;
v102 = 0;
do
++v18;
while ( v44[v18] );
sub_14003A930(&v100, v44, v18);
CCTextInputNode::setString(*(_QWORD *)(a1 + 656), &v100);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v87, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v90, &v93);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v46 = v45;
cocos2d::CCPoint::CCPoint(&v86, &v93);
AccountLoginLayer::createTextBackground((AccountLoginLayer *)a1, v47, v48, v46);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v50 = v49;
cocos2d::CCPoint::CCPoint(&v86, &v93);
*(_QWORD *)(a1 + 680) = AccountLoginLayer::createTextLabel(
(AccountLoginLayer *)a1,
v51,
(const char *)&qword_140539098,
v50);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v87, &v89);
v53 = v52;
cocos2d::CCPoint::CCPoint(&v86, &v93);
*(_QWORD *)(a1 + 664) = AccountLoginLayer::createTextInput((AccountLoginLayer *)a1, v54, v53, "Password", 2);
*(_OWORD *)v97 = 0;
v98 = 0;
v99 = 15;
v97[0] = sub_14003AA10(0x60u);
v98 = 84;
v99 = 95;
strcpy((char *)v97[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*'();:@+$,/?#[]&");
v87 = (ButtonSprite *)v97;
v55 = (void **)(*(_QWORD *)(a1 + 664) + 488LL);
if ( v55 != v97 )
{
v56 = v97;
if ( v99 > 0xF )
v56 = (void **)v97[0];
sub_14003CCE0(v55, v56, v98);
}
sub_14003A830((__int64)v97);
*(_DWORD *)(*(_QWORD *)(a1 + 664) + 568LL) = 20;
*(_BYTE *)(*(_QWORD *)(a1 + 664) + 585LL) = 1;
v57 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v57 + 524) = 1065353216;
CCTextInputNode::refreshLabel((CCTextInputNode *)v57);
cocos2d::CCArray::removeAllObjects(v25);
v87 = (ButtonSprite *)operator new(0x2C0u);
v58 = ButtonSprite::ButtonSprite(v87);
if ( v58 )
{
if ( ButtonSprite::init_1(v58, "Forgot Username", 120, 0, 0.80000001, 1, "goldFont.fnt", "GJ_button_05.png", 25.0) )
{
cocos2d::CCObject::autorelease(v58);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v58->~ButtonSprite)(v58, 1);
v58 = nullptr;
}
}
v59 = CCMenuItemSpriteExtra::create(
v58,
nullptr,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)AccountLoginLayer::onForgotUser);
(*(void (__fastcall **)(_QWORD, CCMenuItemSpriteExtra *))(**(_QWORD **)(a1 + 544) + 448LL))(
*(_QWORD *)(a1 + 544),
v59);
v87 = (ButtonSprite *)operator new(0x2C0u);
v60 = ButtonSprite::ButtonSprite(v87);
if ( v60 )
{
if ( ButtonSprite::init_1(v60, "Forgot Password", 120, 0, 0.80000001, 1, "goldFont.fnt", "GJ_button_05.png", 25.0) )
{
cocos2d::CCObject::autorelease(v60);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v60->~ButtonSprite)(v60, 1);
v60 = nullptr;
}
}
v61 = CCMenuItemSpriteExtra::create(
v60,
nullptr,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)AccountLoginLayer::onForgotPassword);
(*(void (__fastcall **)(_QWORD, CCMenuItemSpriteExtra *))(**(_QWORD **)(a1 + 544) + 448LL))(
*(_QWORD *)(a1 + 544),
v61);
cocos2d::CCArray::addObject(v25, v61);
cocos2d::CCArray::addObject(v25, v59);
v62 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 200LL))(*(_QWORD *)(a1 + 576));
cocos2d::CCPoint::CCPoint(&v103, v88.x, (float)(v88.y - 45.0) + *(float *)(v62 + 4));
v86 = cocos2d::CCNode::convertToNodeSpace(*(cocos2d::CCNode **)(a1 + 544), v104);
v63 = -15.0;
if ( v25 )
{
data = v25->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v68 = *arr;
if ( !*arr )
break;
v69 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v68->__vftable[4].isEqual)(*arr);
v63 = v63
+ (float)((float)(((float (__fastcall *)(cocos2d::CCObject *))v68->__vftable[2].copyWithZone)(v68)
* *(float *)(v69 + 4))
+ 15.0);
}
}
}
v70 = (float)-v63 * 0.5;
if ( v25 )
{
v71 = v25->data;
v72 = v71->num;
if ( (_DWORD)v72 )
{
v73 = v71->arr;
v74 = &v73[v72 - 1];
if ( v73 <= v74 )
{
v75 = v86;
do
{
v76 = *v73;
if ( !*v73 )
break;
v77 = (const struct cocos2d::CCSize *)((__int64 (__fastcall *)(cocos2d::CCObject *))v76->__vftable[4].isEqual)(*v73);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v86, v77);
v78 = v76->__vftable;
v79 = ((double (__fastcall *)(cocos2d::CCObject *))v76->__vftable[2].copyWithZone)(v76);
cocos2d::CCPoint::CCPoint(&v100.origin, 0.0, (float)((float)(*(float *)&v79 * v86.y) * 0.5) + v70);
v78[2].encodeWithCoder(v76, v80);
v76->__vftable[2].getTag(v76);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator+)(v75, &v87);
v76->__vftable[2].encodeWithCoder(v76, (DS_Dictionary *)&v87);
v81 = ((float (__fastcall *)(cocos2d::CCObject *))v76->__vftable[2].copyWithZone)(v76);
v70 = v70 + (float)((float)(v81 * v86.y) + 15.0);
++v73;
}
while ( v73 <= v74 );
}
}
}
v82 = LoadingCircle::create();
*(_QWORD *)(a1 + 688) = v82;
v82->m_parentLayer = *(cocos2d::CCLayer **)(a1 + 576);
*(_BYTE *)(*(_QWORD *)(a1 + 688) + 560LL) = 1;
cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 688));
LoadingCircle::show(*(LoadingCircle **)(a1 + 688));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 320LL))(*(_QWORD *)(a1 + 688), 0);
v83 = *(__int64 **)(*(_QWORD *)(a1 + 688) + 544LL);
v84 = *v83;
cocos2d::CCPoint::CCPoint(&v100.origin, v91 * 0.5, v92 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v84 + 184))(v83, v85);
sub_14003A830((__int64)a2);
return 1;
}
else
{
sub_14003A830((__int64)a2);
return 0;
}
}