//
// ShaderLayer::preMotionBlurShader from 0x684420 to 0x68466c (588 bytes)
//
// 1 xrefs:
// > ShaderLayer::performCalculations @ 0x6855fc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:56:04 +0000
//
int __fastcall ShaderLayer::preMotionBlurShader(ShaderLayer *this)
{
cocos2d::CCGLProgram *v2; // r0
float v4; // s17
float v5; // s16
int v6; // r3
float v7; // s15
float v8; // s14
float v9; // s17
float v10; // s16
cocos2d::CCGLProgram *v11; // r0
int v12; // r0
float v13; // s16
float v14; // s15
float v15; // s13
cocos2d::CCGLProgram *v16; // r0
cocos2d::CCGLProgram *v17; // r0
float v18; // s14
cocos2d::CCGLProgram *v19; // r0
int v20; // r1
float v21; // r2
if ( *((float *)this + 183) != 0.0
|| *((float *)this + 184) != 0.0
|| cocos2d::CCNode::getActionByTag(this, 19)
|| cocos2d::CCNode::getActionByTag(this, 20) )
{
*((_BYTE *)this + 950) = 1;
}
if ( *((float *)this + 183) == 0.0 && *((float *)this + 184) == 0.0 )
{
v2 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 241) + 328))(*((_DWORD *)this + 241));
return cocos2d::CCGLProgram::setUniformLocationWith2f(v2, *((_DWORD *)this + 331), 0.0, 0.0);
}
else
{
if ( *((_DWORD *)this + 189) )
v4 = *((float *)this + 185);
else
v4 = 1.0;
if ( *((_DWORD *)this + 190) )
{
v5 = *((float *)this + 186);
if ( v4 == 0.0 )
v4 = 0.001;
if ( v5 == 0.0 )
v5 = 0.001;
}
else
{
if ( v4 == 0.0 )
v4 = 0.001;
v5 = 1.0;
}
if ( *((_BYTE *)this + 765) && (v6 = *((_DWORD *)this + 244)) != 0 )
v7 = fabsf((*(float (__fastcall **)(_DWORD))(**(_DWORD **)(v6 + 2436) + 84))(*(_DWORD *)(v6 + 2436)));
else
v7 = 1.0;
v8 = *((float *)this + 248);
v9 = (float)((float)((float)(v4 * *((float *)this + 183)) * 0.1) * *((float *)this + 96)) * v7;
v10 = (float)((float)((float)((float)((float)(v5 * *((float *)this + 184)) * 0.1) * *((float *)this + 97)) * v7) * v8)
* *((float *)this + 250);
v11 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 241) + 328))(*((_DWORD *)this + 241));
cocos2d::CCGLProgram::setUniformLocationWith2f(v11, *((_DWORD *)this + 331), v9 * v8, v10);
v12 = *((_DWORD *)this + 241);
if ( *((float *)this + 175) == 0.0 )
{
v13 = 0.2;
if ( !*((_BYTE *)this + 764) )
v13 = 0.1;
v14 = v13 * *((float *)this + 176);
if ( v14 > v13 )
v15 = v13;
else
v15 = v13 * *((float *)this + 176);
if ( (float)-v13 >= v15 )
{
v13 = -v13;
}
else if ( v14 <= v13 )
{
v13 = v13 * *((float *)this + 176);
}
v16 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(int))(*(_DWORD *)v12 + 328))(v12);
cocos2d::CCGLProgram::setUniformLocationWith1f(v16, *((_DWORD *)this + 330), v13);
v17 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 241) + 328))(*((_DWORD *)this + 241));
v18 = 36.0;
if ( *((_BYTE *)this + 764) )
v18 = 20.0;
cocos2d::CCGLProgram::setUniformLocationWith1f(
v17,
*((_DWORD *)this + 332),
1.0 / (float)(9.0 - (float)(v18 * v13)));
v19 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 241) + 328))(*((_DWORD *)this + 241));
v20 = *((_DWORD *)this + 333);
v21 = (float)*((unsigned __int8 *)this + 764);
}
else
{
v19 = (cocos2d::CCGLProgram *)(*(int (__fastcall **)(int))(*(_DWORD *)v12 + 328))(v12);
v20 = *((_DWORD *)this + 332);
v21 = 1.0;
}
return cocos2d::CCGLProgram::setUniformLocationWith1f(v19, v20, v21);
}
}