//
// GJEffectManager::processCopyColorPulseActions from 0x8c13e4 to 0x8c1654 (624 bytes)
//
// 2 xrefs:
// > GJEffectManager::processColors @ 0x8c1684
// > ??> @ 0x543a8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJEffectManager::processCopyColorPulseActions(GJEffectManager *a1)
{
PulseEffectAction *m_start; // x2
PulseEffectAction *m_finish; // x4
__int64 v4; // x19
unsigned __int64 v5; // x20
char *v6; // x26
char *v7; // x22
char *v8; // x27
PulseEffectAction *v9; // x21
ColorActionSprite *ColorSprite; // x24
__int64 v11; // x22
__int64 v12; // x1
_BYTE *v13; // x0
char v14; // w3
char v15; // w2
signed __int64 v16; // x26
unsigned __int64 v17; // x22
unsigned __int64 v18; // x21
char *v19; // x3
unsigned __int64 v20; // x0
char *v21; // [xsp+68h] [xbp+68h]
cocos2d::ccColor3B v22; // [xsp+78h] [xbp+78h] BYREF
cocos2d::ccColor3B v23; // [xsp+80h] [xbp+80h]
m_start = a1->m_pulseEffectVector.m_start;
m_finish = a1->m_pulseEffectVector.m_finish;
if ( !(0x8E38E38E38E38E39LL * (((char *)m_finish - (char *)m_start) >> 3)) )
return;
v4 = 0;
v5 = 1;
v6 = nullptr;
v7 = nullptr;
v8 = nullptr;
while ( 1 )
{
v9 = &m_start[v4];
if ( !m_start[v4].m_colorIndex )
goto LABEL_3;
ColorSprite = GJEffectManager::getColorSprite(a1, v9->m_targetGroupID);
v22 = GJEffectManager::activeColorForIndex(a1, v9->m_targetGroupID);
v23 = GJEffectManager::colorForPulseEffect(a1, &v22, v9);
ColorSprite->m_pulseColor = v23;
if ( v6 == v7 )
{
v16 = v6 - v8;
v17 = v16 >> 3;
if ( v16 >> 3 )
{
v20 = 2 * v17;
v18 = -8;
if ( v17 <= 2 * v17 && v20 <= 0x1FFFFFFFFFFFFFFFLL )
{
v18 = 16 * v17;
v19 = nullptr;
if ( !v20 )
{
LABEL_19:
if ( &v19[v16] )
*(_QWORD *)&v19[v16] = ColorSprite;
if ( v17 )
{
v19 = (char *)memmove(v19, v8, v16);
v7 = &v19[v16 + 8];
}
else
{
v7 = &v19[v16 + 8];
if ( !v8 )
{
LABEL_24:
m_start = a1->m_pulseEffectVector.m_start;
v6 = &v19[v18];
m_finish = a1->m_pulseEffectVector.m_finish;
v8 = v19;
goto LABEL_3;
}
}
v21 = v19;
operator delete(v8);
v19 = v21;
goto LABEL_24;
}
}
}
else
{
v18 = 8;
}
v19 = (char *)operator new(v18);
goto LABEL_19;
}
if ( v7 )
*(_QWORD *)v7 = ColorSprite;
v7 += 8;
m_start = a1->m_pulseEffectVector.m_start;
m_finish = a1->m_pulseEffectVector.m_finish;
LABEL_3:
++v4;
if ( 0x8E38E38E38E38E39LL * (((char *)m_finish - (char *)m_start) >> 3) <= v5 )
break;
++v5;
}
v11 = v7 - v8;
if ( v11 >> 3 )
{
v12 = 0;
do
{
v13 = *(_BYTE **)&v8[v12];
v12 += 8;
v14 = v13[333];
v15 = v13[334];
v13[323] = v13[332];
v13[324] = v14;
v13[325] = v15;
}
while ( v12 != v11 );
}
if ( v8 )
operator delete(v8);
}