PopSpoilBatteryEstimate

VOID __stdcall PopSpoilBatteryEstimate(POP_ESTIMATE_SPOILER Spoiler, UINT8 Indefinite){
  int v2; 
  unsigned int v4; 
  const char *v5; 
  int v6; 
  POP_ESTIMATE_SPOILER v7; 
  _EVENT_DATA_DESCRIPTOR v8; 
  int *v9; 
  int v10; 
  int v11; 
  POP_ESTIMATE_SPOILER *v12; 
  int v13; 
  int v14; 

  if( Spoiler < EstimateSpoilerCount )
  {
    v2 = Indefinite;
    v4 = (unsigned __int8)(1 << Spoiler);
    if( Indefinite )
      _InterlockedOr(&dword_140CED0C8, v4);
    else
      _InterlockedAnd(&dword_140CED0C8, ~v4);
    PopBatteryQueueWork(4i64);
    v5 = "indefinitely";
    if( !(_BYTE)v2 )
      v5 = "temporarily";
    DbgPrintEx(0x92u, 3u, "Battery estimates spoiled %s by %d; mask=%x\n", v5, Spoiler, dword_140CED0C8);
    if( *(&stru_140C00F40 + 1194) > 5u )
    {
      v11 = 0;
      v14 = 0;
      v9 = &v6;
      v6 = v2;
      v12 = &v7;
      v10 = 4;
      v7 = Spoiler;
      v13 = 4;
      tlgWriteTransfer_EtwWriteTransfer(
        (__int64)&stru_140C00F40 + 4776,
        (unsigned __int8 *)word_140027EA2,
        0i64,
        0i64,
        4u,
        &v8);
    }
  }
}

Referenced by:

PopSpoilEstimatesOnPowerStateTransitionWorker
PopUpdateConsoleDisplayState