{"type": "func", "start": 7859164, "end": 7859612, "name": "EditorSFXManager::encodeSound", "pseudocode": "// \n// EditorSFXManager::encodeSound from 0x77ebdc to 0x77ed9c (448 bytes)\n// \n// 2 xrefs:\n// > EditorSFXManager::serializeAll @ 0x77eed0\n// > EditorSFXManager::deserializeAll @ 0x780c0a\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:59:26 +0000\n// \n\nEditorSFXManager *__fastcall EditorSFXManager::encodeSound(EditorSFXManager *this, SFXTriggerGameObject *a2, int a3)\n{\n  int v5; // r2\n  int v6; // r3\n  int v7; // r3\n  int v8; // r0\n  int v9; // r1\n  int v10; // r2\n  int v11; // r3\n  int v12; // r2\n  const void *v13; // r1\n  size_t v14; // r2\n  int v16; // [sp+0h] [bp-14h] BYREF\n  int v17; // [sp+4h] [bp-10h]\n  int v18; // [sp+8h] [bp-Ch]\n\n  if ( a3 )\n  {\n    v5 = *(_DWORD *)(a3 + 1660);\n    v16 = 0;\n    v17 = 0;\n    v18 = 0;\n    sub_77EB20(&v16, 1, v5);\n    if ( fabsf(*(float *)(a3 + 1680) - 1.0) >= 0.0001 )\n      sub_77EAB4(&v16, 2);\n    sub_77EB20(&v16, 3, *(_DWORD *)(a3 + 1672));\n    sub_77EB20(&v16, 4, *(_DWORD *)(a3 + 1676));\n    sub_77EB20(&v16, 5, *(_DWORD *)(a3 + 1684));\n    sub_77EB20(&v16, 6, *(_DWORD *)(a3 + 1692));\n    sub_77EB20(&v16, 7, *(_DWORD *)(a3 + 1688));\n    sub_77EB20(&v16, 8, *(_DWORD *)(a3 + 1696));\n    if ( fabsf(*(float *)(a3 + 1744)) >= 0.0001 )\n      sub_77EAB4(&v16, 9);\n    sub_77EB20(&v16, 10, *(_DWORD *)(a3 + 1780));\n    sub_77EB20(&v16, 11, *(_DWORD *)(a3 + 1784));\n    if ( fabsf(*(float *)(a3 + 1788)) >= 0.0001 )\n      sub_77EAB4(&v16, 12);\n    sub_77EB7C(&v16, 13, *(unsigned __int8 *)(a3 + 1792));\n    sub_77EB7C(&v16, 14, *(unsigned __int8 *)(a3 + 1701));\n    sub_77EB20(&v16, 15, *(_DWORD *)(a3 + 1664));\n    sub_77EB7C(&v16, 16, *(unsigned __int8 *)(a3 + 1700));\n    v6 = *(unsigned __int8 *)(a3 + 1796);\n    if ( (v6 & 1) != 0 )\n      v7 = *(_DWORD *)(a3 + 1800);\n    else\n      v7 = v6 >> 1;\n    if ( v7 )\n    {\n      if ( (v16 & 1) != 0 )\n        v11 = v17;\n      else\n        v11 = (int)(unsigned __int8)v16 >> 1;\n      if ( v11 )\n        std::string::push_back(&v16, 44);\n      v12 = *(unsigned __int8 *)(a3 + 1796);\n      if ( (v12 & 1) != 0 )\n      {\n        v13 = *(const void **)(a3 + 1804);\n        v14 = *(_DWORD *)(a3 + 1800);\n      }\n      else\n      {\n        v13 = (const void *)(a3 + 1797);\n        v14 = v12 >> 1;\n      }\n      std::string::append(&v16, v13, v14);\n    }\n    v8 = v16;\n    v9 = v17;\n    v10 = v18;\n    v16 = 0;\n    v17 = 0;\n    v18 = 0;\n    *(_DWORD *)this = v8;\n    *((_DWORD *)this + 1) = v9;\n    *((_DWORD *)this + 2) = v10;\n    std::string::~string((int)&v16);\n  }\n  else\n  {\n    *(_DWORD *)this = 0;\n    *((_DWORD *)this + 1) = 0;\n    *((_DWORD *)this + 2) = 0;\n    std::string::__init((int *)this, &unk_B6B226, 0);\n  }\n  return this;\n}", "assembly": "; \n; EditorSFXManager::encodeSound from 0x77ebdc to 0x77ed9c (448 bytes)\n; \n; 2 xrefs:\n; > EditorSFXManager::serializeAll @ 0x77eed0\n; > EditorSFXManager::deserializeAll @ 0x780c0a\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:59:26 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x77ebdc\nMOV             R6, R0                                                 ; +0x2, 0x77ebde\nLDR             R7, =(__stack_chk_guard_ptr - 0x77EBEC)                ; +0x4, 0x77ebe0\nMOV             R4, R2                                                 ; +0x6, 0x77ebe2\nVPUSH           {D8}                                                   ; +0x8, 0x77ebe4\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xc, 0x77ebe8\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xe, 0x77ebea\nLDR             R3, [R7]                                               ; +0x10, 0x77ebec\nSUB             SP, SP, #0x14                                          ; +0x12, 0x77ebee\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x14, 0x77ebf0\nCBNZ            R2, loc_77EC04                                         ; +0x16, 0x77ebf2\nLDR             R1, =(unk_B6B226 - 0x77EBFE)                           ; +0x18, 0x77ebf4\nSTR             R2, [R6]                                               ; +0x1a, 0x77ebf6\nSTR             R2, [R6,#4]                                            ; +0x1c, 0x77ebf8\nADD             R1, PC; unk_B6B226                                     ; +0x1e, 0x77ebfa\nSTR             R2, [R6,#8]                                            ; +0x20, 0x77ebfc\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x22, 0x77ebfe\nB               loc_77ED86                                             ; +0x26, 0x77ec02\nMOV             R0, SP                                                 ; +0x28, 0x77ec04\nMOVS            R1, #1                                                 ; +0x2a, 0x77ec06\nLDR.W           R2, [R2,#0x67C]                                        ; +0x2c, 0x77ec08\nMOVS            R3, #0                                                 ; +0x30, 0x77ec0c\nMOV             R5, SP                                                 ; +0x32, 0x77ec0e\nSTR             R3, [SP,#0x14+var_14]                                  ; +0x34, 0x77ec10\nSTR             R3, [SP,#0x14+var_10]                                  ; +0x36, 0x77ec12\nSTR             R3, [SP,#0x14+var_C]                                   ; +0x38, 0x77ec14\nBL              sub_77EB20                                             ; +0x3a, 0x77ec16\nVMOV.F32        S15, #1.0                                              ; +0x3e, 0x77ec1a\nADD.W           R3, R4, #0x690                                         ; +0x42, 0x77ec1e\nVLDR            S16, =0.0001                                           ; +0x46, 0x77ec22\nVLDR            S0, [R3]                                               ; +0x4a, 0x77ec26\nVSUB.F32        S15, S0, S15                                           ; +0x4e, 0x77ec2a\nVABS.F32        S15, S15                                               ; +0x52, 0x77ec2e\nVCMPE.F32       S15, S16                                               ; +0x56, 0x77ec32\nVMRS            APSR_nzcv, FPSCR                                       ; +0x5a, 0x77ec36\nBPL             loc_77EC4A                                             ; +0x5e, 0x77ec3a\nMOV             R0, R5                                                 ; +0x60, 0x77ec3c\nMOVS            R1, #3                                                 ; +0x62, 0x77ec3e\nLDR.W           R2, [R4,#0x688]                                        ; +0x64, 0x77ec40\nBL              sub_77EB20                                             ; +0x68, 0x77ec44\nB               loc_77EC54                                             ; +0x6c, 0x77ec48\nMOV             R0, SP                                                 ; +0x6e, 0x77ec4a\nMOVS            R1, #2                                                 ; +0x70, 0x77ec4c\nBL              sub_77EAB4                                             ; +0x72, 0x77ec4e\nB               loc_77EC3C                                             ; +0x76, 0x77ec52\nMOV             R0, R5                                                 ; +0x78, 0x77ec54\nMOVS            R1, #4                                                 ; +0x7a, 0x77ec56\nLDR.W           R2, [R4,#0x68C]                                        ; +0x7c, 0x77ec58\nBL              sub_77EB20                                             ; +0x80, 0x77ec5c\nMOV             R0, R5                                                 ; +0x84, 0x77ec60\nMOVS            R1, #5                                                 ; +0x86, 0x77ec62\nLDR.W           R2, [R4,#0x694]                                        ; +0x88, 0x77ec64\nBL              sub_77EB20                                             ; +0x8c, 0x77ec68\nMOV             R0, R5                                                 ; +0x90, 0x77ec6c\nMOVS            R1, #6                                                 ; +0x92, 0x77ec6e\nLDR.W           R2, [R4,#0x69C]                                        ; +0x94, 0x77ec70\nBL              sub_77EB20                                             ; +0x98, 0x77ec74\nMOV             R0, R5                                                 ; +0x9c, 0x77ec78\nMOVS            R1, #7                                                 ; +0x9e, 0x77ec7a\nLDR.W           R2, [R4,#0x698]                                        ; +0xa0, 0x77ec7c\nBL              sub_77EB20                                             ; +0xa4, 0x77ec80\nMOV             R0, R5                                                 ; +0xa8, 0x77ec84\nMOVS            R1, #8                                                 ; +0xaa, 0x77ec86\nLDR.W           R2, [R4,#0x6A0]                                        ; +0xac, 0x77ec88\nBL              sub_77EB20                                             ; +0xb0, 0x77ec8c\nADD.W           R3, R4, #0x6D0                                         ; +0xb4, 0x77ec90\nVLDR            S0, [R3]                                               ; +0xb8, 0x77ec94\nVABS.F32        S15, S0                                                ; +0xbc, 0x77ec98\nVCMPE.F32       S15, S16                                               ; +0xc0, 0x77ec9c\nVMRS            APSR_nzcv, FPSCR                                       ; +0xc4, 0x77eca0\nBPL             loc_77ECB4                                             ; +0xc8, 0x77eca4\nMOV             R0, R5                                                 ; +0xca, 0x77eca6\nMOVS            R1, #0xA                                               ; +0xcc, 0x77eca8\nLDR.W           R2, [R4,#0x6F4]                                        ; +0xce, 0x77ecaa\nBL              sub_77EB20                                             ; +0xd2, 0x77ecae\nB               loc_77ECBE                                             ; +0xd6, 0x77ecb2\nMOV             R0, R5                                                 ; +0xd8, 0x77ecb4\nMOVS            R1, #9                                                 ; +0xda, 0x77ecb6\nBL              sub_77EAB4                                             ; +0xdc, 0x77ecb8\nB               loc_77ECA6                                             ; +0xe0, 0x77ecbc\nMOV             R0, R5                                                 ; +0xe2, 0x77ecbe\nMOVS            R1, #0xB                                               ; +0xe4, 0x77ecc0\nLDR.W           R2, [R4,#0x6F8]                                        ; +0xe6, 0x77ecc2\nBL              sub_77EB20                                             ; +0xea, 0x77ecc6\nADDW            R3, R4, #0x6FC                                         ; +0xee, 0x77ecca\nVLDR            S0, [R3]                                               ; +0xf2, 0x77ecce\nVABS.F32        S15, S0                                                ; +0xf6, 0x77ecd2\nVCMPE.F32       S15, S16                                               ; +0xfa, 0x77ecd6\nVMRS            APSR_nzcv, FPSCR                                       ; +0xfe, 0x77ecda\nBPL             loc_77ECEE                                             ; +0x102, 0x77ecde\nMOV             R0, R5                                                 ; +0x104, 0x77ece0\nMOVS            R1, #0xD                                               ; +0x106, 0x77ece2\nLDRB.W          R2, [R4,#0x700]                                        ; +0x108, 0x77ece4\nBL              sub_77EB7C                                             ; +0x10c, 0x77ece8\nB               loc_77ECF8                                             ; +0x110, 0x77ecec\nMOV             R0, R5                                                 ; +0x112, 0x77ecee\nMOVS            R1, #0xC                                               ; +0x114, 0x77ecf0\nBL              sub_77EAB4                                             ; +0x116, 0x77ecf2\nB               loc_77ECE0                                             ; +0x11a, 0x77ecf6\nMOV             R0, R5                                                 ; +0x11c, 0x77ecf8\nMOVS            R1, #0xE                                               ; +0x11e, 0x77ecfa\nLDRB.W          R2, [R4,#0x6A5]                                        ; +0x120, 0x77ecfc\nBL              sub_77EB7C                                             ; +0x124, 0x77ed00\nMOV             R0, R5                                                 ; +0x128, 0x77ed04\nMOVS            R1, #0xF                                               ; +0x12a, 0x77ed06\nLDR.W           R2, [R4,#0x680]                                        ; +0x12c, 0x77ed08\nBL              sub_77EB20                                             ; +0x130, 0x77ed0c\nMOV             R0, R5                                                 ; +0x134, 0x77ed10\nMOVS            R1, #0x10                                              ; +0x136, 0x77ed12\nLDRB.W          R2, [R4,#0x6A4]                                        ; +0x138, 0x77ed14\nBL              sub_77EB7C                                             ; +0x13c, 0x77ed18\nLDRB.W          R3, [R4,#0x704]                                        ; +0x140, 0x77ed1c\nLSLS            R1, R3, #0x1F                                          ; +0x144, 0x77ed20\nITE PL                                                                 ; +0x146, 0x77ed22\nASRPL           R3, R3, #1                                             ; +0x148, 0x77ed24\nLDRMI.W         R3, [R4,#0x708]                                        ; +0x14a, 0x77ed26\nCBNZ            R3, loc_77ED44                                         ; +0x14e, 0x77ed2a\nLDM.W           R5, {R0-R2}                                            ; +0x150, 0x77ed2c\nMOVS            R3, #0                                                 ; +0x154, 0x77ed30\nSTR             R3, [SP,#0x14+var_14]                                  ; +0x156, 0x77ed32\nSTR             R3, [SP,#0x14+var_10]                                  ; +0x158, 0x77ed34\nSTR             R3, [SP,#0x14+var_C]                                   ; +0x15a, 0x77ed36\nSTM.W           R6, {R0-R2}                                            ; +0x15c, 0x77ed38\nMOV             R0, R5                                                 ; +0x160, 0x77ed3c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x162, 0x77ed3e\nB               loc_77ED86                                             ; +0x166, 0x77ed42\nLDRB.W          R3, [SP,#0x14+var_14]                                  ; +0x168, 0x77ed44\nLSLS            R2, R3, #0x1F                                          ; +0x16c, 0x77ed48\nITE PL                                                                 ; +0x16e, 0x77ed4a\nASRPL           R3, R3, #1                                             ; +0x170, 0x77ed4c\nLDRMI           R3, [SP,#0x14+var_10]                                  ; +0x172, 0x77ed4e\nCBNZ            R3, loc_77ED64                                         ; +0x174, 0x77ed50\nLDRB.W          R2, [R4,#0x704]                                        ; +0x176, 0x77ed52\nLSLS            R3, R2, #0x1F                                          ; +0x17a, 0x77ed56\nBPL             loc_77ED6E                                             ; +0x17c, 0x77ed58\nLDR.W           R1, [R4,#0x70C]                                        ; +0x17e, 0x77ed5a\nLDR.W           R2, [R4,#0x708]                                        ; +0x182, 0x77ed5e\nB               loc_77ED74                                             ; +0x186, 0x77ed62\nMOV             R0, R5                                                 ; +0x188, 0x77ed64\nMOVS            R1, #0x2C ; ','                                        ; +0x18a, 0x77ed66\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc; std::string::push_back(char) ; +0x18c, 0x77ed68\nB               loc_77ED52                                             ; +0x190, 0x77ed6c\nADDW            R1, R4, #0x705                                         ; +0x192, 0x77ed6e\nASRS            R2, R2, #1                                             ; +0x196, 0x77ed72\nMOV             R0, R5                                                 ; +0x198, 0x77ed74\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj; std::string::append(char const*,uint) ; +0x19a, 0x77ed76\nB               loc_77ED2C                                             ; +0x19e, 0x77ed7a\nMOV             R0, R5                                                 ; +0x1a0, 0x77ed7c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x1a2, 0x77ed7e\nBL              __cxa_end_cleanup                                      ; +0x1a6, 0x77ed82\nLDR             R2, [SP,#0x14+var_8]                                   ; +0x1aa, 0x77ed86\nMOV             R0, R6                                                 ; +0x1ac, 0x77ed88\nLDR             R3, [R7]                                               ; +0x1ae, 0x77ed8a\nCMP             R2, R3                                                 ; +0x1b0, 0x77ed8c\nBEQ             loc_77ED94                                             ; +0x1b2, 0x77ed8e\nBLX             __stack_chk_fail                                       ; +0x1b4, 0x77ed90\nADD             SP, SP, #0x14                                          ; +0x1b8, 0x77ed94\nVPOP            {D8}                                                   ; +0x1ba, 0x77ed96\nPOP             {R4-R7,PC}                                             ; +0x1be, 0x77ed9a", "xrefs": ["EditorSFXManager::serializeAll @ 0x77eed0", "EditorSFXManager::deserializeAll @ 0x780c0a"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}