Power_Ip_SMC_ModeConfig (const struct Power_Ip_ModeConfigType * pModeConfigPtr)
{
  boolean TimeoutOccurred;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  uint32 u32RegValue;
  uint32 u32PowerModeStatus;
  uint32 u32TempValue;
  Power_Ip_PowerModeType ePowerMode;
  uint32 ePowerSwitchMode;
  uint32 D.5748;

  <bb 2> :
  ePowerSwitchMode = 0;
  ePowerMode = 0;
  u32RegValue = 0;
  TimeoutOccurred = 0;
  ePowerMode = pModeConfigPtr->Power_Ip_ePowerMode;
  switch (ePowerMode) <default: <L27> [INV], case 0: <L0> [INV], case 1: <L6> [INV], case 2: <L12> [INV], case 3: <L18> [INV], case 4: <L21> [INV], case 5: <L24> [INV]>

  <bb 3> :
<L0>:
  _1 = 1074257920B;
  u32TempValue = _1->PMCTRL;
  u32TempValue = u32TempValue & 4294967199;
  u32TempValue = u32TempValue;
  _2 = 1074257920B;
  _2->PMCTRL = u32TempValue;
  PowerStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 4> :
  TimeoutTicks.0_3 = TimeoutTicks;
  TimeoutOccurred = PowerTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.0_3);
  _4 = 1074257920B;
  _5 = _4->PMSTAT;
  u32PowerModeStatus = _5 & 1;
  if (u32PowerModeStatus != 1)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _6 = ~TimeoutOccurred;
  if (_6 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  if (TimeoutOccurred != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  ePowerSwitchMode = 1;

  <bb 8> :
  goto <bb 31>; [INV]

  <bb 9> :
<L6>:
  _7 = 1074257920B;
  u32TempValue = _7->PMCTRL;
  u32TempValue = u32TempValue & 4294967199;
  u32TempValue = u32TempValue | 96;
  _8 = 1074257920B;
  _8->PMCTRL = u32TempValue;
  PowerStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 10> :
  TimeoutTicks.1_9 = TimeoutTicks;
  TimeoutOccurred = PowerTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.1_9);
  _10 = 1074257920B;
  _11 = _10->PMSTAT;
  u32PowerModeStatus = _11 & 128;
  if (u32PowerModeStatus != 128)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  _12 = ~TimeoutOccurred;
  if (_12 != 0)
    goto <bb 10>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  if (TimeoutOccurred != 0)
    goto <bb 13>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 13> :
  ePowerSwitchMode = 1;

  <bb 14> :
  goto <bb 31>; [INV]

  <bb 15> :
<L12>:
  _13 = 1074257920B;
  u32TempValue = _13->PMCTRL;
  u32TempValue = u32TempValue & 4294967199;
  u32TempValue = u32TempValue | 64;
  _14 = 1074257920B;
  _14->PMCTRL = u32TempValue;
  PowerStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 16> :
  TimeoutTicks.2_15 = TimeoutTicks;
  TimeoutOccurred = PowerTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.2_15);
  _16 = 1074257920B;
  _17 = _16->PMSTAT;
  u32PowerModeStatus = _17 & 4;
  if (u32PowerModeStatus != 4)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  _18 = ~TimeoutOccurred;
  if (_18 != 0)
    goto <bb 16>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 18> :
  if (TimeoutOccurred != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  ePowerSwitchMode = 1;

  <bb 20> :
  goto <bb 31>; [INV]

  <bb 21> :
<L18>:
  _19 = 1074257920B;
  u32TempValue = _19->PMCTRL;
  u32TempValue = u32TempValue & 4294967288;
  u32TempValue = u32TempValue | 2;
  _20 = 1074257920B;
  _20->PMCTRL = u32TempValue;
  _21 = 1074257920B;
  u32RegValue = _21->PMCTRL;
  _22 = pModeConfigPtr->Power_Ip_SleepOnExit;
  if (_22 != 0)
    goto <bb 22>; [INV]
  else
    goto <bb 23>; [INV]

  <bb 22> :
  Power_Ip_CM4_EnableSleepOnExit ();

  <bb 23> :
  __asm__ __volatile__(" cpsie i");
  __asm__ __volatile__("  wfi");
  __asm__ __volatile__(" cpsid i");
  goto <bb 31>; [INV]

  <bb 24> :
<L21>:
  _23 = 1074257920B;
  _23->STOPCTRL = 64;
  _24 = 1074257920B;
  u32TempValue = _24->PMCTRL;
  u32TempValue = u32TempValue & 4294967288;
  u32TempValue = u32TempValue;
  _25 = 1074257920B;
  _25->PMCTRL = u32TempValue;
  _26 = 1074257920B;
  u32RegValue = _26->STOPCTRL;
  _27 = pModeConfigPtr->Power_Ip_SleepOnExit;
  if (_27 != 0)
    goto <bb 25>; [INV]
  else
    goto <bb 26>; [INV]

  <bb 25> :
  Power_Ip_CM4_EnableSleepOnExit ();

  <bb 26> :
  __asm__ __volatile__(" cpsie i");
  __asm__ __volatile__("  wfi");
  __asm__ __volatile__(" cpsid i");
  goto <bb 31>; [INV]

  <bb 27> :
<L24>:
  _28 = 1074257920B;
  _28->STOPCTRL = 128;
  _29 = 1074257920B;
  u32TempValue = _29->PMCTRL;
  u32TempValue = u32TempValue & 4294967288;
  u32TempValue = u32TempValue;
  _30 = 1074257920B;
  _30->PMCTRL = u32TempValue;
  _31 = 1074257920B;
  u32RegValue = _31->STOPCTRL;
  _32 = pModeConfigPtr->Power_Ip_SleepOnExit;
  if (_32 != 0)
    goto <bb 28>; [INV]
  else
    goto <bb 29>; [INV]

  <bb 28> :
  Power_Ip_CM4_EnableSleepOnExit ();

  <bb 29> :
  __asm__ __volatile__(" cpsie i");
  __asm__ __volatile__("  wfi");
  __asm__ __volatile__(" cpsid i");
  goto <bb 31>; [INV]

  <bb 30> :
<L27>:
  ePowerSwitchMode = 1;

  <bb 31> :
  D.5748 = ePowerSwitchMode;
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};

  <bb 32> :
<L30>:
  return D.5748;

}


Power_Ip_SMC_ModeCheckEntry (Power_Ip_PowerModeType ePowerMode)
{
  uint32 eCurrentPowerMode;
  Power_Ip_SMC_ModeStatusType ePowerModeCheck;
  Power_Ip_SMC_ModeStatusType D.5731;

  <bb 2> :
  ePowerModeCheck = 1;
  eCurrentPowerMode = 1;
  _1 = 1074257920B;
  _2 = _1->PMSTAT;
  eCurrentPowerMode = _2 & 255;
  switch (ePowerMode) <default: <L18> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L4> [INV], case 3: <L8> [INV], case 4: <L12> [INV], case 5: <L15> [INV]>

  <bb 3> :
<L0>:
  ePowerModeCheck = 0;
  goto <bb 22>; [INV]

  <bb 4> :
<L1>:
  if (eCurrentPowerMode == 1)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  ePowerModeCheck = 0;

  <bb 6> :
  goto <bb 22>; [INV]

  <bb 7> :
<L4>:
  if (eCurrentPowerMode == 1)
    goto <bb 9>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  if (eCurrentPowerMode == 16)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  ePowerModeCheck = 0;

  <bb 10> :
  goto <bb 22>; [INV]

  <bb 11> :
<L8>:
  if (eCurrentPowerMode == 1)
    goto <bb 13>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  if (eCurrentPowerMode == 4)
    goto <bb 13>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 13> :
  ePowerModeCheck = 0;

  <bb 14> :
  goto <bb 22>; [INV]

  <bb 15> :
<L12>:
  if (eCurrentPowerMode == 1)
    goto <bb 16>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 16> :
  ePowerModeCheck = 0;

  <bb 17> :
  goto <bb 22>; [INV]

  <bb 18> :
<L15>:
  if (eCurrentPowerMode == 1)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  ePowerModeCheck = 0;

  <bb 20> :
  goto <bb 22>; [INV]

  <bb 21> :
<L18>:

  <bb 22> :
  D.5731 = ePowerModeCheck;

  <bb 23> :
<L20>:
  return D.5731;

}


Power_Ip_SMC_AllowedModesConfig (const struct Power_Ip_SMC_ConfigType * pConfigPtr)
{
  <bb 2> :
  _1 = pConfigPtr->u32AllowedModes;
  _2 = 1074257920B;
  _3 = _1 & 160;
  _2->PMPROT = _3;
  return;

}


