{"type": "func", "start": 3176352, "end": 3176536, "name": "AppDelegate::trySaveGame", "pseudocode": "// \n// AppDelegate::trySaveGame from 0x3077a0 to 0x307858 (184 bytes)\n// \n// 0 xrefs:\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 AppDelegate::trySaveGame(AppDelegate *a1, bool a2)\n{\n  GameManager *v3; // r0\n  LocalLevelManager *v4; // r0\n  float v5; // s14\n  int v6; // [sp+4h] [bp-10h] BYREF\n  int v7; // [sp+8h] [bp-Ch]\n\n  if ( a2 )\n    *(_DWORD *)&a1->m_loadingFinished = 0;\n  if ( *(float *)&a1->m_loadingFinished == 0.0\n    || (clock_gettime(0, (struct timespec *)&v6),\n        (double)v6 + (double)v7 / 1000000000.0 - *(float *)&a1->m_loadingFinished >= 10.0) )\n  {\n    if ( a1->m_glViewSetup )\n    {\n      v3 = GameManager::sharedState();\n      GManager::save(v3);\n      v4 = LocalLevelManager::sharedState();\n      GManager::save(v4);\n      clock_gettime(0, (struct timespec *)&v6);\n      v5 = (double)v6 + (double)v7 / 1000000000.0;\n      *(float *)&a1->m_loadingFinished = v5;\n    }\n    PlatformToolbox::gameDidSave();\n  }\n}", "assembly": "; \n; AppDelegate::trySaveGame from 0x3077a0 to 0x307858 (184 bytes)\n; \n; 0 xrefs:\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x3077A8)                ; +0x0, 0x3077a0\nPUSH            {R4,R5,LR}                                             ; +0x2, 0x3077a2\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x4, 0x3077a4\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x6, 0x3077a6\nSUB             SP, SP, #0x14                                          ; +0x8, 0x3077a8\nMOV             R5, R0                                                 ; +0xa, 0x3077aa\nLDR             R2, [R3]                                               ; +0xc, 0x3077ac\nMOV             R4, R3                                                 ; +0xe, 0x3077ae\nSTR             R2, [SP,#0x14+var_8]                                   ; +0x10, 0x3077b0\nCBZ             R1, loc_3077B8                                         ; +0x12, 0x3077b2\nMOVS            R3, #0                                                 ; +0x14, 0x3077b4\nSTR             R3, [R0,#0x18]                                         ; +0x16, 0x3077b6\nVLDR            S15, [R5,#0x18]                                        ; +0x18, 0x3077b8\nVCMP.F32        S15, #0.0                                              ; +0x1c, 0x3077bc\nVMRS            APSR_nzcv, FPSCR                                       ; +0x20, 0x3077c0\nBEQ             loc_307804                                             ; +0x24, 0x3077c4\nMOVS            R0, #0; clock_id                                       ; +0x26, 0x3077c6\nADD             R1, SP, #0x14+var_10; tp                               ; +0x28, 0x3077c8\nBLX             clock_gettime                                          ; +0x2a, 0x3077ca\nVLDR            S13, [SP,#0x14+var_C]                                  ; +0x2e, 0x3077ce\nVLDR            D5, =1.0e9                                             ; +0x32, 0x3077d2\nVCVT.F64.S32    D6, S13                                                ; +0x36, 0x3077d6\nVLDR            S15, [SP,#0x14+var_10]                                 ; +0x3a, 0x3077da\nVDIV.F64        D6, D6, D5                                             ; +0x3e, 0x3077de\nVCVT.F64.S32    D7, S15                                                ; +0x42, 0x3077e2\nVADD.F64        D6, D7, D6                                             ; +0x46, 0x3077e6\nVLDR            S14, [R5,#0x18]                                        ; +0x4a, 0x3077ea\nVCVT.F64.F32    D7, S14                                                ; +0x4e, 0x3077ee\nVSUB.F64        D7, D6, D7                                             ; +0x52, 0x3077f2\nVMOV.F64        D6, #10.0                                              ; +0x56, 0x3077f6\nVCMPE.F64       D7, D6                                                 ; +0x5a, 0x3077fa\nVMRS            APSR_nzcv, FPSCR                                       ; +0x5e, 0x3077fe\nBMI             loc_307848                                             ; +0x62, 0x307802\nLDRB            R3, [R5,#0x10]                                         ; +0x64, 0x307804\nCBZ             R3, loc_307844                                         ; +0x66, 0x307806\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x68, 0x307808\nBL              _ZN8GManager4saveEv; GManager::save(void)              ; +0x6c, 0x30780c\nBL              _ZN17LocalLevelManager11sharedStateEv; LocalLevelManager::sharedState(void) ; +0x70, 0x307810\nBL              _ZN8GManager4saveEv; GManager::save(void)              ; +0x74, 0x307814\nMOVS            R0, #0; clock_id                                       ; +0x78, 0x307818\nADD             R1, SP, #0x14+var_10; tp                               ; +0x7a, 0x30781a\nBLX             clock_gettime                                          ; +0x7c, 0x30781c\nVLDR            S15, [SP,#0x14+var_10]                                 ; +0x80, 0x307820\nVLDR            D5, =1.0e9                                             ; +0x84, 0x307824\nVCVT.F64.S32    D6, S15                                                ; +0x88, 0x307828\nVLDR            S15, [SP,#0x14+var_C]                                  ; +0x8c, 0x30782c\nVCVT.F64.S32    D7, S15                                                ; +0x90, 0x307830\nVDIV.F64        D7, D7, D5                                             ; +0x94, 0x307834\nVADD.F64        D7, D6, D7                                             ; +0x98, 0x307838\nVCVT.F32.F64    S14, D7                                                ; +0x9c, 0x30783c\nVSTR            S14, [R5,#0x18]                                        ; +0xa0, 0x307840\nBL              _ZN15PlatformToolbox11gameDidSaveEv; PlatformToolbox::gameDidSave(void) ; +0xa4, 0x307844\nLDR             R2, [SP,#0x14+var_8]                                   ; +0xa8, 0x307848\nLDR             R3, [R4]                                               ; +0xaa, 0x30784a\nCMP             R2, R3                                                 ; +0xac, 0x30784c\nBEQ             loc_307854                                             ; +0xae, 0x30784e\nBLX             __stack_chk_fail                                       ; +0xb0, 0x307850\nADD             SP, SP, #0x14                                          ; +0xb4, 0x307854\nPOP             {R4,R5,PC}                                             ; +0xb6, 0x307856", "xrefs": [], "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"}