//
// sub_1003E32F0 from 0x1003e32f0 to 0x1003e3940 (1616 bytes)
//
// 3 xrefs:
// > SecretLayer5::init @ 0x10007d2a0
// > LevelAreaLayer::init @ 0x1003e2d78
// > LevelAreaInnerLayer::init @ 0x1003e4574
//
// 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 11:04:23 +0000
//
void __fastcall sub_1003E32F0(__int64 a1, __int64 a2, int a3, unsigned int a4, char a5, int a6, __int64 a7, float a8)
{
char *v15; // x1
void **v16; // x0
void *v17; // x20
void **v18; // x0
void *v19; // x21
float v20; // s0
__int64 v21; // x0
int v22; // w19
_QWORD *v23; // x27
__int64 v24; // x0
__int64 v25; // x26
int i; // w23
__int64 v27; // x25
void *v28; // x0
__int64 CString; // x0
__int64 v30; // x0
__int64 v31; // x25
void *v32; // x0
__int64 v33; // x0
_QWORD *v34; // x0
void *v35; // x0
_DWORD *v36; // x0
_QWORD *v37; // x0
void *v38; // x0
_DWORD *v39; // x0
void *v40; // x26
float32x2_t *v41; // x22
double v42; // d0
float v43; // s8
float *v44; // x0
_OWORD *v45; // x22
float *v46; // x0
char v47; // w0
__int64 v48; // x1
__int64 v49; // x2
__int64 v50; // x3
__int64 v51; // x4
__int64 v52; // x5
__int64 v53; // x6
__int64 v54; // x7
__int64 v55; // x0
_DWORD *v56; // x0
float *v57; // x0
_OWORD *v58; // x22
float *v59; // x0
char v60; // w0
__int64 v61; // x1
__int64 v62; // x2
__int64 v63; // x3
__int64 v64; // x4
__int64 v65; // x5
__int64 v66; // x6
__int64 v67; // x7
__int64 v68; // x0
_DWORD *v69; // x0
void *v70; // x22
float32x2_t *v71; // x25
double v72; // d0
void *v73; // x25
float32x2_t *v74; // x22
double v75; // d0
int v76; // [xsp+14h] [xbp-ACh]
unsigned int v78; // [xsp+1Ch] [xbp-A4h]
__int64 v79; // [xsp+20h] [xbp-A0h]
float32x2_t v80; // [xsp+28h] [xbp-98h] BYREF
float32x2_t v81; // [xsp+30h] [xbp-90h] BYREF
void *__p[2]; // [xsp+38h] [xbp-88h] BYREF
char v83; // [xsp+4Fh] [xbp-71h]
if ( a3 == 2 )
v15 = "Fire_02_looped_001.png";
else
v15 = "Fire_01_looped_001.png";
sub_100009900(__p, v15);
if ( v83 >= 0 )
v16 = __p;
else
v16 = (void **)__p[0];
v17 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v16);
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v17, a4 - 2);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v17 + 184LL))(v17, a2);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v17 + 160LL))(v17, a8);
if ( v83 >= 0 )
v18 = __p;
else
v18 = (void **)__p[0];
v19 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v18);
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v19, a4 - 3);
v20 = (*(float (__fastcall **)(void *))(*(_QWORD *)v17 + 168LL))(v17);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v19 + 160LL))(v19, v20 + v20);
v21 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v17 + 192LL))(v17);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v19 + 184LL))(v19, v21);
v81.i8[2] = 0;
v81.i16[0] = 13055;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v17 + 960LL))(v17, &v81);
v81.i8[2] = 0;
v81.i16[0] = -1;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v19 + 960LL))(v19, &v81);
if ( a3 == 2 )
v22 = 2;
else
v22 = 1;
v23 = sub_1002E736C();
v78 = a4;
v76 = a6;
v79 = a7;
v24 = (__int64)sub_1002E736C();
v25 = v24;
for ( i = 1; i != 10; ++i )
{
v27 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v24);
v28 = sub_1003065B0("Fire_0%i_looped_%03i.png", v22, i);
CString = cocos2d::CCString::getCString((__int64)v28);
cocos2d::CCSpriteFrameCache::spriteFrameByName(v27, CString);
v30 = sub_1002E74E0((__int64)v23);
v31 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v30);
v32 = sub_1003065B0("Fire_0%i_2_looped_%03i.png", v22, i);
v33 = cocos2d::CCString::getCString((__int64)v32);
cocos2d::CCSpriteFrameCache::spriteFrameByName(v31, v33);
v24 = sub_1002E74E0(v25);
}
v34 = cocos2d::CCAnimation::createWithSpriteFrames((__int64)v23, 0.08);
v35 = cocos2d::CCAnimate::create((__int64)v34);
v36 = cocos2d::CCRepeatForever::create((__int64)v35);
cocos2d::CCNode::runAction((__int64)v17, (__int64)v36);
v37 = cocos2d::CCAnimation::createWithSpriteFrames(v25, 0.08);
v38 = cocos2d::CCAnimate::create((__int64)v37);
v39 = cocos2d::CCRepeatForever::create((__int64)v38);
cocos2d::CCNode::runAction((__int64)v19, (__int64)v39);
v40 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"towerShine.png");
v41 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v17 + 192LL))(v17);
sub_1000262BC((float *)&v80, 0.0, -10.0);
*(float32x2_t *)&v42 = sub_100026318(v41, &v80, &v81);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v40 + 184LL))(v40, &v81, v42);
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v40, v78 - 1);
v43 = a8 + a8;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v40 + 160LL))(v40, v43 * 1.2);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v40 + 1080LL))(v40, 0x100000302LL);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v40 + 912LL))(v40, 140);
v81.i8[2] = 0;
v81.i16[0] = -14081;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v40 + 960LL))(v40, &v81);
v44 = cocos2d::CCFadeTo::create(112, 1.6);
v45 = cocos2d::CCEaseInOut::create((__int64)v44, 1.3);
v46 = cocos2d::CCFadeTo::create(157, 1.6);
v47 = (unsigned __int8)cocos2d::CCEaseInOut::create((__int64)v46, 1.3);
v55 = sub_10021D420((__int64)v45, v48, v49, v50, v51, v52, v53, v54, v47);
v56 = cocos2d::CCRepeatForever::create(v55);
cocos2d::CCNode::runAction((__int64)v40, (__int64)v56);
v57 = cocos2d::CCScaleTo::create_1(1.0, v43);
v58 = cocos2d::CCEaseInOut::create((__int64)v57, 1.5);
v59 = cocos2d::CCScaleTo::create_1(1.0, v43 * 1.2);
v60 = (unsigned __int8)cocos2d::CCEaseInOut::create((__int64)v59, 1.5);
v68 = sub_10021D420((__int64)v58, v61, v62, v63, v64, v65, v66, v67, v60);
v69 = cocos2d::CCRepeatForever::create(v68);
cocos2d::CCNode::runAction((__int64)v40, (__int64)v69);
if ( (a5 & 1) == 0 )
{
v70 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"towerTorch_001.png");
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v70, v78);
v71 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v17 + 192LL))(v17);
sub_1000262BC((float *)&v80, 0.5, -18.0);
*(float32x2_t *)&v72 = sub_100026318(v71, &v80, &v81);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v70 + 184LL))(v70, &v81, v72);
}
v73 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"towerShine.png");
v74 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v17 + 192LL))(v17);
sub_1000262BC((float *)&v80, 0.0, -14.0);
*(float32x2_t *)&v75 = sub_100026318(v74, &v80, &v81);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v73 + 184LL))(v73, &v81, v75);
(*(void (__fastcall **)(__int64, void *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v73, v78 + 1);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v73 + 160LL))(v73, v43 * 0.6);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v73 + 1080LL))(v73, 0x100000302LL);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v73 + 912LL))(v73, 122);
v81.i8[2] = 0;
v81.i16[0] = -26881;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v73 + 960LL))(v73, &v81);
if ( v76 == 1 )
{
v81.i8[2] = 127;
v81.i16[0] = 50;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v17 + 960LL))(v17, &v81);
v81.i8[2] = -40;
v81.i16[0] = 10837;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v19 + 960LL))(v19, &v81);
v81.i8[2] = -1;
v81.i16[0] = 12950;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v40 + 960LL))(v40, &v81);
v81.i8[2] = -1;
v81.i16[0] = 130;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v73 + 960LL))(v73, &v81);
}
if ( v79 )
{
sub_1002E74E0(v79);
sub_1002E74E0(v79);
sub_1002E74E0(v79);
sub_1002E74E0(v79);
}
if ( v83 < 0 )
operator delete(__p[0]);
}