//
// GJBaseGameLayer::applyShake from 0x596da4 to 0x596ebc (280 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::updateCamera @ 0x5b7d34
//
// 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:53:09 +0000
//
int __fastcall GJBaseGameLayer::applyShake(int result, float *a2)
{
int v2; // r4
float *v4; // r7
float *v5; // r6
double v6; // d7
double v7; // d6
float v8; // s11
float v9; // s14
float v10; // s16
float v11; // s17
float v12; // s17
float v13; // s15
v2 = result;
v4 = (float *)(result + 1040);
v5 = (float *)(result + 1044);
v6 = *(double *)(result + 1032);
v7 = *(double *)(result + 784);
if ( v6 < 0.0 || (v8 = *(float *)(result + 1024), v8 <= 0.0) || (v9 = v7 - v6, v9 > v8) )
{
*(double *)(result + 1032) = v7;
if ( *(_BYTE *)(result + 10864) )
{
v10 = 1.0;
if ( (float)((float)rand() * 4.6566e-10) > 0.5 )
v11 = 1.0;
else
v11 = -1.0;
result = rand();
if ( (float)((float)result * 4.6566e-10) <= 0.5 )
v10 = -1.0;
}
else
{
v12 = (float)rand();
result = rand();
v11 = (float)((float)(v12 * 4.6566e-10) + (float)(v12 * 4.6566e-10)) - 1.0;
v10 = (float)((float)((float)result * 4.6566e-10) + (float)((float)result * 4.6566e-10)) - 1.0;
}
v13 = *(float *)(v2 + 1020);
*v4 = v11 * v13;
*v5 = v10 * v13;
}
*a2 = *a2 + *v4;
a2[1] = a2[1] + *v5;
return result;
}