{"type": "func", "start": 5370203440, "end": 5370203542, "name": "GJGameLevel::getAverageDifficulty", "pseudocode": "// \n// GJGameLevel::getAverageDifficulty from 0x14016cd30 to 0x14016cd96 (102 bytes)\n// \n// 3 xrefs:\n// > LevelCell::loadCustomLevelCell @ 0x1400af5b9\n// > LevelInfoLayer::updateLabelValues @ 0x1402ffa74\n// > <???> @ 0x1406cadb8\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nint GJGameLevel::getAverageDifficulty(GJGameLevel *a1)\n{\n  int m_ratings; // eax\n  float v3; // xmm1_4\n\n  m_ratings = a1->m_ratings;\n  if ( m_ratings < 5 )\n    return 0;\n  v3 = (float)a1->m_ratingsSum / (float)m_ratings;\n  if ( v3 < 0.0 )\n    return (int)ceilf(v3 - 0.5);\n  else\n    return (int)floorf(v3 + 0.5);\n}", "assembly": "; \n; GJGameLevel::getAverageDifficulty from 0x14016cd30 to 0x14016cd96 (102 bytes)\n; \n; 3 xrefs:\n; > LevelCell::loadCustomLevelCell @ 0x1400af5b9\n; > LevelInfoLayer::updateLabelValues @ 0x1402ffa74\n; > <???> @ 0x1406cadb8\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nsub     rsp, 28h                                                       ; +0x0, 0x14016cd30\nmov     eax, [rcx+2BCh]                                                ; +0x4, 0x14016cd34\ncmp     eax, 5                                                         ; +0xa, 0x14016cd3a\njge     short loc_14016CD46                                            ; +0xd, 0x14016cd3d\nxor     eax, eax                                                       ; +0xf, 0x14016cd3f\nadd     rsp, 28h                                                       ; +0x11, 0x14016cd41\nretn                                                                   ; +0x15, 0x14016cd45\nmovd    xmm1, dword ptr [rcx+2C0h]                                     ; +0x16, 0x14016cd46\nmovd    xmm0, eax                                                      ; +0x1e, 0x14016cd4e\ncvtdq2ps xmm0, xmm0                                                    ; +0x22, 0x14016cd52\ncvtdq2ps xmm1, xmm1                                                    ; +0x25, 0x14016cd55\ndivss   xmm1, xmm0                                                     ; +0x28, 0x14016cd58\nxorps   xmm0, xmm0                                                     ; +0x2c, 0x14016cd5c\ncomiss  xmm1, xmm0                                                     ; +0x2f, 0x14016cd5f\njb      short loc_14016CD7D                                            ; +0x32, 0x14016cd62\naddss   xmm1, cs:dword_140622B08                                       ; +0x34, 0x14016cd64\nmovaps  xmm0, xmm1; X                                                  ; +0x3c, 0x14016cd6c\ncall    floorf                                                         ; +0x3f, 0x14016cd6f\ncvttss2si eax, xmm0                                                    ; +0x44, 0x14016cd74\nadd     rsp, 28h                                                       ; +0x48, 0x14016cd78\nretn                                                                   ; +0x4c, 0x14016cd7c\nsubss   xmm1, cs:dword_140622B08                                       ; +0x4d, 0x14016cd7d\nmovaps  xmm0, xmm1; X                                                  ; +0x55, 0x14016cd85\ncall    ceilf                                                          ; +0x58, 0x14016cd88\ncvttss2si eax, xmm0                                                    ; +0x5d, 0x14016cd8d\nadd     rsp, 28h                                                       ; +0x61, 0x14016cd91\nretn                                                                   ; +0x65, 0x14016cd95", "xrefs": ["LevelCell::loadCustomLevelCell @ 0x1400af5b9", "LevelInfoLayer::updateLabelValues @ 0x1402ffa74", "<???> @ 0x1406cadb8"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}