{"type": "func", "start": 783604, "end": 783840, "name": "sub_BF4F4", "pseudocode": "// \n// sub_BF4F4 from 0xbf4f4 to 0xbf5e0 (236 bytes)\n// \n// 0 xrefs:\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_BF4F4(\n        unsigned __int64 **a1,\n        int a2,\n        int a3,\n        _DWORD *a4,\n        _DWORD *a5,\n        int *a6,\n        int *a7,\n        unsigned int a8,\n        int a9,\n        int a10,\n        const char *a11)\n{\n  unsigned __int64 *v13; // r0\n  int *v14; // r4\n  int v15; // r1\n  int v16; // r5\n  const char *v17; // r0\n  unsigned __int64 *v19; // r0\n  int v20; // [sp+4h] [bp-24h] BYREF\n  int v21; // [sp+8h] [bp-20h] BYREF\n\n  a1[12] = (_QWORD *)(&dword_0 + 1);\n  if ( !*a5 )\n  {\n    *a5 = 3;\n    *a6 = 2;\n  }\n  *a7 = *((_DWORD *)&unk_E5EB8 + 2 * a2);\n  v13 = sub_BD580(\n          *(int *)((char *)&dword_14C + (_DWORD)off_E8000),\n          0x20u,\n          \"../../src/fmod_output_wavwriter_nrt.cpp\",\n          0x64u,\n          0);\n  *a1 = v13;\n  if ( !v13 )\n    return 38;\n  v14 = (int *)v13;\n  *(_DWORD *)v13 = *a4;\n  *((_DWORD *)v13 + 1) = *a6;\n  v15 = *a7;\n  *((_DWORD *)v13 + 2) = a8;\n  *((_DWORD *)v13 + 4) = v15;\n  v21 = 0;\n  v16 = sub_4C6EA(a8, &v21, *a6, *a7);\n  if ( !v16 )\n  {\n    v14[3] = v21;\n    v20 = 0;\n    v17 = \"fmodoutput.wav\";\n    if ( a11 )\n      v17 = a11;\n    if ( j_FMOD_OS_File_Open(v17, 1, &v20, v14 + 7) )\n    {\n      return 51;\n    }\n    else\n    {\n      v16 = sub_85CA8(v14[7], v14[4], v14[1], *v14, v14[5]);\n      if ( !v16 )\n      {\n        v16 = 0;\n        v19 = sub_BD580(\n                *(int *)((char *)&dword_14C + (_DWORD)off_E8000),\n                v14[3],\n                \"../../src/fmod_output_wavwriter_nrt.cpp\",\n                0x84u,\n                0);\n        v14[6] = (int)v19;\n        if ( !v19 )\n          return 38;\n      }\n    }\n  }\n  return v16;\n}", "assembly": "; \n; sub_BF4F4 from 0xbf4f4 to 0xbf5e0 (236 bytes)\n; \n; 0 xrefs:\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, 0xbf4f4\nADD             R7, SP, #0xC                                           ; +0x2, 0xbf4f6\nPUSH.W          {R5-R11}                                               ; +0x4, 0xbf4f8\nMOV             R6, R0                                                 ; +0x8, 0xbf4fc\nMOVS            R0, #1                                                 ; +0xa, 0xbf4fe\nSTR             R0, [R6,#0x30]                                         ; +0xc, 0xbf500\nMOV             R11, R3                                                ; +0xe, 0xbf502\nLDR             R0, [R7,#-0x1C+arg_0]                                  ; +0x10, 0xbf504\nLDRD.W          R9, R10, [R7,#-0x1C+arg_4]                             ; +0x12, 0xbf506\nLDR             R2, [R0]                                               ; +0x16, 0xbf50a\nCBNZ            R2, loc_BF518                                          ; +0x18, 0xbf50c\nMOVS            R2, #3                                                 ; +0x1a, 0xbf50e\nSTR             R2, [R0]                                               ; +0x1c, 0xbf510\nMOVS            R0, #2                                                 ; +0x1e, 0xbf512\nSTR.W           R0, [R9]                                               ; +0x20, 0xbf514\nLDR             R0, =(unk_E5EB8 - 0xBF522)                             ; +0x24, 0xbf518\nMOVS            R5, #0                                                 ; +0x26, 0xbf51a\nMOVS            R3, #0x64 ; 'd'                                        ; +0x28, 0xbf51c\nADD             R0, PC; unk_E5EB8                                      ; +0x2a, 0xbf51e\nLDR.W           R0, [R0,R1,LSL#3]                                      ; +0x2c, 0xbf520\nMOVS            R1, #0x20 ; ' '                                        ; +0x30, 0xbf524\nSTR.W           R0, [R10]                                              ; +0x32, 0xbf526\nLDR             R0, =(off_E6144 - 0xBF530)                             ; +0x36, 0xbf52a\nADD             R0, PC; off_E6144                                      ; +0x38, 0xbf52c\nLDR.W           R8, [R0]; off_E8000                                    ; +0x3a, 0xbf52e\nLDR.W           R0, [R8]; dword_F2488                                  ; +0x3e, 0xbf532\nLDR.W           R0, [R0,#(dword_F25D4 - 0xF2488)]                      ; +0x42, 0xbf536\nSTR             R5, [SP,#0xC+var_C]                                    ; +0x46, 0xbf53a\nLDR             R2, =(aSrcFmodOutputW_0 - 0xBF542); \"../../src/fmod_output_wavwriter_nrt.cpp\" ... ; +0x48, 0xbf53c\nADD             R2, PC; \"../../src/fmod_output_wavwriter_nrt.cpp\"      ; +0x4a, 0xbf53e\nBL              sub_BD580                                              ; +0x4c, 0xbf540\nSTR             R0, [R6]                                               ; +0x50, 0xbf544\nCBZ             R0, loc_BF59E                                          ; +0x52, 0xbf546\nMOV             R4, R0                                                 ; +0x54, 0xbf548\nLDR.W           R1, [R11]                                              ; +0x56, 0xbf54a\nSTR             R1, [R4]                                               ; +0x5a, 0xbf54e\nLDR.W           R1, [R9]                                               ; +0x5c, 0xbf550\nSTR             R1, [R4,#4]                                            ; +0x60, 0xbf554\nLDR             R0, [R7,#-0x1C+arg_C]                                  ; +0x62, 0xbf556\nLDR.W           R1, [R10]                                              ; +0x64, 0xbf558\nSTR             R0, [R4,#8]                                            ; +0x68, 0xbf55c\nSTR             R1, [R4,#0x10]                                         ; +0x6a, 0xbf55e\nMOVS            R1, #1                                                 ; +0x6c, 0xbf560\nSTR             R5, [SP,#0xC+var_4]                                    ; +0x6e, 0xbf562\nLDR.W           R3, [R10]                                              ; +0x70, 0xbf564\nLDR.W           R2, [R9]                                               ; +0x74, 0xbf568\nSTR             R1, [SP,#0xC+var_C]                                    ; +0x78, 0xbf56c\nADD             R1, SP, #0xC+var_4                                     ; +0x7a, 0xbf56e\nBL              sub_4C6EA                                              ; +0x7c, 0xbf570\nMOV             R5, R0                                                 ; +0x80, 0xbf574\nCBNZ            R0, loc_BF5A0                                          ; +0x82, 0xbf576\nLDR             R0, [SP,#0xC+var_4]                                    ; +0x84, 0xbf578\nADD.W           R3, R4, #0x1C                                          ; +0x86, 0xbf57a\nSTR             R0, [R4,#0xC]                                          ; +0x8a, 0xbf57e\nMOVS            R0, #0                                                 ; +0x8c, 0xbf580\nSTR             R0, [SP,#0xC+var_8]                                    ; +0x8e, 0xbf582\nADD             R2, SP, #0xC+var_8                                     ; +0x90, 0xbf584\nLDR             R0, =(aFmodoutputWav - 0xBF58E); \"fmodoutput.wav\" ...  ; +0x92, 0xbf586\nLDR             R1, [R7,#-0x1C+arg_18]                                 ; +0x94, 0xbf588\nADD             R0, PC; \"fmodoutput.wav\"                               ; +0x96, 0xbf58a\nCMP             R1, #0                                                 ; +0x98, 0xbf58c\nIT NE                                                                  ; +0x9a, 0xbf58e\nMOVNE           R0, R1                                                 ; +0x9c, 0xbf590\nMOVS            R1, #1                                                 ; +0x9e, 0xbf592\nBLX             j_FMOD_OS_File_Open                                    ; +0xa0, 0xbf594\nCBZ             R0, loc_BF5A8                                          ; +0xa4, 0xbf598\nMOVS            R5, #0x33 ; '3'                                        ; +0xa6, 0xbf59a\nB               loc_BF5A0                                              ; +0xa8, 0xbf59c\nMOVS            R5, #0x26 ; '&'                                        ; +0xaa, 0xbf59e\nMOV             R0, R5                                                 ; +0xac, 0xbf5a0\nPOP.W           {R1-R3,R8-R11}                                         ; +0xae, 0xbf5a2\nPOP             {R4-R7,PC}                                             ; +0xb2, 0xbf5a6\nLDR             R0, [R4,#0x1C]                                         ; +0xb4, 0xbf5a8\nLDRD.W          R3, R2, [R4]                                           ; +0xb6, 0xbf5aa\nLDRD.W          R1, R5, [R4,#0x10]                                     ; +0xba, 0xbf5ae\nSTR             R5, [SP,#0xC+var_C]                                    ; +0xbe, 0xbf5b2\nBL              sub_85CA8                                              ; +0xc0, 0xbf5b4\nMOV             R5, R0                                                 ; +0xc4, 0xbf5b8\nCMP             R0, #0                                                 ; +0xc6, 0xbf5ba\nBNE             loc_BF5A0                                              ; +0xc8, 0xbf5bc\nLDR.W           R0, [R8]; dword_F2488                                  ; +0xca, 0xbf5be\nMOVS            R5, #0                                                 ; +0xce, 0xbf5c2\nLDR             R1, [R4,#0xC]                                          ; +0xd0, 0xbf5c4\nMOVS            R3, #0x84                                              ; +0xd2, 0xbf5c6\nLDR.W           R0, [R0,#(dword_F25D4 - 0xF2488)]                      ; +0xd4, 0xbf5c8\nSTR             R5, [SP,#0xC+var_C]                                    ; +0xd8, 0xbf5cc\nLDR             R2, =(aSrcFmodOutputW_0 - 0xBF5D4); \"../../src/fmod_output_wavwriter_nrt.cpp\" ... ; +0xda, 0xbf5ce\nADD             R2, PC; \"../../src/fmod_output_wavwriter_nrt.cpp\"      ; +0xdc, 0xbf5d0\nBL              sub_BD580                                              ; +0xde, 0xbf5d2\nSTR             R0, [R4,#0x18]                                         ; +0xe2, 0xbf5d6\nCMP             R0, #0                                                 ; +0xe4, 0xbf5d8\nIT EQ                                                                  ; +0xe6, 0xbf5da\nMOVEQ           R5, #0x26 ; '&'                                        ; +0xe8, 0xbf5dc\nB               loc_BF5A0                                              ; +0xea, 0xbf5de", "xrefs": [], "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"}