{"type": "func", "start": 421952, "end": 422128, "name": "sub_67040", "pseudocode": "// \n// sub_67040 from 0x67040 to 0x670f0 (176 bytes)\n// \n// 1 xrefs:\n// > sub_54A54 @ 0x54a88\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\n__int64 __fastcall sub_67040(__int64 a1, unsigned int *a2, __int64 a3)\n{\n  unsigned int v4; // w9\n  unsigned int v5; // w9\n  __int64 result; // x0\n\n  if ( atomic_load((unsigned int *)(a1 + 272)) )\n  {\n    v4 = atomic_load((unsigned int *)(a1 + 272));\n    if ( v4 != 7 )\n      return 46;\n  }\n  if ( !a2 )\n    return 31;\n  switch ( (_DWORD)a3 )\n  {\n    case 1:\n      v5 = (unsigned int)(float)((float)*(unsigned int *)(a1 + 392) * (float)(0.001 * *(float *)(a1 + 108)));\n      break;\n    case 4:\n      sub_66774(a1, *(_DWORD *)(a1 + 392), a2);\n      return 0;\n    case 2:\n      v5 = *(_DWORD *)(a1 + 392);\n      break;\n    default:\n      result = sub_D2CC8(*(_QWORD *)(a1 + 96), a2, a3);\n      if ( (_DWORD)result )\n        return result;\n      return 0;\n  }\n  *a2 = v5;\n  return 0;\n}", "assembly": "; \n; sub_67040 from 0x67040 to 0x670f0 (176 bytes)\n; \n; 1 xrefs:\n; > sub_54A54 @ 0x54a88\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             X29, X30, [SP,#-0x10+var_s0]!                          ; +0x0, 0x67040\nADD             X9, X0, #0x110                                         ; +0x4, 0x67044\nLDAR            W10, [X9]                                              ; +0x8, 0x67048\nMOV             X8, X1                                                 ; +0xc, 0x6704c\nMOV             X29, SP                                                ; +0x10, 0x67050\nCBZ             W10, loc_67064                                         ; +0x14, 0x67054\nLDAR            W9, [X9]                                               ; +0x18, 0x67058\nCMP             W9, #7                                                 ; +0x1c, 0x6705c\nB.NE            loc_67088                                              ; +0x20, 0x67060\nCBZ             X8, loc_67090                                          ; +0x24, 0x67064\nCMP             W2, #1                                                 ; +0x28, 0x67068\nB.EQ            loc_67098                                              ; +0x2c, 0x6706c\nCMP             W2, #4                                                 ; +0x30, 0x67070\nB.EQ            loc_670C0                                              ; +0x34, 0x67074\nCMP             W2, #2                                                 ; +0x38, 0x67078\nB.NE            loc_670D4                                              ; +0x3c, 0x6707c\nLDR             W9, [X0,#0x188]                                        ; +0x40, 0x67080\nB               loc_670B8                                              ; +0x44, 0x67084\nMOV             W0, #0x2E ; '.'                                        ; +0x48, 0x67088\nB               loc_670E8                                              ; +0x4c, 0x6708c\nMOV             W0, #0x1F                                              ; +0x50, 0x67090\nB               loc_670E8                                              ; +0x54, 0x67094\nADRP            X9, #dword_2F10C@PAGE                                  ; +0x58, 0x67098\nLDR             S0, [X0,#0x188]                                        ; +0x5c, 0x6709c\nLDR             S1, [X9,#dword_2F10C@PAGEOFF]                          ; +0x60, 0x670a0\nLDR             S2, [X0,#0x6C]                                         ; +0x64, 0x670a4\nUCVTF           S0, S0                                                 ; +0x68, 0x670a8\nFMUL            S1, S1, S2                                             ; +0x6c, 0x670ac\nFMUL            S0, S0, S1                                             ; +0x70, 0x670b0\nFCVTZU          W9, S0                                                 ; +0x74, 0x670b4\nSTR             W9, [X8]                                               ; +0x78, 0x670b8\nB               loc_670E4                                              ; +0x7c, 0x670bc\nLDR             W1, [X0,#0x188]                                        ; +0x80, 0x670c0\nMOV             W3, #1                                                 ; +0x84, 0x670c4\nMOV             X2, X8                                                 ; +0x88, 0x670c8\nBL              sub_66774                                              ; +0x8c, 0x670cc\nB               loc_670E4                                              ; +0x90, 0x670d0\nLDR             X0, [X0,#0x60]                                         ; +0x94, 0x670d4\nMOV             X1, X8                                                 ; +0x98, 0x670d8\nBL              sub_D2CC8                                              ; +0x9c, 0x670dc\nCBNZ            W0, loc_670E8                                          ; +0xa0, 0x670e0\nMOV             W0, WZR                                                ; +0xa4, 0x670e4\nLDP             X29, X30, [SP+var_s0],#0x10                            ; +0xa8, 0x670e8\nRET                                                                    ; +0xac, 0x670ec", "xrefs": ["sub_54A54 @ 0x54a88"], "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"}