{"type": "func", "start": 4300750816, "end": 4300750885, "name": "GJGameLevel::getAverageDifficulty", "pseudocode": "// \n// GJGameLevel::getAverageDifficulty from 0x100583fe0 to 0x100584025 (69 bytes)\n// \n// 4 xrefs:\n// > LevelCell::loadCustomLevelCell @ 0x100238a48\n// > LevelInfoLayer::updateLabelValues @ 0x1002afcd6\n// > sub_1005070C0 @ 0x100507931\n// > sub_100507FE0 @ 0x10050801e\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:32:21 +0000\n// \n\n__int64 __fastcall GJGameLevel::getAverageDifficulty(__int64 a1, __m128 a2)\n{\n  int v2; // ecx\n  __int64 result; // rax\n  __m128 v4; // xmm1\n\n  v2 = *(_DWORD *)(a1 + 636);\n  result = 0;\n  if ( v2 >= 5 )\n  {\n    a2.f32[0] = (float)*(int *)(a1 + 640) / (float)v2;\n    v4 = _mm_or_ps(_mm_and_ps((__m128)xmmword_100A035F0, a2), (__m128)xmmword_100A03600);\n    v4.f32[0] = v4.f32[0] + a2.f32[0];\n    return (unsigned int)(int)_mm_round_ss((__m128)0LL, v4, 11).f32[0];\n  }\n  return result;\n}", "assembly": "; \n; GJGameLevel::getAverageDifficulty from 0x100583fe0 to 0x100584025 (69 bytes)\n; \n; 4 xrefs:\n; > LevelCell::loadCustomLevelCell @ 0x100238a48\n; > LevelInfoLayer::updateLabelValues @ 0x1002afcd6\n; > sub_1005070C0 @ 0x100507931\n; > sub_100507FE0 @ 0x10050801e\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:32:21 +0000\n; \nmov     ecx, [rdi+27Ch]                                                ; +0x0, 0x100583fe0\nxor     eax, eax                                                       ; +0x6, 0x100583fe6\ncmp     ecx, 5                                                         ; +0x8, 0x100583fe8\njl      short locret_100584024                                         ; +0xb, 0x100583feb\npush    rbp                                                            ; +0xd, 0x100583fed\nmov     rbp, rsp                                                       ; +0xe, 0x100583fee\ncvtsi2ss xmm0, dword ptr [rdi+280h]                                    ; +0x11, 0x100583ff1\ncvtsi2ss xmm1, ecx                                                     ; +0x19, 0x100583ff9\ndivss   xmm0, xmm1                                                     ; +0x1d, 0x100583ffd\nmovaps  xmm1, cs:xmmword_100A035F0                                     ; +0x21, 0x100584001\nandps   xmm1, xmm0                                                     ; +0x28, 0x100584008\norps    xmm1, cs:xmmword_100A03600                                     ; +0x2b, 0x10058400b\naddss   xmm1, xmm0                                                     ; +0x32, 0x100584012\nxorps   xmm0, xmm0                                                     ; +0x36, 0x100584016\nroundss xmm0, xmm1, 0Bh                                                ; +0x39, 0x100584019\ncvttss2si eax, xmm0                                                    ; +0x3f, 0x10058401f\npop     rbp                                                            ; +0x43, 0x100584023\nretn                                                                   ; +0x44, 0x100584024", "xrefs": ["LevelCell::loadCustomLevelCell @ 0x100238a48", "LevelInfoLayer::updateLabelValues @ 0x1002afcd6", "sub_1005070C0 @ 0x100507931", "sub_100507FE0 @ 0x10050801e"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}