{"type": "func", "start": 4065972, "end": 4066204, "name": "CustomSongWidget::downloadAssetFailed", "pseudocode": "// \n// CustomSongWidget::downloadAssetFailed from 0x3e0ab4 to 0x3e0b9c (232 bytes)\n// \n// 2 xrefs:\n// > CustomSongWidget::downloadSongFailed @ 0x3e0bb0\n// > CustomSongWidget::downloadSFXFailed @ 0x3e0bda\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\nvoid CustomSongWidget::downloadAssetFailed(CustomSongWidget *a1, int a2, GJAssetType a3, GJSongError a4)\n{\n  GJAssetDownloadAction *m_start; // r4\n  GJAssetDownloadAction *m_finish; // r5\n  int p_m_assetType; // r3\n  int v8; // r2\n  int v9; // r7\n  int v10; // r5\n  int v11; // r6\n  int i; // r9\n  int *v13; // r4\n  int v14; // r9\n  _DWORD *v15; // r11\n  int v16; // [sp+4h] [bp-8h]\n\n  m_start = a1->m_undownloadedAssets.m_start;\n  m_finish = a1->m_undownloadedAssets.m_finish;\n  while ( m_start != m_finish )\n  {\n    p_m_assetType = (int)&m_start[1].m_assetType;\n    if ( m_start->m_id == a2 && m_start->m_assetType == a3 )\n    {\n      ++m_start->m_status;\n      v8 = 0;\n      LOBYTE(m_start[1].m_id) = 0;\n      if ( m_finish != (GJAssetDownloadAction *)p_m_assetType )\n      {\n        v9 = 1;\n        v10 = ((char *)m_finish - (char *)m_start) >> 4;\n        if ( v10 != 2 )\n        {\n          while ( 1 )\n          {\n            v11 = v10 - v9;\n            if ( v9 >= v10 - v9 )\n            {\n              v13 = &m_start->m_id + 4 * v10;\n              v14 = 0;\n              p_m_assetType = (int)&v13[-4 * v11];\n              v15 = (_DWORD *)p_m_assetType;\n              while ( v14 < v9 )\n              {\n                v15 -= 4;\n                v13 -= 4;\n                v16 = p_m_assetType;\n                ++v14;\n                std::swap<GJAssetDownloadAction>(v15, v13, v8, p_m_assetType);\n                p_m_assetType = v16;\n              }\n              m_start = (GJAssetDownloadAction *)(p_m_assetType - 16 * (v9 & ~(v9 >> 31)));\n              v9 = v10 % v11;\n              if ( !(v10 % v11) )\n                goto LABEL_6;\n            }\n            else\n            {\n              for ( i = 0; i < v11; ++i )\n                std::swap<GJAssetDownloadAction>(\n                  &m_start->m_id + 4 * i,\n                  &m_start->m_id + 4 * i + 4 * v9,\n                  v8,\n                  p_m_assetType);\n              m_start = (GJAssetDownloadAction *)((char *)m_start + 16 * (v11 & ~(v11 >> 31)));\n              if ( !(v10 % v9) )\n                goto LABEL_6;\n              v11 = v9;\n              v9 -= v10 % v9;\n            }\n            v10 = v11;\n          }\n        }\n        std::swap<GJAssetDownloadAction>(m_start, &m_start[1].m_assetType, 0, p_m_assetType);\n      }\nLABEL_6:\n      CustomSongWidget::processNextMultiAsset(a1);\n      return;\n    }\n    m_start = (GJAssetDownloadAction *)((char *)m_start + 16);\n  }\n}", "assembly": "; \n; CustomSongWidget::downloadAssetFailed from 0x3e0ab4 to 0x3e0b9c (232 bytes)\n; \n; 2 xrefs:\n; > CustomSongWidget::downloadSongFailed @ 0x3e0bb0\n; > CustomSongWidget::downloadSFXFailed @ 0x3e0bda\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.W          {R0-R2,R4-R11,LR}                                      ; +0x0, 0x3e0ab4\nMOV             R8, R0                                                 ; +0x4, 0x3e0ab8\nLDR.W           R4, [R0,#0x1A8]                                        ; +0x6, 0x3e0aba\nLDR.W           R5, [R0,#0x1AC]                                        ; +0xa, 0x3e0abe\nCMP             R4, R5                                                 ; +0xe, 0x3e0ac2\nBEQ             loc_3E0B96                                             ; +0x10, 0x3e0ac4\nMOV             R3, R4                                                 ; +0x12, 0x3e0ac6\nLDR.W           R0, [R3],#0x10                                         ; +0x14, 0x3e0ac8\nCMP             R0, R1                                                 ; +0x18, 0x3e0acc\nBNE             loc_3E0AF4                                             ; +0x1a, 0x3e0ace\nLDR             R0, [R4,#4]                                            ; +0x1c, 0x3e0ad0\nCMP             R0, R2                                                 ; +0x1e, 0x3e0ad2\nBNE             loc_3E0AF4                                             ; +0x20, 0x3e0ad4\nLDR             R2, [R4,#8]                                            ; +0x22, 0x3e0ad6\nCMP             R5, R3                                                 ; +0x24, 0x3e0ad8\nADD.W           R2, R2, #1                                             ; +0x26, 0x3e0ada\nSTR             R2, [R4,#8]                                            ; +0x2a, 0x3e0ade\nMOV.W           R2, #0                                                 ; +0x2c, 0x3e0ae0\nSTRB            R2, [R4,#0xC]                                          ; +0x30, 0x3e0ae4\nBNE             loc_3E0AF8                                             ; +0x32, 0x3e0ae6\nMOV             R0, R8; this                                           ; +0x34, 0x3e0ae8\nADD             SP, SP, #0xC                                           ; +0x36, 0x3e0aea\nPOP.W           {R4-R11,LR}                                            ; +0x38, 0x3e0aec\nB.W             _ZN16CustomSongWidget21processNextMultiAssetEv; CustomSongWidget::processNextMultiAsset(void) ; +0x3c, 0x3e0af0\nMOV             R4, R3                                                 ; +0x40, 0x3e0af4\nB               loc_3E0AC2                                             ; +0x42, 0x3e0af6\nSUBS            R5, R5, R4                                             ; +0x44, 0x3e0af8\nMOVS            R7, #1                                                 ; +0x46, 0x3e0afa\nASRS            R5, R5, #4                                             ; +0x48, 0x3e0afc\nCMP             R5, #2                                                 ; +0x4a, 0x3e0afe\nBEQ             loc_3E0B8C                                             ; +0x4c, 0x3e0b00\nMOV             R10, #0xFFFFFFF0                                       ; +0x4e, 0x3e0b02\nSUBS            R6, R5, R7                                             ; +0x52, 0x3e0b06\nCMP             R7, R6                                                 ; +0x54, 0x3e0b08\nBGE             loc_3E0B4A                                             ; +0x56, 0x3e0b0a\nMOV.W           R11, R7,LSL#4                                          ; +0x58, 0x3e0b0c\nMOV.W           R9, #0                                                 ; +0x5c, 0x3e0b10\nMOV.W           R0, R9,LSL#4                                           ; +0x60, 0x3e0b14\nCMP             R9, R6                                                 ; +0x64, 0x3e0b18\nADD.W           R1, R0, R11                                            ; +0x66, 0x3e0b1a\nADD             R0, R4                                                 ; +0x6a, 0x3e0b1e\nADD             R1, R4                                                 ; +0x6c, 0x3e0b20\nBGE             loc_3E0B2E                                             ; +0x6e, 0x3e0b22\nBL              _ZSt4swapI21GJAssetDownloadActionEvRT_S2_; std::swap<GJAssetDownloadAction>(GJAssetDownloadAction &,GJAssetDownloadAction &) ; +0x70, 0x3e0b24\nADD.W           R9, R9, #1                                             ; +0x74, 0x3e0b28\nB               loc_3E0B14                                             ; +0x78, 0x3e0b2c\nBIC.W           R6, R6, R6,ASR#31                                      ; +0x7a, 0x3e0b2e\nMOV             R0, R5                                                 ; +0x7e, 0x3e0b32\nMOV             R1, R7                                                 ; +0x80, 0x3e0b34\nADD.W           R4, R4, R6,LSL#4                                       ; +0x82, 0x3e0b36\nBLX             __aeabi_idivmod                                        ; +0x86, 0x3e0b3a\nCMP             R1, #0                                                 ; +0x8a, 0x3e0b3e\nBEQ             loc_3E0AE8                                             ; +0x8c, 0x3e0b40\nMOV             R6, R7                                                 ; +0x8e, 0x3e0b42\nSUBS            R7, R7, R1                                             ; +0x90, 0x3e0b44\nMOV             R5, R6                                                 ; +0x92, 0x3e0b46\nB               loc_3E0B06                                             ; +0x94, 0x3e0b48\nADD.W           R4, R4, R5,LSL#4                                       ; +0x96, 0x3e0b4a\nMOV.W           R9, #0                                                 ; +0x9a, 0x3e0b4e\nSUB.W           R3, R4, R6,LSL#4                                       ; +0x9e, 0x3e0b52\nMOV             R11, R3                                                ; +0xa2, 0x3e0b56\nCMP             R9, R7                                                 ; +0xa4, 0x3e0b58\nBGE             loc_3E0B74                                             ; +0xa6, 0x3e0b5a\nSUB.W           R11, R11, #0x10                                        ; +0xa8, 0x3e0b5c\nSUBS            R4, #0x10                                              ; +0xac, 0x3e0b60\nSTR             R3, [SP,#0xC+var_8]                                    ; +0xae, 0x3e0b62\nADD.W           R9, R9, #1                                             ; +0xb0, 0x3e0b64\nMOV             R0, R11                                                ; +0xb4, 0x3e0b68\nMOV             R1, R4                                                 ; +0xb6, 0x3e0b6a\nBL              _ZSt4swapI21GJAssetDownloadActionEvRT_S2_; std::swap<GJAssetDownloadAction>(GJAssetDownloadAction &,GJAssetDownloadAction &) ; +0xb8, 0x3e0b6c\nLDR             R3, [SP,#0xC+var_8]                                    ; +0xbc, 0x3e0b70\nB               loc_3E0B58                                             ; +0xbe, 0x3e0b72\nBIC.W           R7, R7, R7,ASR#31                                      ; +0xc0, 0x3e0b74\nMOV             R0, R5                                                 ; +0xc4, 0x3e0b78\nMOV             R1, R6                                                 ; +0xc6, 0x3e0b7a\nMLA             R4, R10, R7, R3                                        ; +0xc8, 0x3e0b7c\nBLX             __aeabi_idivmod                                        ; +0xcc, 0x3e0b80\nMOV             R7, R1                                                 ; +0xd0, 0x3e0b84\nCMP             R1, #0                                                 ; +0xd2, 0x3e0b86\nBNE             loc_3E0B46                                             ; +0xd4, 0x3e0b88\nB               loc_3E0AE8                                             ; +0xd6, 0x3e0b8a\nMOV             R0, R4                                                 ; +0xd8, 0x3e0b8c\nMOV             R1, R3                                                 ; +0xda, 0x3e0b8e\nBL              _ZSt4swapI21GJAssetDownloadActionEvRT_S2_; std::swap<GJAssetDownloadAction>(GJAssetDownloadAction &,GJAssetDownloadAction &) ; +0xdc, 0x3e0b90\nB               loc_3E0AE8                                             ; +0xe0, 0x3e0b94\nADD             SP, SP, #0xC                                           ; +0xe2, 0x3e0b96\nPOP.W           {R4-R11,PC}                                            ; +0xe4, 0x3e0b98", "xrefs": ["CustomSongWidget::downloadSongFailed @ 0x3e0bb0", "CustomSongWidget::downloadSFXFailed @ 0x3e0bda"], "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"}