//
// GJEffectManager::processCopyColorPulseActions from 0xa1bbec to 0xa1be34 (584 bytes)
//
// 2 xrefs:
// > GJEffectManager::processColors @ 0xa1be64
// > ??> @ 0x74bf0
//
// 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 12:59:37 +0000
//
__int64 __fastcall GJEffectManager::processCopyColorPulseActions(GJEffectManager *this)
{
__int64 v2; // x2
__int64 v3; // x4
__int64 v4; // x19
unsigned __int64 i; // x20
__int64 v6; // x26
cocos2d::CCObject *ColorSprite; // x0
int v8; // w1
cocos2d::CCObject *v9; // x27
unsigned __int64 active; // x0
int v11; // w0
cocos2d::CCObject **v12; // x1
cocos2d::CCObject **v13; // x4
char *v15; // x7
__int64 v16; // x2
char *v17; // x0
signed __int64 v18; // x6
_BYTE *v19; // x1
char v20; // w4
char v21; // w3
__int16 v22; // [xsp+68h] [xbp+68h] BYREF
char v23; // [xsp+6Ah] [xbp+6Ah]
__int16 v24; // [xsp+70h] [xbp+70h]
char v25; // [xsp+72h] [xbp+72h]
cocos2d::CCObject *v26; // [xsp+78h] [xbp+78h] BYREF
void *v27; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCObject **v28; // [xsp+88h] [xbp+88h]
cocos2d::CCObject **v29; // [xsp+90h] [xbp+90h]
v2 = *((_QWORD *)this + 43);
v3 = *((_QWORD *)this + 44);
v27 = nullptr;
v28 = nullptr;
v29 = nullptr;
if ( 0x8E38E38E38E38E39LL * ((v3 - v2) >> 3) )
{
v4 = 0;
for ( i = 1; ; ++i )
{
v6 = v2 + v4;
if ( *(_DWORD *)(v2 + v4 + 52) )
{
ColorSprite = GJEffectManager::getColorSprite(this, *(_DWORD *)(v6 + 20));
v8 = *(_DWORD *)(v6 + 20);
v9 = ColorSprite;
v26 = ColorSprite;
active = GJEffectManager::activeColorForIndex(this, v8);
v22 = active;
v23 = BYTE2(active);
v11 = GJEffectManager::colorForPulseEffect(this, &v22, v6);
v12 = v28;
v13 = v29;
v24 = v11;
v25 = BYTE2(v11);
*((_WORD *)v9 + 166) = v11;
*((_BYTE *)v9 + 334) = BYTE2(v11);
if ( v12 == v13 )
{
std::vector::__push_back_slow_path(&v27, &v26);
v2 = *((_QWORD *)this + 43);
v3 = *((_QWORD *)this + 44);
}
else
{
if ( v12 )
{
*v12 = v26;
v12 = v28;
}
v2 = *((_QWORD *)this + 43);
v28 = v12 + 1;
v3 = *((_QWORD *)this + 44);
}
}
v4 += 72;
if ( 0x8E38E38E38E38E39LL * ((v3 - v2) >> 3) <= i )
break;
}
v15 = (char *)v28;
v16 = 0;
v17 = (char *)v27;
v18 = (char *)v28 - (_BYTE *)v27;
if ( ((char *)v28 - (_BYTE *)v27) >> 3 )
{
do
{
v19 = *(_BYTE **)&v17[v16];
v16 += 8;
v20 = v19[333];
v21 = v19[334];
v19[323] = v19[332];
v19[324] = v20;
v19[325] = v21;
}
while ( v16 != v18 );
}
else if ( !v27 )
{
return _stack_chk_guard;
}
if ( v15 != v17 )
v28 = (cocos2d::CCObject **)&v15[8 * ~((unsigned __int64)(v15 - 8 - v17) >> 3)];
operator delete(v17);
}
return _stack_chk_guard;
}