{"type": "func", "start": 4298013448, "end": 4298013616, "name": "GManager::save", "pseudocode": "// \n// GManager::save from 0x1002e7b08 to 0x1002e7bb0 (168 bytes)\n// \n// 4 xrefs:\n// > AppDelegate::trySaveGame @ 0x100307438\n// > AppDelegate::trySaveGame @ 0x100307450\n// > GameManager::doQuickSave @ 0x1003baf7c\n// > LevelEditorLayer::saveLevel @ 0x100404cf0\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:02:51 +0000\n// \n\nbool __fastcall GManager::save(__int64 a1, __int64 a2)\n{\n  unsigned __int8 *v4; // x8\n  unsigned __int8 v5; // w21\n  void *__p[2]; // [xsp+0h] [xbp-40h] BYREF\n  __int64 v8; // [xsp+10h] [xbp-30h]\n\n  if ( (a2 & 1) == 0 )\n    GManager::waitForSave(a1, 30.0);\n  v4 = (unsigned __int8 *)(a1 + 345);\n  do\n    v5 = __ldaxr(v4);\n  while ( __stlxr(1u, v4) );\n  if ( (v5 & 1) == 0 )\n  {\n    if ( *(char *)(a1 + 343) < 0 )\n    {\n      sub_1000097D0(__p, *(void **)(a1 + 320), *(_QWORD *)(a1 + 328));\n    }\n    else\n    {\n      *(_OWORD *)__p = *(_OWORD *)(a1 + 320);\n      v8 = *(_QWORD *)(a1 + 336);\n    }\n    GManager::saveGMTo(a1, __p, a2);\n    if ( SHIBYTE(v8) < 0 )\n      operator delete(__p[0]);\n  }\n  return (v5 & 1) == 0;\n}", "assembly": "; \n; GManager::save from 0x1002e7b08 to 0x1002e7bb0 (168 bytes)\n; \n; 4 xrefs:\n; > AppDelegate::trySaveGame @ 0x100307438\n; > AppDelegate::trySaveGame @ 0x100307450\n; > GameManager::doQuickSave @ 0x1003baf7c\n; > LevelEditorLayer::saveLevel @ 0x100404cf0\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:02:51 +0000\n; \nSUB             SP, SP, #0x50                                          ; +0x0, 0x1002e7b08\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x4, 0x1002e7b0c\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0x8, 0x1002e7b10\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0xc, 0x1002e7b14\nADD             X29, SP, #0x40                                         ; +0x10, 0x1002e7b18\nMOV             X19, X1                                                ; +0x14, 0x1002e7b1c\nMOV             X20, X0                                                ; +0x18, 0x1002e7b20\nTBNZ            W1, #0, loc_1002E7B34                                  ; +0x1c, 0x1002e7b24\nFMOV            D0, #30.0                                              ; +0x20, 0x1002e7b28\nMOV             X0, X20                                                ; +0x24, 0x1002e7b2c\nBL              GManager__waitForSave                                  ; +0x28, 0x1002e7b30\nADD             X8, X20, #0x159                                        ; +0x2c, 0x1002e7b34\nMOV             W9, #1                                                 ; +0x30, 0x1002e7b38\nLDAXRB          W21, [X8]                                              ; +0x34, 0x1002e7b3c\nSTLXRB          W10, W9, [X8]                                          ; +0x38, 0x1002e7b40\nCBNZ            W10, loc_1002E7B3C                                     ; +0x3c, 0x1002e7b44\nTBNZ            W21, #0, loc_1002E7B94                                 ; +0x40, 0x1002e7b48\nLDRSB           W8, [X20,#0x157]                                       ; +0x44, 0x1002e7b4c\nTBNZ            W8, #0x1F, loc_1002E7B68                               ; +0x48, 0x1002e7b50\nLDR             Q0, [X20,#0x140]                                       ; +0x4c, 0x1002e7b54\nSTR             Q0, [SP,#0x40+__p]                                     ; +0x50, 0x1002e7b58\nLDR             X8, [X20,#0x150]                                       ; +0x54, 0x1002e7b5c\nSTR             X8, [SP,#0x40+var_30]                                  ; +0x58, 0x1002e7b60\nB               loc_1002E7B74                                          ; +0x5c, 0x1002e7b64\nLDP             X1, X2, [X20,#0x140]; __src                            ; +0x60, 0x1002e7b68\nMOV             X0, SP; __dst                                          ; +0x64, 0x1002e7b6c\nBL              sub_1000097D0                                          ; +0x68, 0x1002e7b70\nMOV             X1, SP                                                 ; +0x6c, 0x1002e7b74\nMOV             X0, X20                                                ; +0x70, 0x1002e7b78\nMOV             X2, X19                                                ; +0x74, 0x1002e7b7c\nBL              GManager__saveGMTo                                     ; +0x78, 0x1002e7b80\nLDRSB           W8, [SP,#0x40+var_30+7]                                ; +0x7c, 0x1002e7b84\nTBZ             W8, #0x1F, loc_1002E7B94                               ; +0x80, 0x1002e7b88\nLDR             X0, [SP,#0x40+__p]; __p                                ; +0x84, 0x1002e7b8c\nBL              __ZdlPv; operator delete(void *)                       ; +0x88, 0x1002e7b90\nMOV             W8, #1                                                 ; +0x8c, 0x1002e7b94\nBIC             W0, W8, W21                                            ; +0x90, 0x1002e7b98\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x94, 0x1002e7b9c\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x98, 0x1002e7ba0\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x9c, 0x1002e7ba4\nADD             SP, SP, #0x50 ; 'P'                                    ; +0xa0, 0x1002e7ba8\nRET                                                                    ; +0xa4, 0x1002e7bac", "xrefs": ["AppDelegate::trySaveGame @ 0x100307438", "AppDelegate::trySaveGame @ 0x100307450", "GameManager::doQuickSave @ 0x1003baf7c", "LevelEditorLayer::saveLevel @ 0x100404cf0"], "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"}