{"type": "func", "start": 4298367708, "end": 4298367872, "name": "GameStatsManager::awardSecretKey", "pseudocode": "// \n// GameStatsManager::awardSecretKey from 0x10033e2dc to 0x10033e380 (164 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::levelComplete @ 0x10011a030\n// > PlayLayer::destroyPlayer @ 0x10011eebc\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\nbool __fastcall GameStatsManager::awardSecretKey(GameStatsManager *a1)\n{\n  int Stat; // w0\n  int v3; // w8\n  float v4; // s8\n  float v5; // s9\n  int v6; // w20\n  float v7; // s0\n\n  Stat = GameStatsManager::getStat(a1, \"22\");\n  v3 = a1->m_bonusKey.random - a1->m_bonusKey.seed;\n  v4 = (float)v3;\n  v5 = floorf((float)Stat / 500.0);\n  if ( v5 > (float)v3 )\n  {\n    v6 = v3 + 1;\n    a1->m_bonusKey.value = v3 + 1;\n    v7 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;\n    a1->m_bonusKey.seed = (int)v7;\n    a1->m_bonusKey.random = v6 + (int)v7;\n    GameStatsManager::incrementStat(a1, \"21\", 1);\n  }\n  return v5 > v4;\n}", "assembly": "; \n; GameStatsManager::awardSecretKey from 0x10033e2dc to 0x10033e380 (164 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::levelComplete @ 0x10011a030\n; > PlayLayer::destroyPlayer @ 0x10011eebc\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             D9, D8, [SP,#-0x10+var_20]!                            ; +0x0, 0x10033e2dc\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0x10033e2e0\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x8, 0x10033e2e4\nADD             X29, SP, #0x20                                         ; +0xc, 0x10033e2e8\nMOV             X19, X0                                                ; +0x10, 0x10033e2ec\nADRL            X1, a22; \"22\"                                          ; +0x14, 0x10033e2f0\nBL              GameStatsManager__getStat                              ; +0x1c, 0x10033e2f8\nLDR             W8, [X19,#0x2F8]                                       ; +0x20, 0x10033e2fc\nLDR             W9, [X19,#0x2FC]                                       ; +0x24, 0x10033e300\nSUB             W8, W8, W9                                             ; +0x28, 0x10033e304\nSCVTF           S8, W8                                                 ; +0x2c, 0x10033e308\nSCVTF           S0, W0                                                 ; +0x30, 0x10033e30c\nMOV             W9, #0x43FA0000                                        ; +0x34, 0x10033e310\nFMOV            S1, W9                                                 ; +0x38, 0x10033e314\nFDIV            S0, S0, S1                                             ; +0x3c, 0x10033e318\nFRINTM          S9, S0                                                 ; +0x40, 0x10033e31c\nFCMP            S9, S8                                                 ; +0x44, 0x10033e320\nB.LE            loc_10033E368                                          ; +0x48, 0x10033e324\nADD             W20, W8, #1                                            ; +0x4c, 0x10033e328\nSTR             W20, [X19,#0x300]                                      ; +0x50, 0x10033e32c\nBL              _rand                                                  ; +0x54, 0x10033e330\nSCVTF           S0, W0, #0x1F                                          ; +0x58, 0x10033e334\nMOV             W8, #0x447A0000                                        ; +0x5c, 0x10033e338\nFMOV            S1, W8                                                 ; +0x60, 0x10033e33c\nFMUL            S0, S0, S1                                             ; +0x64, 0x10033e340\nFCVTZS          W8, S0                                                 ; +0x68, 0x10033e344\nSTR             W8, [X19,#0x2FC]                                       ; +0x6c, 0x10033e348\nADD             W8, W20, W8                                            ; +0x70, 0x10033e34c\nSTR             W8, [X19,#0x2F8]                                       ; +0x74, 0x10033e350\nADRL            X1, a21; \"21\"                                          ; +0x78, 0x10033e354\nMOV             X0, X19; int                                           ; +0x80, 0x10033e35c\nMOV             W2, #1                                                 ; +0x84, 0x10033e360\nBL              GameStatsManager__incrementStat                        ; +0x88, 0x10033e364\nFCMP            S9, S8                                                 ; +0x8c, 0x10033e368\nCSET            W0, GT                                                 ; +0x90, 0x10033e36c\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x94, 0x10033e370\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x98, 0x10033e374\nLDP             D9, D8, [SP+0x20+var_20],#0x30                         ; +0x9c, 0x10033e378\nRET                                                                    ; +0xa0, 0x10033e37c", "xrefs": ["PlayLayer::levelComplete @ 0x10011a030", "PlayLayer::destroyPlayer @ 0x10011eebc"], "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"}