{"type": "func", "start": 4298310976, "end": 4298311512, "name": "GameStatsManager::checkCoinAchievement", "pseudocode": "// \n// GameStatsManager::checkCoinAchievement from 0x100330540 to 0x100330758 (536 bytes)\n// \n// 4 xrefs:\n// > PlayLayer::levelComplete @ 0x10011a054\n// > GameManager::dataLoaded @ 0x10031c348\n// > GameManager::dataLoaded @ 0x10031c36c\n// > GameManager::dataLoaded @ 0x10031c390\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::checkCoinAchievement(GameStatsManager *a1, GJGameLevel *a2)\n{\n  int v2; // w8\n  int v3; // w19\n  GameManager *v4; // x0\n  int v5; // w2\n  const char *v6; // x1\n  int v7; // w19\n  int v8; // w19\n  int CollectedCoinsForLevel; // w19\n  int v10; // w19\n\n  if ( a2->m_levelType == Main )\n  {\n    v2 = a2->m_levelID.random - a2->m_levelID.seed;\n    if ( v2 <= 5000 )\n    {\n      switch ( v2 )\n      {\n        case 14:\n          v7 = (int)fminf(\n                      floorf((float)((float)GameStatsManager::getCollectedCoinsForLevel(a1, a2) / 3.0) * 100.0),\n                      100.0);\n          v4 = GameManager::sharedState();\n          v6 = \"geometry.ach.demoncoin01\";\n          break;\n        case 18:\n          v7 = (int)fminf(\n                      floorf((float)((float)GameStatsManager::getCollectedCoinsForLevel(a1, a2) / 3.0) * 100.0),\n                      100.0);\n          v4 = GameManager::sharedState();\n          v6 = \"geometry.ach.demoncoin02\";\n          break;\n        case 20:\n          v7 = (int)fminf(\n                      floorf((float)((float)GameStatsManager::getCollectedCoinsForLevel(a1, a2) / 3.0) * 100.0),\n                      100.0);\n          v4 = GameManager::sharedState();\n          v6 = \"geometry.ach.demoncoin03\";\n          break;\n        default:\n          return;\n      }\n      v5 = v7;\n      goto LABEL_19;\n    }\n    if ( v2 <= 5002 )\n    {\n      if ( v2 == 5001 )\n      {\n        CollectedCoinsForLevel = GameStatsManager::getCollectedCoinsForLevel(a1, a2);\n        v4 = GameManager::sharedState();\n        v5 = vcvtms_s32_f32((float)((float)CollectedCoinsForLevel / 3.0) * 100.0);\n        v6 = \"geometry.ach.tower01Coin\";\n      }\n      else\n      {\n        v3 = GameStatsManager::getCollectedCoinsForLevel(a1, a2);\n        v4 = GameManager::sharedState();\n        v5 = vcvtms_s32_f32((float)((float)v3 / 3.0) * 100.0);\n        v6 = \"geometry.ach.tower02Coin\";\n      }\n      goto LABEL_19;\n    }\n    if ( v2 == 5003 )\n    {\n      v10 = GameStatsManager::getCollectedCoinsForLevel(a1, a2);\n      v4 = GameManager::sharedState();\n      v5 = vcvtms_s32_f32((float)((float)v10 / 3.0) * 100.0);\n      v6 = \"geometry.ach.tower03Coin\";\n      goto LABEL_19;\n    }\n    if ( v2 == 5004 )\n    {\n      v8 = GameStatsManager::getCollectedCoinsForLevel(a1, a2);\n      v4 = GameManager::sharedState();\n      v5 = vcvtms_s32_f32((float)((float)v8 / 3.0) * 100.0);\n      v6 = \"geometry.ach.tower04Coin\";\nLABEL_19:\n      GameManager::reportAchievementWithID(v4, v6, v5, 0);\n    }\n  }\n}", "assembly": "; \n; GameStatsManager::checkCoinAchievement from 0x100330540 to 0x100330758 (536 bytes)\n; \n; 4 xrefs:\n; > PlayLayer::levelComplete @ 0x10011a054\n; > GameManager::dataLoaded @ 0x10031c348\n; > GameManager::dataLoaded @ 0x10031c36c\n; > GameManager::dataLoaded @ 0x10031c390\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\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x100330540\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x100330544\nADD             X29, SP, #0x10                                         ; +0x8, 0x100330548\nLDR             W8, [X1,#0x404]                                        ; +0xc, 0x10033054c\nCMP             W8, #1                                                 ; +0x10, 0x100330550\nB.NE            loc_100330664                                          ; +0x14, 0x100330554\nLDR             W8, [X1,#0x148]                                        ; +0x18, 0x100330558\nLDR             W9, [X1,#0x14C]                                        ; +0x1c, 0x10033055c\nSUB             W8, W8, W9                                             ; +0x20, 0x100330560\nMOV             W9, #0x1388                                            ; +0x24, 0x100330564\nCMP             W8, W9                                                 ; +0x28, 0x100330568\nB.LE            loc_1003305C8                                          ; +0x2c, 0x10033056c\nMOV             W9, #0x138A                                            ; +0x30, 0x100330570\nCMP             W8, W9                                                 ; +0x34, 0x100330574\nB.GT            loc_100330618                                          ; +0x38, 0x100330578\nMOV             W9, #0x1389                                            ; +0x3c, 0x10033057c\nCMP             W8, W9                                                 ; +0x40, 0x100330580\nB.EQ            loc_1003306A8                                          ; +0x44, 0x100330584\nMOV             W9, #0x138A                                            ; +0x48, 0x100330588\nCMP             W8, W9                                                 ; +0x4c, 0x10033058c\nB.NE            loc_100330664                                          ; +0x50, 0x100330590\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0x54, 0x100330594\nMOV             X19, X0                                                ; +0x58, 0x100330598\nBL              GameManager__sharedState                               ; +0x5c, 0x10033059c\nSCVTF           S0, W19                                                ; +0x60, 0x1003305a0\nFMOV            S1, #3.0                                               ; +0x64, 0x1003305a4\nFDIV            S0, S0, S1                                             ; +0x68, 0x1003305a8\nMOV             W8, #0x42C80000                                        ; +0x6c, 0x1003305ac\nFMOV            S1, W8                                                 ; +0x70, 0x1003305b0\nFMUL            S0, S0, S1                                             ; +0x74, 0x1003305b4\nFCVTMS          W2, S0                                                 ; +0x78, 0x1003305b8\nADRL            X1, aGeometryAchTow_4; \"geometry.ach.tower02Coin\"      ; +0x7c, 0x1003305bc\nB               loc_100330748                                          ; +0x84, 0x1003305c4\nCMP             W8, #0xE                                               ; +0x88, 0x1003305c8\nB.EQ            loc_100330670                                          ; +0x8c, 0x1003305cc\nCMP             W8, #0x12                                              ; +0x90, 0x1003305d0\nB.EQ            loc_100330710                                          ; +0x94, 0x1003305d4\nCMP             W8, #0x14                                              ; +0x98, 0x1003305d8\nB.NE            loc_100330664                                          ; +0x9c, 0x1003305dc\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0xa0, 0x1003305e0\nSCVTF           S0, W0                                                 ; +0xa4, 0x1003305e4\nFMOV            S1, #3.0                                               ; +0xa8, 0x1003305e8\nFDIV            S0, S0, S1                                             ; +0xac, 0x1003305ec\nMOV             W8, #0x42C80000                                        ; +0xb0, 0x1003305f0\nFMOV            S1, W8                                                 ; +0xb4, 0x1003305f4\nFMUL            S0, S0, S1                                             ; +0xb8, 0x1003305f8\nFRINTM          S0, S0                                                 ; +0xbc, 0x1003305fc\nFMINNM          S0, S0, S1                                             ; +0xc0, 0x100330600\nFCVTZS          W19, S0                                                ; +0xc4, 0x100330604\nBL              GameManager__sharedState                               ; +0xc8, 0x100330608\nADRL            X1, aGeometryAchDem_28; \"geometry.ach.demoncoin03\"     ; +0xcc, 0x10033060c\nB               loc_100330744                                          ; +0xd4, 0x100330614\nMOV             W9, #0x138B                                            ; +0xd8, 0x100330618\nCMP             W8, W9                                                 ; +0xdc, 0x10033061c\nB.EQ            loc_1003306DC                                          ; +0xe0, 0x100330620\nMOV             W9, #0x138C                                            ; +0xe4, 0x100330624\nCMP             W8, W9                                                 ; +0xe8, 0x100330628\nB.NE            loc_100330664                                          ; +0xec, 0x10033062c\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0xf0, 0x100330630\nMOV             X19, X0                                                ; +0xf4, 0x100330634\nBL              GameManager__sharedState                               ; +0xf8, 0x100330638\nSCVTF           S0, W19                                                ; +0xfc, 0x10033063c\nFMOV            S1, #3.0                                               ; +0x100, 0x100330640\nFDIV            S0, S0, S1                                             ; +0x104, 0x100330644\nMOV             W8, #0x42C80000                                        ; +0x108, 0x100330648\nFMOV            S1, W8                                                 ; +0x10c, 0x10033064c\nFMUL            S0, S0, S1                                             ; +0x110, 0x100330650\nFCVTMS          W2, S0                                                 ; +0x114, 0x100330654\nADRL            X1, aGeometryAchTow_6; \"geometry.ach.tower04Coin\"      ; +0x118, 0x100330658\nB               loc_100330748                                          ; +0x120, 0x100330660\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x124, 0x100330664\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x128, 0x100330668\nRET                                                                    ; +0x12c, 0x10033066c\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0x130, 0x100330670\nSCVTF           S0, W0                                                 ; +0x134, 0x100330674\nFMOV            S1, #3.0                                               ; +0x138, 0x100330678\nFDIV            S0, S0, S1                                             ; +0x13c, 0x10033067c\nMOV             W8, #0x42C80000                                        ; +0x140, 0x100330680\nFMOV            S1, W8                                                 ; +0x144, 0x100330684\nFMUL            S0, S0, S1                                             ; +0x148, 0x100330688\nFRINTM          S0, S0                                                 ; +0x14c, 0x10033068c\nFMINNM          S0, S0, S1                                             ; +0x150, 0x100330690\nFCVTZS          W19, S0                                                ; +0x154, 0x100330694\nBL              GameManager__sharedState                               ; +0x158, 0x100330698\nADRL            X1, aGeometryAchDem_26; \"geometry.ach.demoncoin01\"     ; +0x15c, 0x10033069c\nB               loc_100330744                                          ; +0x164, 0x1003306a4\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0x168, 0x1003306a8\nMOV             X19, X0                                                ; +0x16c, 0x1003306ac\nBL              GameManager__sharedState                               ; +0x170, 0x1003306b0\nSCVTF           S0, W19                                                ; +0x174, 0x1003306b4\nFMOV            S1, #3.0                                               ; +0x178, 0x1003306b8\nFDIV            S0, S0, S1                                             ; +0x17c, 0x1003306bc\nMOV             W8, #0x42C80000                                        ; +0x180, 0x1003306c0\nFMOV            S1, W8                                                 ; +0x184, 0x1003306c4\nFMUL            S0, S0, S1                                             ; +0x188, 0x1003306c8\nFCVTMS          W2, S0                                                 ; +0x18c, 0x1003306cc\nADRL            X1, aGeometryAchTow_3; \"geometry.ach.tower01Coin\"      ; +0x190, 0x1003306d0\nB               loc_100330748                                          ; +0x198, 0x1003306d8\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0x19c, 0x1003306dc\nMOV             X19, X0                                                ; +0x1a0, 0x1003306e0\nBL              GameManager__sharedState                               ; +0x1a4, 0x1003306e4\nSCVTF           S0, W19                                                ; +0x1a8, 0x1003306e8\nFMOV            S1, #3.0                                               ; +0x1ac, 0x1003306ec\nFDIV            S0, S0, S1                                             ; +0x1b0, 0x1003306f0\nMOV             W8, #0x42C80000                                        ; +0x1b4, 0x1003306f4\nFMOV            S1, W8                                                 ; +0x1b8, 0x1003306f8\nFMUL            S0, S0, S1                                             ; +0x1bc, 0x1003306fc\nFCVTMS          W2, S0                                                 ; +0x1c0, 0x100330700\nADRL            X1, aGeometryAchTow_5; \"geometry.ach.tower03Coin\"      ; +0x1c4, 0x100330704\nB               loc_100330748                                          ; +0x1cc, 0x10033070c\nBL              GameStatsManager__getCollectedCoinsForLevel            ; +0x1d0, 0x100330710\nSCVTF           S0, W0                                                 ; +0x1d4, 0x100330714\nFMOV            S1, #3.0                                               ; +0x1d8, 0x100330718\nFDIV            S0, S0, S1                                             ; +0x1dc, 0x10033071c\nMOV             W8, #0x42C80000                                        ; +0x1e0, 0x100330720\nFMOV            S1, W8                                                 ; +0x1e4, 0x100330724\nFMUL            S0, S0, S1                                             ; +0x1e8, 0x100330728\nFRINTM          S0, S0                                                 ; +0x1ec, 0x10033072c\nFMINNM          S0, S0, S1                                             ; +0x1f0, 0x100330730\nFCVTZS          W19, S0                                                ; +0x1f4, 0x100330734\nBL              GameManager__sharedState                               ; +0x1f8, 0x100330738\nADRL            X1, aGeometryAchDem_27; \"geometry.ach.demoncoin02\"     ; +0x1fc, 0x10033073c\nMOV             X2, X19                                                ; +0x204, 0x100330744\nMOV             W3, #0                                                 ; +0x208, 0x100330748\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x20c, 0x10033074c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x210, 0x100330750\nB               GameManager__reportAchievementWithID                   ; +0x214, 0x100330754", "xrefs": ["PlayLayer::levelComplete @ 0x10011a054", "GameManager::dataLoaded @ 0x10031c348", "GameManager::dataLoaded @ 0x10031c36c", "GameManager::dataLoaded @ 0x10031c390"], "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"}