{"type": "func", "start": 315468, "end": 315566, "name": "sub_4D04C", "pseudocode": "// \n// sub_4D04C from 0x4d04c to 0x4d0ae (98 bytes)\n// \n// 1 xrefs:\n// > sub_46B58 @ 0x46c48\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\nint __fastcall sub_4D04C(int a1, int a2, int a3, int a4)\n{\n  int v6; // r0\n  int result; // r0\n  int v8; // [sp+0h] [bp-10h] BYREF\n  int v9; // [sp+4h] [bp-Ch] BYREF\n\n  v8 = a3;\n  v9 = a4;\n  if ( *(_DWORD *)(a1 + 300) )\n  {\n    if ( FMOD::ChannelI::validate(a2, &v9, 0) )\n    {\n      if ( !sub_48F28(a2, &v8, nullptr) )\n      {\n        v6 = v8;\n        if ( *(_DWORD *)(v8 + 380) == 1 )\n        {\n          *(_DWORD *)(v8 + 380) = 2;\n          return v6 + 368;\n        }\n      }\n    }\n    else\n    {\n      result = *(_DWORD *)(a1 + 300) + 44 * *(_DWORD *)(v9 + 324);\n      if ( *(_DWORD *)(result + 12) == 1 )\n      {\n        *(_DWORD *)(result + 12) = 2;\n        return result;\n      }\n    }\n  }\n  return 0;\n}", "assembly": "; \n; sub_4D04C from 0x4d04c to 0x4d0ae (98 bytes)\n; \n; 1 xrefs:\n; > sub_46B58 @ 0x46c48\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            {R2-R5,R7,LR}                                          ; +0x0, 0x4d04c\nADD             R7, SP, #0x10                                          ; +0x2, 0x4d04e\nMOV             R5, R0                                                 ; +0x4, 0x4d050\nLDR.W           R0, [R0,#0x12C]                                        ; +0x6, 0x4d052\nCBZ             R0, loc_4D0A8                                          ; +0xa, 0x4d056\nMOV             R4, R1                                                 ; +0xc, 0x4d058\nADD             R1, SP, #8+var_4                                       ; +0xe, 0x4d05a\nMOV             R0, R4                                                 ; +0x10, 0x4d05c\nMOVS            R2, #0                                                 ; +0x12, 0x4d05e\nBLX             j__ZN4FMOD8ChannelI8validateEPNS_7ChannelEPPS0_PNS_15SystemLockScopeE; FMOD::ChannelI::validate(FMOD::Channel *,FMOD::ChannelI**,FMOD::SystemLockScope *) ; +0x14, 0x4d060\nCBZ             R0, loc_4D088                                          ; +0x18, 0x4d064\nMOV             R1, SP                                                 ; +0x1a, 0x4d066\nMOV             R0, R4                                                 ; +0x1c, 0x4d068\nMOVS            R2, #0                                                 ; +0x1e, 0x4d06a\nBL              sub_48F28                                              ; +0x20, 0x4d06c\nCBNZ            R0, loc_4D0A8                                          ; +0x24, 0x4d070\nLDR             R0, [SP,#8+var_8]                                      ; +0x26, 0x4d072\nLDR.W           R1, [R0,#0x17C]                                        ; +0x28, 0x4d074\nCMP             R1, #1                                                 ; +0x2c, 0x4d078\nBNE             loc_4D0A8                                              ; +0x2e, 0x4d07a\nMOVS            R1, #2                                                 ; +0x30, 0x4d07c\nSTR.W           R1, [R0,#0x17C]                                        ; +0x32, 0x4d07e\nADD.W           R0, R0, #0x170                                         ; +0x36, 0x4d082\nB               loc_4D0AA                                              ; +0x3a, 0x4d086\nLDR             R1, [SP,#8+var_4]                                      ; +0x3c, 0x4d088\nMOVS            R2, #0x2C ; ','                                        ; +0x3e, 0x4d08a\nLDR.W           R0, [R5,#0x12C]                                        ; +0x40, 0x4d08c\nLDR.W           R1, [R1,#0x144]                                        ; +0x44, 0x4d090\nMLA             R0, R1, R2, R0                                         ; +0x48, 0x4d094\nMOV             R1, R0                                                 ; +0x4c, 0x4d098\nLDR.W           R2, [R1,#0xC]!                                         ; +0x4e, 0x4d09a\nCMP             R2, #1                                                 ; +0x52, 0x4d09e\nBNE             loc_4D0A8                                              ; +0x54, 0x4d0a0\nMOVS            R2, #2                                                 ; +0x56, 0x4d0a2\nSTR             R2, [R1]                                               ; +0x58, 0x4d0a4\nB               loc_4D0AA                                              ; +0x5a, 0x4d0a6\nMOVS            R0, #0                                                 ; +0x5c, 0x4d0a8\nADD             SP, SP, #8                                             ; +0x5e, 0x4d0aa\nPOP             {R4,R5,R7,PC}                                          ; +0x60, 0x4d0ac", "xrefs": ["sub_46B58 @ 0x46c48"], "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"}