{"type": "func", "start": 5371729008, "end": 5371729190, "name": "GameStatsManager::getCollectedCoinsForLevel", "pseudocode": "// \n// GameStatsManager::getCollectedCoinsForLevel from 0x1402e1470 to 0x1402e1526 (182 bytes)\n// \n// 9 xrefs:\n// > GameStatsManager::checkCoinAchievement @ 0x1402e08f4\n// > GameStatsManager::checkCoinAchievement @ 0x1402e0a91\n// > GameStatsManager::checkCoinAchievement @ 0x1402e0c2e\n// > GameStatsManager::checkCoinAchievement @ 0x1402e0dcb\n// > GameStatsManager::checkCoinAchievement @ 0x1402e0f83\n// > GameStatsManager::checkCoinAchievement @ 0x1402e111a\n// > GameStatsManager::checkCoinAchievement @ 0x1402e12b1\n// > <???> @ 0x14091de10\n// > <???> @ 0x14091de1c\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 11:29:48 +0000\n// \n\n__int64 __fastcall GameStatsManager::getCollectedCoinsForLevel(__int64 a1, __int64 a2)\n{\n  const char *CoinKey; // rax\n  unsigned int hasSecretCoin; // ebx\n  const char *v6; // rax\n  unsigned int v7; // edi\n  const char *v8; // rax\n  char v9; // al\n  unsigned int v10; // ecx\n\n  CoinKey = GJGameLevel::getCoinKey(a2, 1u, *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));\n  hasSecretCoin = (unsigned __int8)GameStatsManager::hasSecretCoin(a1, CoinKey);\n  v6 = GJGameLevel::getCoinKey(a2, 2u, *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));\n  v7 = hasSecretCoin + 1;\n  if ( !(unsigned __int8)GameStatsManager::hasSecretCoin(a1, v6) )\n    v7 = hasSecretCoin;\n  v8 = GJGameLevel::getCoinKey(a2, 3u, *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));\n  v9 = GameStatsManager::hasSecretCoin(a1, v8);\n  v10 = v7 + 1;\n  if ( !v9 )\n    return v7;\n  return v10;\n}", "assembly": "; \n; GameStatsManager::getCollectedCoinsForLevel from 0x1402e1470 to 0x1402e1526 (182 bytes)\n; \n; 9 xrefs:\n; > GameStatsManager::checkCoinAchievement @ 0x1402e08f4\n; > GameStatsManager::checkCoinAchievement @ 0x1402e0a91\n; > GameStatsManager::checkCoinAchievement @ 0x1402e0c2e\n; > GameStatsManager::checkCoinAchievement @ 0x1402e0dcb\n; > GameStatsManager::checkCoinAchievement @ 0x1402e0f83\n; > GameStatsManager::checkCoinAchievement @ 0x1402e111a\n; > GameStatsManager::checkCoinAchievement @ 0x1402e12b1\n; > <???> @ 0x14091de10\n; > <???> @ 0x14091de1c\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 11:29:48 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1402e1470\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1402e1475\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1402e147a\npush    rdi                                                            ; +0xf, 0x1402e147f\nsub     rsp, 20h                                                       ; +0x10, 0x1402e1480\nmov     r8d, [rdx+3E0h]                                                ; +0x14, 0x1402e1484\nmov     rsi, rdx                                                       ; +0x1b, 0x1402e148b\nsub     r8d, [rdx+3E4h]                                                ; +0x1e, 0x1402e148e\nmov     rbp, rcx                                                       ; +0x25, 0x1402e1495\nmov     edx, 1                                                         ; +0x28, 0x1402e1498\nmov     rcx, rsi                                                       ; +0x2d, 0x1402e149d\ncall    GJGameLevel__getCoinKey                                        ; +0x30, 0x1402e14a0\nmov     rdx, rax                                                       ; +0x35, 0x1402e14a5\nmov     rcx, rbp                                                       ; +0x38, 0x1402e14a8\ncall    GameStatsManager__hasSecretCoin                                ; +0x3b, 0x1402e14ab\nmov     r8d, [rsi+3E0h]                                                ; +0x40, 0x1402e14b0\nmov     edx, 2                                                         ; +0x47, 0x1402e14b7\nsub     r8d, [rsi+3E4h]                                                ; +0x4c, 0x1402e14bc\nmov     rcx, rsi                                                       ; +0x53, 0x1402e14c3\nmovzx   ebx, al                                                        ; +0x56, 0x1402e14c6\ncall    GJGameLevel__getCoinKey                                        ; +0x59, 0x1402e14c9\nmov     rdx, rax                                                       ; +0x5e, 0x1402e14ce\nmov     rcx, rbp                                                       ; +0x61, 0x1402e14d1\ncall    GameStatsManager__hasSecretCoin                                ; +0x64, 0x1402e14d4\nmov     r8d, [rsi+3E0h]                                                ; +0x69, 0x1402e14d9\nlea     edi, [rbx+1]                                                   ; +0x70, 0x1402e14e0\ntest    al, al                                                         ; +0x73, 0x1402e14e3\nmov     edx, 3                                                         ; +0x75, 0x1402e14e5\nmov     rcx, rsi                                                       ; +0x7a, 0x1402e14ea\ncmovz   edi, ebx                                                       ; +0x7d, 0x1402e14ed\nsub     r8d, [rsi+3E4h]                                                ; +0x80, 0x1402e14f0\ncall    GJGameLevel__getCoinKey                                        ; +0x87, 0x1402e14f7\nmov     rdx, rax                                                       ; +0x8c, 0x1402e14fc\nmov     rcx, rbp                                                       ; +0x8f, 0x1402e14ff\ncall    GameStatsManager__hasSecretCoin                                ; +0x92, 0x1402e1502\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x97, 0x1402e1507\nlea     ecx, [rdi+1]                                                   ; +0x9c, 0x1402e150c\nmov     rbp, [rsp+28h+arg_8]                                           ; +0x9f, 0x1402e150f\ntest    al, al                                                         ; +0xa4, 0x1402e1514\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xa6, 0x1402e1516\ncmovz   ecx, edi                                                       ; +0xab, 0x1402e151b\nmov     eax, ecx                                                       ; +0xae, 0x1402e151e\nadd     rsp, 20h                                                       ; +0xb0, 0x1402e1520\npop     rdi                                                            ; +0xb4, 0x1402e1524\nretn                                                                   ; +0xb5, 0x1402e1525", "xrefs": ["GameStatsManager::checkCoinAchievement @ 0x1402e08f4", "GameStatsManager::checkCoinAchievement @ 0x1402e0a91", "GameStatsManager::checkCoinAchievement @ 0x1402e0c2e", "GameStatsManager::checkCoinAchievement @ 0x1402e0dcb", "GameStatsManager::checkCoinAchievement @ 0x1402e0f83", "GameStatsManager::checkCoinAchievement @ 0x1402e111a", "GameStatsManager::checkCoinAchievement @ 0x1402e12b1", "<???> @ 0x14091de10", "<???> @ 0x14091de1c"], "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"}