//
// cocos2d::CCMotionStreak::update from 0x18005f270 to 0x18005fa45 (2005 bytes)
//
// 5 xrefs:
// > ??> @ 0x1800ff938
// > ??> @ 0x18014250c
// > ??> @ 0x1801425ac
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd408
//
// 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
//
void __fastcall cocos2d::CCMotionStreak::update(cocos2d::CCMotionStreak *this, float a2, float a3)
{
float v4; // xmm6_4
const struct cocos2d::CCPoint *v5; // r12
struct cocos2d::CCPoint *v6; // rdx
__int32 v7; // xmm1_4
unsigned int v8; // esi
__int64 v9; // rdx
__int64 v10; // rcx
unsigned int v11; // eax
int v12; // ebp
unsigned int v13; // esi
struct cocos2d::CCPoint **v14; // rbx
float v15; // xmm1_4
__int64 v16; // rax
int v17; // r15d
__int64 v18; // r14
__int64 v19; // r9
__int64 v20; // r10
__int64 v21; // rax
__int64 v22; // r10
__int64 v23; // rdx
__int64 v24; // r9
unsigned int v25; // eax
float *v26; // rbx
float *v27; // rax
float *v28; // rax
bool v29; // si
bool v30; // cl
int v31; // eax
float *v32; // rbx
float *v33; // rax
float *v34; // rax
float v35; // xmm0_4
float v36; // xmm1_4
__int64 v37; // rcx
__int64 v38; // r8
__int64 v39; // rcx
struct cocos2d::_ccVertex2F *v40; // r9
cocos2d *v41; // rcx
int v42; // ebx
char v43; // si
float v44; // xmm7_4
float v45; // xmm6_4
float v46; // xmm0_4
unsigned int v47; // r8d
__int64 v48; // rdx
int v49; // eax
__int64 v50; // rcx
float v51; // xmm0_4
__int64 v52; // rax
float v53; // xmm0_4
__int64 v54; // rax
unsigned int v55; // ebx
unsigned int v56; // r8d
float v57; // xmm1_4
__int64 v58; // rdx
int v59; // eax
__int64 v60; // rcx
float v61; // xmm0_4
__int64 v62; // rax
float v63; // xmm0_4
__int64 v64; // rax
unsigned int v65; // [rsp+28h] [rbp-80h]
float v66[4]; // [rsp+30h] [rbp-78h] BYREF
float v67; // [rsp+B0h] [rbp+8h] BYREF
float v68; // [rsp+B4h] [rbp+Ch]
int v69; // [rsp+C0h] [rbp+18h] BYREF
int v70; // [rsp+C8h] [rbp+20h] BYREF
if ( !*((_BYTE *)this + 353) )
return;
v4 = a2 * *((float *)this + 95);
v5 = (cocos2d::CCMotionStreak *)((char *)this + 456);
cocos2d::CCSize::operator-((float *)this + 118, &v67, (float *)this + 114);
if ( !*((_DWORD *)this + 98) )
goto LABEL_7;
v7 = _mm_load_si128((const __m128i *)&xmmword_1800EC5C0).m128i_i32[0];
a3 = 8192.0;
if ( COERCE_FLOAT(LODWORD(v67) & v7) > 8192.0 || COERCE_FLOAT(LODWORD(v68) & v7) > 8192.0 )
{
v8 = 0;
do
{
cocos2d::CCSize::operator-((float *)(*((_QWORD *)this + 50) + 8LL * v8), (float *)&v69, &v67);
cocos2d::CCSize::operator=((_DWORD *)(*((_QWORD *)this + 50) + 8LL * v8), &v69);
v9 = 2 * v8;
v10 = (unsigned int)(v9 + 1);
++v8;
*(float *)(*((_QWORD *)this + 52) + 8 * v9) = *(float *)(*((_QWORD *)this + 52) + 8 * v9) - v67;
*(float *)(*((_QWORD *)this + 52) + 8 * v9 + 4) = *(float *)(*((_QWORD *)this + 52) + 8 * v9 + 4) - v68;
*(float *)(*((_QWORD *)this + 52) + 8 * v10) = *(float *)(*((_QWORD *)this + 52) + 8 * v10) - v67;
*(float *)(*((_QWORD *)this + 52) + 8 * v10 + 4) = *(float *)(*((_QWORD *)this + 52) + 8 * v10 + 4) - v68;
}
while ( v8 < *((_DWORD *)this + 98) );
LABEL_7:
cocos2d::CCSize::operator=(v5, (_DWORD *)this + 118);
cocos2d::CCNode::setPosition(this, v5);
cocos2d::CCSize::operator=(&v67, dword_1801B2430);
}
v11 = *((_DWORD *)this + 98);
v12 = 0;
v13 = 0;
if ( v11 )
{
v14 = (struct cocos2d::CCPoint **)((char *)this + 424);
do
{
*(float *)(*((_QWORD *)this + 51) + 4LL * v13) = *(float *)(*((_QWORD *)this + 51) + 4LL * v13) - v4;
v6 = *((struct cocos2d::CCPoint **)this + 51);
v15 = *((float *)v6 + v13);
if ( v15 > 0.0 )
{
v16 = v13 - v12;
v17 = v16;
v18 = 4 * v16;
if ( v12 )
{
*(float *)((char *)v6 + v18) = v15;
cocos2d::CCSize::operator=(
(_DWORD *)(*((_QWORD *)this + 50) + 8 * v16),
(_DWORD *)(*((_QWORD *)this + 50) + 8LL * v13));
v19 = 2 * v13;
v20 = (unsigned int)(2 * v17);
v21 = (unsigned int)(v20 + 1);
*(_QWORD *)(*((_QWORD *)this + 52) + 8 * v20) = *(_QWORD *)(*((_QWORD *)this + 52) + 8 * v19);
v22 = (unsigned int)(8 * v17);
v23 = (unsigned int)(v19 + 1);
v24 = 8 * v13;
*(_QWORD *)(*((_QWORD *)this + 52) + 8 * v21) = *(_QWORD *)(*((_QWORD *)this + 52) + 8 * v23);
v6 = *v14;
*((_BYTE *)*v14 + v22) = *((_BYTE *)*v14 + v24);
*((_BYTE *)*v14 + (unsigned int)(v22 + 1)) = *((_BYTE *)*v14 + (unsigned int)(v24 + 1));
*((_BYTE *)*v14 + (unsigned int)(v22 + 2)) = *((_BYTE *)*v14 + (unsigned int)(v24 + 2));
*((_BYTE *)*v14 + (unsigned int)(v22 + 4)) = *((_BYTE *)*v14 + (unsigned int)(v24 + 4));
*((_BYTE *)*v14 + (unsigned int)(v22 + 5)) = *((_BYTE *)*v14 + (unsigned int)(v24 + 5));
*((_BYTE *)*v14 + (unsigned int)(v22 + 6)) = *((_BYTE *)*v14 + (unsigned int)(v24 + 6));
}
else
{
LODWORD(v22) = 8 * v16;
}
if ( *((_BYTE *)this + 468) )
LOBYTE(v6) = -1;
else
v6 = (struct cocos2d::CCPoint *)(unsigned int)(int)(float)(*(float *)(v18 + *((_QWORD *)this + 51)) * 255.0);
*((_BYTE *)*v14 + (unsigned int)(v22 + 3)) = (_BYTE)v6;
*((_BYTE *)*v14 + (unsigned int)(v22 + 7)) = (_BYTE)v6;
}
else
{
++v12;
v14 = (struct cocos2d::CCPoint **)((char *)this + 424);
}
v11 = *((_DWORD *)this + 98);
++v13;
}
while ( v13 < v11 );
}
v25 = v11 - v12;
*((_DWORD *)this + 98) = v25;
if ( v25 < *((_DWORD *)this + 97) && *((_BYTE *)this + 354) )
{
if ( v25 )
{
v26 = (float *)cocos2d::cc_timeval::operator=(&v69, &v67);
v27 = (float *)cocos2d::cc_timeval::operator=(
&v70,
(_DWORD *)(*((_QWORD *)this + 50) + 8LL * (unsigned int)(*((_DWORD *)this + 98) - 1)));
v28 = cocos2d::CCSize::operator-(v27, v66, v26);
v29 = *((float *)this + 96) > (float)((float)(v28[1] * v28[1]) + (float)(*v28 * *v28));
if ( *((_DWORD *)this + 98) == 1 )
{
v30 = 0;
v31 = 1;
}
else
{
v32 = (float *)cocos2d::cc_timeval::operator=(&v69, &v67);
v33 = (float *)cocos2d::cc_timeval::operator=(
&v70,
(_DWORD *)(*((_QWORD *)this + 50) + 8LL * (unsigned int)(*((_DWORD *)this + 98) - 2)));
v34 = cocos2d::CCSize::operator-(v33, v66, v32);
a3 = *((float *)this + 96) + *((float *)this + 96);
v35 = *v34;
v36 = v34[1];
v31 = *((_DWORD *)this + 98);
v30 = a3 > (float)((float)(v36 * v36) + (float)(v35 * v35));
}
if ( v29 || v30 )
goto LABEL_38;
if ( v31
&& *((float *)this + 116) != 0.0
&& cocos2d::CCPoint::getDistance(
(cocos2d::CCPoint *)(*((_QWORD *)this + 50) + 8LL * (unsigned int)(v31 - 1)),
(const struct cocos2d::CCPoint *)&v67) > *((float *)this + 116) )
{
*((_DWORD *)this + 98) = 1;
cocos2d::CCSize::operator=(v5, (_DWORD *)this + 118);
cocos2d::CCNode::setPosition(this, v5);
cocos2d::CCSize::operator=(*((_DWORD **)this + 50), dword_1801B2430);
**((_DWORD **)this + 51) = 1065353216;
goto LABEL_38;
}
}
cocos2d::CCSize::operator=((_DWORD *)(*((_QWORD *)this + 50) + 8LL * *((unsigned int *)this + 98)), &v67);
*(_DWORD *)(*((_QWORD *)this + 51) + 4LL * *((unsigned int *)this + 98)) = 1065353216;
v37 = *((_QWORD *)this + 53);
v38 = (unsigned int)(8 * *((_DWORD *)this + 98));
*(_WORD *)(v37 + v38) = *((_WORD *)this + 165);
*(_BYTE *)(v37 + v38 + 2) = *((_BYTE *)this + 332);
v39 = *((_QWORD *)this + 53);
*(_WORD *)(v39 + v38 + 4) = *((_WORD *)this + 165);
*(_BYTE *)(v39 + v38 + 6) = *((_BYTE *)this + 332);
*(_BYTE *)((unsigned int)(v38 + 3) + *((_QWORD *)this + 53)) = -1;
*(_BYTE *)((unsigned int)(v38 + 7) + *((_QWORD *)this + 53)) = -1;
v40 = (struct cocos2d::_ccVertex2F *)*((unsigned int *)this + 98);
if ( (_DWORD)v40 && *((_BYTE *)this + 352) )
{
v41 = *((cocos2d **)this + 50);
if ( (unsigned int)v40 <= 1 )
cocos2d::ccVertexLineToPolygon(v41, v6, a3, nullptr, 2u, v65);
else
cocos2d::ccVertexLineToPolygon(v41, v6, a3, v40, 1u, v65);
}
++*((_DWORD *)this + 98);
}
LABEL_38:
v42 = *((_DWORD *)this + 98);
if ( !*((_BYTE *)this + 352) )
{
cocos2d::ccVertexLineToPolygon(*((cocos2d **)this + 50), v6, a3, nullptr, *((_DWORD *)this + 98), v65);
v42 = *((_DWORD *)this + 98);
}
v43 = *((_BYTE *)this + 440);
if ( v43 )
{
if ( v12 )
*((float *)this + 112) = (float)v12 + *((float *)this + 112);
v45 = *((float *)this + 112);
v46 = *((float *)this + 111) * v45;
if ( v46 > 1024.0 )
{
v44 = *((float *)this + 111);
*((float *)this + 112) = v45 - (float)(floorf(v46) / v44);
}
}
*((_BYTE *)this + 452) = 0;
if ( v42 )
{
if ( *((_DWORD *)this + 99) == v42 )
{
if ( !v43 )
return;
}
else if ( !v43 )
{
v56 = 0;
v57 = 1.0 / (float)v42;
do
{
v58 = 2 * v56;
v59 = v56;
v60 = (unsigned int)(v58 + 1);
++v56;
v61 = (float)v59;
v62 = *((_QWORD *)this + 54);
*(_DWORD *)(v62 + 8 * v58) = 0;
v63 = v61 * v57;
*(float *)(v62 + 8 * v58 + 4) = v63;
v64 = *((_QWORD *)this + 54);
*(_DWORD *)(v64 + 8 * v60) = 1065353216;
*(float *)(v64 + 8 * v60 + 4) = v63;
v55 = *((_DWORD *)this + 98);
}
while ( v56 < v55 );
goto LABEL_55;
}
v47 = 0;
do
{
v48 = 2 * v47;
v49 = v47;
v50 = (unsigned int)(v48 + 1);
++v47;
v51 = (float)v49;
v52 = *((_QWORD *)this + 54);
v53 = (float)(v51 + *((float *)this + 112)) * *((float *)this + 111);
*(_DWORD *)(v52 + 8 * v48) = 0;
*(float *)(v52 + 8 * v48 + 4) = v53;
v54 = *((_QWORD *)this + 54);
*(_DWORD *)(v54 + 8 * v50) = 1065353216;
*(float *)(v54 + 8 * v50 + 4) = v53;
v55 = *((_DWORD *)this + 98);
}
while ( v47 < v55 );
LABEL_55:
*((_DWORD *)this + 99) = v55;
}
}