//
// GJBaseGameLayer::updateShaderLayer from 0x100118950 to 0x10011996a (4122 bytes)
//
// 6 xrefs:
// > PlayLayer::resetLevel @ 0x10008d091
// > LevelEditorLayer::updateGameObjects @ 0x1000ad852
// > LevelEditorLayer::onPlaytest @ 0x1000c6149
// > GJBaseGameLayer::update @ 0x10012f42c
// > GJBaseGameLayer::update @ 0x100130bc9
// > GJBaseGameLayer::resetLevelVariables @ 0x100138988
//
// This function is hookable on this platform (idp: pc, 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:24:35 +0000
//
__int64 __fastcall GJBaseGameLayer::updateShaderLayer(__int64 a1, __int64 a2, float a3)
{
__int64 v4; // rcx
__int64 v5; // rsi
__int64 active; // rax
__int64 v7; // rsi
int v8; // eax
__int64 v9; // rcx
__int64 v10; // r14
__int64 v11; // rax
__int64 v12; // rcx
int v13; // r15d
char shouldBlend; // al
__int64 v15; // rdi
int v16; // edx
_BYTE *v17; // rdi
char v18; // r14
__int64 v19; // rax
__int64 v20; // r14
int v21; // r12d
__int64 v22; // r15
unsigned int v23; // eax
__int64 v24; // r14
__int64 v25; // r15
unsigned int v26; // eax
__int64 *v27; // r13
__int64 v28; // r14
__int64 *v29; // rax
__int64 v30; // r15
unsigned int v31; // eax
__int64 *v32; // rax
__int64 v33; // rdi
__int64 v34; // rax
__int64 v35; // r14
__int64 v36; // r15
unsigned int *v37; // rax
_QWORD *v38; // r13
_QWORD *v39; // r12
_QWORD *v40; // r14
__int64 v41; // r15
unsigned int v42; // eax
__int64 v43; // rdi
__int64 v44; // rax
__int64 v45; // r14
__int64 v46; // r15
unsigned int *v47; // rax
_QWORD *v48; // r13
_QWORD *v49; // r12
_QWORD *v50; // r14
__int64 v51; // r15
unsigned int v52; // eax
__int64 v53; // rdi
__int64 v54; // rax
__int64 v55; // r14
__int64 v56; // r15
unsigned int *v57; // rax
_QWORD *v58; // r12
unsigned __int64 v59; // r13
__int64 v60; // r14
__int64 v61; // r15
unsigned int v62; // eax
__int64 v63; // rdi
__int64 v64; // rax
__int64 v65; // r14
__int64 v66; // r15
unsigned int *v67; // rax
_QWORD *v68; // r12
unsigned __int64 v69; // r13
__int64 v70; // r14
__int64 v71; // r15
unsigned int v72; // eax
__int64 v73; // r14
unsigned int v74; // eax
__int64 v75; // r14
unsigned int v76; // eax
__int64 v77; // r14
__int64 v78; // r15
unsigned int v79; // eax
__int64 v80; // r15
unsigned int v81; // eax
__int64 v82; // r15
__int64 v83; // r14
unsigned int v84; // eax
unsigned int v85; // ecx
unsigned int v86; // eax
_BOOL8 v87; // rdx
__int64 v88; // rsi
int v89; // r8d
__int64 v90; // rdi
bool v91; // zf
__int64 v92; // r12
__int64 v93; // rdi
__int64 v94; // rsi
__int64 v95; // r14
__int64 v96; // rdi
__int64 v97; // rsi
__int64 v98; // r14
__int64 v99; // rsi
unsigned int *v100; // rax
_QWORD *v101; // r14
unsigned __int64 v102; // r15
__int64 v103; // r12
int v104; // eax
__int64 v105; // r13
unsigned int v106; // eax
unsigned int *v107; // rax
_QWORD *v108; // r14
unsigned __int64 v109; // r13
__int64 v110; // r15
int v111; // eax
__int64 v112; // r12
unsigned int v113; // eax
unsigned int *v114; // rax
_QWORD *v115; // r12
unsigned __int64 v116; // r13
__int64 v117; // r14
int v118; // eax
__int64 v119; // r15
unsigned int v120; // eax
__int64 v121; // rax
__int64 v122; // r14
unsigned int v123; // eax
__int64 v124; // rdx
bool v125; // r15
__int64 v126; // rcx
__int64 v127; // r14
__int64 v129; // [rsp+8h] [rbp-68h]
__int64 v130; // [rsp+10h] [rbp-60h]
__int64 v131; // [rsp+18h] [rbp-58h]
int v132; // [rsp+20h] [rbp-50h]
float v133; // [rsp+28h] [rbp-48h]
__int64 v134; // [rsp+28h] [rbp-48h]
int v135; // [rsp+34h] [rbp-3Ch] BYREF
float v136; // [rsp+38h] [rbp-38h]
float v137; // [rsp+3Ch] [rbp-34h]
float v138[12]; // [rsp+40h] [rbp-30h]
v138[0] = a3;
v4 = *(_QWORD *)(a1 + 12416);
if ( v4 )
{
v5 = *(unsigned int *)(v4 + 988);
if ( (int)v5 <= 0 )
{
LODWORD(active) = 0xFFFFFF;
}
else
{
active = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), v5);
v4 = *(_QWORD *)(a1 + 12416);
}
*(_WORD *)(v4 + 992) = active;
*(_BYTE *)(v4 + 994) = BYTE2(active);
v7 = *(unsigned int *)(*(_QWORD *)(a1 + 12416) + 528LL);
if ( (int)v7 <= 0 )
{
v11 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3944) + 944LL))(*(_QWORD *)(a1 + 3944));
v12 = *(_QWORD *)(a1 + 12416);
*(_WORD *)(v12 + 520) = *(_WORD *)v11;
*(_BYTE *)(v12 + 522) = *(_BYTE *)(v11 + 2);
v10 = *(_QWORD *)(a1 + 12416);
if ( *(_BYTE *)(v10 + 836) != 1 )
goto LABEL_11;
}
else
{
v8 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), v7);
v9 = *(_QWORD *)(a1 + 12416);
*(_WORD *)(v9 + 520) = v8;
*(_BYTE *)(v9 + 522) = BYTE2(v8);
v10 = *(_QWORD *)(a1 + 12416);
if ( *(_BYTE *)(v10 + 836) != 1 )
goto LABEL_11;
}
if ( *(_DWORD *)(v10 + 840) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
sub_100278300(*(_QWORD *)(a1 + 12416) + 844LL, &v135);
v10 = *(_QWORD *)(a1 + 12416);
}
LABEL_11:
if ( *(_BYTE *)(v10 + 936) == 1 && *(_DWORD *)(v10 + 940) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
v10 = *(_QWORD *)(a1 + 12416);
*(_DWORD *)(v10 + 948) = v135;
}
if ( *(_BYTE *)(v10 + 937) == 1 && *(_DWORD *)(v10 + 944) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
v10 = *(_QWORD *)(a1 + 12416);
*(float *)(v10 + 952) = v136;
}
if ( *(_DWORD *)(v10 + 584) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
ShaderLayer::updateShockWaveCenter(v10, &v135);
v10 = *(_QWORD *)(a1 + 12416);
}
if ( *(_DWORD *)(v10 + 664) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
ShaderLayer::updateShockLineCenter(v10, &v135);
v10 = *(_QWORD *)(a1 + 12416);
}
if ( *(_DWORD *)(v10 + 796) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
sub_100278300(*(_QWORD *)(a1 + 12416) + 812LL, &v135);
v10 = *(_QWORD *)(a1 + 12416);
}
if ( *(_DWORD *)(v10 + 904) )
{
GJBaseGameLayer::positionForShaderTarget(&v135, a1);
sub_100278300(*(_QWORD *)(a1 + 12416) + 912LL, &v135);
v10 = *(_QWORD *)(a1 + 12416);
}
a2 = *(unsigned int *)(v10 + 800);
if ( (int)a2 <= 0 )
{
shouldBlend = 0;
v13 = 0;
}
else
{
v13 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), a2);
a2 = *(unsigned int *)(*(_QWORD *)(a1 + 12416) + 800LL);
shouldBlend = GJEffectManager::shouldBlend(*(_QWORD *)(a1 + 2152));
v10 = *(_QWORD *)(a1 + 12416);
}
*(_WORD *)(v10 + 806) = v13;
*(_BYTE *)(v10 + 808) = BYTE2(v13);
v15 = *(_QWORD *)(a1 + 12416);
*(_BYTE *)(v15 + 805) = shouldBlend;
v16 = *(_DWORD *)(v15 + 884);
v137 = 0.0;
if ( v16 )
{
a2 = a1;
GJBaseGameLayer::speedForShaderTarget(&v135, a1);
v15 = *(_QWORD *)(a1 + 12416);
}
if ( *(_DWORD *)(v15 + 888) )
{
a2 = a1;
GJBaseGameLayer::speedForShaderTarget(&v135, a1);
v137 = v136;
v15 = *(_QWORD *)(a1 + 12416);
}
v133 = 60.0 * v138[0];
ShaderLayer::updateMotionBlurSpeedX(v15, a2);
ShaderLayer::updateMotionBlurSpeedY(*(_QWORD *)(a1 + 12416), v137, v133);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 12416) + 40LL))(*(_QWORD *)(a1 + 12416), v138[0]);
ShaderLayer::performCalculations(*(_QWORD *)(a1 + 12416));
v17 = *(_BYTE **)(a1 + 12416);
v18 = v17[1078];
v19 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v17 + 512LL))(v17);
if ( v18 != 1 )
{
if ( v19 )
{
v33 = *(_QWORD *)(a1 + 3904);
v34 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v33 + 488LL))(v33);
if ( v34 )
{
v35 = v34;
*(_QWORD *)v138 = *(_QWORD *)(a1 + 3928);
v36 = sub_1007FE900(v33);
sub_1007FEF70(v36, v35);
if ( v36 )
{
v37 = *(unsigned int **)(v36 + 56);
if ( *v37 )
{
v38 = *((_QWORD **)v37 + 2);
v39 = &v38[*v37 - 1];
do
{
v40 = (_QWORD *)*v38;
if ( !*v38 )
break;
if ( v40 != *(_QWORD **)v138 )
{
v41 = *(_QWORD *)(a1 + 3896);
if ( (*(__int64 (__fastcall **)(_QWORD))(*v40 + 512LL))(*v38) != v41
&& (*(unsigned int (__fastcall **)(_QWORD *))(*v40 + 64LL))(v40) != -9999 )
{
cocos2d::CCObject::retain(v40);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v40 + 528LL))(v40, 0);
if ( v41 )
{
v42 = (*(__int64 (__fastcall **)(_QWORD *))(*v40 + 104LL))(v40);
(*(void (__fastcall **)(__int64, _QWORD *, _QWORD))(*(_QWORD *)v41 + 464LL))(v41, v40, v42);
}
cocos2d::CCObject::release(v40);
}
}
++v38;
}
while ( v38 <= v39 );
}
}
}
v43 = *(_QWORD *)(a1 + 3912);
v44 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v43 + 488LL))(v43);
if ( v44 )
{
v45 = v44;
*(_QWORD *)v138 = *(_QWORD *)(a1 + 3936);
v46 = sub_1007FE900(v43);
sub_1007FEF70(v46, v45);
if ( v46 )
{
v47 = *(unsigned int **)(v46 + 56);
if ( *v47 )
{
v48 = *((_QWORD **)v47 + 2);
v49 = &v48[*v47 - 1];
do
{
v50 = (_QWORD *)*v48;
if ( !*v48 )
break;
if ( v50 != *(_QWORD **)v138 )
{
v51 = *(_QWORD *)(a1 + 3896);
if ( (*(__int64 (__fastcall **)(_QWORD))(*v50 + 512LL))(*v48) != v51
&& (*(unsigned int (__fastcall **)(_QWORD *))(*v50 + 64LL))(v50) != -9999 )
{
cocos2d::CCObject::retain(v50);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v50 + 528LL))(v50, 0);
if ( v51 )
{
v52 = (*(__int64 (__fastcall **)(_QWORD *))(*v50 + 104LL))(v50);
(*(void (__fastcall **)(__int64, _QWORD *, _QWORD))(*(_QWORD *)v51 + 464LL))(v51, v50, v52);
}
cocos2d::CCObject::release(v50);
}
}
++v48;
}
while ( v48 <= v49 );
}
}
}
v53 = *(_QWORD *)(a1 + 3928);
v54 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v53 + 488LL))(v53);
if ( v54 )
{
v55 = v54;
v56 = sub_1007FE900(v53);
sub_1007FEF70(v56, v55);
if ( v56 )
{
v57 = *(unsigned int **)(v56 + 56);
if ( *v57 )
{
v58 = *((_QWORD **)v57 + 2);
v59 = (unsigned __int64)&v58[*v57 - 1];
do
{
v60 = *v58;
if ( !*v58 )
break;
v61 = *(_QWORD *)(a1 + 3920);
if ( (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v60 + 512LL))(*v58) != v61
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v60 + 64LL))(v60) != -9999 )
{
cocos2d::CCObject::retain(v60);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v60 + 528LL))(v60, 0);
if ( v61 )
{
v62 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 104LL))(v60);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v61 + 464LL))(v61, v60, v62);
}
cocos2d::CCObject::release(v60);
}
++v58;
}
while ( (unsigned __int64)v58 <= v59 );
}
}
}
v63 = *(_QWORD *)(a1 + 3936);
v64 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v63 + 488LL))(v63);
if ( v64 )
{
v65 = v64;
v66 = sub_1007FE900(v63);
sub_1007FEF70(v66, v65);
if ( v66 )
{
v67 = *(unsigned int **)(v66 + 56);
if ( *v67 )
{
v68 = *((_QWORD **)v67 + 2);
v69 = (unsigned __int64)&v68[*v67 - 1];
do
{
v70 = *v68;
if ( !*v68 )
break;
v71 = *(_QWORD *)(a1 + 3920);
if ( (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v70 + 512LL))(*v68) != v71
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v70 + 64LL))(v70) != -9999 )
{
cocos2d::CCObject::retain(v70);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v70 + 528LL))(v70, 0);
if ( v71 )
{
v72 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v70 + 104LL))(v70);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v71 + 464LL))(v71, v70, v72);
}
cocos2d::CCObject::release(v70);
}
++v68;
}
while ( (unsigned __int64)v68 <= v69 );
}
}
}
v73 = *(_QWORD *)(a1 + 3896);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v73 + 512LL))(v73) != a1
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v73 + 64LL))(v73) != -9999 )
{
cocos2d::CCObject::retain(v73);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v73 + 528LL))(v73, 0);
v74 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v73 + 104LL))(v73);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v73, v74);
cocos2d::CCObject::release(v73);
}
v75 = *(_QWORD *)(a1 + 3904);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v75 + 512LL))(v75) != a1
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v75 + 64LL))(v75) != -9999 )
{
cocos2d::CCObject::retain(v75);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v75 + 528LL))(v75, 0);
v76 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v75 + 104LL))(v75);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v75, v76);
cocos2d::CCObject::release(v75);
}
a2 = 0;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 12416) + 528LL))(*(_QWORD *)(a1 + 12416), 0);
}
goto LABEL_202;
}
v20 = *(_QWORD *)(a1 + 12416);
if ( v19 && *(_BYTE *)(v20 + 1076) != 1 )
{
LABEL_202:
*(_BYTE *)(*(_QWORD *)(a1 + 12416) + 1076LL) = 0;
goto LABEL_203;
}
v21 = *(_DWORD *)(v20 + 1072);
v22 = *(_QWORD *)(a1 + 3896);
v132 = *(_DWORD *)(v20 + 1068);
if ( v132 >= 2 )
v20 = a1;
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 512LL))(v22) != v20
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v22 + 64LL))(v22) != -9999 )
{
cocos2d::CCObject::retain(v22);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v22 + 528LL))(v22, 0);
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 104LL))(v22);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v20 + 464LL))(v20, v22, v23);
cocos2d::CCObject::release(v22);
}
v24 = *(_QWORD *)(a1 + 3904);
v25 = a1;
if ( v132 >= 2 )
v25 = *(_QWORD *)(a1 + 12416);
if ( (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v24 + 512LL))(*(_QWORD *)(a1 + 3904)) != v25
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v24 + 64LL))(v24) != -9999 )
{
cocos2d::CCObject::retain(v24);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v24 + 528LL))(v24, 0);
if ( v25 )
{
v26 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v24 + 104LL))(v24);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v25 + 464LL))(v25, v24, v26);
}
cocos2d::CCObject::release(v24);
}
*(_QWORD *)v138 = a1 + 3896;
v27 = (__int64 *)(a1 + 3904);
v28 = *(_QWORD *)(a1 + 3976);
if ( v28 )
{
v29 = *(__int64 **)v138;
if ( v21 >= 2 )
v29 = (__int64 *)(a1 + 3904);
if ( v132 != 2 )
v29 = *(__int64 **)v138;
v30 = *v29;
if ( (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v28 + 512LL))(*(_QWORD *)(a1 + 3976)) != v30
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v28 + 64LL))(v28) != -9999 )
{
cocos2d::CCObject::retain(v28);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v28 + 528LL))(v28, 0);
if ( v30 )
{
v31 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v28 + 104LL))(v28);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v30 + 464LL))(v30, v28, v31);
}
cocos2d::CCObject::release(v28);
}
}
if ( v132 >= 2 && v21 < 13 )
{
v32 = (__int64 *)(a1 + 3912);
}
else
{
v32 = (__int64 *)(a1 + 3904);
if ( v21 >= 13 || v132 >= 2 )
{
v32 = (__int64 *)(a1 + 3904);
if ( v21 < 13 || (unsigned int)(v132 - 2) >= 0xC )
v32 = *(__int64 **)v138;
}
}
v77 = *v32;
v78 = *(_QWORD *)(a1 + 3960);
if ( v78
&& (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v78 + 512LL))(*(_QWORD *)(a1 + 3960)) != v77
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v78 + 64LL))(v78) != -9999 )
{
cocos2d::CCObject::retain(v78);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v78 + 528LL))(v78, 0);
if ( v77 )
{
v79 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v78 + 104LL))(v78);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v77 + 464LL))(v77, v78, v79);
}
cocos2d::CCObject::release(v78);
}
v80 = *(_QWORD *)(a1 + 3968);
if ( v80
&& (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v80 + 512LL))(*(_QWORD *)(a1 + 3968)) != v77
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v80 + 64LL))(v80) != -9999 )
{
cocos2d::CCObject::retain(v80);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v80 + 528LL))(v80, 0);
if ( v77 )
{
v81 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v80 + 104LL))(v80);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v77 + 464LL))(v77, v80, v81);
}
cocos2d::CCObject::release(v80);
}
if ( v132 >= 2 && v21 < 14 )
{
v27 = (__int64 *)(a1 + 3912);
}
else if ( (v21 >= 14 || v132 >= 2) && (v21 < 14 || (unsigned int)(v132 - 2) >= 0xD) )
{
v82 = **(_QWORD **)v138;
LABEL_133:
v83 = *(_QWORD *)(a1 + 13312);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v83 + 512LL))(v83) != v82
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v83 + 64LL))(v83) != -9999 )
{
cocos2d::CCObject::retain(v83);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v83 + 528LL))(v83, 0);
if ( v82 )
{
v84 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v83 + 104LL))(v83);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v82 + 464LL))(v82, v83, v84);
}
cocos2d::CCObject::release(v83);
}
v85 = 0;
v86 = 0;
if ( (unsigned int)(v132 - 1) <= 0xE )
v86 = dword_100A050D4[v132 - 1];
if ( (unsigned int)(v21 - 1) <= 0xE )
v85 = dword_100A05098[v21 - 1];
v87 = v132 >= 2;
v88 = *(_QWORD *)(a1 + 12416);
v89 = 60;
if ( v21 != 8 )
v89 = v85;
v90 = 40;
if ( v132 != 8 )
v90 = v86;
v91 = *(_BYTE *)(v88 + 1077) == 0;
if ( !*(_BYTE *)(v88 + 1077) )
v89 = v85;
v137 = *(float *)&v89;
if ( v91 )
v90 = v86;
LODWORD(v138[0]) = v90;
v131 = *(_QWORD *)(a1 + 8 * v87 + 3920);
v134 = *(_QWORD *)(a1 + 8 * v87 + 3928);
v92 = sub_1007FE900(v90);
v93 = *(_QWORD *)(a1 + 3920);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v93 + 488LL))(v93) )
{
v93 = v92;
v94 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3920) + 488LL))(*(_QWORD *)(a1 + 3920));
sub_1007FEF70(v92, v94);
}
v95 = sub_1007FE900(v93);
v96 = *(_QWORD *)(a1 + 3928);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v96 + 488LL))(v96) )
{
v96 = v95;
v97 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3928) + 488LL))(*(_QWORD *)(a1 + 3928));
sub_1007FEF70(v95, v97);
}
v130 = v95;
v98 = sub_1007FE900(v96);
if ( (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3936) + 488LL))(*(_QWORD *)(a1 + 3936)) )
{
v99 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3936) + 488LL))(*(_QWORD *)(a1 + 3936));
sub_1007FEF70(v98, v99);
}
v129 = v98;
if ( v92 )
{
v100 = *(unsigned int **)(v92 + 56);
if ( *v100 )
{
v101 = *((_QWORD **)v100 + 2);
v102 = (unsigned __int64)&v101[*v100 - 1];
do
{
v103 = *v101;
if ( !*v101 )
break;
v104 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v103 + 104LL))(*v101);
if ( v104 >= SLODWORD(v138[0]) )
{
v105 = v134;
if ( v104 <= SLODWORD(v137) )
v105 = v131;
}
else
{
v105 = *(_QWORD *)(a1 + 3920);
}
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v103 + 512LL))(v103) != v105
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v103 + 64LL))(v103) != -9999 )
{
cocos2d::CCObject::retain(v103);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v103 + 528LL))(v103, 0);
if ( v105 )
{
v106 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v103 + 104LL))(v103);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v105 + 464LL))(v105, v103, v106);
}
cocos2d::CCObject::release(v103);
}
++v101;
}
while ( (unsigned __int64)v101 <= v102 );
}
}
if ( v130 )
{
v107 = *(unsigned int **)(v130 + 56);
if ( *v107 )
{
v108 = *((_QWORD **)v107 + 2);
v109 = (unsigned __int64)&v108[*v107 - 1];
do
{
v110 = *v108;
if ( !*v108 )
break;
v111 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v110 + 104LL))(*v108);
if ( v111 >= SLODWORD(v138[0]) )
{
v112 = v134;
if ( v111 <= SLODWORD(v137) )
v112 = v131;
}
else
{
v112 = *(_QWORD *)(a1 + 3920);
}
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v110 + 512LL))(v110) != v112
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v110 + 64LL))(v110) != -9999 )
{
cocos2d::CCObject::retain(v110);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v110 + 528LL))(v110, 0);
if ( v112 )
{
v113 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v110 + 104LL))(v110);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v112 + 464LL))(v112, v110, v113);
}
cocos2d::CCObject::release(v110);
}
++v108;
}
while ( (unsigned __int64)v108 <= v109 );
}
}
if ( v129 )
{
v114 = *(unsigned int **)(v129 + 56);
if ( *v114 )
{
v115 = *((_QWORD **)v114 + 2);
v116 = (unsigned __int64)&v115[*v114 - 1];
do
{
v117 = *v115;
if ( !*v115 )
break;
v118 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v117 + 104LL))(*v115);
if ( v118 >= SLODWORD(v138[0]) )
{
v119 = v134;
if ( v118 <= SLODWORD(v137) )
v119 = v131;
}
else
{
v119 = *(_QWORD *)(a1 + 3920);
}
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v117 + 512LL))(v117) != v119
&& (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v117 + 64LL))(v117) != -9999 )
{
cocos2d::CCObject::retain(v117);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v117 + 528LL))(v117, 0);
if ( v119 )
{
v120 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v117 + 104LL))(v117);
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v119 + 464LL))(v119, v117, v120);
}
cocos2d::CCObject::release(v117);
}
++v115;
}
while ( (unsigned __int64)v115 <= v116 );
}
}
v121 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 12416) + 512LL))(*(_QWORD *)(a1 + 12416));
a2 = *(_QWORD *)(a1 + 12416);
if ( v121 )
{
if ( (*(unsigned int (__fastcall **)(_QWORD))(*(_QWORD *)a2 + 104LL))(*(_QWORD *)(a1 + 12416)) != v132 >= 2 )
{
a2 = v132 >= 2;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 12416) + 88LL))(*(_QWORD *)(a1 + 12416), a2);
}
}
else
{
(*(void (__fastcall **)(__int64, __int64, bool))(*(_QWORD *)a1 + 464LL))(a1, a2, v132 >= 2);
}
goto LABEL_202;
}
v82 = *v27;
goto LABEL_133;
}
LABEL_203:
v122 = *(_QWORD *)(a1 + 3904);
v123 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v122 + 496LL))(v122);
v125 = 1;
LOBYTE(v126) = 1;
if ( v123 <= 1 )
LOBYTE(v126) = (*(unsigned int (__fastcall **)(_QWORD, __int64, __int64, __int64))(**(_QWORD **)(a1 + 3928) + 496LL))(
*(_QWORD *)(a1 + 3928),
a2,
v124,
v126) != 0;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v122 + 344LL))(v122, (unsigned __int8)v126);
v127 = *(_QWORD *)(a1 + 3912);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v127 + 496LL))(v127) <= 1 )
v125 = (*(unsigned int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3936) + 496LL))(*(_QWORD *)(a1 + 3936)) != 0;
return (*(__int64 (__fastcall **)(__int64, bool))(*(_QWORD *)v127 + 344LL))(v127, v125);
}