{"type": "func", "start": 4296886892, "end": 4296887028, "name": "MusicDownloadManager::limitDownloadedSongs", "pseudocode": "// \n// MusicDownloadManager::limitDownloadedSongs from 0x1001d4a6c to 0x1001d4af4 (136 bytes)\n// \n// 1 xrefs:\n// > MusicDownloadManager::onDownloadSongCompleted @ 0x1001d53d0\n// \n// This function is hookable on this platform (idp: arm, 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 11:00:24 +0000\n// \n\n__int64 __fastcall MusicDownloadManager::limitDownloadedSongs(__int64 a1)\n{\n  __int64 v2; // x0\n  int v3; // w21\n  int v4; // w22\n  __int64 DownloadedSongs; // x20\n  __int64 result; // x0\n  __int64 v7; // x1\n\n  v2 = GameManager::sharedState(a1);\n  v3 = *(_DWORD *)(v2 + 1140);\n  v4 = *(_DWORD *)(GameManager::sharedState(v2) + 1144);\n  DownloadedSongs = MusicDownloadManager::getDownloadedSongs(a1);\n  result = sub_1002E757C(DownloadedSongs);\n  if ( (unsigned int)result >= 0x33 )\n  {\n    do\n    {\n      v7 = *(unsigned int *)(sub_1002E75B0(DownloadedSongs) + 316);\n      if ( (_DWORD)v7 != v3 && (_DWORD)v7 != v4 )\n        MusicDownloadManager::deleteSong(a1, v7);\n      sub_1002E7648(DownloadedSongs, 1);\n      result = sub_1002E757C(DownloadedSongs);\n    }\n    while ( (unsigned int)result > 0x32 );\n  }\n  return result;\n}", "assembly": "; \n; MusicDownloadManager::limitDownloadedSongs from 0x1001d4a6c to 0x1001d4af4 (136 bytes)\n; \n; 1 xrefs:\n; > MusicDownloadManager::onDownloadSongCompleted @ 0x1001d53d0\n; \n; This function is hookable on this platform (idp: arm, 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 11:00:24 +0000\n; \nSTP             X22, X21, [SP,#-0x10+var_20]!                          ; +0x0, 0x1001d4a6c\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0x1001d4a70\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x8, 0x1001d4a74\nADD             X29, SP, #0x20                                         ; +0xc, 0x1001d4a78\nMOV             X19, X0                                                ; +0x10, 0x1001d4a7c\nBL              GameManager__sharedState                               ; +0x14, 0x1001d4a80\nLDR             W21, [X0,#0x474]                                       ; +0x18, 0x1001d4a84\nBL              GameManager__sharedState                               ; +0x1c, 0x1001d4a88\nLDR             W22, [X0,#0x478]                                       ; +0x20, 0x1001d4a8c\nMOV             X0, X19                                                ; +0x24, 0x1001d4a90\nBL              MusicDownloadManager__getDownloadedSongs               ; +0x28, 0x1001d4a94\nMOV             X20, X0                                                ; +0x2c, 0x1001d4a98\nBL              sub_1002E757C                                          ; +0x30, 0x1001d4a9c\nCMP             W0, #0x33 ; '3'                                        ; +0x34, 0x1001d4aa0\nB.CC            loc_1001D4AE4                                          ; +0x38, 0x1001d4aa4\nMOV             X0, X20                                                ; +0x3c, 0x1001d4aa8\nBL              sub_1002E75B0                                          ; +0x40, 0x1001d4aac\nLDR             W1, [X0,#0x13C]                                        ; +0x44, 0x1001d4ab0\nCMP             W1, W21                                                ; +0x48, 0x1001d4ab4\nCCMP            W1, W22, #4, NE                                        ; +0x4c, 0x1001d4ab8\nB.EQ            loc_1001D4AC8                                          ; +0x50, 0x1001d4abc\nMOV             X0, X19                                                ; +0x54, 0x1001d4ac0\nBL              MusicDownloadManager__deleteSong                       ; +0x58, 0x1001d4ac4\nMOV             X0, X20                                                ; +0x5c, 0x1001d4ac8\nMOV             W1, #1                                                 ; +0x60, 0x1001d4acc\nBL              sub_1002E7648                                          ; +0x64, 0x1001d4ad0\nMOV             X0, X20                                                ; +0x68, 0x1001d4ad4\nBL              sub_1002E757C                                          ; +0x6c, 0x1001d4ad8\nCMP             W0, #0x32 ; '2'                                        ; +0x70, 0x1001d4adc\nB.HI            loc_1001D4AA8                                          ; +0x74, 0x1001d4ae0\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x78, 0x1001d4ae4\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x7c, 0x1001d4ae8\nLDP             X22, X21, [SP+0x20+var_20],#0x30                       ; +0x80, 0x1001d4aec\nRET                                                                    ; +0x84, 0x1001d4af0", "xrefs": ["MusicDownloadManager::onDownloadSongCompleted @ 0x1001d53d0"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}