//
// GJPathsLayer::init from 0xba5bb8 to 0xba60a0 (1256 bytes)
//
// 3 xrefs:
// > GJPathsLayer::create @ 0xba6204
// > ??> @ 0xa6378
// > ??> @ 0x14d9af0
//
// 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 13:02:49 +0000
//
__int64 __fastcall GJPathsLayer::init(GJPathsLayer *this)
{
cocos2d::CCTextureCache *v2; // x0
cocos2d::CCSpriteFrameCache *v3; // x0
cocos2d::CCSpriteFrameCache *v4; // x0
GameStatsManager *v5; // x0
GameStatsManager *v6; // x0
int v8; // w20
cocos2d::CCDirector *v9; // x0
cocos2d::CCDirector *v10; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v12; // x0
const char *v13; // x1
__int64 v14; // x28
__int64 v15; // x0
cocos2d::CCMenu *v16; // x28
__int64 v17; // x28
float v18; // s2
const char *v19; // x1
__int64 v20; // x28
const char *v21; // x1
__int64 v22; // x28
const char *v23; // x1
__int64 v24; // x28
GJPathSprite *v25; // x28
__int64 v26; // x28
float v27; // s8
float v28; // s8
float v29; // s13
float v30; // s0
cocos2d::CCNode *v31; // x27
void (__fastcall *v32)(__int64, __int64 *); // x24
void (__fastcall *v33)(__int64, _BYTE *); // [xsp+90h] [xbp+90h]
void (__fastcall *v34)(__int64, _BYTE *); // [xsp+90h] [xbp+90h]
void (__fastcall *v35)(__int64, _BYTE *); // [xsp+90h] [xbp+90h]
void (__fastcall *v36)(__int64, _BYTE *); // [xsp+90h] [xbp+90h]
void (__fastcall *v37)(__int64, _BYTE *); // [xsp+90h] [xbp+90h]
unsigned __int8 v38; // [xsp+9Fh] [xbp+9Fh]
__int64 v39; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v40[8]; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v41; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v42; // [xsp+B8h] [xbp+B8h] BYREF
_BYTE v43[8]; // [xsp+C0h] [xbp+C0h] BYREF
v2 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(_stack_chk_guard);
v3 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCTextureCache::addImage(v2, "GJ_PathSheet.png", 0);
v4 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v3);
v5 = (GameStatsManager *)cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v4, "GJ_PathSheet.plist");
*((_BYTE *)this + 680) = 1;
v6 = (GameStatsManager *)GameStatsManager::sharedState(v5);
GameStatsManager::trySelectActivePath(v6);
FLAlertLayer::incrementForcePrio(this);
v43[0] = 0;
v43[1] = 0;
v43[2] = 0;
v43[3] = -81;
v38 = cocos2d::CCLayerColor::initWithColor(this, v43);
if ( v38 )
{
v8 = 0;
(*(void (__fastcall **)(GJPathsLayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v9 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(GJPathsLayer *, __int64))(*(_QWORD *)this + 1072LL))(this, 1);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v39, v10);
v12 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v12;
(*(void (__fastcall **)(GJPathsLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v12);
v14 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"pathSelectBG_001.png", v13);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v14,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v14 + 160LL))(v14, 1.2);
v33 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v14 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, *(float *)&v39 * 0.5, *((float *)&v39 + 1) * 0.5);
v33(v14, v43);
*((_DWORD *)this + 160) = -1;
v15 = cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_closeBtn_001.png",
(const char *)0xFFFFFFFFLL);
*((_QWORD *)this + 84) = v15;
v16 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v15, 0, (__int64)this, (__int64)GJPathsLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v16, 1.6);
v17 = cocos2d::CCMenu::create(v16, nullptr);
v18 = *(float *)&v39;
*((_QWORD *)this + 69) = v17;
v34 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v43,
(float)((float)(v18 * 0.5) + -130.0) + 10.0,
(float)((float)(*((float *)&v39 + 1) * 0.5) + 130.0) - 10.0);
v34(v17, v43);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 69),
10);
v20 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_paths_001.png", v19);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v20,
20);
v35 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, *(float *)&v39 * 0.5, (float)(*((float *)&v39 + 1) * 0.5) + 29.0);
v35(v20, v43);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.8);
v22 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_of_001.png", v21);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v22,
20);
v36 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, *(float *)&v39 * 0.5, *((float *)&v39 + 1) * 0.5);
v36(v22, v43);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v22 + 160LL))(v22, 0.8);
v24 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_power_001.png", v23);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v24,
20);
v37 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v24 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v43,
*(float *)&v39 * 0.5,
(float)(*((float *)&v39 + 1) * 0.5) + -34.0);
v37(v24, v43);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v24 + 160LL))(v24, 0.8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, *(float *)&v39 * 0.5, *((float *)&v39 + 1) * 0.5);
do
{
v25 = (GJPathSprite *)GJPathSprite::create((GJPathSprite *)(unsigned int)(v8 + 1));
GJPathSprite::updateState(v25);
v26 = CCMenuItemSpriteExtra::create((__int64)v25, 0, (__int64)this, (__int64)GJPathsLayer::onPath, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v26 + 72LL))(v26, (unsigned int)(v8 + 1));
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v26);
v27 = (float)v8++;
v28 = (float)(90.0 - (float)(v27 * 36.0)) * 0.0174532925;
v29 = cosf(v28);
v30 = sinf(v28);
v31 = *((cocos2d::CCNode **)this + 69);
v32 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, v29 * 100.0, v30 * 100.0);
cocos2d::CCPoint::operator+(&v42, v40);
cocos2d::CCNode::convertToNodeSpace(&v41, v31, (const cocos2d::CCPoint *)&v42);
v32(v26, &v41);
}
while ( v8 != 10 );
}
return v38;
}