{"type": "func", "start": 307864, "end": 308116, "name": "sub_4B298", "pseudocode": "// \n// sub_4B298 from 0x4b298 to 0x4b394 (252 bytes)\n// \n// 6 xrefs:\n// > sub_4ABC8 @ 0x4ac9e\n// > sub_4ADB4 @ 0x4adfe\n// > sub_4AE6C @ 0x4af04\n// > sub_4F960 @ 0x4fa2c\n// > sub_73AD8 @ 0x750ae\n// > FMOD::Channel::setPosition @ 0xad21c\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_4B298(_DWORD *a1, unsigned int a2, int a3)\n{\n  int v4; // r0\n  int result; // r0\n  int v8; // r0\n  _DWORD *v9; // r0\n  int v10; // r2\n  float v11; // s0\n  int v12; // r3\n  int v13; // r2\n  int v14; // r2\n  int v15; // [sp+0h] [bp-20h]\n  unsigned int v16; // [sp+4h] [bp-1Ch] BYREF\n  unsigned int v17; // [sp+Ch] [bp-14h] BYREF\n\n  v4 = a1[83];\n  if ( !v4 || !a1[4] )\n    return 30;\n  if ( (a3 & 0x600) != 0 )\n    return 68;\n  if ( (a3 & 0x10) == 0 )\n  {\n    v8 = *(_DWORD *)(v4 + 20);\n    if ( v8 )\n    {\n      result = (*(int (__fastcall **)(int, unsigned int *, int))(*(_DWORD *)v8 + 76))(v8, &v17, a3);\n      if ( result )\n        return result;\n      if ( v17 <= a2 )\n        return 32;\n    }\n  }\n  if ( !(a3 << 29) )\n  {\n    result = (*(int (__fastcall **)(_DWORD, unsigned int, int, _DWORD))(*(_DWORD *)a1[83] + 108))(a1[83], a2, a3, 0);\n    goto LABEL_25;\n  }\n  v9 = (_DWORD *)a1[83];\n  v10 = v9[5];\n  if ( v10 )\n  {\n    v11 = *(float *)(v10 + 80);\n    v12 = *(_DWORD *)(v10 + 24);\n    v13 = *(_DWORD *)(v10 + 76);\n    goto LABEL_15;\n  }\n  v14 = v9[6];\n  if ( !v14 )\n    return 30;\n  v13 = *(unsigned __int16 *)(v14 + 192);\n  v12 = 5;\n  v11 = (float)*(int *)(a1[1] + 1184);\nLABEL_15:\n  if ( (a3 & 2) != 0 )\n  {\n    v16 = a2;\n    result = (*(int (__fastcall **)(_DWORD *, _DWORD, _DWORD, unsigned int))(*v9 + 64))(\n               v9,\n               *(_DWORD *)(*v9 + 64),\n               0,\n               a2);\n  }\n  else\n  {\n    if ( (a3 & 4) != 0 )\n    {\n      sub_4C6A4(a2, &v16, v13, v12);\n      v15 = 0;\n      v9 = (_DWORD *)a1[83];\n    }\n    else if ( a3 << 31 )\n    {\n      v16 = (unsigned int)(float)((float)((float)((float)a2 * 0.001) * v11) + 0.5);\n      result = (*(int (__fastcall **)(_DWORD *, _DWORD, _DWORD, unsigned int))(*v9 + 64))(\n                 v9,\n                 *(_DWORD *)(*v9 + 64),\n                 0,\n                 v16);\n      goto LABEL_25;\n    }\n    result = (*(int (__fastcall **)(_DWORD *, _DWORD, int, unsigned int))(*v9 + 64))(\n               v9,\n               *(_DWORD *)(*v9 + 64),\n               v15,\n               v16);\n  }\nLABEL_25:\n  if ( !result )\n    return sub_4B96E(a1, 1);\n  return result;\n}", "assembly": "; \n; sub_4B298 from 0x4b298 to 0x4b394 (252 bytes)\n; \n; 6 xrefs:\n; > sub_4ABC8 @ 0x4ac9e\n; > sub_4ADB4 @ 0x4adfe\n; > sub_4AE6C @ 0x4af04\n; > sub_4F960 @ 0x4fa2c\n; > sub_73AD8 @ 0x750ae\n; > FMOD::Channel::setPosition @ 0xad21c\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            {R4-R7,LR}                                             ; +0x0, 0x4b298\nADD             R7, SP, #0xC                                           ; +0x2, 0x4b29a\nPUSH.W          {R11}                                                  ; +0x4, 0x4b29c\nSUB             SP, SP, #0x10                                          ; +0x8, 0x4b2a0\nMOV             R4, R0                                                 ; +0xa, 0x4b2a2\nLDR.W           R0, [R0,#0x14C]                                        ; +0xc, 0x4b2a4\nCMP             R0, #0                                                 ; +0x10, 0x4b2a8\nBEQ             loc_4B354                                              ; +0x12, 0x4b2aa\nMOV             R5, R1                                                 ; +0x14, 0x4b2ac\nLDR             R1, [R4,#0x10]                                         ; +0x16, 0x4b2ae\nCMP             R1, #0                                                 ; +0x18, 0x4b2b0\nBEQ             loc_4B354                                              ; +0x1a, 0x4b2b2\nMOV             R6, R2                                                 ; +0x1c, 0x4b2b4\nTST.W           R2, #0x600                                             ; +0x1e, 0x4b2b6\nBEQ             loc_4B2C0                                              ; +0x22, 0x4b2ba\nMOVS            R0, #0x44 ; 'D'                                        ; +0x24, 0x4b2bc\nB               loc_4B356                                              ; +0x26, 0x4b2be\nLSLS            R1, R6, #0x1B                                          ; +0x28, 0x4b2c0\nBMI             loc_4B2DC                                              ; +0x2a, 0x4b2c2\nLDR             R0, [R0,#0x14]                                         ; +0x2c, 0x4b2c4\nCBZ             R0, loc_4B2DC                                          ; +0x2e, 0x4b2c6\nLDR             R1, [R0]                                               ; +0x30, 0x4b2c8\nMOV             R2, R6                                                 ; +0x32, 0x4b2ca\nLDR             R3, [R1,#0x4C]                                         ; +0x34, 0x4b2cc\nADD             R1, SP, #0x10+var_4                                    ; +0x36, 0x4b2ce\nBLX             R3                                                     ; +0x38, 0x4b2d0\nCMP             R0, #0                                                 ; +0x3a, 0x4b2d2\nBNE             loc_4B356                                              ; +0x3c, 0x4b2d4\nLDR             R0, [SP,#0x10+var_4]                                   ; +0x3e, 0x4b2d6\nCMP             R0, R5                                                 ; +0x40, 0x4b2d8\nBLS             loc_4B366                                              ; +0x42, 0x4b2da\nMOVS.W          R12, R6,LSL#29                                         ; +0x44, 0x4b2dc\nBEQ             loc_4B2F4                                              ; +0x48, 0x4b2e0\nLDR.W           R0, [R4,#0x14C]                                        ; +0x4a, 0x4b2e2\nLDR             R2, [R0,#0x14]                                         ; +0x4e, 0x4b2e6\nCBZ             R2, loc_4B308                                          ; +0x50, 0x4b2e8\nVLDR            S0, [R2,#0x50]                                         ; +0x52, 0x4b2ea\nLDR             R3, [R2,#0x18]                                         ; +0x56, 0x4b2ee\nLDR             R2, [R2,#0x4C]                                         ; +0x58, 0x4b2f0\nB               loc_4B320                                              ; +0x5a, 0x4b2f2\nLDR.W           R0, [R4,#0x14C]                                        ; +0x5c, 0x4b2f4\nMOV             R2, R6                                                 ; +0x60, 0x4b2f8\nMOVS            R3, #0                                                 ; +0x62, 0x4b2fa\nLDR             R1, [R0]                                               ; +0x64, 0x4b2fc\nLDR.W           R12, [R1,#0x6C]                                        ; +0x66, 0x4b2fe\nMOV             R1, R5                                                 ; +0x6a, 0x4b302\nBLX             R12                                                    ; +0x6c, 0x4b304\nB               loc_4B386                                              ; +0x6e, 0x4b306\nLDR             R2, [R0,#0x18]                                         ; +0x70, 0x4b308\nCBZ             R2, loc_4B354                                          ; +0x72, 0x4b30a\nLDR             R3, [R4,#4]                                            ; +0x74, 0x4b30c\nLDRH.W          R2, [R2,#0xC0]                                         ; +0x76, 0x4b30e\nADD.W           R3, R3, #0x4A0                                         ; +0x7a, 0x4b312\nVLDR            S0, [R3]                                               ; +0x7e, 0x4b316\nMOVS            R3, #5                                                 ; +0x82, 0x4b31a\nVCVT.F32.S32    S0, S0                                                 ; +0x84, 0x4b31c\nLSLS            R1, R6, #0x1E                                          ; +0x88, 0x4b320\nBMI             loc_4B35E                                              ; +0x8a, 0x4b322\nCMP.W           R12, #0                                                ; +0x8c, 0x4b324\nBMI             loc_4B36A                                              ; +0x90, 0x4b328\nLSLS            R1, R6, #0x1F                                          ; +0x92, 0x4b32a\nBEQ             loc_4B37C                                              ; +0x94, 0x4b32c\nVMOV            S2, R5                                                 ; +0x96, 0x4b32e\nMOVS            R1, #0                                                 ; +0x9a, 0x4b332\nSTR             R1, [SP,#0x10+var_10]                                  ; +0x9c, 0x4b334\nVCVT.F32.U32    S2, S2                                                 ; +0x9e, 0x4b336\nVLDR            S4, =0.001                                             ; +0xa2, 0x4b33a\nVMUL.F32        S2, S2, S4                                             ; +0xa6, 0x4b33e\nVMOV.F32        S4, #0.5                                               ; +0xaa, 0x4b342\nVMLA.F32        S4, S2, S0                                             ; +0xae, 0x4b346\nVCVT.U32.F32    S0, S4                                                 ; +0xb2, 0x4b34a\nVSTR            S0, [SP,#0x10+var_C]                                   ; +0xb6, 0x4b34e\nB               loc_4B37C                                              ; +0xba, 0x4b352\nMOVS            R0, #0x1E                                              ; +0xbc, 0x4b354\nADD             SP, SP, #0x10                                          ; +0xbe, 0x4b356\nPOP.W           {R11}                                                  ; +0xc0, 0x4b358\nPOP             {R4-R7,PC}                                             ; +0xc4, 0x4b35c\nMOVS            R1, #0                                                 ; +0xc6, 0x4b35e\nSTRD.W          R1, R5, [SP,#0x10+var_10]                              ; +0xc8, 0x4b360\nB               loc_4B37C                                              ; +0xcc, 0x4b364\nMOVS            R0, #0x20 ; ' '                                        ; +0xce, 0x4b366\nB               loc_4B356                                              ; +0xd0, 0x4b368\nMOV             R0, SP                                                 ; +0xd2, 0x4b36a\nADDS            R1, R0, #4                                             ; +0xd4, 0x4b36c\nMOV             R0, R5                                                 ; +0xd6, 0x4b36e\nBL              sub_4C6A4                                              ; +0xd8, 0x4b370\nMOVS            R0, #0                                                 ; +0xdc, 0x4b374\nSTR             R0, [SP,#0x10+var_10]                                  ; +0xde, 0x4b376\nLDR.W           R0, [R4,#0x14C]                                        ; +0xe0, 0x4b378\nLDR             R1, [R0]                                               ; +0xe4, 0x4b37c\nLDRD.W          R2, R3, [SP,#0x10+var_10]                              ; +0xe6, 0x4b37e\nLDR             R1, [R1,#0x40]                                         ; +0xea, 0x4b382\nBLX             R1                                                     ; +0xec, 0x4b384\nCMP             R0, #0                                                 ; +0xee, 0x4b386\nBNE             loc_4B356                                              ; +0xf0, 0x4b388\nMOV             R0, R4                                                 ; +0xf2, 0x4b38a\nMOVS            R1, #1                                                 ; +0xf4, 0x4b38c\nBL              sub_4B96E                                              ; +0xf6, 0x4b38e\nB               loc_4B356                                              ; +0xfa, 0x4b392", "xrefs": ["sub_4ABC8 @ 0x4ac9e", "sub_4ADB4 @ 0x4adfe", "sub_4AE6C @ 0x4af04", "sub_4F960 @ 0x4fa2c", "sub_73AD8 @ 0x750ae", "FMOD::Channel::setPosition @ 0xad21c"], "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"}