{"type": "func", "start": 4304286016, "end": 4304286381, "name": "EditorSFXManager::soundsForAction", "pseudocode": "// \n// EditorSFXManager::soundsForAction from 0x1008e3140 to 0x1008e32ad (365 bytes)\n// \n// 3 xrefs:\n// > EditorSFXActionConfigLayer::refreshRows @ 0x1008dfc37\n// > EditorSFXActionConfigLayer::onEditSound @ 0x1008e066b\n// > EditorSFXActionConfigLayer::onPreviewSound @ 0x1008e071b\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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 12:37:47 +0000\n// \n\n__int64 __fastcall EditorSFXManager::soundsForAction(_QWORD *a1, int a2)\n{\n  unsigned __int64 v2; // r10\n  unsigned __int64 v3; // r8\n  unsigned __int64 v4; // r9\n  __int64 **v6; // rax\n  __int64 *v7; // rdi\n  unsigned __int64 v8; // r10\n  __int64 v9; // rax\n  unsigned __int64 v10; // rax\n  __int64 v11; // rax\n\n  v2 = a1[1];\n  if ( !v2 )\n    return 0;\n  v3 = (0x101010101010101LL\n      * ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)\n        + (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)\n        + ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)\n          + (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))\n       & 0xF0F0F0F0F0F0F0FLL)) >> 56;\n  if ( v3 > 1 )\n  {\n    v4 = a2;\n    if ( v2 <= a2 )\n    {\n      if ( (v2 | a2) >> 32 )\n        v4 = a2 % v2;\n      else\n        v4 = a2 % (unsigned int)v2;\n    }\n  }\n  else\n  {\n    v4 = a2 & (v2 - 1);\n  }\n  v6 = *(__int64 ***)(*a1 + 8 * v4);\n  if ( !v6 )\n    return 0;\n  v7 = *v6;\n  if ( !*v6 )\n    return 0;\n  if ( (unsigned int)v3 < 2 )\n  {\n    v8 = v2 - 1;\n    while ( 1 )\n    {\n      v9 = v7[1];\n      if ( v9 == a2 )\n      {\n        if ( *((_DWORD *)v7 + 4) == a2 )\n          goto LABEL_29;\n      }\n      else if ( (v8 & v9) != v4 )\n      {\n        return 0;\n      }\n      v7 = (__int64 *)*v7;\n      if ( !v7 )\n        return 0;\n    }\n  }\n  while ( 1 )\n  {\n    v10 = v7[1];\n    if ( v10 == a2 )\n      break;\n    if ( v10 < v2 )\n      goto LABEL_25;\n    if ( (v2 | v10) >> 32 )\n    {\n      v10 %= v2;\nLABEL_25:\n      if ( v10 != v4 )\n        return 0;\n      goto LABEL_20;\n    }\n    if ( (unsigned int)v10 % (unsigned int)v2 != v4 )\n      return 0;\nLABEL_20:\n    v7 = (__int64 *)*v7;\n    if ( !v7 )\n      return 0;\n  }\n  if ( *((_DWORD *)v7 + 4) != a2 )\n    goto LABEL_20;\nLABEL_29:\n  v11 = v7[3];\n  if ( v11 )\n    return *(_QWORD *)v11;\n  return 0;\n}", "assembly": "; \n; EditorSFXManager::soundsForAction from 0x1008e3140 to 0x1008e32ad (365 bytes)\n; \n; 3 xrefs:\n; > EditorSFXActionConfigLayer::refreshRows @ 0x1008dfc37\n; > EditorSFXActionConfigLayer::onEditSound @ 0x1008e066b\n; > EditorSFXActionConfigLayer::onPreviewSound @ 0x1008e071b\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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 12:37:47 +0000\n; \nmov     r10, [rdi+8]                                                   ; +0x0, 0x1008e3140\ntest    r10, r10                                                       ; +0x4, 0x1008e3144\njz      short loc_1008E31B7                                            ; +0x7, 0x1008e3147\nmovsxd  rcx, esi                                                       ; +0x9, 0x1008e3149\nmov     rax, r10                                                       ; +0xc, 0x1008e314c\nshr     rax, 1                                                         ; +0xf, 0x1008e314f\nmov     rdx, 5555555555555555h                                         ; +0x12, 0x1008e3152\nand     rdx, rax                                                       ; +0x1c, 0x1008e315c\nmov     rax, r10                                                       ; +0x1f, 0x1008e315f\nsub     rax, rdx                                                       ; +0x22, 0x1008e3162\nmov     rdx, 3333333333333333h                                         ; +0x25, 0x1008e3165\nmov     r8, rax                                                        ; +0x2f, 0x1008e316f\nand     r8, rdx                                                        ; +0x32, 0x1008e3172\nshr     rax, 2                                                         ; +0x35, 0x1008e3175\nand     rax, rdx                                                       ; +0x39, 0x1008e3179\nadd     rax, r8                                                        ; +0x3c, 0x1008e317c\nmov     rdx, rax                                                       ; +0x3f, 0x1008e317f\nshr     rdx, 4                                                         ; +0x42, 0x1008e3182\nadd     rdx, rax                                                       ; +0x46, 0x1008e3186\nmov     rax, 0F0F0F0F0F0F0F0Fh                                         ; +0x49, 0x1008e3189\nand     rax, rdx                                                       ; +0x53, 0x1008e3193\nmov     r8, 101010101010101h                                           ; +0x56, 0x1008e3196\nimul    r8, rax                                                        ; +0x60, 0x1008e31a0\nshr     r8, 38h                                                        ; +0x64, 0x1008e31a4\ncmp     r8, 1                                                          ; +0x68, 0x1008e31a8\nja      short loc_1008E31BE                                            ; +0x6c, 0x1008e31ac\nlea     r9, [r10-1]                                                    ; +0x6e, 0x1008e31ae\nand     r9, rcx                                                        ; +0x72, 0x1008e31b2\njmp     short loc_1008E31E9                                            ; +0x75, 0x1008e31b5\nxor     r8d, r8d                                                       ; +0x77, 0x1008e31b7\nmov     rax, r8                                                        ; +0x7a, 0x1008e31ba\nretn                                                                   ; +0x7d, 0x1008e31bd\nmov     r9, rcx                                                        ; +0x7e, 0x1008e31be\ncmp     r10, rcx                                                       ; +0x81, 0x1008e31c1\nja      short loc_1008E31E9                                            ; +0x84, 0x1008e31c4\nmov     rax, rcx                                                       ; +0x86, 0x1008e31c6\nor      rax, r10                                                       ; +0x89, 0x1008e31c9\nshr     rax, 20h                                                       ; +0x8c, 0x1008e31cc\njz      short loc_1008E31DF                                            ; +0x90, 0x1008e31d0\nmov     rax, rcx                                                       ; +0x92, 0x1008e31d2\nxor     edx, edx                                                       ; +0x95, 0x1008e31d5\ndiv     r10                                                            ; +0x97, 0x1008e31d7\nmov     r9, rdx                                                        ; +0x9a, 0x1008e31da\njmp     short loc_1008E31E9                                            ; +0x9d, 0x1008e31dd\nmov     eax, esi                                                       ; +0x9f, 0x1008e31df\nxor     edx, edx                                                       ; +0xa1, 0x1008e31e1\ndiv     r10d                                                           ; +0xa3, 0x1008e31e3\nmov     r9d, edx                                                       ; +0xa6, 0x1008e31e6\npush    rbp                                                            ; +0xa9, 0x1008e31e9\nmov     rbp, rsp                                                       ; +0xaa, 0x1008e31ea\nmov     rax, [rdi]                                                     ; +0xad, 0x1008e31ed\nmov     rax, [rax+r9*8]                                                ; +0xb0, 0x1008e31f0\ntest    rax, rax                                                       ; +0xb4, 0x1008e31f4\njz      loc_1008E32A5                                                  ; +0xb7, 0x1008e31f7\nmov     rdi, [rax]                                                     ; +0xbd, 0x1008e31fd\ntest    rdi, rdi                                                       ; +0xc0, 0x1008e3200\njz      loc_1008E32A5                                                  ; +0xc3, 0x1008e3203\ncmp     r8d, 2                                                         ; +0xc9, 0x1008e3209\njnb     short loc_1008E3243                                            ; +0xcd, 0x1008e320d\ndec     r10                                                            ; +0xcf, 0x1008e320f\nxor     r8d, r8d                                                       ; +0xd2, 0x1008e3212\njmp     short loc_1008E322D                                            ; +0xd5, 0x1008e3215\nalign 20h                                                              ; +0xd7, 0x1008e3217\ncmp     [rdi+10h], esi                                                 ; +0xe0, 0x1008e3220\njz      short loc_1008E3294                                            ; +0xe3, 0x1008e3223\nmov     rdi, [rdi]                                                     ; +0xe5, 0x1008e3225\ntest    rdi, rdi                                                       ; +0xe8, 0x1008e3228\njz      short loc_1008E323E                                            ; +0xeb, 0x1008e322b\nmov     rax, [rdi+8]                                                   ; +0xed, 0x1008e322d\ncmp     rax, rcx                                                       ; +0xf1, 0x1008e3231\njz      short loc_1008E3220                                            ; +0xf4, 0x1008e3234\nand     rax, r10                                                       ; +0xf6, 0x1008e3236\ncmp     rax, r9                                                        ; +0xf9, 0x1008e3239\njz      short loc_1008E3225                                            ; +0xfc, 0x1008e323c\npop     rbp                                                            ; +0xfe, 0x1008e323e\nmov     rax, r8                                                        ; +0xff, 0x1008e323f\nretn                                                                   ; +0x102, 0x1008e3242\nxor     r8d, r8d                                                       ; +0x103, 0x1008e3243\njmp     short loc_1008E325D                                            ; +0x106, 0x1008e3246\nalign 10h                                                              ; +0x108, 0x1008e3248\ncmp     [rdi+10h], esi                                                 ; +0x110, 0x1008e3250\njz      short loc_1008E3294                                            ; +0x113, 0x1008e3253\nmov     rdi, [rdi]                                                     ; +0x115, 0x1008e3255\ntest    rdi, rdi                                                       ; +0x118, 0x1008e3258\njz      short loc_1008E323E                                            ; +0x11b, 0x1008e325b\nmov     rax, [rdi+8]                                                   ; +0x11d, 0x1008e325d\ncmp     rax, rcx                                                       ; +0x121, 0x1008e3261\njz      short loc_1008E3250                                            ; +0x124, 0x1008e3264\ncmp     rax, r10                                                       ; +0x126, 0x1008e3266\njb      short loc_1008E327F                                            ; +0x129, 0x1008e3269\nmov     rdx, rax                                                       ; +0x12b, 0x1008e326b\nor      rdx, r10                                                       ; +0x12e, 0x1008e326e\nshr     rdx, 20h                                                       ; +0x131, 0x1008e3271\njz      short loc_1008E3286                                            ; +0x135, 0x1008e3275\nxor     edx, edx                                                       ; +0x137, 0x1008e3277\ndiv     r10                                                            ; +0x139, 0x1008e3279\nmov     rax, rdx                                                       ; +0x13c, 0x1008e327c\ncmp     rax, r9                                                        ; +0x13f, 0x1008e327f\njz      short loc_1008E3255                                            ; +0x142, 0x1008e3282\njmp     short loc_1008E323E                                            ; +0x144, 0x1008e3284\nxor     edx, edx                                                       ; +0x146, 0x1008e3286\ndiv     r10d                                                           ; +0x148, 0x1008e3288\nmov     eax, edx                                                       ; +0x14b, 0x1008e328b\ncmp     rax, r9                                                        ; +0x14d, 0x1008e328d\njz      short loc_1008E3255                                            ; +0x150, 0x1008e3290\njmp     short loc_1008E323E                                            ; +0x152, 0x1008e3292\nmov     rax, [rdi+18h]                                                 ; +0x154, 0x1008e3294\ntest    rax, rax                                                       ; +0x158, 0x1008e3298\njz      short loc_1008E32A5                                            ; +0x15b, 0x1008e329b\nmov     r8, [rax]                                                      ; +0x15d, 0x1008e329d\npop     rbp                                                            ; +0x160, 0x1008e32a0\nmov     rax, r8                                                        ; +0x161, 0x1008e32a1\nretn                                                                   ; +0x164, 0x1008e32a4\nxor     r8d, r8d                                                       ; +0x165, 0x1008e32a5\npop     rbp                                                            ; +0x168, 0x1008e32a8\nmov     rax, r8                                                        ; +0x169, 0x1008e32a9\nretn                                                                   ; +0x16c, 0x1008e32ac", "xrefs": ["EditorSFXActionConfigLayer::refreshRows @ 0x1008dfc37", "EditorSFXActionConfigLayer::onEditSound @ 0x1008e066b", "EditorSFXActionConfigLayer::onPreviewSound @ 0x1008e071b"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}