//
// GJEffectManager::init from 0x14025ace0 to 0x14025b093 (947 bytes)
//
// 5 xrefs:
// > ??> @ 0x140567e10
// > ??> @ 0x1406848e8
// > ??> @ 0x14068490c
// > ??> @ 0x140684924
// > ??> @ 0x1406cfc3c
//
// 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
//
bool GJEffectManager::init(GJEffectManager *a1)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCDictionary *v4; // rax
__int64 v5; // rcx
cocos2d::CCDictionary *v6; // rax
__int64 v7; // rcx
cocos2d::CCArray *v8; // rax
__int64 v9; // rcx
cocos2d::CCDictionary *v10; // rax
__int64 v11; // rcx
cocos2d::CCDictionary *v12; // rax
std::vector *p_m_colorActionSpriteVector; // rsi
std::_Vector_val>::pointer Mylast; // rdi
std::_Vector_val>::pointer Myfirst; // rdx
unsigned __int64 v16; // rcx
std::_Simple_types::value_type *v17; // rax
size_t v18; // rbx
std::vector *p_m_colorActionVector; // rdi
std::_Vector_val>::pointer v20; // r15
std::_Vector_val>::pointer v21; // rdx
unsigned __int64 v22; // rcx
std::_Simple_types::value_type *v23; // rax
size_t v24; // rbx
__int64 v25; // rbp
std::_Vector_val>::pointer v26; // r12
std::_Vector_val>::pointer v27; // rdx
unsigned __int64 v28; // rcx
std::_Simple_types::value_type *v29; // rax
size_t v30; // rbx
unsigned __int64 v31; // r9
__int64 v32; // r10
char v33; // r8
unsigned __int64 v34; // rax
unsigned __int64 v35; // rdx
_QWORD *v36; // rax
_QWORD *v37; // rcx
unsigned __int64 v38; // r9
unsigned __int64 v39; // r8
__int64 i; // rcx
__int64 v41; // rdx
__int64 v42; // r8
result = cocos2d::CCNode::init(a1);
if ( !result )
return result;
v4 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v3);
a1->m_unkObject148 = v4;
cocos2d::CCObject::retain(v4);
v6 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v5);
a1->m_unkDict150 = v6;
cocos2d::CCObject::retain(v6);
v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);
a1->m_unkArray430 = v8;
cocos2d::CCObject::retain(v8);
v10 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v9);
a1->m_unkDict268 = v10;
cocos2d::CCObject::retain(v10);
v12 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v11);
a1->m_colorActionDict = v12;
cocos2d::CCObject::retain(v12);
p_m_colorActionSpriteVector = &a1->m_colorActionSpriteVector;
Mylast = a1->m_colorActionSpriteVector._Mypair._Myval2._Mylast;
Myfirst = a1->m_colorActionSpriteVector._Mypair._Myval2._Myfirst;
v16 = Mylast - Myfirst;
if ( v16 <= 0x44E )
{
if ( v16 >= 0x44E )
goto LABEL_9;
if ( (unsigned __int64)(a1->m_colorActionSpriteVector._Mypair._Myval2._Myend - Myfirst) < 0x44E )
{
sub_14026CF30(&a1->m_colorActionSpriteVector);
goto LABEL_9;
}
v18 = 1102 - v16;
memset(a1->m_colorActionSpriteVector._Mypair._Myval2._Mylast, 0, v18 * 8);
v17 = &Mylast[v18];
}
else
{
v17 = Myfirst + 1102;
}
a1->m_colorActionSpriteVector._Mypair._Myval2._Mylast = v17;
LABEL_9:
p_m_colorActionVector = &a1->m_colorActionVector;
v20 = a1->m_colorActionVector._Mypair._Myval2._Mylast;
v21 = a1->m_colorActionVector._Mypair._Myval2._Myfirst;
v22 = v20 - v21;
if ( v22 <= 0x44E )
{
if ( v22 >= 0x44E )
goto LABEL_16;
if ( (unsigned __int64)(a1->m_colorActionVector._Mypair._Myval2._Myend - v21) < 0x44E )
{
sub_14026CF30(&a1->m_colorActionVector);
goto LABEL_16;
}
v24 = 1102 - v22;
memset(a1->m_colorActionVector._Mypair._Myval2._Mylast, 0, v24 * 8);
v23 = &v20[v24];
}
else
{
v23 = v21 + 1102;
}
a1->m_colorActionVector._Mypair._Myval2._Mylast = v23;
LABEL_16:
v25 = 10000;
sub_14024AD80((__int64 *)&a1->m_unkVector438, 0x2710u);
v26 = a1->m_unkVector270._Mypair._Myval2._Mylast;
v27 = a1->m_unkVector270._Mypair._Myval2._Myfirst;
v28 = v26 - v27;
if ( v28 <= 0x2710 )
{
if ( v28 >= 0x2710 )
goto LABEL_23;
if ( (unsigned __int64)(a1->m_unkVector270._Mypair._Myval2._Myend - v27) < 0x2710 )
{
sub_1402531F0((__int64)&a1->m_unkVector270);
goto LABEL_23;
}
v30 = 10000 - v28;
memset(a1->m_unkVector270._Mypair._Myval2._Mylast, 0, v30 * 8);
v29 = &v26[v30];
}
else
{
v29 = v27 + 10000;
}
a1->m_unkVector270._Mypair._Myval2._Mylast = v29;
LABEL_23:
sub_14024AD80((__int64 *)&a1->m_unkVector2f0, 0x2710u);
v31 = 0;
v32 = 0;
do
{
++v32;
v33 = v31 & 0x1F;
a1->m_unkVector270._Mypair._Myval2._Myfirst[v32 - 1] = nullptr;
v34 = v31++;
v35 = v34 >> 5;
a1->m_unkVector2f0._Myvec._Mypair._Myval2._Myfirst[v35] &= ~(1 << v33);
a1->m_unkVector438._Myvec._Mypair._Myval2._Myfirst[v35] |= 1 << v33;
--v25;
}
while ( v25 );
v36 = p_m_colorActionVector->_Mypair._Myval2._Myfirst;
v37 = p_m_colorActionSpriteVector->_Mypair._Myval2._Myfirst;
v38 = (unsigned __int64)(p_m_colorActionVector->_Mypair._Myval2._Myfirst + 1101);
v39 = (unsigned __int64)(p_m_colorActionSpriteVector->_Mypair._Myval2._Myfirst + 1101);
if ( (p_m_colorActionVector->_Mypair._Myval2._Myfirst > (std::_Vector_val>::pointer)v39
|| v38 < (unsigned __int64)v37)
&& (v36 > (_QWORD *)p_m_colorActionVector || v38 < (unsigned __int64)p_m_colorActionVector)
&& (v36 > (_QWORD *)p_m_colorActionSpriteVector || v38 < (unsigned __int64)p_m_colorActionSpriteVector)
&& (v37 > (_QWORD *)p_m_colorActionVector || v39 < (unsigned __int64)p_m_colorActionVector)
&& (v37 > (_QWORD *)p_m_colorActionSpriteVector || v39 < (unsigned __int64)p_m_colorActionSpriteVector) )
{
v41 = 137;
v42 = 137;
do
{
*v37 = 0;
v37[1] = 0;
v37[2] = 0;
v37 += 8;
*(v37 - 5) = 0;
*(v37 - 4) = 0;
*(v37 - 3) = 0;
*(v37 - 2) = 0;
*(v37 - 1) = 0;
--v42;
}
while ( v42 );
*v37 = 0;
v37[1] = 0;
v37[2] = 0;
v37[3] = 0;
v37[4] = 0;
v37[5] = 0;
do
{
*v36 = 0;
v36[1] = 0;
v36[2] = 0;
v36 += 8;
*(v36 - 5) = 0;
*(v36 - 4) = 0;
*(v36 - 3) = 0;
*(v36 - 2) = 0;
*(v36 - 1) = 0;
--v41;
}
while ( v41 );
*v36 = 0;
v36[1] = 0;
v36[2] = 0;
v36[3] = 0;
v36[4] = 0;
v36[5] = 0;
return 1;
}
else
{
for ( i = 0; i <= 1101; ++i )
{
p_m_colorActionSpriteVector->_Mypair._Myval2._Myfirst[i] = nullptr;
p_m_colorActionVector->_Mypair._Myval2._Myfirst[i] = nullptr;
}
return 1;
}
}