//
// cocos2d::CCMotionStreak::initWithFade from 0x18005eef0 to 0x18005f0d6 (486 bytes)
//
// 5 xrefs:
// > cocos2d::CCMotionStreak::create @ 0x18005ebfe
// > cocos2d::CCMotionStreak::create @ 0x18005ecbe
// > cocos2d::CCMotionStreak::initWithFade @ 0x18005f145
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd3d8
//
// 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 11:21:50 +0000
//
char __fastcall cocos2d::CCMotionStreak::initWithFade(
cocos2d::CCMotionStreak *this,
float a2,
float a3,
float a4,
const struct cocos2d::_ccColor3B *a5,
struct cocos2d::CCTexture2D *a6)
{
float v6; // xmm6_4
__int64 v8; // rdx
float v9; // xmm0_4
void *v10; // rax
size_t v11; // rcx
void *v12; // rax
size_t v13; // rcx
void *v14; // rax
size_t v15; // rcx
void *v16; // rax
size_t v17; // rcx
void *v18; // rax
__int64 v19; // rbx
cocos2d::CCShaderCache *v20; // rax
struct cocos2d::CCGLProgram *v21; // rax
v6 = a3;
cocos2d::CCNode::setPosition(this, (const struct cocos2d::CCPoint *)dword_1801B2430);
(*(void (__fastcall **)(cocos2d::CCMotionStreak *, _DWORD *))(*(_QWORD *)this + 288LL))(this, dword_1801B2430);
LOBYTE(v8) = 1;
(*(void (__fastcall **)(cocos2d::CCMotionStreak *, __int64))(*(_QWORD *)this + 432LL))(this, v8);
*(_WORD *)((char *)this + 353) = 256;
cocos2d::CCSize::operator=((_DWORD *)this + 118, dword_1801B2430);
*((_BYTE *)this + 352) = 1;
if ( a3 == -1.0 )
v6 = a4 / 5.0;
*((_DWORD *)this + 98) = 0;
*((float *)this + 95) = 1.0 / a2;
*((float *)this + 96) = v6 * v6;
*((float *)this + 94) = a4;
v9 = (float)(2 - (int)(float)(a2 * -60.0)) * 5.0;
*((_DWORD *)this + 97) = (int)v9;
v10 = malloc(4LL * (unsigned int)(int)v9);
v11 = 8LL * *((unsigned int *)this + 97);
*((_QWORD *)this + 51) = v10;
v12 = malloc(v11);
v13 = 16LL * *((unsigned int *)this + 97);
*((_QWORD *)this + 50) = v12;
v14 = malloc(v13);
v15 = 16LL * *((unsigned int *)this + 97);
*((_QWORD *)this + 52) = v14;
v16 = malloc(v15);
v17 = 8LL * *((unsigned int *)this + 97);
*((_QWORD *)this + 54) = v16;
v18 = malloc(v17);
v19 = *(_QWORD *)this;
*((_QWORD *)this + 53) = v18;
*((_DWORD *)this + 92) = 770;
*((_DWORD *)this + 93) = 771;
v20 = cocos2d::CCShaderCache::sharedShaderCache();
v21 = cocos2d::CCShaderCache::programForKey(v20, "ShaderPositionTextureColor");
(*(void (__fastcall **)(cocos2d::CCMotionStreak *, struct cocos2d::CCGLProgram *))(v19 + 656))(this, v21);
(*(void (__fastcall **)(char *, struct cocos2d::CCTexture2D *))(*((_QWORD *)this + 43) + 24LL))(
(char *)this + 344,
a6);
(**((void (__fastcall ***)(char *, const struct cocos2d::_ccColor3B *))this + 40))((char *)this + 320, a5);
cocos2d::CCNode::scheduleUpdate((cocos2d::CCScheduler **)this);
return 1;
}