//
// std::__ndk1::this_thread::sleep_for from 0xf86780 to 0xf86818 (152 bytes)
//
// 3 xrefs:
// > GManager::waitForSave @ 0x6a91a8
// > LevelEditorLayer::waitForAutoSave @ 0x78f4cc
// > ??> @ 0xb67d0
//
// 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 13:13:53 +0000
//
__int64 __fastcall std::this_thread::sleep_for(__int64 result)
{
unsigned __int64 v1; // x8
_QWORD v2[3]; // [xsp+8h] [xbp-18h] BYREF
v2[2] = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
v1 = *(_QWORD *)result;
if ( *(__int64 *)result >= 1 )
{
v2[0] = v1 / 0x3B9ACA00;
v2[1] = v1 % 0x3B9ACA00;
do
{
result = nanosleep((const struct timespec *)v2, (struct timespec *)v2);
if ( (_DWORD)result != -1 )
break;
result = __errno();
}
while ( *(_DWORD *)result == 4 );
}
_ReadStatusReg(TPIDR_EL0);
return result;
}