{"type": "func", "start": 4295449568, "end": 4295449827, "name": "GameStatsManager::awardOldSpecialStats", "pseudocode": "// \n// GameStatsManager::awardOldSpecialStats from 0x100075be0 to 0x100075ce3 (259 bytes)\n// \n// 0 xrefs:\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\nvoid __fastcall GameStatsManager::awardOldSpecialStats(GameStatsManager *a1)\n{\n  std::__hash_node_base<std::__hash_node<int, void *> *>::__next_pointer next; // r12\n  int v2; // r14d\n  GameLevelManager *v3; // rax\n  GJGameLevel *MainLevel; // r14\n  int NormalPercent; // r15d\n  int v6; // eax\n  std::__hash_node_base<std::__hash_node<int, void *> *>::__next_pointer v7; // rdi\n  std::__hash_node_base<std::__hash_node<int, void *> *> *v8; // rbx\n  std::__hash_node_base<std::__hash_node<int, void *> *> **value; // rdi\n  std::unordered_set<int> v10; // [rsp+8h] [rbp-48h] BYREF\n\n  LevelTools::getLevelList(&v10);\n  next = v10.__table_.__p1_.__value_.__next_;\n  if ( v10.__table_.__p1_.__value_.__next_ )\n  {\n    do\n    {\n      v2 = (int)next[2].__next_;\n      v3 = GameLevelManager::sharedState();\n      MainLevel = GameLevelManager::getMainLevel(v3, v2, 1);\n      if ( GJGameLevel::getNormalPercent(MainLevel) > MainLevel->m_orbCompletion.random\n                                                    - MainLevel->m_orbCompletion.seed )\n      {\n        NormalPercent = GJGameLevel::getNormalPercent(MainLevel);\n        MainLevel->m_orbCompletion.value = NormalPercent;\n        v6 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);\n        MainLevel->m_orbCompletion.seed = v6;\n        MainLevel->m_orbCompletion.random = v6 + NormalPercent;\n      }\n      GameStatsManager::awardCurrencyForLevel(a1, MainLevel);\n      next = next->__next_;\n    }\n    while ( next );\n    v7 = v10.__table_.__p1_.__value_.__next_;\n    if ( v10.__table_.__p1_.__value_.__next_ )\n    {\n      do\n      {\n        v8 = v7->__next_;\n        operator delete(v7);\n        v7 = v8;\n      }\n      while ( v8 );\n    }\n  }\n  value = v10.__table_.__bucket_list_.__ptr_.__value_;\n  v10.__table_.__bucket_list_.__ptr_.__value_ = nullptr;\n  if ( value )\n    operator delete(value);\n}", "assembly": "; \n; GameStatsManager::awardOldSpecialStats from 0x100075be0 to 0x100075ce3 (259 bytes)\n; \n; 0 xrefs:\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\npush    rbp                                                            ; +0x0, 0x100075be0\nmov     rbp, rsp                                                       ; +0x1, 0x100075be1\npush    r15                                                            ; +0x4, 0x100075be4\npush    r14                                                            ; +0x6, 0x100075be6\npush    r12                                                            ; +0x8, 0x100075be8\npush    rbx                                                            ; +0xa, 0x100075bea\nsub     rsp, 30h                                                       ; +0xb, 0x100075beb\nmov     rbx, rdi                                                       ; +0xf, 0x100075bef\nlea     rdi, [rbp+var_48]                                              ; +0x12, 0x100075bf2\ncall    LevelTools__getLevelList                                       ; +0x16, 0x100075bf6\nmov     r12, [rbp+__p]                                                 ; +0x1b, 0x100075bfb\ntest    r12, r12                                                       ; +0x1f, 0x100075bff\njz      loc_100075CC0                                                  ; +0x22, 0x100075c02\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x28, 0x100075c08\nmov     r14d, [r12+10h]                                                ; +0x30, 0x100075c10\ncall    GameLevelManager__sharedState                                  ; +0x35, 0x100075c15\nmov     rdi, rax                                                       ; +0x3a, 0x100075c1a\nmov     esi, r14d                                                      ; +0x3d, 0x100075c1d\nmov     edx, 1                                                         ; +0x40, 0x100075c20\ncall    GameLevelManager__getMainLevel                                 ; +0x45, 0x100075c25\nmov     r14, rax                                                       ; +0x4a, 0x100075c2a\nmov     rdi, rax                                                       ; +0x4d, 0x100075c2d\ncall    GJGameLevel__getNormalPercent                                  ; +0x50, 0x100075c30\nmov     ecx, [r14+2ECh]                                                ; +0x55, 0x100075c35\nsub     ecx, [r14+2F0h]                                                ; +0x5c, 0x100075c3c\ncmp     eax, ecx                                                       ; +0x63, 0x100075c43\njle     short loc_100075C8A                                            ; +0x65, 0x100075c45\nmov     rdi, r14                                                       ; +0x67, 0x100075c47\ncall    GJGameLevel__getNormalPercent                                  ; +0x6a, 0x100075c4a\nmov     r15d, eax                                                      ; +0x6f, 0x100075c4f\nmov     [r14+2F4h], eax                                                ; +0x72, 0x100075c52\ncall    _rand                                                          ; +0x79, 0x100075c59\nxorps   xmm0, xmm0                                                     ; +0x7e, 0x100075c5e\ncvtsi2ss xmm0, eax                                                     ; +0x81, 0x100075c61\nmulss   xmm0, cs:dword_100815710                                       ; +0x85, 0x100075c65\nmulss   xmm0, cs:dword_1008152B8                                       ; +0x8d, 0x100075c6d\ncvttss2si eax, xmm0                                                    ; +0x95, 0x100075c75\nmov     [r14+2F0h], eax                                                ; +0x99, 0x100075c79\nadd     r15d, eax                                                      ; +0xa0, 0x100075c80\nmov     [r14+2ECh], r15d                                               ; +0xa3, 0x100075c83\nmov     rdi, rbx                                                       ; +0xaa, 0x100075c8a\nmov     rsi, r14                                                       ; +0xad, 0x100075c8d\ncall    GameStatsManager__awardCurrencyForLevel                        ; +0xb0, 0x100075c90\nmov     r12, [r12]                                                     ; +0xb5, 0x100075c95\ntest    r12, r12                                                       ; +0xb9, 0x100075c99\njnz     loc_100075C10                                                  ; +0xbc, 0x100075c9c\nmov     rdi, [rbp+__p]; __p                                            ; +0xc2, 0x100075ca2\ntest    rdi, rdi                                                       ; +0xc6, 0x100075ca6\njz      short loc_100075CC0                                            ; +0xc9, 0x100075ca9\nnop     dword ptr [rax+rax+00h]                                        ; +0xcb, 0x100075cab\nmov     rbx, [rdi]                                                     ; +0xd0, 0x100075cb0\ncall    __ZdlPv; operator delete(void *)                               ; +0xd3, 0x100075cb3\nmov     rdi, rbx                                                       ; +0xd8, 0x100075cb8\ntest    rbx, rbx                                                       ; +0xdb, 0x100075cbb\njnz     short loc_100075CB0                                            ; +0xde, 0x100075cbe\nmov     rdi, [rbp+var_48]; __p                                         ; +0xe0, 0x100075cc0\nmov     [rbp+var_48], 0                                                ; +0xe4, 0x100075cc4\ntest    rdi, rdi                                                       ; +0xec, 0x100075ccc\njz      short loc_100075CD6                                            ; +0xef, 0x100075ccf\ncall    __ZdlPv; operator delete(void *)                               ; +0xf1, 0x100075cd1\nadd     rsp, 30h                                                       ; +0xf6, 0x100075cd6\npop     rbx                                                            ; +0xfa, 0x100075cda\npop     r12                                                            ; +0xfb, 0x100075cdb\npop     r14                                                            ; +0xfd, 0x100075cdd\npop     r15                                                            ; +0xff, 0x100075cdf\npop     rbp                                                            ; +0x101, 0x100075ce1\nretn                                                                   ; +0x102, 0x100075ce2", "xrefs": [], "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"}