HalpAcquireCmosSpinLockAndWait

UINT64 __stdcall HalpAcquireCmosSpinLockAndWait(_EPROCESS *Process, VOID *StartingAddress, VOID *EndingAddress){
  UINT64 result; 
  INT64 v4; 
  INT64 v5; 
  int v6; 

  LODWORD(result) = HalpAcquireCmosSpinLock((INT64)Process, (INT64)StartingAddress, (INT64)EndingAddress);
  v6 = 0;
  __outbyte(0x70u, 0xAu);
  while( 1 )
  {
    LOBYTE(result) = __inbyte(0x71u);
    if( (result & 0x80u) == 0i64 )
      break;
    if( ++v6 == 100 )
    {
      LOBYTE(v4) = byte_140C49EE0;
      _InterlockedExchange(&HalpSystemHardwareLock, -1);
      v6 = 0;
      if( (_BYTE)byte_140C49EE0 )
        _enable();
      LODWORD(result) = HalpAcquireCmosSpinLock(v4, 113i64, v5);
    }
    __outbyte(0x70u, 0xAu);
  }
  return result;
}

Referenced by:

HalpReadCmosTime
HalpSetWakeAlarm
HalpWriteCmosTime