DisableFirc (Clock_Ip_NameType name)
{
  <bb 2> :
  DisableFirc_TrustedCall (name);
  return;

}


DisableFirc_TrustedCall (Clock_Ip_NameType name)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->FIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4294967294;
  _3->FIRCCSR = _4;
  return;

}


EnableFirc (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  EnableFirc_TrustedCall (config);
  return;

}


EnableFirc_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  uint32 IrcoscStatus;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  boolean TimeoutOccurred;

  <bb 2> :
  TimeoutOccurred = 0;
  _1 = config->enable;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 3> :
  _2 = 1074151424B;
  _3 = _2->FIRCCSR;
  _4 = 1074151424B;
  _5 = _3 | 1;
  _4->FIRCCSR = _5;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 4> :
  _6 = 1074151424B;
  _7 = _6->FIRCCSR;
  _8 = _7 >> 24;
  IrcoscStatus = _8 & 1;
  TimeoutTicks.6_9 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.6_9);
  if (IrcoscStatus == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _10 = ~TimeoutOccurred;
  if (_10 != 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> :
  _11 = config->name;
  ReportClockErrors (1, _11);

  <bb 8> :
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};
  return;

}


SetFirc (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  SetFirc_TrustedCall (config);
  return;

}


SetFirc_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  uint32 IrcoscStatus;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  boolean SircWasDisabled;
  boolean TimeoutOccurred;
  uint32 instance;

  <bb 2> :
  _1 = config->name;
  _2 = clockFeatures[_1][0];
  instance = (uint32) _2;
  TimeoutOccurred = 0;
  SircWasDisabled = 0;
  _3 = 1074151424B;
  _4 = _3->FIRCCSR;
  _5 = 1074151424B;
  _6 = _4 & 4286578687;
  _5->FIRCCSR = _6;
  _7 = 1074151424B;
  _8 = _7->FIRCCSR;
  _9 = _8 & 33554432;
  if (_9 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 3> :
  _10 = config->range;
  _11 = (long unsigned int) _10;
  _12 = 1074151424B;
  _13 = _12->FIRCCFG;
  _14 = _13 & 3;
  if (_11 != _14)
    goto <bb 5>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  _15 = config->regulator;
  _16 = (long unsigned int) _15;
  _17 = 1074151424B;
  _18 = _17->FIRCCSR;
  _19 = _18 >> 3;
  _20 = _19 & 1;
  if (_16 != _20)
    goto <bb 5>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 5> :
  _21 = 1074151424B;
  _22 = _21->SIRCCSR;
  _23 = _22 & 1;
  if (_23 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  SircWasDisabled = 1;
  SetSirc (0B);

  <bb 7> :
  SetInputSouceSytemClock (2);
  _24 = 1074151424B;
  _25 = _24->FIRCCSR;
  _26 = 1074151424B;
  _27 = _25 & 4294967294;
  _26->FIRCCSR = _27;
  _28 = config->enable;
  if (_28 == 1)
    goto <bb 8>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 8> :
  _29 = config->range;
  _30 = (long unsigned int) _29;
  _31 = 1074151424B;
  _32 = _30 & 3;
  _31->FIRCCFG = _32;
  _33 = 1074151424B;
  _34 = _33->FIRCCSR;
  _35 = config->regulator;
  _36 = (long unsigned int) _35;
  _37 = _36 << 3;
  _38 = _37 & 8;
  _39 = _34 | _38;
  _40 = 1074151424B;
  _41 = _39 | 1;
  _40->FIRCCSR = _41;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 9> :
  _42 = 1074151424B;
  _43 = _42->FIRCCSR;
  _44 = _43 >> 24;
  IrcoscStatus = _44 & 1;
  TimeoutTicks.4_45 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.4_45);
  if (IrcoscStatus == 0)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

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

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

  <bb 12> :
  _47 = config->name;
  ReportClockErrors (1, _47);

  <bb 13> :
  SetInputSouceSytemClock (3);
  if (SircWasDisabled != 0)
    goto <bb 14>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 14> :
  DisableSirc (2);
  goto <bb 21>; [INV]

  <bb 15> :
  _48 = 1074151424B;
  _49 = _48->FIRCCSR;
  _50 = 1074151424B;
  _51 = _49 & 4294967294;
  _50->FIRCCSR = _51;
  _52 = config->enable;
  if (_52 == 1)
    goto <bb 16>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 16> :
  _53 = config->range;
  _54 = (long unsigned int) _53;
  _55 = 1074151424B;
  _56 = _54 & 3;
  _55->FIRCCFG = _56;
  _57 = 1074151424B;
  _58 = _57->FIRCCSR;
  _59 = config->regulator;
  _60 = (long unsigned int) _59;
  _61 = _60 << 3;
  _62 = _61 & 8;
  _63 = _58 | _62;
  _64 = 1074151424B;
  _65 = _63 | 1;
  _64->FIRCCSR = _65;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 17> :
  _66 = 1074151424B;
  _67 = _66->FIRCCSR;
  _68 = _67 >> 24;
  IrcoscStatus = _68 & 1;
  TimeoutTicks.5_69 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.5_69);
  if (IrcoscStatus == 0)
    goto <bb 18>; [INV]
  else
    goto <bb 19>; [INV]

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

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

  <bb 20> :
  _71 = config->name;
  ReportClockErrors (1, _71);

  <bb 21> :
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};
  return;

}


SetInputSouceSytemClock (uint32 sourceClock)
{
  uint32 ScsStatus;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  boolean TimeoutOccurred;
  uint32 regValue;
  uint32 iftmp.2;

  <bb 2> :
  TimeoutOccurred = 0;
  _1 = 1074151424B;
  regValue = _1->RCCR;
  regValue = regValue & 4043309055;
  _2 = sourceClock << 24;
  regValue = regValue | _2;
  _3 = 1074151424B;
  _3->RCCR = regValue;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 3> :
  _4 = 1074151424B;
  _5 = _4->CSR;
  _6 = _5 >> 24;
  _7 = _6 & 15;
  if (sourceClock != _7)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  iftmp.2 = 1;
  goto <bb 6>; [INV]

  <bb 5> :
  iftmp.2 = 0;

  <bb 6> :
  ScsStatus = iftmp.2;
  TimeoutTicks.3_8 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.3_8);
  if (ScsStatus == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

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

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

  <bb 9> :
  ReportClockErrors (1, 5);

  <bb 10> :
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};
  return;

}


DisableSircStop (Clock_Ip_NameType name)
{
  <bb 2> :
  DisableSircStop_TrustedCall (name);
  return;

}


DisableSircStop_TrustedCall (Clock_Ip_NameType name)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4294967293;
  _3->SIRCCSR = _4;
  return;

}


EnableSircStop (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  EnableSircStop_TrustedCall (config);
  return;

}


EnableSircStop_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  _1 = config->enable;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _2 = 1074151424B;
  _3 = _2->SIRCCSR;
  _4 = 1074151424B;
  _5 = _3 | 2;
  _4->SIRCCSR = _5;

  <bb 4> :
  return;

}


SetSircStop (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  SetSircStop_TrustedCall (config);
  return;

}


SetSircStop_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4286578687;
  _3->SIRCCSR = _4;
  _5 = 1074151424B;
  _6 = _5->SIRCCSR;
  _7 = 1074151424B;
  _8 = _6 & 4294967293;
  _7->SIRCCSR = _8;
  _9 = 1074151424B;
  _10 = _9->SIRCCSR;
  _11 = config->stopModeEnable;
  _12 = (long unsigned int) _11;
  _13 = _12 << 1;
  _14 = _13 & 2;
  _15 = 1074151424B;
  _16 = _10 | _14;
  _15->SIRCCSR = _16;
  return;

}


DisableSircVlp (Clock_Ip_NameType name)
{
  <bb 2> :
  DisableSircVlp_TrustedCall (name);
  return;

}


DisableSircVlp_TrustedCall (Clock_Ip_NameType name)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4294967291;
  _3->SIRCCSR = _4;
  return;

}


EnableSircVlp (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  EnableSircVlp_TrustedCall (config);
  return;

}


EnableSircVlp_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  _1 = config->enable;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _2 = 1074151424B;
  _3 = _2->SIRCCSR;
  _4 = 1074151424B;
  _5 = _3 | 4;
  _4->SIRCCSR = _5;

  <bb 4> :
  return;

}


SetSircVlp (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  SetSircVlp_TrustedCall (config);
  return;

}


SetSircVlp_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4286578687;
  _3->SIRCCSR = _4;
  _5 = 1074151424B;
  _6 = _5->SIRCCSR;
  _7 = 1074151424B;
  _8 = _6 & 4294967291;
  _7->SIRCCSR = _8;
  _9 = 1074151424B;
  _10 = _9->SIRCCSR;
  _11 = config->lowPowerModeEnable;
  _12 = (long unsigned int) _11;
  _13 = _12 << 2;
  _14 = _13 & 4;
  _15 = 1074151424B;
  _16 = _10 | _14;
  _15->SIRCCSR = _16;
  return;

}


DisableSirc (Clock_Ip_NameType name)
{
  <bb 2> :
  DisableSirc_TrustedCall (name);
  return;

}


DisableSirc_TrustedCall (Clock_Ip_NameType name)
{
  <bb 2> :
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 & 4294967294;
  _3->SIRCCSR = _4;
  _5 = 1074151424B;
  _6 = _5->SIRCCSR;
  _7 = 1074151424B;
  _8 = _6 & 4294967291;
  _7->SIRCCSR = _8;
  return;

}


EnableSirc (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  EnableSirc_TrustedCall (config);
  return;

}


EnableSirc_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  uint32 IrcoscStatus;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  boolean TimeoutOccurred;

  <bb 2> :
  TimeoutOccurred = 0;
  _1 = 1074151424B;
  _2 = _1->SIRCCSR;
  _3 = 1074151424B;
  _4 = _2 | 1;
  _3->SIRCCSR = _4;
  _5 = 1074151424B;
  _6 = _5->SIRCCSR;
  _7 = 1074151424B;
  _8 = _6 | 4;
  _7->SIRCCSR = _8;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 3> :
  _9 = 1074151424B;
  _10 = _9->SIRCCSR;
  _11 = _10 >> 24;
  IrcoscStatus = _11 & 1;
  TimeoutTicks.1_12 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.1_12);
  if (IrcoscStatus == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

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

  <bb 6> :
  _14 = config->name;
  ReportClockErrors (1, _14);

  <bb 7> :
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};
  return;

}


SetSirc (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  SetSirc_TrustedCall (config);
  return;

}


SetSirc_TrustedCall (const struct Clock_Ip_IrcoscConfigType * config)
{
  struct Clock_Ip_IrcoscConfigType sircConfig;
  uint32 IrcoscStatus;
  uint32 TimeoutTicks;
  uint32 ElapsedTime;
  uint32 StartTime;
  boolean TimeoutOccurred;

  <bb 2> :
  TimeoutOccurred = 0;
  if (config == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  sircConfig.name = 5;
  sircConfig.range = 1;
  sircConfig.enable = 1;
  sircConfig.lowPowerModeEnable = 1;
  goto <bb 5>; [INV]

  <bb 4> :
  _1 = config->name;
  sircConfig.name = _1;
  _2 = config->range;
  sircConfig.range = _2;
  _3 = config->enable;
  sircConfig.enable = _3;
  _4 = config->lowPowerModeEnable;
  sircConfig.lowPowerModeEnable = _4;

  <bb 5> :
  _5 = 1074151424B;
  _6 = _5->SIRCCSR;
  _7 = 1074151424B;
  _8 = _6 & 4286578687;
  _7->SIRCCSR = _8;
  _9 = 1074151424B;
  _10 = _9->SIRCCSR;
  _11 = 1074151424B;
  _12 = _10 & 4294967294;
  _11->SIRCCSR = _12;
  _13 = 1074151424B;
  _14 = _13->SIRCCSR;
  _15 = 1074151424B;
  _16 = _14 & 4294967291;
  _15->SIRCCSR = _16;
  _17 = sircConfig.enable;
  if (_17 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 6> :
  _18 = sircConfig.range;
  _19 = (long unsigned int) _18;
  _20 = 1074151424B;
  _21 = _19 & 1;
  _20->SIRCCFG = _21;
  _22 = 1074151424B;
  _23 = _22->SIRCCSR;
  _24 = 1074151424B;
  _25 = _23 | 1;
  _24->SIRCCSR = _25;
  _26 = 1074151424B;
  _27 = _26->SIRCCSR;
  _28 = sircConfig.lowPowerModeEnable;
  _29 = (long unsigned int) _28;
  _30 = _29 << 2;
  _31 = _30 & 4;
  _32 = 1074151424B;
  _33 = _27 | _31;
  _32->SIRCCSR = _33;
  ClockStartTimeout (&StartTime, &ElapsedTime, &TimeoutTicks, 50000);

  <bb 7> :
  _34 = 1074151424B;
  _35 = _34->SIRCCSR;
  _36 = _35 >> 24;
  IrcoscStatus = _36 & 1;
  TimeoutTicks.0_37 = TimeoutTicks;
  TimeoutOccurred = ClockTimeoutExpired (&StartTime, &ElapsedTime, TimeoutTicks.0_37);
  if (IrcoscStatus == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

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

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

  <bb 10> :
  _39 = sircConfig.name;
  ReportClockErrors (1, _39);

  <bb 11> :
  StartTime = {CLOBBER};
  ElapsedTime = {CLOBBER};
  TimeoutTicks = {CLOBBER};
  sircConfig = {CLOBBER};
  return;

}


InternalOscillatorEmpty_Disable (Clock_Ip_NameType name)
{
  <bb 2> :
  return;

}


InternalOscillatorEmpty (const struct Clock_Ip_IrcoscConfigType * config)
{
  <bb 2> :
  return;

}


