//
// CurrencySprite::createWithSprite from 0x1400a4bc0 to 0x1400a4dda (538 bytes)
//
// 2 xrefs:
// > CurrencyRewardLayer::createObjectsFull @ 0x1400a21ab
// > ??> @ 0x1406c7704
//
// 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
CurrencySprite *CurrencySprite::createWithSprite(cocos2d::CCSprite *a1)
{
float v1; // xmm3_4
CurrencySprite *v3; // rax
CurrencySprite *v4; // rsi
bool v5; // zf
CurrencySprite_vtbl *v6; // rax
struct cocos2d::CCSprite *v7; // rax
float v8; // xmm6_4
struct cocos2d::CCRotateBy *v9; // rax
struct cocos2d::CCRepeatForever *v10; // rax
cocos2d::ccColor3B *v11; // r8
CCLightFlash *v12; // rdi
CCLightFlash_vtbl *v13; // rbx
struct cocos2d::CCPoint v14; // rax
struct cocos2d::CCRotateBy *v15; // rax
struct cocos2d::CCRepeatForever *v16; // rax
cocos2d::ccColor3B *v17; // r8
float v19; // [rsp+20h] [rbp-28h]
float v20; // [rsp+20h] [rbp-28h]
CurrencySprite *v21; // [rsp+58h] [rbp+10h] BYREF
__int16 v22; // [rsp+60h] [rbp+18h] BYREF
char v23; // [rsp+62h] [rbp+1Ah]
struct cocos2d::CCPoint v24; // [rsp+68h] [rbp+20h] BYREF
v21 = (CurrencySprite *)operator new(0x2A8u);
v3 = CurrencySprite::CurrencySprite(v21);
v4 = v3;
if ( !v3 )
return v4;
v5 = !cocos2d::CCSprite::init(v3);
v6 = v4->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v5 )
{
((void (__fastcall *)(CurrencySprite *, __int64))v6->~CurrencySprite)(v4, 1);
return nullptr;
}
v6->addChild_1(v4, a1);
a1->setPosition_0(a1, &stru_1406C1948);
v7 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
v4->m_burstSprite = v7;
cocos2d::CCObject::retain(v7);
if ( (float)((float)rand() / 32767.0) <= 0.5 )
v8 = -1.0;
else
v8 = 1.0;
v9 = cocos2d::CCRotateBy::create(1.0, v8 * 90.0);
v10 = cocos2d::CCRepeatForever::create(v9);
cocos2d::CCNode::runAction((CCLightFlash *)v4->m_burstSprite, (cocos2d::CCPoint)v10, v11, v1, v19);
((void (__fastcall *)(cocos2d::CCSprite *))v4->m_burstSprite->setScale_0)(v4->m_burstSprite);
LOWORD(v21) = -1;
BYTE2(v21) = -1;
v4->m_burstSprite->setColor(&v4->m_burstSprite->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v21);
v12 = (CCLightFlash *)cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
v4->m_burstSprite->addChild_1(v4->m_burstSprite, v12);
v13 = v12->__vftable;
v14 = cocos2d::CCNode::convertToNodeSpace(v4->m_burstSprite, &v24);
((void (__fastcall *)(CCLightFlash *, struct cocos2d::CCPoint))v13->setPosition_0)(v12, v14);
((void (__fastcall *)(CCLightFlash *))v12->setScale_0)(v12);
v22 = -1;
v23 = -1;
((void (__fastcall *)(cocos2d::CCArray **, __int16 *))v12->m_lightStripArray->__vftable)(
&v12->m_lightStripArray,
&v22);
v15 = cocos2d::CCRotateBy::create(1.0, (float)-v8 * 180.0);
v16 = cocos2d::CCRepeatForever::create(v15);
cocos2d::CCNode::runAction(v12, (cocos2d::CCPoint)v16, v17, v1, v20);
cocos2d::CCObject::autorelease(v4);
return v4;
}