//
// GManager::waitForSave from 0x6a9158 to 0x6a91fc (164 bytes)
//
// 7 xrefs:
// > GManager::save @ 0x6a92e4
// > AppDelegate::applicationWillTerminate @ 0x6e64b4
// > AppDelegate::applicationWillTerminate @ 0x6e64c8
// > AppDelegate::trySaveGame @ 0x6e66e4
// > AppDelegate::trySaveGame @ 0x6e66f0
// > EditorPauseLayer::saveLevel @ 0x8b6d68
// > ??> @ 0x9f160
//
// This function is hookable on this platform (idp: arm, 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 12:50:47 +0000
//
__int64 __fastcall GManager::waitForSave(GManager *this, double a2)
{
unsigned __int8 *v2; // x19
__int64 v4; // x20
std::chrono::steady_clock *v5; // x0
__int64 v8; // [xsp+40h] [xbp+40h] BYREF
v2 = (unsigned __int8 *)this + 345;
v4 = std::chrono::steady_clock::now(_stack_chk_guard);
do
{
if ( !atomic_load(v2) )
break;
v8 = 10000000;
v5 = (std::chrono::steady_clock *)std::this_thread::sleep_for(&v8);
}
while ( a2 * 1000000000.0 >= (double)(std::chrono::steady_clock::now(v5) - v4) );
return _stack_chk_guard;
}