//
// sub_1004A5220 from 0x1004a5220 to 0x1004a529d (125 bytes)
//
// 9 xrefs:
// > EditorPauseLayer::onSaveAndPlay @ 0x10027e306
// > EditorPauseLayer::onSaveAndExit @ 0x10027e395
// > EditorPauseLayer::onExport @ 0x10027e69b
// > EditorPauseLayer::saveLevel @ 0x10027f2a9
// > EditorPauseLayer::FLAlert_Clicked @ 0x10027f507
// > AppDelegate::applicationWillTerminate @ 0x10073ba3c
// > AppDelegate::applicationWillTerminate @ 0x10073ba52
// > AppDelegate::trySaveGame @ 0x10073bd74
// > AppDelegate::trySaveGame @ 0x10073bd89
//
// 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 12:30:54 +0000
//
double __fastcall sub_1004A5220(__int64 a1, double a2)
{
std::chrono::steady_clock::time_point v2; // r14
double result; // xmm0_8
std::chrono::nanoseconds __ns; // [rsp+8h] [rbp-28h] BYREF
double v5; // [rsp+10h] [rbp-20h]
v2.__d_.__rep_ = std::chrono::steady_clock::now().__d_.__rep_;
result = a2 * 1000000000.0;
v5 = result;
do
{
if ( (*(_BYTE *)(a1 + 345) & 1) == 0 )
break;
__ns.__rep_ = 10000000;
std::this_thread::sleep_for(&__ns);
result = (double)(LODWORD(std::chrono::steady_clock::now().__d_.__rep_) - LODWORD(v2.__d_.__rep_));
}
while ( result <= v5 );
return result;
}