//
// GJBaseGameLayer::applyShake from 0x10013a640 to 0x10013a760 (288 bytes)
//
// 0 xrefs:
//
// 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:52 +0000
//
void __fastcall GJBaseGameLayer::applyShake(__int64 a1, double *a2)
{
double v2; // xmm0_8
double v3; // xmm1_8
char v4; // r15
__m128 v5; // xmm0
__m128 v6; // xmm0
__m128 v7; // xmm1
float v8; // xmm2_4
float v9; // xmm1_4
__m128 v10; // xmm0
__m128 inserted; // xmm1
__m128 v12; // [rsp+0h] [rbp-30h]
v2 = *(double *)(a1 + 920);
v3 = *(double *)(a1 + 1240);
if ( v3 < 0.0 || (v8 = *(float *)(a1 + 1232), v8 <= 0.0) || (v9 = v2 - v3, v9 > v8) )
{
*(double *)(a1 + 1240) = v2;
v4 = *(_BYTE *)(a1 + 12648);
v5 = 0;
v5.f32[0] = (float)rand() * 4.6566129e-10;
v12 = v5;
v6 = 0;
v6.f32[0] = (float)rand() * 4.6566129e-10;
if ( v4 == 1 )
{
v7 = _mm_blendv_ps(
(__m128)xmmword_100A041E0,
(__m128)xmmword_100A038B0,
_mm_cmplt_ps((__m128)xmmword_100A04CE0, _mm_insert_ps(v12, v6, 16)));
}
else
{
inserted = _mm_insert_ps(v12, v6, 16);
v7 = _mm_add_ps(_mm_add_ps(inserted, inserted), (__m128)xmmword_100A041E0);
}
v10 = _mm_mul_ps(_mm_moveldup_ps((__m128)*(unsigned int *)(a1 + 1228)), v7);
_mm_storel_ps((double *)(a1 + 1248), v10);
}
else
{
v10 = (__m128)*(unsigned __int64 *)(a1 + 1248);
}
_mm_storel_ps(a2, _mm_add_ps((__m128)*(unsigned __int64 *)a2, v10));
}