//
// LevelPage::addSecretCoin from 0x14031c3a0 to 0x14031c5d3 (563 bytes)
//
// 2 xrefs:
// > LevelSelectLayer::updatePageWithObject @ 0x140319252
// > ??> @ 0x1406d4b08
//
// 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=1
void LevelPage::addSecretCoin(LevelPage *a1)
{
float v1; // xmm3_4
cocos2d::CCDirector *v3; // rax
GameObject *v4; // rax
GameObject *v5; // rbx
float v6; // xmm0_4
GameObject_vtbl *v7; // rbx
const cocos2d::CCPoint *v8; // rax
__int64 v9; // rcx
cocos2d::CCArray *v10; // rdi
cocos2d::CCString *v11; // rax
const char *CString; // rbx
__int64 v13; // rcx
cocos2d::CCSpriteFrameCache *v14; // rax
struct cocos2d::CCSpriteFrame *v15; // rax
cocos2d::CCString *v16; // rax
const char *v17; // rbx
__int64 v18; // rcx
cocos2d::CCSpriteFrameCache *v19; // rax
struct cocos2d::CCSpriteFrame *v20; // rax
cocos2d::CCString *v21; // rax
const char *v22; // rbx
__int64 v23; // rcx
cocos2d::CCSpriteFrameCache *v24; // rax
struct cocos2d::CCSpriteFrame *v25; // rax
cocos2d::CCString *v26; // rax
const char *v27; // rbx
__int64 v28; // rcx
cocos2d::CCSpriteFrameCache *v29; // rax
struct cocos2d::CCSpriteFrame *v30; // rax
struct cocos2d::CCAnimation *v31; // rax
struct cocos2d::CCAnimate *v32; // rax
struct cocos2d::CCRepeatForever *v33; // rax
cocos2d::ccColor3B *v34; // r8
float v35; // [rsp+20h] [rbp-8h]
float v36; // [rsp+30h] [rbp+8h]
GameObject *v37; // [rsp+38h] [rbp+10h]
v3 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v3);
v37 = (GameObject *)operator new(0x550u);
v4 = GameObject::GameObject(v37);
v5 = v4;
if ( v4 )
{
v4->m_eObjType = GameObjectObjectType;
if ( cocos2d::CCSprite::initWithSpriteFrameName(v4, "secretCoin_01_001.png") )
{
GameObject::commonSetup(v5);
v5->m_bUnkBool2 = 1;
cocos2d::CCObject::autorelease(v5);
}
else
{
((void (__fastcall *)(GameObject *, __int64))v5->~GameObject)(v5, 1);
v5 = nullptr;
}
}
a1->m_coinObject = v5;
v5->m_bUnkBool2 = 0;
v6 = ((float (__fastcall *)(LevelPage *, GameObject *, __int64))a1->addChild_0)(a1, a1->m_coinObject, 1);
v7 = a1->m_coinObject->__vftable;
cocos2d::CCPoint::CCPoint(v6, v36 * 0.5);
v7->setPosition_0(a1->m_coinObject, v8);
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9);
v11 = cocos2d::CCString::createWithFormat("%s_01_001.png", "secretCoin");
CString = cocos2d::CCString::getCString(v11);
v14 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v13);
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, CString);
cocos2d::CCArray::addObject(v10, v15);
v16 = cocos2d::CCString::createWithFormat("%s_01_002.png", "secretCoin");
v17 = cocos2d::CCString::getCString(v16);
v19 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v18);
v20 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v19, v17);
cocos2d::CCArray::addObject(v10, v20);
v21 = cocos2d::CCString::createWithFormat("%s_01_003.png", "secretCoin");
v22 = cocos2d::CCString::getCString(v21);
v24 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v23);
v25 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v24, v22);
cocos2d::CCArray::addObject(v10, v25);
v26 = cocos2d::CCString::createWithFormat("%s_01_004.png", "secretCoin");
v27 = cocos2d::CCString::getCString(v26);
v29 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v28);
v30 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v29, v27);
cocos2d::CCArray::addObject(v10, v30);
v31 = cocos2d::CCAnimation::createWithSpriteFrames(v10, 0.115);
v32 = cocos2d::CCAnimate::create(v31);
v33 = cocos2d::CCRepeatForever::create(v32);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_coinObject, (cocos2d::CCPoint)v33, v34, v1, v35);
}