//
// GJEffectManager::processCopyColorPulseActions from 0x140261510 to 0x140261753 (579 bytes)
//
// 2 xrefs:
// > GJEffectManager::processColors @ 0x14025b44d
// > ??> @ 0x1406d0014
//
// 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
//
// Hidden C++ exception states: #wind=1
void GJEffectManager::processCopyColorPulseActions(GJEffectManager *a1)
{
int v2; // ebp
_BYTE *v3; // rdi
int v4; // r13d
std::_Vector_val>::pointer Myfirst; // r8
_BYTE *v6; // rbx
__int64 v7; // r12
PulseEffectAction *v8; // rsi
ColorActionSprite *ColorSprite; // r14
int m_targetGroupID; // edx
ColorActionSprite *v11; // rax
GLubyte b; // al
char *v13; // r8
unsigned __int64 v14; // rbx
char *v15; // rdx
__int64 v16; // rcx
char *v17; // rax
void *Block[2]; // [rsp+20h] [rbp-58h] BYREF
_BYTE *v19; // [rsp+30h] [rbp-48h]
cocos2d::ccColor3B v20; // [rsp+80h] [rbp+8h] BYREF
char v21; // [rsp+88h] [rbp+10h] BYREF
ColorActionSprite *v22; // [rsp+90h] [rbp+18h] BYREF
*(_OWORD *)Block = 0;
v2 = 0;
v3 = nullptr;
v19 = nullptr;
v4 = 0;
Myfirst = a1->m_pulseEffectVector._Mypair._Myval2._Myfirst;
v6 = nullptr;
if ( a1->m_pulseEffectVector._Mypair._Myval2._Mylast - Myfirst )
{
v7 = 0;
while ( 1 )
{
v8 = &Myfirst[v7];
if ( Myfirst[v7].m_colorIndex )
break;
LABEL_14:
++v4;
++v7;
Myfirst = a1->m_pulseEffectVector._Mypair._Myval2._Myfirst;
if ( v4 >= (unsigned __int64)(a1->m_pulseEffectVector._Mypair._Myval2._Mylast - Myfirst) )
{
v2 = 0;
goto LABEL_16;
}
}
ColorSprite = GJEffectManager::getColorSprite(a1, v8->m_targetGroupID);
v22 = ColorSprite;
m_targetGroupID = v8->m_targetGroupID;
if ( m_targetGroupID )
{
if ( m_targetGroupID == 1010 )
{
*(_WORD *)&v20.r = 0;
b = 0;
goto LABEL_11;
}
if ( m_targetGroupID != 1011 )
{
v11 = GJEffectManager::getColorSprite(a1, m_targetGroupID);
if ( v11 )
{
*(_WORD *)&v20.r = *(_WORD *)&v11->m_copyColor.r;
b = v11->m_copyColor.b;
goto LABEL_11;
}
}
}
*(_WORD *)&v20.r = -1;
b = -1;
LABEL_11:
v20.b = b;
ColorSprite->m_pulseColor = *GJEffectManager::colorForPulseEffect(
(cocos2d::ccColor3B *)a1,
(GJEffectManager *)&v21,
&v20,
v8);
if ( v6 == v3 )
{
sub_14012D2A0((const void **)Block, v6, &v22);
v3 = v19;
v6 = Block[1];
}
else
{
*(_QWORD *)v6 = ColorSprite;
v6 += 8;
Block[1] = v6;
}
goto LABEL_14;
}
LABEL_16:
v13 = (char *)Block[0];
v14 = (v6 - (char *)Block[0]) >> 3;
if ( v14 )
{
v15 = (char *)Block[0];
do
{
v16 = *(_QWORD *)v15;
*(_WORD *)(v16 + 327) = *(_WORD *)(*(_QWORD *)v15 + 336LL);
*(_BYTE *)(v16 + 329) = *(_BYTE *)(v16 + 338);
++v2;
v15 += 8;
}
while ( v2 < v14 );
}
if ( v13 )
{
v17 = v13;
if ( ((v3 - v13) & 0xFFFFFFFFFFFFFFF8uLL) >= 0x1000 )
{
v13 = *((char **)v13 - 1);
if ( (unsigned __int64)(v17 - v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v13);
}
}