vTimerSetTimerNumber (struct tmrTimerControl * xTimer, UBaseType_t uxTimerNumber)
{
  <bb 2> :
  MEM[(struct Timer_t *)xTimer].uxTimerNumber = uxTimerNumber;
  return;

}


uxTimerGetTimerNumber (struct tmrTimerControl * xTimer)
{
  UBaseType_t D.6790;

  <bb 2> :
  D.6790 = MEM[(struct Timer_t *)xTimer].uxTimerNumber;

  <bb 3> :
<L0>:
  return D.6790;

}


xTimerPendFunctionCall (void (*PendedFunction_t) (void *, uint32_t) xFunctionToPend, void * pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait)
{
  BaseType_t xReturn;
  struct DaemonTaskMessage_t xMessage;
  BaseType_t D.6787;

  <bb 2> :
  xTimerQueue.26_1 = xTimerQueue;
  if (xTimerQueue.26_1 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  xMessage.xMessageID = -1;
  xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend;
  xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1;
  xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;
  xTimerQueue.27_2 = xTimerQueue;
  xReturn = xQueueGenericSend (xTimerQueue.27_2, &xMessage, xTicksToWait, 0);
  D.6787 = xReturn;
  xMessage = {CLOBBER};

  <bb 6> :
<L4>:
  return D.6787;

}


xTimerPendFunctionCallFromISR (void (*PendedFunction_t) (void *, uint32_t) xFunctionToPend, void * pvParameter1, uint32_t ulParameter2, BaseType_t * pxHigherPriorityTaskWoken)
{
  BaseType_t xReturn;
  struct DaemonTaskMessage_t xMessage;
  BaseType_t D.6782;

  <bb 2> :
  xMessage.xMessageID = -2;
  xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend;
  xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1;
  xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;
  xTimerQueue.25_1 = xTimerQueue;
  xReturn = xQueueGenericSendFromISR (xTimerQueue.25_1, &xMessage, pxHigherPriorityTaskWoken, 0);
  D.6782 = xReturn;
  xMessage = {CLOBBER};

  <bb 3> :
<L1>:
  return D.6782;

}


vTimerSetTimerID (struct tmrTimerControl * xTimer, void * pvNewID)
{
  struct Timer_t * const pxTimer;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  vPortEnterCritical ();
  pxTimer->pvTimerID = pvNewID;
  vPortExitCritical ();
  return;

}


pvTimerGetTimerID (struct tmrTimerControl * const xTimer)
{
  void * pvReturn;
  struct Timer_t * const pxTimer;
  void * D.6778;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  vPortEnterCritical ();
  pvReturn = pxTimer->pvTimerID;
  vPortExitCritical ();
  D.6778 = pvReturn;

  <bb 6> :
<L3>:
  return D.6778;

}


xTimerIsTimerActive (struct tmrTimerControl * xTimer)
{
  struct Timer_t * pxTimer;
  BaseType_t xReturn;
  BaseType_t D.6774;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  vPortEnterCritical ();
  _1 = pxTimer->ucStatus;
  _2 = (int) _1;
  _3 = _2 & 1;
  if (_3 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  xReturn = 0;
  goto <bb 8>; [INV]

  <bb 7> :
  xReturn = 1;

  <bb 8> :
  vPortExitCritical ();
  D.6774 = xReturn;

  <bb 9> :
<L6>:
  return D.6774;

}


prvCheckForValidListAndQueue ()
{
  <bb 2> :
  vPortEnterCritical ();
  xTimerQueue.22_1 = xTimerQueue;
  if (xTimerQueue.22_1 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vListInitialise (&xActiveTimerList1);
  vListInitialise (&xActiveTimerList2);
  pxCurrentTimerList = &xActiveTimerList1;
  pxOverflowTimerList = &xActiveTimerList2;
  _2 = xQueueGenericCreate (10, 16, 0);
  xTimerQueue = _2;
  xTimerQueue.23_3 = xTimerQueue;
  if (xTimerQueue.23_3 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  xTimerQueue.24_4 = xTimerQueue;
  vQueueAddToRegistry (xTimerQueue.24_4, "TmrQ");

  <bb 5> :
  vPortExitCritical ();
  return;

}


prvSwitchTimerLists ()
{
  struct List_t * pxTemp;
  TickType_t xNextExpireTime;

  <bb 2> :
  goto <bb 4>; [INV]

  <bb 3> :
  pxCurrentTimerList.19_1 = pxCurrentTimerList;
  _2 = pxCurrentTimerList.19_1->xListEnd.pxNext;
  xNextExpireTime = _2->xItemValue;
  prvProcessExpiredTimer (xNextExpireTime, 4294967295);

  <bb 4> :
  pxCurrentTimerList.20_3 = pxCurrentTimerList;
  _4 = pxCurrentTimerList.20_3->uxNumberOfItems;
  if (_4 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  pxTemp = pxCurrentTimerList;
  pxOverflowTimerList.21_5 = pxOverflowTimerList;
  pxCurrentTimerList = pxOverflowTimerList.21_5;
  pxOverflowTimerList = pxTemp;
  return;

}


prvProcessReceivedCommands ()
{
  const struct CallbackParameters_t * const pxCallback;
  TickType_t xTimeNow;
  BaseType_t xTimerListsWereSwitched;
  struct Timer_t * pxTimer;
  struct DaemonTaskMessage_t xMessage;

  <bb 2> :
  goto <bb 28>; [INV]

  <bb 3> :
  _1 = xMessage.xMessageID;
  if (_1 < 0)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 4> :
  pxCallback = &xMessage.u.xCallbackParameters;
  if (pxCallback == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  vPortRaiseBASEPRI ();

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

  <bb 7> :
  _2 = pxCallback->pxCallbackFunction;
  _3 = pxCallback->pvParameter1;
  _4 = pxCallback->ulParameter2;
  _2 (_3, _4);

  <bb 8> :
  _5 = xMessage.xMessageID;
  if (_5 >= 0)
    goto <bb 9>; [INV]
  else
    goto <bb 28>; [INV]

  <bb 9> :
  pxTimer = xMessage.u.xTimerParameters.pxTimer;
  _6 = pxTimer->xTimerListItem.pvContainer;
  if (_6 != 0B)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  _7 = &pxTimer->xTimerListItem;
  uxListRemove (_7);

  <bb 11> :
  xTimeNow = prvSampleTimeNow (&xTimerListsWereSwitched);
  _8 = xMessage.xMessageID;
  switch (_8) <default: <L32> [INV], case 1 ... 2: <L11> [INV], case 3: <L21> [INV], case 4: <L23> [INV], case 5: <L28> [INV], case 6 ... 7: <L11> [INV], case 8: <L21> [INV], case 9: <L23> [INV]>

  <bb 12> :
<L11>:
  _9 = pxTimer->ucStatus;
  _10 = _9 | 1;
  pxTimer->ucStatus = _10;
  _11 = xMessage.u.xTimerParameters.xMessageValue;
  _12 = pxTimer->xTimerPeriodInTicks;
  _13 = _11 + _12;
  _14 = xMessage.u.xTimerParameters.xMessageValue;
  _15 = prvInsertTimerInActiveList (pxTimer, _13, xTimeNow, _14);
  if (_15 != 0)
    goto <bb 13>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 13> :
  _16 = pxTimer->ucStatus;
  _17 = (int) _16;
  _18 = _17 & 4;
  if (_18 != 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  _19 = xMessage.u.xTimerParameters.xMessageValue;
  _20 = pxTimer->xTimerPeriodInTicks;
  _21 = _19 + _20;
  prvReloadTimer (pxTimer, _21, xTimeNow);
  goto <bb 16>; [INV]

  <bb 15> :
  _22 = pxTimer->ucStatus;
  _23 = _22 & 254;
  pxTimer->ucStatus = _23;

  <bb 16> :
  _24 = pxTimer->pxCallbackFunction;
  _24 (pxTimer);

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

  <bb 18> :
<L21>:
  _25 = pxTimer->ucStatus;
  _26 = _25 & 254;
  pxTimer->ucStatus = _26;
  goto <bb 28>; [INV]

  <bb 19> :
<L23>:
  _27 = pxTimer->ucStatus;
  _28 = _27 | 1;
  pxTimer->ucStatus = _28;
  _29 = xMessage.u.xTimerParameters.xMessageValue;
  pxTimer->xTimerPeriodInTicks = _29;
  _30 = pxTimer->xTimerPeriodInTicks;
  if (_30 == 0)
    goto <bb 20>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 20> :
  vPortRaiseBASEPRI ();

  <bb 21> :
  goto <bb 21>; [INV]

  <bb 22> :
  _31 = pxTimer->xTimerPeriodInTicks;
  _32 = xTimeNow + _31;
  prvInsertTimerInActiveList (pxTimer, _32, xTimeNow, xTimeNow);
  goto <bb 28>; [INV]

  <bb 23> :
<L28>:
  _33 = pxTimer->ucStatus;
  _34 = (int) _33;
  _35 = _34 & 2;
  if (_35 == 0)
    goto <bb 24>; [INV]
  else
    goto <bb 25>; [INV]

  <bb 24> :
  vPortFree (pxTimer);
  goto <bb 26>; [INV]

  <bb 25> :
  _36 = pxTimer->ucStatus;
  _37 = _36 & 254;
  pxTimer->ucStatus = _37;

  <bb 26> :
  goto <bb 28>; [INV]

  <bb 27> :
<L32>:

  <bb 28> :
  xTimerQueue.18_38 = xTimerQueue;
  _39 = xQueueReceive (xTimerQueue.18_38, &xMessage, 0);
  if (_39 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 29>; [INV]

  <bb 29> :
  xMessage = {CLOBBER};
  xTimerListsWereSwitched = {CLOBBER};
  return;

}


prvInsertTimerInActiveList (struct Timer_t * const pxTimer, const TickType_t xNextExpiryTime, const TickType_t xTimeNow, const TickType_t xCommandTime)
{
  BaseType_t xProcessTimerNow;
  BaseType_t D.6740;

  <bb 2> :
  xProcessTimerNow = 0;
  pxTimer->xTimerListItem.xItemValue = xNextExpiryTime;
  pxTimer->xTimerListItem.pvOwner = pxTimer;
  if (xNextExpiryTime <= xTimeNow)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  _1 = xTimeNow - xCommandTime;
  _2 = pxTimer->xTimerPeriodInTicks;
  if (_1 >= _2)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  xProcessTimerNow = 1;
  goto <bb 10>; [INV]

  <bb 5> :
  pxOverflowTimerList.16_3 = pxOverflowTimerList;
  _4 = &pxTimer->xTimerListItem;
  vListInsert (pxOverflowTimerList.16_3, _4);
  goto <bb 10>; [INV]

  <bb 6> :
  if (xTimeNow < xCommandTime)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 7> :
  if (xNextExpiryTime >= xCommandTime)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  xProcessTimerNow = 1;
  goto <bb 10>; [INV]

  <bb 9> :
  pxCurrentTimerList.17_5 = pxCurrentTimerList;
  _6 = &pxTimer->xTimerListItem;
  vListInsert (pxCurrentTimerList.17_5, _6);

  <bb 10> :
  D.6740 = xProcessTimerNow;

  <bb 11> :
<L10>:
  return D.6740;

}


prvSampleTimeNow (BaseType_t * const pxTimerListsWereSwitched)
{
  static TickType_t xLastTime = 0;
  TickType_t xTimeNow;
  TickType_t D.6728;

  <bb 2> :
  xTimeNow = xTaskGetTickCount ();
  xLastTime.15_1 = xLastTime;
  if (xTimeNow < xLastTime.15_1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  prvSwitchTimerLists ();
  *pxTimerListsWereSwitched = 1;
  goto <bb 5>; [INV]

  <bb 4> :
  *pxTimerListsWereSwitched = 0;

  <bb 5> :
  xLastTime = xTimeNow;
  D.6728 = xTimeNow;

  <bb 6> :
<L3>:
  return D.6728;

}


prvGetNextExpireTime (BaseType_t * const pxListWasEmpty)
{
  TickType_t xNextExpireTime;
  TickType_t D.6723;
  long int iftmp.12;

  <bb 2> :
  pxCurrentTimerList.13_1 = pxCurrentTimerList;
  _2 = pxCurrentTimerList.13_1->uxNumberOfItems;
  if (_2 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.12 = 1;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.12 = 0;

  <bb 5> :
  *pxListWasEmpty = iftmp.12;
  _3 = *pxListWasEmpty;
  if (_3 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  pxCurrentTimerList.14_4 = pxCurrentTimerList;
  _5 = pxCurrentTimerList.14_4->xListEnd.pxNext;
  xNextExpireTime = _5->xItemValue;
  goto <bb 8>; [INV]

  <bb 7> :
  xNextExpireTime = 0;

  <bb 8> :
  D.6723 = xNextExpireTime;

  <bb 9> :
<L6>:
  return D.6723;

}


prvProcessTimerOrBlockTask (const TickType_t xNextExpireTime, BaseType_t xListWasEmpty)
{
  BaseType_t xTimerListsWereSwitched;
  TickType_t xTimeNow;
  long int iftmp.9;

  <bb 2> :
  vTaskSuspendAll ();
  xTimeNow = prvSampleTimeNow (&xTimerListsWereSwitched);
  xTimerListsWereSwitched.8_1 = xTimerListsWereSwitched;
  if (xTimerListsWereSwitched.8_1 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 3> :
  if (xListWasEmpty == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  if (xNextExpireTime <= xTimeNow)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  xTaskResumeAll ();
  prvProcessExpiredTimer (xNextExpireTime, xTimeNow);
  goto <bb 13>; [INV]

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

  <bb 7> :
  pxOverflowTimerList.10_2 = pxOverflowTimerList;
  _3 = pxOverflowTimerList.10_2->uxNumberOfItems;
  if (_3 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  iftmp.9 = 1;
  goto <bb 10>; [INV]

  <bb 9> :
  iftmp.9 = 0;

  <bb 10> :
  xListWasEmpty = iftmp.9;

  <bb 11> :
  xTimerQueue.11_4 = xTimerQueue;
  _5 = xNextExpireTime - xTimeNow;
  vQueueWaitForMessageRestricted (xTimerQueue.11_4, _5, xListWasEmpty);
  _6 = xTaskResumeAll ();
  if (_6 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  _7 = 3758157060B;
  *_7 = 268435456;
  __asm__ __volatile__("dsb" :  :  : "memory");
  __asm__ __volatile__("isb");

  <bb 13> :
  goto <bb 15>; [INV]

  <bb 14> :
  xTaskResumeAll ();

  <bb 15> :
  xTimerListsWereSwitched = {CLOBBER};
  return;

}


prvTimerTask (void * pvParameters)
{
  BaseType_t xListWasEmpty;
  TickType_t xNextExpireTime;

  <bb 2> :
  xNextExpireTime = prvGetNextExpireTime (&xListWasEmpty);
  xListWasEmpty.7_1 = xListWasEmpty;
  prvProcessTimerOrBlockTask (xNextExpireTime, xListWasEmpty.7_1);
  prvProcessReceivedCommands ();
  goto <bb 2>; [INV]

}


prvProcessExpiredTimer (const TickType_t xNextExpireTime, const TickType_t xTimeNow)
{
  struct Timer_t * const pxTimer;

  <bb 2> :
  pxCurrentTimerList.6_1 = pxCurrentTimerList;
  _2 = pxCurrentTimerList.6_1->xListEnd.pxNext;
  pxTimer = _2->pvOwner;
  _3 = &pxTimer->xTimerListItem;
  uxListRemove (_3);
  _4 = pxTimer->ucStatus;
  _5 = (int) _4;
  _6 = _5 & 4;
  if (_6 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  prvReloadTimer (pxTimer, xNextExpireTime, xTimeNow);
  goto <bb 5>; [INV]

  <bb 4> :
  _7 = pxTimer->ucStatus;
  _8 = _7 & 254;
  pxTimer->ucStatus = _8;

  <bb 5> :
  _9 = pxTimer->pxCallbackFunction;
  _9 (pxTimer);
  return;

}


prvReloadTimer (struct Timer_t * const pxTimer, TickType_t xExpiredTime, const TickType_t xTimeNow)
{
  <bb 2> :
  goto <bb 4>; [INV]

  <bb 3> :
  _1 = pxTimer->xTimerPeriodInTicks;
  xExpiredTime = xExpiredTime + _1;
  _2 = pxTimer->pxCallbackFunction;
  _2 (pxTimer);

  <bb 4> :
  _3 = pxTimer->xTimerPeriodInTicks;
  _4 = xExpiredTime + _3;
  _5 = prvInsertTimerInActiveList (pxTimer, _4, xTimeNow, xExpiredTime);
  if (_5 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  return;

}


pcTimerGetName (struct tmrTimerControl * xTimer)
{
  struct Timer_t * pxTimer;
  const char * D.6695;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  D.6695 = pxTimer->pcTimerName;

  <bb 6> :
<L3>:
  return D.6695;

}


xTimerGetExpiryTime (struct tmrTimerControl * xTimer)
{
  TickType_t xReturn;
  struct Timer_t * pxTimer;
  TickType_t D.6691;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  xReturn = pxTimer->xTimerListItem.xItemValue;
  D.6691 = xReturn;

  <bb 6> :
<L3>:
  return D.6691;

}


uxTimerGetReloadMode (struct tmrTimerControl * xTimer)
{
  UBaseType_t uxReturn;
  struct Timer_t * pxTimer;
  UBaseType_t D.6687;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  vPortEnterCritical ();
  _1 = pxTimer->ucStatus;
  _2 = (int) _1;
  _3 = _2 & 4;
  if (_3 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  uxReturn = 0;
  goto <bb 8>; [INV]

  <bb 7> :
  uxReturn = 1;

  <bb 8> :
  vPortExitCritical ();
  D.6687 = uxReturn;

  <bb 9> :
<L6>:
  return D.6687;

}


vTimerSetReloadMode (struct tmrTimerControl * xTimer, const UBaseType_t uxAutoReload)
{
  struct Timer_t * pxTimer;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

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

  <bb 6> :
  _1 = pxTimer->ucStatus;
  _2 = _1 | 4;
  pxTimer->ucStatus = _2;
  goto <bb 8>; [INV]

  <bb 7> :
  _3 = pxTimer->ucStatus;
  _4 = _3 & 251;
  pxTimer->ucStatus = _4;

  <bb 8> :
  vPortExitCritical ();
  return;

}


xTimerGetPeriod (struct tmrTimerControl * xTimer)
{
  struct Timer_t * pxTimer;
  TickType_t D.6675;

  <bb 2> :
  pxTimer = xTimer;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  D.6675 = pxTimer->xTimerPeriodInTicks;

  <bb 6> :
<L3>:
  return D.6675;

}


xTimerGetTimerDaemonTaskHandle ()
{
  struct tskTaskControlBlock * D.6671;

  <bb 2> :
  xTimerTaskHandle.5_1 = xTimerTaskHandle;
  if (xTimerTaskHandle.5_1 == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  D.6671 = xTimerTaskHandle;

  <bb 6> :
<L3>:
  return D.6671;

}


xTimerGenericCommand (struct tmrTimerControl * xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait)
{
  struct DaemonTaskMessage_t xMessage;
  BaseType_t xReturn;
  BaseType_t D.6666;

  <bb 2> :
  xReturn = 0;
  if (xTimer == 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  xTimerQueue.1_1 = xTimerQueue;
  if (xTimerQueue.1_1 != 0B)
    goto <bb 6>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 6> :
  xMessage.xMessageID = xCommandID;
  xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
  xMessage.u.xTimerParameters.pxTimer = xTimer;
  if (xCommandID <= 5)
    goto <bb 7>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 7> :
  _2 = xTaskGetSchedulerState ();
  if (_2 == 2)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  xTimerQueue.2_3 = xTimerQueue;
  xReturn = xQueueGenericSend (xTimerQueue.2_3, &xMessage, xTicksToWait, 0);
  goto <bb 11>; [INV]

  <bb 9> :
  xTimerQueue.3_4 = xTimerQueue;
  xReturn = xQueueGenericSend (xTimerQueue.3_4, &xMessage, 0, 0);
  goto <bb 11>; [INV]

  <bb 10> :
  xTimerQueue.4_5 = xTimerQueue;
  xReturn = xQueueGenericSendFromISR (xTimerQueue.4_5, &xMessage, pxHigherPriorityTaskWoken, 0);

  <bb 11> :
  D.6666 = xReturn;
  xMessage = {CLOBBER};

  <bb 12> :
<L13>:
  return D.6666;

}


prvInitialiseNewTimer (const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, void (*TimerCallbackFunction_t) (struct tmrTimerControl *) pxCallbackFunction, struct Timer_t * pxNewTimer)
{
  <bb 2> :
  if (xTimerPeriodInTicks == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  vPortRaiseBASEPRI ();

  <bb 4> :
  goto <bb 4>; [INV]

  <bb 5> :
  prvCheckForValidListAndQueue ();
  pxNewTimer->pcTimerName = pcTimerName;
  pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
  pxNewTimer->pvTimerID = pvTimerID;
  pxNewTimer->pxCallbackFunction = pxCallbackFunction;
  _1 = &pxNewTimer->xTimerListItem;
  vListInitialiseItem (_1);
  if (uxAutoReload != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  _2 = pxNewTimer->ucStatus;
  _3 = _2 | 4;
  pxNewTimer->ucStatus = _3;

  <bb 7> :
  return;

}


xTimerCreate (const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, void (*TimerCallbackFunction_t) (struct tmrTimerControl *) pxCallbackFunction)
{
  struct Timer_t * pxNewTimer;
  struct tmrTimerControl * D.6649;

  <bb 2> :
  pxNewTimer = pvPortMalloc (44);
  if (pxNewTimer != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  pxNewTimer->ucStatus = 0;
  prvInitialiseNewTimer (pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer);

  <bb 4> :
  D.6649 = pxNewTimer;

  <bb 5> :
<L2>:
  return D.6649;

}


xTimerCreateTimerTask ()
{
  BaseType_t xReturn;
  BaseType_t D.6645;

  <bb 2> :
  xReturn = 0;
  prvCheckForValidListAndQueue ();
  xTimerQueue.0_1 = xTimerQueue;
  if (xTimerQueue.0_1 != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  xReturn = xTaskCreate (prvTimerTask, "Tmr Svc", 180, 0B, 2, &xTimerTaskHandle);

  <bb 4> :
  if (xReturn == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  vPortRaiseBASEPRI ();

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

  <bb 7> :
  D.6645 = xReturn;

  <bb 8> :
<L6>:
  return D.6645;

}


__attribute__((always_inline))
vPortRaiseBASEPRI ()
{
  uint32_t ulNewBASEPRI;

  <bb 2> :
  __asm__ __volatile__("	mov %0, %1												
	msr basepri, %0											
	isb														
	dsb														
" : "=r" ulNewBASEPRI : "i" 16 : "memory");
  return;

}


