//
// GJBaseGameLayer::recordHitboxTrailState from 0x5a0148 to 0x5a02c0 (376 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::recordHitboxTrail @ 0x5a02dc
// > GJBaseGameLayer::recordHitboxTrail @ 0x5a02fc
//
// 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 11:53:16 +0000
//
void __fastcall GJBaseGameLayer::recordHitboxTrailState(_BYTE *a1, _BYTE *a2, void **a3, int *a4)
{
const cocos2d::CCRect *v8; // r0
float v9; // r11
float v10; // r0
int v11; // r0
int (__fastcall *v12)(_BYTE *); // r3
int v13; // r0
char *v14; // r3
int v15; // r10
int v16; // r11
int v17; // r1
cocos2d::CCPoint *v18; // r5
char *v19; // r5
int v20; // r4
_BYTE v21[8]; // [sp+8h] [bp-18h] BYREF
_BYTE v22[8]; // [sp+10h] [bp-10h] BYREF
float v23; // [sp+18h] [bp-8h]
_BYTE v24[8]; // [sp+20h] [bp+0h] BYREF
float v25; // [sp+28h] [bp+8h]
float v26; // [sp+2Ch] [bp+Ch]
unsigned __int8 v27; // [sp+30h] [bp+10h]
v8 = (const cocos2d::CCRect *)(*(int (__fastcall **)(_BYTE *))(*(_DWORD *)a2 + 664))(a2);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v22, v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24);
v9 = COERCE_FLOAT(cocos2d::CCRect::getMidX((cocos2d::CCRect *)v22));
v10 = COERCE_FLOAT(cocos2d::CCRect::getMidY((cocos2d::CCRect *)v22));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, v9, v10);
cocos2d::CCPoint::operator=(v24, v21);
v25 = v23;
*(float *)&v11 = COERCE_FLOAT((*(int (__fastcall **)(_BYTE *))(*(_DWORD *)a2 + 788))(a2));
v27 = a2[1901];
v12 = *(int (__fastcall **)(_BYTE *))(*(_DWORD *)a1 + 668);
v26 = *(float *)&v11;
v13 = v12(a1);
v14 = (char *)*a3;
v15 = -858993459 * (((_BYTE *)a3[1] - (_BYTE *)*a3) >> 2);
v16 = v13;
if ( v15 <= 0
|| (v15 < v13 ? (char *)(v17 = v15 - 1) : (v17 = (*a4 + v13 - 1) % v13, v14 = (char *)*a3),
(v18 = (cocos2d::CCPoint *)&v14[20 * v17], !cocos2d::CCPoint::equals(v18, (const cocos2d::CCPoint *)v24))
|| *((float *)v18 + 3) != v26
|| *((float *)v18 + 2) != v25
|| *((unsigned __int8 *)v18 + 16) != v27) )
{
if ( v15 < v16 )
{
v19 = (char *)a3[1];
if ( v19 == a3[2] )
{
std::vector
::__push_back_slow_path(a3, (int)v24);
}
else
{
if ( v19 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)a3[1], (const cocos2d::CCPoint *)v24);
*((float *)v19 + 2) = v25;
*((float *)v19 + 3) = v26;
v19[16] = v27;
}
a3[1] = (char *)a3[1] + 20;
}
}
else
{
v20 = (int)*a3 + 20 * *a4;
cocos2d::CCPoint::operator=(v20, v24);
*(float *)(v20 + 8) = v25;
*(float *)(v20 + 12) = v26;
*(_BYTE *)(v20 + 16) = v27;
*a4 = (*a4 + 1) % v16;
}
a1[11628] = 1;
}
}