//
// ShaderLayer::preGlitchShader from 0xb2bbf4 to 0xb2bee8 (756 bytes)
//
// 2 xrefs:
// > ShaderLayer::performCalculations @ 0xb2e624
// > ??> @ 0x9b200
//
// 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 13:01:41 +0000
//
__int64 __fastcall ShaderLayer::preGlitchShader(ShaderLayer *this)
{
int v2; // w0
float v3; // s0
float v4; // s13
float v5; // s8
float v6; // s12
float v7; // s0
float v8; // s9
float v9; // s0
float v10; // s15
float v11; // s0
float v12; // s11
float v13; // s0
float v14; // s0
float v15; // s8
float v16; // s10
cocos2d::CCGLProgram *v17; // x0
cocos2d::CCGLProgram *v18; // x0
cocos2d::CCGLProgram *v19; // x0
cocos2d::CCGLProgram *v20; // x0
cocos2d::CCGLProgram *v21; // x0
__int64 v23; // x0
cocos2d::CCGLProgram *v24; // x0
float v25[2]; // [xsp+70h] [xbp+70h] BYREF
_BYTE v26[8]; // [xsp+78h] [xbp+78h] BYREF
float v27; // [xsp+80h] [xbp+80h] BYREF
if ( *((float *)this + 174) <= 0.0 )
{
v24 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v24, *((_DWORD *)this + 348), 0.0);
}
else
{
v2 = *((unsigned __int8 *)this + 720);
*((_BYTE *)this + 1078) = 1;
if ( v2 && (v23 = *((_QWORD *)this + 141)) != 0 )
v3 = fabsf((*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v23 + 3920) + 168LL))(*(_QWORD *)(v23 + 3920)));
else
v3 = 1.0;
v4 = v3 * *((float *)this + 287);
v5 = floor(*((float *)this + 175) * *((double *)this + 61) * 20.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v5, 2345.0);
v6 = (float)(random2d(&v27) * *((float *)this + 129)) * v4;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v5, 9035.0);
v7 = random2d(&v27);
v8 = (float)(v6
+ (float)((float)((float)((float)(v7 * *((float *)this + 176)) * *((float *)this + 174))
* *((float *)this + 129))
* v4))
+ floorf(
v6
+ (float)((float)((float)((float)(v7 * *((float *)this + 176)) * *((float *)this + 174))
* *((float *)this + 129))
* v4));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v5, 9625.0);
randomRange((const cocos2d::CCPoint *)&v27);
v10 = v9;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, v5, 9545.0);
randomRange((const cocos2d::CCPoint *)v26);
v12 = v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v5, 7205.0);
randomRange((const cocos2d::CCPoint *)&v27);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v12, v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, v5, 9545.0);
v14 = random2d(&v27);
v15 = *((float *)this + 289);
v16 = v14;
v17 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v17, *((_DWORD *)this + 347), v6 * v15);
v18 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v18, *((_DWORD *)this + 348), v8 * v15);
v19 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v19, *((_DWORD *)this + 349), v10);
v20 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith2f(v20, *((_DWORD *)this + 350), v25[0], v15 * v25[1]);
v21 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v21, *((_DWORD *)this + 351), v16);
}
return _stack_chk_guard;
}