//
// SecretGame01Layer::init from 0x10047fb90 to 0x10047fd42 (434 bytes)
//
// 3 xrefs:
// > SecretLayer6::init @ 0x10047edeb
// > SecretGame01Layer::create @ 0x10047effd
// > ??> @ 0x10093b900
//
// 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
//
bool __fastcall SecretGame01Layer::init(SecretGame01Layer *a1)
{
bool result; // al
bool v3; // r12
cocos2d::CCMenu *v4; // rax
cocos2d::CCMenu *m_mainMenu; // rdi
cocos2d::CCArray *v6; // rax
cocos2d::CCArray *v7; // rdi
cocos2d::CCArray *v8; // rax
cocos2d::CCSprite *v9; // r14
cocos2d::CCSprite *m_timeBarSprite; // r14
cocos2d::CCSprite *v11; // rdi
cocos2d::CCSprite *v12; // r14
float *v13; // rax
float v14; // [rsp+0h] [rbp-30h] BYREF
float v15[10]; // [rsp+8h] [rbp-28h] BYREF
double v16; // 0:xmm0_8.8
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v3 = result;
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v16 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v14);
v4 = cocos2d::CCMenu::create();
a1->m_mainMenu = v4;
((void (__fastcall *)(SecretGame01Layer *, cocos2d::CCMenu *, double))a1->addChild)(a1, v4, v16);
m_mainMenu = a1->m_mainMenu;
((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))m_mainMenu->setTouchEnabled)(m_mainMenu, 0);
v6 = (cocos2d::CCArray *)sub_10071F9E0(m_mainMenu, 0);
a1->m_gameObjects = v6;
v7 = v6;
cocos2d::CCObject::retain(v6);
v8 = (cocos2d::CCArray *)sub_10071F9E0(v7, 0);
a1->m_requiredObjects = v8;
cocos2d::CCObject::retain(v8);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
a1->m_timeBarSprite = v9;
sub_10028CBE0(v15, (float)(v14 * 0.5) + -50.0, 40.0);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v9->setPosition)(v9, v15);
m_timeBarSprite = a1->m_timeBarSprite;
sub_10028CBE0(v15, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, float *))m_timeBarSprite->setAnchorPoint)(m_timeBarSprite, v15);
((void (__fastcall *)(cocos2d::CCSprite *, float))a1->m_timeBarSprite->setScaleY)(a1->m_timeBarSprite, 0.60000002);
v11 = a1->m_timeBarSprite;
memset(v15, 100, 3);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v11->setColor)(v11, v15);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_timeBarSprite->setOpacity)(a1->m_timeBarSprite, 100);
v12 = a1->m_timeBarSprite;
v13 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v12->getContentSize)(v12);
((void (__fastcall *)(cocos2d::CCSprite *, float))v12->setScaleX)(v12, 100.0 / *v13);
((void (__fastcall *)(SecretGame01Layer *, cocos2d::CCSprite *))a1->addChild)(a1, a1->m_timeBarSprite);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_timeBarSprite->setVisible)(a1->m_timeBarSprite, 0);
cocos2d::CCNode::scheduleUpdate(a1);
return v3;
}
return result;
}