//
// GManager::waitForSave from 0x1400777c0 to 0x140077844 (132 bytes)
//
// 12 xrefs:
// > GManager::save @ 0x140077553
// > AppDelegate::applicationWillTerminate @ 0x140098612
// > AppDelegate::applicationWillTerminate @ 0x14009862b
// > AppDelegate::trySaveGame @ 0x140098c69
// > AppDelegate::trySaveGame @ 0x140098c7e
// > EditorPauseLayer::onSaveAndPlay @ 0x1401825c9
// > EditorPauseLayer::onExport @ 0x140182962
// > EditorPauseLayer::onSaveAndExit @ 0x140182b64
// > EditorPauseLayer::FLAlert_Clicked @ 0x140182e5a
// > ??> @ 0x14088a55c
// > ??> @ 0x14088a56c
// > ??> @ 0x140911bc4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:25:51 +0000
//
_QWORD *__fastcall GManager::waitForSave(__int64 a1, double a2)
{
_QWORD *result; // rax
int v4; // ebx
__int64 v5; // [rsp+40h] [rbp+8h] BYREF
__int64 v6; // [rsp+50h] [rbp+18h] BYREF
sub_140077240(&v5);
result = (_QWORD *)*(unsigned __int8 *)(a1 + 353);
if ( (_BYTE)result )
{
v4 = v5;
v6 = 10;
do
{
sub_1400779D0(&v6);
result = sub_140077240(&v5);
if ( (double)(*(_DWORD *)result - v4) > a2 * 1000000000.0 )
break;
result = (_QWORD *)*(unsigned __int8 *)(a1 + 353);
}
while ( (_BYTE)result );
}
return result;
}