//
// GJGameLevel::getAverageDifficulty from 0x100583fe0 to 0x100584025 (69 bytes)
//
// 4 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x100238a48
// > LevelInfoLayer::updateLabelValues @ 0x1002afcd6
// > sub_1005070C0 @ 0x100507931
// > sub_100507FE0 @ 0x10050801e
//
// 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:32:21 +0000
//
__int64 __fastcall GJGameLevel::getAverageDifficulty(__int64 a1, __m128 a2)
{
int v2; // ecx
__int64 result; // rax
__m128 v4; // xmm1
v2 = *(_DWORD *)(a1 + 636);
result = 0;
if ( v2 >= 5 )
{
a2.f32[0] = (float)*(int *)(a1 + 640) / (float)v2;
v4 = _mm_or_ps(_mm_and_ps((__m128)xmmword_100A035F0, a2), (__m128)xmmword_100A03600);
v4.f32[0] = v4.f32[0] + a2.f32[0];
return (unsigned int)(int)_mm_round_ss((__m128)0LL, v4, 11).f32[0];
}
return result;
}