//
// cocos2d::CCMotionStreak::update from 0x7dee10 to 0x7df39a (1418 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:48 +0000
//
float __fastcall cocos2d::CCMotionStreak::update(float this, float a2)
{
int v2; // r6
float *v3; // r7
float *v4; // r5
float v5; // s16
const cocos2d::CCPoint *v6; // r2
unsigned int v7; // r9
float *v8; // r10
int v9; // r3
float *v10; // r2
int v11; // r2
float v12; // s14
unsigned int v13; // r4
int v14; // r10
unsigned int i; // r9
unsigned int v16; // r1
_DWORD *v17; // r3
unsigned int v18; // r11
int v19; // r8
int v20; // r3
_DWORD *v21; // r2
_DWORD *v22; // r3
int v23; // r1
int v24; // r3
_DWORD *v25; // r2
int v26; // r3
int v27; // r1
char v28; // r3
unsigned int v29; // r3
unsigned int v30; // r1
int v31; // r3
float v32; // s17
float v33; // s16
bool v34; // fnf
int v35; // r3
int v36; // r5
float v37; // s16
float v38; // s17
unsigned int v39; // r2
unsigned int v40; // r3
unsigned int v41; // s15
int v42; // r1
int v43; // r2
float v44; // s15
float v45; // s14
float v46; // s15
int v47; // r2
unsigned int v48; // r3
float v49; // s15
unsigned int v50; // s13
int v51; // r2
int v52; // r1
float v53; // s13
float *v54; // r2
int v55; // r2
int v56; // r3
int v57; // r2
unsigned int v58; // r3
int v59; // r2
bool v60; // cc
float v61; // [sp+14h] [bp-28h] BYREF
float v62; // [sp+18h] [bp-24h]
float v63[2]; // [sp+1Ch] [bp-20h] BYREF
float v64[2]; // [sp+24h] [bp-18h] BYREF
float v65; // [sp+2Ch] [bp-10h] BYREF
float v66; // [sp+30h] [bp-Ch]
v2 = LODWORD(this);
if ( !*(_BYTE *)(LODWORD(this) + 285) )
return this;
v3 = (float *)(LODWORD(this) + 376);
v4 = (float *)(LODWORD(this) + 360);
v5 = a2 * *(float *)(LODWORD(this) + 304);
this = COERCE_FLOAT(cocos2d::CCPoint::operator-(&v61, (float *)(LODWORD(this) + 376), (float *)(LODWORD(this) + 360)));
if ( !*(_DWORD *)(v2 + 316) )
goto LABEL_8;
if ( fabsf(v61) > 8192.0 || fabsf(v62) > 8192.0 )
{
v7 = 0;
while ( v7 < *(_DWORD *)(v2 + 316) )
{
v8 = (float *)(*(_DWORD *)(v2 + 324) + 8 * v7);
cocos2d::CCPoint::operator-(&v65, v8, &v61);
cocos2d::CCPoint::operator=(v8, &v65);
v9 = 16 * v7;
v10 = (float *)(*(_DWORD *)(v2 + 332) + 16 * v7++);
*v10 = *v10 - v61;
v11 = *(_DWORD *)(v2 + 332) + v9;
v9 += 8;
v12 = v61;
*(float *)(v11 + 4) = *(float *)(v11 + 4) - v62;
*(float *)(*(_DWORD *)(v2 + 332) + v9) = *(float *)(*(_DWORD *)(v2 + 332) + v9) - v12;
*(float *)(v9 + *(_DWORD *)(v2 + 332) + 4) = *(float *)(v9 + *(_DWORD *)(v2 + 332) + 4) - v62;
}
LABEL_8:
cocos2d::CCPoint::operator=(v4, v3);
cocos2d::CCNode::setPosition(v2, v4);
this = COERCE_FLOAT(cocos2d::CCPoint::operator=(&v61, flt_D2F4AC));
}
v13 = 0;
v14 = 4;
for ( i = 0; ; ++i )
{
v16 = *(_DWORD *)(v2 + 316);
if ( i >= v16 )
break;
*(float *)(*(_DWORD *)(v2 + 328) + 4 * i) = *(float *)(*(_DWORD *)(v2 + 328) + 4 * i) - v5;
v6 = *(const cocos2d::CCPoint **)(v2 + 328);
v17 = (_DWORD *)((char *)v6 + 4 * i);
if ( *(float *)v17 > 0.0 )
{
v18 = i - v13;
v19 = 8 * (i - v13);
if ( v13 )
{
*((_DWORD *)v6 + v18) = *v17;
cocos2d::CCPoint::operator=(
(float *)(*(_DWORD *)(v2 + 324) + 8 * v18),
(float *)(*(_DWORD *)(v2 + 324) + 8 * i));
v20 = *(_DWORD *)(v2 + 332);
v21 = (_DWORD *)(v20 + 16 * i);
v22 = (_DWORD *)(v20 + 16 * v18);
v23 = v21[1];
*v22 = *v21;
v22[1] = v23;
v24 = *(_DWORD *)(v2 + 332);
v25 = (_DWORD *)(v24 + 16 * v18);
v26 = v24 + 2 * v14;
v25 += 2;
this = *(float *)v26;
v27 = *(_DWORD *)(v26 + 4);
*v25 = *(_DWORD *)v26;
v25[1] = v27;
*(_BYTE *)(*(_DWORD *)(v2 + 336) + 8 * v18) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + 8 * i);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 1) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + v14 - 3);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 2) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + v14 - 2);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 4) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + v14);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 5) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + v14 + 1);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 6) = *(_BYTE *)(*(_DWORD *)(v2 + 336) + v14 + 2);
}
if ( *(_BYTE *)(v2 + 372) )
v28 = -1;
else
v28 = (unsigned int)(float)(*(float *)(*(_DWORD *)(v2 + 328) + 4 * v18) * 255.0);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v19 + 3) = v28;
v6 = *(const cocos2d::CCPoint **)(v2 + 336);
*((_BYTE *)v6 + v19 + 7) = v28;
}
else
{
++v13;
}
v14 += 8;
}
v29 = *(_DWORD *)(v2 + 312);
v30 = v16 - v13;
*(_DWORD *)(v2 + 316) = v30;
if ( v30 < v29 && *(_BYTE *)(v2 + 286) )
{
if ( !v30 )
goto LABEL_28;
cocos2d::CCPoint::CCPoint(v63, (const cocos2d::CCPoint *)(*(_DWORD *)(v2 + 324) + 8 * (v30 + 0x1FFFFFFF)));
cocos2d::CCPoint::CCPoint(v64, (const cocos2d::CCPoint *)&v61);
this = COERCE_FLOAT(cocos2d::CCPoint::operator-(&v65, v63, v64));
v31 = *(_DWORD *)(v2 + 316);
v32 = *(float *)(v2 + 308);
v33 = (float)(v66 * v66) + (float)(v65 * v65);
if ( v31 == 1 )
{
v34 = v33 < v32;
}
else
{
cocos2d::CCPoint::CCPoint(v63, (const cocos2d::CCPoint *)(*(_DWORD *)(v2 + 324) + 8 * (v31 + 536870910)));
cocos2d::CCPoint::CCPoint(v64, (const cocos2d::CCPoint *)&v61);
this = COERCE_FLOAT(cocos2d::CCPoint::operator-(&v65, v63, v64));
if ( v33 < v32 )
goto LABEL_32;
v34 = (float)((float)(v66 * v66) + (float)(v65 * v65)) < (float)(*(float *)(v2 + 308) + *(float *)(v2 + 308));
}
if ( !v34 )
{
LABEL_28:
v35 = *(_DWORD *)(v2 + 316);
if ( !v35
|| *(float *)(v2 + 368) == 0.0
|| COERCE_FLOAT(
cocos2d::ccpDistance(
(cocos2d *)(*(_DWORD *)(v2 + 324) + 8 * (v35 + 0x1FFFFFFF)),
(const cocos2d::CCPoint *)&v61,
v6)) <= *(float *)(v2 + 368) )
{
cocos2d::CCPoint::operator=((float *)(*(_DWORD *)(v2 + 324) + 8 * *(_DWORD *)(v2 + 316)), &v61);
*(_DWORD *)(*(_DWORD *)(v2 + 328) + 4 * *(_DWORD *)(v2 + 316)) = 1065353216;
v55 = *(_DWORD *)(v2 + 336);
v56 = 8 * *(_DWORD *)(v2 + 316);
*(_WORD *)(v55 + v56) = *(_WORD *)(v2 + 270);
*(_BYTE *)(v55 + v56 + 2) = *(_BYTE *)(v2 + 272);
LODWORD(this) = *(unsigned __int16 *)(v2 + 270);
v57 = *(_DWORD *)(v2 + 336) + v56;
*(_WORD *)(v57 + 4) = LOWORD(this);
*(_BYTE *)(v57 + 6) = *(_BYTE *)(v2 + 272);
*(_BYTE *)(*(_DWORD *)(v2 + 336) + v56 + 3) = -1;
*(_BYTE *)(v56 + *(_DWORD *)(v2 + 336) + 7) = -1;
v58 = *(_DWORD *)(v2 + 316);
if ( v58 )
{
v59 = *(unsigned __int8 *)(v2 + 284);
if ( *(_BYTE *)(v2 + 284) )
{
v60 = v58 > 1;
if ( v58 <= 1 )
v58 = 2;
else
v59 = 1;
if ( v60 )
this = COERCE_FLOAT(
cocos2d::ccVertexLineToPolygon(
*(_DWORD *)(v2 + 324),
*(_DWORD *)(v2 + 300),
*(_DWORD *)(v2 + 332),
v58,
v59));
else
this = COERCE_FLOAT(
cocos2d::ccVertexLineToPolygon(
*(_DWORD *)(v2 + 324),
*(_DWORD *)(v2 + 300),
*(_DWORD *)(v2 + 332),
0,
v58));
}
}
++*(_DWORD *)(v2 + 316);
}
else
{
*(_DWORD *)(v2 + 316) = 1;
cocos2d::CCPoint::operator=(v4, v3);
cocos2d::CCNode::setPosition(v2, v4);
this = COERCE_FLOAT(cocos2d::CCPoint::operator=(*(float **)(v2 + 324), flt_D2F4AC));
**(_DWORD **)(v2 + 328) = 1065353216;
}
}
}
LABEL_32:
if ( !*(_BYTE *)(v2 + 284) )
this = COERCE_FLOAT(
cocos2d::ccVertexLineToPolygon(
*(_DWORD *)(v2 + 324),
*(_DWORD *)(v2 + 300),
*(_DWORD *)(v2 + 332),
*(unsigned __int8 *)(v2 + 284),
*(_DWORD *)(v2 + 316)));
v36 = *(unsigned __int8 *)(v2 + 344);
if ( *(_BYTE *)(v2 + 344) )
{
if ( v13 )
*(float *)(v2 + 352) = *(float *)(v2 + 352) + (float)v13;
v37 = *(float *)(v2 + 352);
v38 = *(float *)(v2 + 348);
if ( (float)(v37 * v38) > 1024.0 )
{
this = floorf(v37 * v38);
*(float *)(v2 + 352) = v37 - (float)(this / v38);
}
}
v39 = *(_DWORD *)(v2 + 316);
v40 = 0;
*(_BYTE *)(v2 + 356) = 0;
if ( v39 )
{
if ( *(_DWORD *)(v2 + 320) == v39 )
{
if ( !v36 )
return this;
}
else if ( !v36 )
{
v48 = 0;
this = 0.0;
v49 = 1.0 / (float)v39;
while ( v48 < *(_DWORD *)(v2 + 316) )
{
v50 = v48;
v51 = 16 * v48++;
v52 = *(_DWORD *)(v2 + 340) + v51;
*(_DWORD *)v52 = 0;
v53 = v49 * (float)v50;
*(float *)(v52 + 4) = v53;
v54 = (float *)(v51 + 8 + *(_DWORD *)(v2 + 340));
*v54 = 1.0;
v54[1] = v53;
}
goto LABEL_47;
}
this = 0.0;
while ( v40 < *(_DWORD *)(v2 + 316) )
{
v41 = v40;
v42 = *(_DWORD *)(v2 + 340) + 16 * v40;
v43 = 16 * v40++ + 8;
v44 = (float)v41 + *(float *)(v2 + 352);
v45 = *(float *)(v2 + 348);
*(_DWORD *)v42 = 0;
v46 = v44 * v45;
*(float *)(v42 + 4) = v46;
v47 = v43 + *(_DWORD *)(v2 + 340);
*(_DWORD *)v47 = 1065353216;
*(float *)(v47 + 4) = v46;
}
LABEL_47:
*(_DWORD *)(v2 + 320) = *(_DWORD *)(v2 + 316);
}
return this;
}