//
// GauntletSelectLayer::init from 0x100254168 to 0x100254b40 (2520 bytes)
//
// 1 xrefs:
// > GauntletSelectLayer::create @ 0x10025411c
//
// This function is hookable on this platform (idp: arm, 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:01:33 +0000
//
bool __fastcall GauntletSelectLayer::init(__int64 a1)
{
_BOOL8 v2; // x19
void *v3; // x0
_DWORD *v4; // x0
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x21
__int64 v10; // x21
__int64 v11; // x0
__int64 v12; // x21
float v13; // s8
__int64 v14; // x0
float v15; // s0
__int64 v16; // x22
__int64 v17; // x0
float v18; // s8
__int64 v19; // x0
float v20; // s0
__int64 v21; // x22
__int64 v22; // x0
float v23; // s8
__int64 v24; // x0
float v25; // s0
__int64 v26; // x22
__int64 v27; // x0
float v28; // s8
__int64 v29; // x0
float v30; // s0
__int64 v31; // x21
__int64 v32; // x0
float v33; // s8
__int64 v34; // x0
float v35; // s0
__int64 v36; // x0
float v37; // s8
__int64 v38; // x0
float v39; // s11
__int64 v40; // x21
int isControllerConnected; // w22
const char *v42; // x0
__int64 v43; // x24
const char *v44; // x23
__int64 v45; // x0
__int64 v46; // x24
__int64 v47; // x0
float v48; // s0
__n128 v49; // q0
__int64 v50; // x23
__int64 v51; // x0
__int64 v52; // x23
__int64 v53; // x0
float v54; // s0
__n128 v55; // q0
__int64 v56; // x0
__int64 v57; // x23
__int64 v58; // x21
__int64 v59; // x0
float v60; // s8
__int64 v61; // x0
float v62; // s0
__int64 v63; // x0
__int64 v64; // x24
__n128 v65; // q0
__int64 v66; // x0
float v67; // s8
__int64 v68; // x0
float v69; // s0
__n128 v70; // q0
__int64 v71; // x0
__int64 v72; // x0
__n128 v73; // q0
__int64 v74; // x0
void *v75; // x22
__int64 v76; // x22
__int64 v77; // x0
__int64 v78; // x22
__int64 v79; // x0
float v80; // s0
__n128 v81; // q0
__int64 v82; // x0
__int64 v83; // x0
void *__p[2]; // [xsp+8h] [xbp-88h] BYREF
char v86; // [xsp+1Fh] [xbp-71h]
float v87[2]; // [xsp+24h] [xbp-6Ch] BYREF
_WORD v88[2]; // [xsp+2Ch] [xbp-64h] BYREF
__int64 v89; // [xsp+30h] [xbp-60h] BYREF
__int64 v90; // [xsp+38h] [xbp-58h] BYREF
v2 = cocos2d::CCLayer::init((_WORD *)a1);
if ( v2 )
{
v3 = cocos2d::CCTextureCache::sharedTextureCache();
v4 = cocos2d::CCTextureCache::addImage((__int64)v3, "GauntletSheet.png");
v5 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v4);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v5, "GauntletSheet.plist");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 1);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6, &v90);
v8 = cocos2d::CCDictionary::create(v7);
*(_QWORD *)(a1 + 496) = v8;
cocos2d::CCObject::retain(v8);
v9 = cocos2d::CCSprite::create("GJ_gradientBG.png");
*(_QWORD *)(a1 + 432) = v9;
sub_1000262BC((float *)&v89, 0.0, 0.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v9 + 296LL))(v9, &v89);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 432), 4294967294LL);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 432) + 128LL))(
*(_QWORD *)(a1 + 432),
(float)(*(float *)&v90 + 10.0) / *(float *)(*(_QWORD *)(a1 + 432) + 432LL));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 432) + 144LL))(
*(_QWORD *)(a1 + 432),
(float)(*((float *)&v90 + 1) + 10.0) / *(float *)(*(_QWORD *)(a1 + 432) + 436LL));
v10 = *(_QWORD *)(a1 + 432);
sub_1000262BC((float *)&v89, -5.0, -5.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 184LL))(v10, &v89);
v11 = *(_QWORD *)(a1 + 432);
memset(&v89, 51, 3);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 960LL))(v11, &v89);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("theLostGauntletsLabel_001.png");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v12);
v13 = *(float *)&v90 * 0.5;
v14 = cocos2d::CCDirector::sharedDirector();
v15 = sub_100207E98(v14);
sub_1000262BC((float *)&v89, v13, v15 + -28.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL))(v12, &v89);
memset(v88, 76, 3);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletCorner_001.png");
sub_1000262BC((float *)&v89, 0.0, 0.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 296LL))(v16, &v89);
v17 = cocos2d::CCDirector::sharedDirector();
v18 = sub_100207EA8(v17) + -1.0;
v19 = cocos2d::CCDirector::sharedDirector();
v20 = sub_100207EA0(v19);
sub_1000262BC((float *)&v89, v18, v20 + -1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL))(v16, &v89);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v16, 1);
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v16 + 960LL))(v16, v88);
v21 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletCorner_001.png");
sub_1000262BC((float *)&v89, 1.0, 0.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 296LL))(v21, &v89);
v22 = cocos2d::CCDirector::sharedDirector();
v23 = sub_100207EB0(v22) + 1.0;
v24 = cocos2d::CCDirector::sharedDirector();
v25 = sub_100207EA0(v24);
sub_1000262BC((float *)&v89, v23, v25 + -1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 184LL))(v21, &v89);
cocos2d::CCSprite::setFlipX(v21, 1);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v21, 1);
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v21 + 960LL))(v21, v88);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletCorner_001.png");
sub_1000262BC((float *)&v89, 0.0, 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 296LL))(v26, &v89);
v27 = cocos2d::CCDirector::sharedDirector();
v28 = sub_100207EA8(v27) + -1.0;
v29 = cocos2d::CCDirector::sharedDirector();
v30 = sub_100207E98(v29);
sub_1000262BC((float *)&v89, v28, v30 + 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL))(v26, &v89);
cocos2d::CCSprite::setFlipY(v26, 1);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v26, 1);
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v26 + 960LL))(v26, v88);
v31 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletCorner_001.png");
sub_1000262BC((float *)&v89, 1.0, 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v31 + 296LL))(v31, &v89);
v32 = cocos2d::CCDirector::sharedDirector();
v33 = sub_100207EB0(v32) + 1.0;
v34 = cocos2d::CCDirector::sharedDirector();
v35 = sub_100207E98(v34);
sub_1000262BC((float *)&v89, v33, v35 + 1.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v31 + 184LL))(v31, &v89);
cocos2d::CCSprite::setFlipX(v31, 1);
cocos2d::CCSprite::setFlipY(v31, 1);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v31, 1);
v36 = (*(__int64 (__fastcall **)(__int64, _WORD *))(*(_QWORD *)v31 + 960LL))(v31, v88);
v37 = *((float *)&v90 + 1) * 0.5;
v38 = AppDelegate::get(v36);
if ( *(_BYTE *)(v38 + 37) )
v39 = 50.0;
else
v39 = 25.0;
v40 = cocos2d::CCMenu::create(v38);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v40, 5);
isControllerConnected = PlatformToolbox::isControllerConnected();
if ( isControllerConnected )
v42 = "controllerBtn_DPad_Left_001.png";
else
v42 = "navArrowBtn_001.png";
v43 = cocos2d::CCSprite::createWithSpriteFrameName(v42);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v43 + 160LL))(v43, 0.8);
if ( (isControllerConnected & 1) != 0 )
{
v44 = "controllerBtn_DPad_Right_001.png";
}
else
{
cocos2d::CCSprite::setFlipX(v43, 1);
v44 = "navArrowBtn_001.png";
}
v45 = CCMenuItemSpriteExtra::create(v43, 0, a1, sub_100254B5C, 0);
*(_QWORD *)(a1 + 448) = v45;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v40 + 456LL))(v40, v45);
CCMenuItemSpriteExtra::setSizeMult(2.0);
v46 = *(_QWORD *)(a1 + 448);
v47 = cocos2d::CCDirector::sharedDirector();
v48 = sub_100207EA8(v47);
sub_1000262BC(v87, v39 + v48, v37);
cocos2d::CCNode::convertToNodeSpace(&v89, v40, v87, v49);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v46 + 184LL))(v46, &v89);
v50 = cocos2d::CCSprite::createWithSpriteFrameName(v44);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v50 + 160LL))(v50, 0.8);
v51 = CCMenuItemSpriteExtra::create(v50, 0, a1, sub_100254B70, 0);
*(_QWORD *)(a1 + 456) = v51;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v40 + 456LL))(v40, v51);
CCMenuItemSpriteExtra::setSizeMult(2.0);
v52 = *(_QWORD *)(a1 + 456);
v53 = cocos2d::CCDirector::sharedDirector();
v54 = sub_100207EB0(v53);
sub_1000262BC(v87, v54 - v39, v37);
cocos2d::CCNode::convertToNodeSpace(&v89, v40, v87, v55);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v52 + 184LL))(v52, &v89);
v56 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v57 = CCMenuItemSpriteExtra::create(v56, 0, a1, sub_100254B84, 0);
CCMenuItemSpriteExtra::setSizeMult(1.6);
v58 = sub_100270434(v57);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v58, 1);
v59 = cocos2d::CCDirector::sharedDirector();
v60 = sub_100207EA8(v59) + 25.0;
v61 = cocos2d::CCDirector::sharedDirector();
v62 = sub_100207E98(v61);
sub_1000262BC((float *)&v89, v60, v62 + -22.0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v58 + 184LL))(v58, &v89);
v63 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v64 = CCMenuItemSpriteExtra::create(v63, 0, a1, sub_100254C00, 0);
v65 = CCMenuItemSpriteExtra::setSizeMult(2.0);
(*(void (__fastcall **)(__int64, __int64, __n128))(*(_QWORD *)v58 + 456LL))(v58, v64, v65);
v66 = cocos2d::CCDirector::sharedDirector();
v67 = sub_100207EA8(v66) + 30.0;
v68 = cocos2d::CCDirector::sharedDirector();
v69 = sub_100207EA0(v68);
sub_1000262BC(v87, v67, v69 + 30.0);
cocos2d::CCNode::convertToNodeSpace(&v89, v58, v87, v70);
v71 = (*(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v64 + 184LL))(v64, &v89);
if ( isControllerConnected )
v71 = GameToolbox::addBackButton(a1, v57);
v72 = LoadingCircle::create(v71);
*(_QWORD *)(a1 + 488) = v72;
*(_QWORD *)(v72 + 552) = a1;
*(_BYTE *)(v72 + 560) = 0;
cocos2d::CCObject::retain(v72);
v73 = LoadingCircle::show(*(_QWORD *)(a1 + 488));
(*(void (__fastcall **)(_QWORD, _QWORD, __n128))(**(_QWORD **)(a1 + 488) + 344LL))(*(_QWORD *)(a1 + 488), 0, v73);
v74 = *(_QWORD *)(*(_QWORD *)(a1 + 488) + 544LL);
memset(&v89, 100, 3);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v74 + 960LL))(v74, &v89);
sub_100009900(__p, "Something went wrong\nplease try again later");
sub_1000262BC((float *)&v89, 0.5, 1.0);
v75 = TextArea::create((__int64)__p, (__int64)"bigFont.fnt", (double *)&v89, 0, 0, 1.0, 600.0, 30.0);
*(_QWORD *)(a1 + 480) = v75;
if ( v86 < 0 )
{
operator delete(__p[0]);
v75 = *(void **)(a1 + 480);
}
sub_1000262BC((float *)&v89, *(float *)&v90 * 0.5, (float)(*((float *)&v90 + 1) * 0.5) + 10.0);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v75 + 184LL))(v75, &v89);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 480) + 160LL))(*(_QWORD *)(a1 + 480), 0.6);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 480), 10);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 480) + 344LL))(*(_QWORD *)(a1 + 480), 0);
v76 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v76 + 160LL))(v76, 0.75);
v77 = CCMenuItemSpriteExtra::create(v76, 0, a1, sub_100254C98, 0);
*(_QWORD *)(a1 + 464) = v77;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v58 + 456LL))(v58, v77);
v78 = *(_QWORD *)(a1 + 464);
v79 = cocos2d::CCDirector::sharedDirector();
v80 = sub_100207EB0(v79);
sub_1000262BC(v87, v80 + -25.0, 25.0);
cocos2d::CCNode::convertToNodeSpace(&v89, v58, v87, v81);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v78 + 184LL))(v78, &v89);
v82 = GameLevelManager::sharedState();
if ( sub_1000B938C(v82) )
{
GauntletSelectLayer::setupGauntlets(a1);
}
else
{
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 488) + 344LL))(*(_QWORD *)(a1 + 488), 1);
*(_QWORD *)(GameLevelManager::sharedState() + 1224) = a1 + 416;
v83 = GameLevelManager::sharedState();
sub_1000B8C0C(v83);
}
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 448) + 344LL))(
*(_QWORD *)(a1 + 448),
*(_QWORD *)(a1 + 440) != 0);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 456) + 344LL))(
*(_QWORD *)(a1 + 456),
*(_QWORD *)(a1 + 440) != 0);
}
return v2;
}