//
// SecretLayer6::init from 0x1004734d0 to 0x100473891 (961 bytes)
//
// 3 xrefs:
// > sub_100473350 @ 0x1004733d0
// > SecretLayer6::create @ 0x10047348f
// > ??> @ 0x100b460e0
//
// 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 12:30:34 +0000
//
__int64 __fastcall SecretLayer6::init(_QWORD *a1, double a2)
{
__int64 result; // rax
unsigned int v4; // r13d
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
float *v9; // r14
__int64 v10; // r14
char *v11; // r14
double v12; // xmm0_8
char *v13; // rax
void *v14; // r14
int v15; // edx
int v16; // ecx
int v17; // r8d
int v18; // r9d
__int64 v19; // rsi
__int64 v20; // rdi
__int64 v21; // rax
double v22; // xmm0_8
double v23; // xmm0_8
_OWORD *v24; // r14
__int64 v25; // rax
__int64 v26; // rax
void *v27[3]; // [rsp+8h] [rbp-58h] BYREF
float v28; // [rsp+24h] [rbp-3Ch]
float v29; // [rsp+28h] [rbp-38h] BYREF
float v30; // [rsp+2Ch] [rbp-34h]
float v31[12]; // [rsp+30h] [rbp-30h] BYREF
result = cocos2d::CCLayer::init(a1);
if ( (_BYTE)result )
{
v4 = result;
v5 = cocos2d::CCTextureCache::sharedTextureCache(a1);
cocos2d::CCTextureCache::addImage(v5, "SecretSheet.png", 0);
v6 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2(v6, "SecretSheet.plist", a2);
v7 = GameManager::sharedState();
strcpy((char *)v27, " secretLoop03.mp3");
GameManager::fadeInMusic(*(__m128 *)"secretLoop03.mp3", v7, (unsigned __int8 *)v27);
if ( ((__int64)v27[0] & 1) != 0 )
operator delete(v27[2]);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1088LL))(a1, 1);
v8 = cocos2d::CCDirector::sharedDirector(a1, 1);
cocos2d::CCDirector::getWinSize(&v29, v8);
v9 = (float *)cocos2d::CCSprite::create_1((__int64)"GJ_gradientBG.png");
sub_100278250(v31, 0.0, 0.0);
(*(void (__fastcall **)(float *, float *))(*(_QWORD *)v9 + 296LL))(v9, v31);
(*(void (__fastcall **)(_QWORD *, float *, __int64))(*a1 + 464LL))(a1, v9, 4294967293LL);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v9 + 128LL))(v9, (float)(v29 + 10.0) / v9[108]);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v9 + 144LL))(v9, (float)(v30 + 10.0) / v9[109]);
sub_100278250(v31, -5.0, -5.0);
(*(void (__fastcall **)(float *, float *))(*(_QWORD *)v9 + 184LL))(v9, v31);
BYTE2(v31[0]) = 60;
LOWORD(v31[0]) = 30;
(*(void (__fastcall **)(float *, float *))(*(_QWORD *)v9 + 960LL))(v9, v31);
v10 = cocos2d::CCLabelBMFont::create_3("...", "goldFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 1.0);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v10);
sub_100278250(v31, v29 * 0.5, v30 + -24.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v10 + 184LL))(v10, v31);
v11 = (char *)operator new(0x1D0u);
cocos2d::CCLayer::CCLayer(v11);
*(_QWORD *)v11 = off_100B45A88;
*((_QWORD *)v11 + 40) = off_100B45F18;
*((_QWORD *)v11 + 41) = &off_100B45F88;
*((_QWORD *)v11 + 42) = off_100B45FA0;
*((_QWORD *)v11 + 43) = off_100B45FC0;
*((_QWORD *)v11 + 44) = off_100B45FE8;
*(_QWORD *)(v11 + 444) = 0;
*((_QWORD *)v11 + 57) = 0;
*(_OWORD *)(v11 + 408) = 0;
*(_OWORD *)(v11 + 424) = 0;
v11[440] = 0;
if ( (unsigned __int8)SecretGame01Layer::init(v11) )
{
cocos2d::CCObject::autorelease(v11);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v11 + 16LL))(v11);
v11 = nullptr;
}
a1[51] = v11;
v12 = (*(double (__fastcall **)(_QWORD *, char *, __int64))(*a1 + 464LL))(a1, v11, 100);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_arrow_01_001.png", v12);
v14 = CCMenuItemSpriteExtra::create((__int64)v13, 0, (__int64)a1, (__int64)SecretLayer6::onBack, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v14, 1.5);
v19 = sub_1008735E0((_DWORD)v14, 0, v15, v16, v17, v18);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*a1 + 464LL))(a1, v19, 1);
v20 = cocos2d::CCDirector::sharedDirector(a1, v19);
v28 = sub_100479760(v20) + 24.0;
v21 = cocos2d::CCDirector::sharedDirector(v20, v19);
v22 = sub_100479740(v21);
sub_100278250(v31, v28, *(float *)&v22 + -23.0);
v23 = (*(double (__fastcall **)(__int64, float *))(*(_QWORD *)v19 + 184LL))(v19, v31);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected(v23) )
GameToolbox::addBackButton(a1, v14);
v24 = cocos2d::CCDelayTime::create((__m128)0x3F000000u);
v25 = cocos2d::CCCallFunc::create(a1, SecretLayer6::startGame01, 0);
v26 = sub_10039EB60((__int64)v24, v25, 0);
cocos2d::CCNode::runAction((__int64)a1, v26);
return v4;
}
return result;
}