FlexCAN_ConfigCtrlOptions (struct FLEXCAN_Type * pBase, uint32 u32Options)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = u32Options & 32;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetIsoCan (pBase, 1);
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetIsoCan (pBase, 0);

  <bb 5> :
  # DEBUG BEGIN_STMT
  _2 = u32Options & 64;
  if (_2 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase, 1);
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase, 0);

  <bb 8> :
  # DEBUG BEGIN_STMT
  _3 = u32Options & 8;
  if (_3 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetProtocolException (pBase, 1);
  goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetProtocolException (pBase, 0);

  <bb 11> :
  # DEBUG BEGIN_STMT
  _4 = u32Options & 2;
  if (_4 != 0)
    goto <bb 12>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 12> :
  _5 = pBase->MCR;
  _6 = _5 & 2048;
  if (_6 == 0)
    goto <bb 13>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  FlexCAN_CanBitSampling (pBase, 1);
  goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  FlexCAN_CanBitSampling (pBase, 0);

  <bb 15> :
  # DEBUG BEGIN_STMT
  _7 = u32Options & 4;
  if (_7 != 0)
    goto <bb 16>; [INV]
  else
    goto <bb 17>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetBusOffAutorecovery (pBase, 1);
  goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetBusOffAutorecovery (pBase, 0);

  <bb 18> :
  # DEBUG BEGIN_STMT
  _8 = u32Options & 16;
  if (_8 != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEdgeFilter (pBase, 1);
  goto <bb 21>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEdgeFilter (pBase, 0);

  <bb 21> :
  return;

}


FlexCAN_SetEnhancedRxFifoFilter (struct FLEXCAN_Type * base, const struct Flexcan_Ip_EnhancedIdTableType * idFilterTable)
{
  volatile uint32 * filterStdIDTable;
  volatile uint32 * filterExtIDTable;
  uint32 val;
  uint32 val1;
  uint32 val2;
  uint32 numOfStdIDFilter;
  uint32 numOfExtIDFilter;
  uint32 numOfEnhancedFilter;
  uint32 n;
  uint32 j;
  uint32 i;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  val2 = 0;
  val1 = 0;
  val = 0;
  # DEBUG BEGIN_STMT
  filterExtIDTable = 0B;
  # DEBUG BEGIN_STMT
  filterStdIDTable = 0B;
  # DEBUG BEGIN_STMT
  _1 = base->ERFCR;
  _2 = _1 >> 8;
  numOfEnhancedFilter = _2 & 63;
  # DEBUG BEGIN_STMT
  _3 = base->ERFCR;
  _4 = _3 >> 16;
  numOfExtIDFilter = _4 & 127;
  # DEBUG BEGIN_STMT
  _5 = numOfEnhancedFilter - numOfExtIDFilter;
  _6 = _5 + 1;
  numOfStdIDFilter = _6 * 2;
  # DEBUG BEGIN_STMT
  filterExtIDTable = &base->ERFFEL[0];
  # DEBUG BEGIN_STMT
  _7 = numOfExtIDFilter * 2;
  filterStdIDTable = &base->ERFFEL[_7];
  # DEBUG BEGIN_STMT
  j = 0;
  # DEBUG BEGIN_STMT
  n = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 25>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _8 = i * 12;
  _9 = idFilterTable + _8;
  _10 = _9->isExtendedFrame;
  _11 = ~_10;
  if (_11 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  val = 0;
  # DEBUG BEGIN_STMT
  _12 = i * 12;
  _13 = idFilterTable + _12;
  _14 = _13->rtr2;
  if (_14 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  val = 134217728;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _15 = i * 12;
  _16 = idFilterTable + _15;
  _17 = _16->rtr1;
  if (_17 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  val = val | 2048;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _18 = i * 12;
  _19 = idFilterTable + _18;
  _20 = _19->id2;
  _21 = _20 << 16;
  _22 = _21 & 134152192;
  _23 = i * 12;
  _24 = idFilterTable + _23;
  _25 = _24->id1;
  _26 = _25 & 2047;
  _27 = _22 | _26;
  _28 = j * 4;
  _29 = filterStdIDTable + _28;
  _30 = val | _27;
  *_29 = _30;
  # DEBUG BEGIN_STMT
  _31 = i * 12;
  _32 = idFilterTable + _31;
  _33 = _32->filterType;
  _34 = (int) _33;
  switch (_34) <default: <L9> [INV], case 0: <L6> [INV], case 1: <L7> [INV], case 2: <L8> [INV]>

  <bb 9> :
<L6>:
  # DEBUG BEGIN_STMT
  _35 = j * 4;
  _36 = filterStdIDTable + _35;
  _37 = j * 4;
  _38 = filterStdIDTable + _37;
  _39 = *_36;
  *_38 = _39;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 10> :
<L7>:
  # DEBUG BEGIN_STMT
  _40 = j * 4;
  _41 = filterStdIDTable + _40;
  _42 = *_41;
  _43 = j * 4;
  _44 = filterStdIDTable + _43;
  _45 = _42 | 1073741824;
  *_44 = _45;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 11> :
<L8>:
  # DEBUG BEGIN_STMT
  _46 = j * 4;
  _47 = filterStdIDTable + _46;
  _48 = *_47;
  _49 = j * 4;
  _50 = filterStdIDTable + _49;
  _51 = _48 | 2147483648;
  *_50 = _51;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 12> :
<L9>:
  # DEBUG BEGIN_STMT
  DevAssert (0);
  # DEBUG BEGIN_STMT

  <bb 13> :
  # DEBUG BEGIN_STMT
  j = j + 1;
  goto <bb 24>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  val2 = 0;
  # DEBUG BEGIN_STMT
  val1 = 0;
  # DEBUG BEGIN_STMT
  _52 = i * 12;
  _53 = idFilterTable + _52;
  _54 = _53->rtr2;
  if (_54 != 0)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  val2 = 536870912;

  <bb 16> :
  # DEBUG BEGIN_STMT
  _55 = i * 12;
  _56 = idFilterTable + _55;
  _57 = _56->rtr1;
  if (_57 != 0)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  val1 = 536870912;

  <bb 18> :
  # DEBUG BEGIN_STMT
  _58 = i * 12;
  _59 = idFilterTable + _58;
  _60 = _59->id2;
  _61 = _60 & 536870911;
  _62 = n * 4;
  _63 = filterExtIDTable + _62;
  _64 = val2 | _61;
  *_63 = _64;
  # DEBUG BEGIN_STMT
  _65 = i * 12;
  _66 = idFilterTable + _65;
  _67 = _66->id1;
  _68 = _67 & 536870911;
  _69 = n + 1;
  _70 = _69 * 4;
  _71 = filterExtIDTable + _70;
  _72 = val1 | _68;
  *_71 = _72;
  # DEBUG BEGIN_STMT
  _73 = i * 12;
  _74 = idFilterTable + _73;
  _75 = _74->filterType;
  _76 = (int) _75;
  switch (_76) <default: <L19> [INV], case 0: <L16> [INV], case 1: <L17> [INV], case 2: <L18> [INV]>

  <bb 19> :
<L16>:
  # DEBUG BEGIN_STMT
  _77 = n * 4;
  _78 = filterExtIDTable + _77;
  _79 = n * 4;
  _80 = filterExtIDTable + _79;
  _81 = *_78;
  *_80 = _81;
  # DEBUG BEGIN_STMT
  goto <bb 23>; [INV]

  <bb 20> :
<L17>:
  # DEBUG BEGIN_STMT
  _82 = n * 4;
  _83 = filterExtIDTable + _82;
  _84 = *_83;
  _85 = n * 4;
  _86 = filterExtIDTable + _85;
  _87 = _84 | 1073741824;
  *_86 = _87;
  # DEBUG BEGIN_STMT
  goto <bb 23>; [INV]

  <bb 21> :
<L18>:
  # DEBUG BEGIN_STMT
  _88 = n * 4;
  _89 = filterExtIDTable + _88;
  _90 = *_89;
  _91 = n * 4;
  _92 = filterExtIDTable + _91;
  _93 = _90 | 2147483648;
  *_92 = _93;
  # DEBUG BEGIN_STMT
  goto <bb 23>; [INV]

  <bb 22> :
<L19>:
  # DEBUG BEGIN_STMT
  DevAssert (0);
  # DEBUG BEGIN_STMT

  <bb 23> :
  # DEBUG BEGIN_STMT
  n = n + 2;

  <bb 24> :
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 25> :
  # DEBUG BEGIN_STMT
  _94 = numOfExtIDFilter + numOfStdIDFilter;
  if (i < _94)
    goto <bb 3>; [INV]
  else
    goto <bb 26>; [INV]

  <bb 26> :
  return;

}


FlexCAN_EnableEnhancedRxFifo (struct FLEXCAN_Type * base, uint32 numOfStdIDFilters, uint32 numOfExtIDFilters, uint32 numOfWatermark)
{
  uint32 numOfEnhancedFilters;
  Flexcan_Ip_StatusType stat;
  Flexcan_Ip_StatusType D.5914;

  <bb 2> :
  # DEBUG BEGIN_STMT
  stat = 0;
  # DEBUG BEGIN_STMT
  numOfEnhancedFilters = 0;
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_IsEnhancedRxFifoAvailable (base);
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = numOfStdIDFilters >> 1;
  _3 = numOfExtIDFilters + _2;
  numOfEnhancedFilters = _3 + 4294967295;
  # DEBUG BEGIN_STMT
  if (numOfStdIDFilters == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  stat = 1;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _4 = numOfStdIDFilters & 1;
  if (_4 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  stat = 1;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _5 = base->MCR;
  _6 = _5 & 536870912;
  if (_6 == 536870912)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  stat = 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  if (stat == 0)
    goto <bb 11>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _7 = base->ERFCR;
  _8 = _7 | 2147483648;
  base->ERFCR = _8;
  # DEBUG BEGIN_STMT
  _9 = base->ERFSR;
  _10 = _9 | 134217728;
  base->ERFSR = _10;
  # DEBUG BEGIN_STMT
  _11 = base->ERFSR;
  _12 = _11 & 268435455;
  base->ERFSR = _12;
  # DEBUG BEGIN_STMT
  _13 = base->ERFCR;
  _14 = _13 & 4294951167;
  _15 = numOfEnhancedFilters << 8;
  _16 = _15 & 16128;
  _17 = _14 | _16;
  base->ERFCR = _17;
  # DEBUG BEGIN_STMT
  _18 = base->ERFCR;
  _19 = _18 & 4286644223;
  _20 = numOfExtIDFilters << 16;
  _21 = _20 & 8323072;
  _22 = _19 | _21;
  base->ERFCR = _22;
  # DEBUG BEGIN_STMT
  _23 = base->ERFCR;
  _24 = _23 & 4294967264;
  _25 = numOfWatermark & 31;
  _26 = _24 | _25;
  base->ERFCR = _26;
  goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  stat = 1;

  <bb 13> :
  # DEBUG BEGIN_STMT
  D.5914 = stat;
  return D.5914;

}


FlexCAN_IsEnhancedRxFifoAvailable (const struct FLEXCAN_Type * base)
{
  boolean returnValue;
  static struct FLEXCAN_Type * const flexcanBase[1] = {1076903936B};
  uint32 i;
  boolean D.5899;

  <bb 2> :
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = flexcanBase[i];
  if (base == _1)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  returnValue = 1;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 6> :
  # DEBUG BEGIN_STMT
  if (i == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.5899 = returnValue;
  return D.5899;

}


FlexCAN_IsMbOutOfRange (const struct FLEXCAN_Type * pBase, uint8 u8MbIndex, boolean bIsLegacyFifoEn, uint32 u32MaxMbNum)
{
  uint32 u32NumOfMbOccupiedByFiFo;
  uint32 u32NumOfFiFoElement;
  boolean returnValue;
  boolean D.5895;

  <bb 2> :
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  u32NumOfFiFoElement = 0;
  # DEBUG BEGIN_STMT
  u32NumOfMbOccupiedByFiFo = 0;
  # DEBUG BEGIN_STMT
  _1 = (unsigned char) u32MaxMbNum;
  if (u8MbIndex >= _1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  returnValue = 1;
  goto <bb 8>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (bIsLegacyFifoEn != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _2 = pBase->CTRL2;
  _3 = _2 >> 24;
  u32NumOfFiFoElement = _3 & 15;
  # DEBUG BEGIN_STMT
  _4 = u32NumOfFiFoElement + 1;
  _5 = _4 * 8;
  _6 = _5 / 4;
  u32NumOfMbOccupiedByFiFo = _6 + 5;
  # DEBUG BEGIN_STMT
  _7 = (long unsigned int) u8MbIndex;
  if (u32NumOfMbOccupiedByFiFo >= _7)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  returnValue = 1;
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  returnValue = 0;

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.5895 = returnValue;
  return D.5895;

}


FlexCAN_GetRxFifoMask (Flexcan_Ip_MsgBuffIdType id_type, Flexcan_Ip_RxFifoIdElementFormatType formatType, uint32 mask)
{
  uint32 val;
  uint32 D.5884;

  <bb 2> :
  # DEBUG BEGIN_STMT
  val = 0;
  # DEBUG BEGIN_STMT
  _1 = (int) formatType;
  switch (_1) <default: <L22> [INV], case 0: <L0> [INV], case 1: <L7> [INV], case 2: <L14> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  val = mask & 3221225472;
  # DEBUG BEGIN_STMT
  if (id_type == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = mask << 19;
  _3 = _2 & 1073217536;
  val = val | _3;
  goto <bb 13>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (id_type == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _4 = mask << 1;
  _5 = _4 & 1073741823;
  val = val | _5;
  goto <bb 13>; [INV]

  <bb 7> :
<L7>:
  # DEBUG BEGIN_STMT
  val = mask & 3221225472;
  # DEBUG BEGIN_STMT
  if (id_type == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _6 = mask << 19;
  _7 = _6 & 1073217536;
  val = val | _7;
  goto <bb 13>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (id_type == 1)
    goto <bb 10>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _8 = mask << 16;
  _9 = _8 & 1073676288;
  val = val | _9;
  goto <bb 13>; [INV]

  <bb 11> :
<L14>:
  # DEBUG BEGIN_STMT
  if (id_type <= 1)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _10 = mask << 24;
  val = val | _10;

  <bb 13> :
<L22>:
  # DEBUG BEGIN_STMT
  D.5884 = val;
  return D.5884;

}


FlexCAN_AbortTxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  volatile uint32 * flexcan_mb;
  uint32 code;
  uint32 flexcan_mb_config;

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = 0;
  # DEBUG BEGIN_STMT
  code = 9;
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  flexcan_mb_config = *flexcan_mb;
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config & 4043309055;
  # DEBUG BEGIN_STMT
  _1 = code << 24;
  _2 = _1 & 251658240;
  flexcan_mb_config = flexcan_mb_config | _2;
  # DEBUG BEGIN_STMT
  *flexcan_mb = flexcan_mb_config;
  return;

}


FlexCAN_GetBusOffStatusFlag (uint8 u8Instance)
{
  boolean bBOffStatus;
  static struct FLEXCAN_Type * const flexcanBase[6] = {1076903936B, 1076920320B, 1076936704B, 1076953088B, 1076969472B, 1076985856B};
  boolean D.5867;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  bBOffStatus = 0;
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance;
  _2 = flexcanBase[_1];
  _3 = _2->ESR1;
  _4 = _3 & 4;
  if (_4 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  bBOffStatus = 1;

  <bb 4> :
  # DEBUG BEGIN_STMT
  D.5867 = bBOffStatus;
  return D.5867;

}


FlexCAN_GetErrStatusFlag (uint8 u8Instance)
{
  boolean bErrStatus;
  static struct FLEXCAN_Type * const flexcanBase[6] = {1076903936B, 1076920320B, 1076936704B, 1076953088B, 1076969472B, 1076985856B};
  boolean D.5863;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  bErrStatus = 0;
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance;
  _2 = flexcanBase[_1];
  _3 = _2->ESR1;
  _4 = _3 & 2;
  if (_4 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  bErrStatus = 1;

  <bb 4> :
  # DEBUG BEGIN_STMT
  D.5863 = bErrStatus;
  return D.5863;

}


FlexCAN_ReadEnhancedRxFifo (const struct FLEXCAN_Type * base, struct Flexcan_Ip_MsgBuffType * rxFifo)
{
  uint8 can_real_payload;
  uint8 flexcan_mb_dlc_value;
  uint32 * msgData_32;
  const uint32 * flexcan_mb_data_32;
  const uint32 * flexcan_mb_id;
  const uint32 * flexcan_mb;
  uint8 idhit_offset;
  uint32 mbWord;
  uint32 databyte;
  uint8 iftmp.19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  base.18_1 = (long unsigned int) base;
  _2 = base.18_1 + 8192;
  flexcan_mb = (const uint32 *) _2;
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  flexcan_mb_data_32 = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  msgData_32 = 0B;
  # DEBUG BEGIN_STMT
  _3 = *flexcan_mb;
  _4 = _3 >> 16;
  _5 = (unsigned char) _4;
  flexcan_mb_dlc_value = _5 & 15;
  # DEBUG BEGIN_STMT
  can_real_payload = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value);
  # DEBUG BEGIN_STMT
  _6 = rxFifo != 0B;
  DevAssert (_6);
  # DEBUG BEGIN_STMT
  msgData_32 = &rxFifo->data;
  # DEBUG BEGIN_STMT
  rxFifo->dataLen = can_real_payload;
  # DEBUG BEGIN_STMT
  _7 = *flexcan_mb;
  rxFifo->cs = _7;
  # DEBUG BEGIN_STMT
  _8 = rxFifo->cs;
  _9 = _8 & 2097152;
  if (_9 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _10 = *flexcan_mb_id;
  rxFifo->msgId = _10;
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _11 = *flexcan_mb_id;
  _12 = _11 >> 18;
  rxFifo->msgId = _12;

  <bb 5> :
  # DEBUG BEGIN_STMT
  _13 = rxFifo->cs;
  _14 = _13 & 1048576;
  if (_14 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  can_real_payload = 0;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _15 = can_real_payload >> 2;
  _16 = can_real_payload & 3;
  if (_16 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

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

  <bb 9> :
  iftmp.19 = 0;

  <bb 10> :
  idhit_offset = iftmp.19 + _15;
  # DEBUG BEGIN_STMT
  _17 = (unsigned int) idhit_offset;
  _18 = _17 * 4;
  _19 = flexcan_mb_data_32 + _18;
  _20 = *_19;
  _21 = (unsigned char) _20;
  _22 = _21 & 127;
  rxFifo->id_hit = _22;
  # DEBUG BEGIN_STMT
  _23 = rxFifo->cs;
  _24 = _23 & 65535;
  rxFifo->time_stamp = _24;
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _25 = databyte >> 2;
  _26 = _25 * 4;
  _27 = flexcan_mb_data_32 + _26;
  mbWord = *_27;
  # DEBUG BEGIN_STMT
  _28 = mbWord >> 24;
  _29 = mbWord >> 8;
  _30 = _29 & 65280;
  _31 = _28 | _30;
  _32 = mbWord << 8;
  _33 = _32 & 16711680;
  _34 = _31 | _33;
  _35 = mbWord << 24;
  _36 = databyte >> 2;
  _37 = _36 * 4;
  _38 = msgData_32 + _37;
  _39 = _34 | _35;
  *_38 = _39;
  # DEBUG BEGIN_STMT
  databyte = databyte + 4;

  <bb 12> :
  # DEBUG BEGIN_STMT
  _40 = (long unsigned int) can_real_payload;
  if (databyte < _40)
    goto <bb 11>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  return;

}


FlexCAN_ReadRxFifo (const struct FLEXCAN_Type * base, struct Flexcan_Ip_MsgBuffType * rxFifo)
{
  uint8 can_real_payload;
  uint8 flexcan_mb_dlc_value;
  uint32 * msgData_32;
  const uint32 * flexcan_mb_data_32;
  const uint32 * flexcan_mb_id;
  const uint32 * flexcan_mb;
  uint32 mbWord;
  uint32 databyte;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  base.17_1 = (long unsigned int) base;
  _2 = base.17_1 + 128;
  flexcan_mb = (const uint32 *) _2;
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  flexcan_mb_data_32 = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  msgData_32 = &rxFifo->data;
  # DEBUG BEGIN_STMT
  _3 = *flexcan_mb;
  _4 = _3 >> 16;
  _5 = (unsigned char) _4;
  flexcan_mb_dlc_value = _5 & 15;
  # DEBUG BEGIN_STMT
  can_real_payload = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value);
  # DEBUG BEGIN_STMT
  _6 = rxFifo != 0B;
  DevAssert (_6);
  # DEBUG BEGIN_STMT
  if (can_real_payload > 8)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  can_real_payload = 8;

  <bb 4> :
  # DEBUG BEGIN_STMT
  rxFifo->dataLen = can_real_payload;
  # DEBUG BEGIN_STMT
  _7 = *flexcan_mb;
  rxFifo->cs = _7;
  # DEBUG BEGIN_STMT
  _8 = rxFifo->cs;
  _9 = _8 & 2097152;
  if (_9 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _10 = *flexcan_mb_id;
  rxFifo->msgId = _10;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _11 = *flexcan_mb_id;
  _12 = _11 >> 18;
  rxFifo->msgId = _12;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _13 = base->RXFIR;
  _14 = (unsigned char) _13;
  rxFifo->id_hit = _14;
  # DEBUG BEGIN_STMT
  _15 = rxFifo->cs;
  _16 = _15 & 65535;
  rxFifo->time_stamp = _16;
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _17 = databyte >> 2;
  _18 = _17 * 4;
  _19 = flexcan_mb_data_32 + _18;
  mbWord = *_19;
  # DEBUG BEGIN_STMT
  _20 = mbWord >> 24;
  _21 = mbWord >> 8;
  _22 = _21 & 65280;
  _23 = _20 | _22;
  _24 = mbWord << 8;
  _25 = _24 & 16711680;
  _26 = _23 | _25;
  _27 = mbWord << 24;
  _28 = databyte >> 2;
  _29 = _28 * 4;
  _30 = msgData_32 + _29;
  _31 = _26 | _27;
  *_30 = _31;
  # DEBUG BEGIN_STMT
  databyte = databyte + 4;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _32 = (long unsigned int) can_real_payload;
  if (databyte < _32)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  return;

}


FlexCAN_SetRxFifoFilter (struct FLEXCAN_Type * base, Flexcan_Ip_RxFifoIdElementFormatType idFormat, const struct Flexcan_Ip_IdTableType * idFilterTable)
{
  volatile uint32 * filterTable;
  uint32 val;
  uint32 val2;
  uint32 val1;
  uint32 numOfFilters;
  uint32 j;
  uint32 i;
  int iftmp.16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  val1 = 0;
  val2 = 0;
  val = 0;
  # DEBUG BEGIN_STMT
  base.15_1 = (long unsigned int) base;
  _2 = base.15_1 + 224;
  filterTable = (volatile uint32 *) _2;
  # DEBUG BEGIN_STMT
  if (idFilterTable != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  if (idFormat == 3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  iftmp.16 = 0;

  <bb 6> :
  _3 = (_Bool) iftmp.16;
  DevAssert (_3);
  # DEBUG BEGIN_STMT
  _4 = base->CTRL2;
  _5 = _4 >> 24;
  numOfFilters = _5 & 15;
  # DEBUG BEGIN_STMT
  _6 = (int) idFormat;
  switch (_6) <default: <L46> [INV], case 0: <L4> [INV], case 1: <L13> [INV], case 2: <L27> [INV], case 3: <L43> [INV]>

  <bb 7> :
<L4>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _7 = base->MCR;
  _8 = _7 & 4294966527;
  base->MCR = _8;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 14>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  val = 0;
  # DEBUG BEGIN_STMT
  _9 = i * 8;
  _10 = idFilterTable + _9;
  _11 = _10->isRemoteFrame;
  if (_11 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  val = 2147483648;

  <bb 10> :
  # DEBUG BEGIN_STMT
  _12 = i * 8;
  _13 = idFilterTable + _12;
  _14 = _13->isExtendedFrame;
  if (_14 != 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  val = val | 1073741824;
  # DEBUG BEGIN_STMT
  _15 = i * 8;
  _16 = idFilterTable + _15;
  _17 = _16->id;
  _18 = _17 << 1;
  _19 = _18 & 1073741823;
  _20 = i * 4;
  _21 = filterTable + _20;
  _22 = val + _19;
  *_21 = _22;
  goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _23 = i * 8;
  _24 = idFilterTable + _23;
  _25 = _24->id;
  _26 = _25 << 19;
  _27 = _26 & 1073217536;
  _28 = i * 4;
  _29 = filterTable + _28;
  _30 = val + _27;
  *_29 = _30;

  <bb 13> :
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 14> :
  # DEBUG BEGIN_STMT
  _31 = numOfFilters + 1;
  _32 = _31 * 8;
  if (i < _32)
    goto <bb 8>; [INV]
  else
    goto <bb 44>; [INV]

  <bb 15> :
<L13>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _33 = base->MCR;
  _34 = _33 & 4294966527;
  _35 = _34 | 256;
  base->MCR = _35;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  j = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 27>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  val1 = 0;
  # DEBUG BEGIN_STMT
  val2 = 0;
  # DEBUG BEGIN_STMT
  _36 = j * 8;
  _37 = idFilterTable + _36;
  _38 = _37->isRemoteFrame;
  if (_38 != 0)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  val1 = 2147483648;

  <bb 18> :
  # DEBUG BEGIN_STMT
  _39 = j + 1;
  _40 = _39 * 8;
  _41 = idFilterTable + _40;
  _42 = _41->isRemoteFrame;
  if (_42 != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  val2 = 32768;

  <bb 20> :
  # DEBUG BEGIN_STMT
  _43 = j * 8;
  _44 = idFilterTable + _43;
  _45 = _44->isExtendedFrame;
  if (_45 != 0)
    goto <bb 21>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  val1 = val1 | 1073741824;
  # DEBUG BEGIN_STMT
  _46 = j * 8;
  _47 = idFilterTable + _46;
  _48 = _47->id;
  _49 = _48 >> 15;
  _50 = _49 << 16;
  _51 = _50 & 1073676288;
  _52 = i * 4;
  _53 = filterTable + _52;
  _54 = val1 + _51;
  *_53 = _54;
  goto <bb 23>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  _55 = j * 8;
  _56 = idFilterTable + _55;
  _57 = _56->id;
  _58 = _57 << 19;
  _59 = _58 & 1073217536;
  _60 = i * 4;
  _61 = filterTable + _60;
  _62 = val1 + _59;
  *_61 = _62;

  <bb 23> :
  # DEBUG BEGIN_STMT
  _63 = j + 1;
  _64 = _63 * 8;
  _65 = idFilterTable + _64;
  _66 = _65->isExtendedFrame;
  if (_66 != 0)
    goto <bb 24>; [INV]
  else
    goto <bb 25>; [INV]

  <bb 24> :
  # DEBUG BEGIN_STMT
  val2 = val2 | 16384;
  # DEBUG BEGIN_STMT
  _67 = i * 4;
  _68 = filterTable + _67;
  _69 = *_68;
  _70 = j + 1;
  _71 = _70 * 8;
  _72 = idFilterTable + _71;
  _73 = _72->id;
  _74 = _73 >> 15;
  _75 = _74 & 16383;
  _76 = val2 + _75;
  _77 = i * 4;
  _78 = filterTable + _77;
  _79 = _69 | _76;
  *_78 = _79;
  goto <bb 26>; [INV]

  <bb 25> :
  # DEBUG BEGIN_STMT
  _80 = i * 4;
  _81 = filterTable + _80;
  _82 = *_81;
  _83 = j + 1;
  _84 = _83 * 8;
  _85 = idFilterTable + _84;
  _86 = _85->id;
  _87 = _86 << 3;
  _88 = _87 & 16376;
  _89 = val2 + _88;
  _90 = i * 4;
  _91 = filterTable + _90;
  _92 = _82 | _89;
  *_91 = _92;

  <bb 26> :
  # DEBUG BEGIN_STMT
  j = j + 2;
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 27> :
  # DEBUG BEGIN_STMT
  _93 = numOfFilters + 1;
  _94 = _93 * 8;
  if (i < _94)
    goto <bb 16>; [INV]
  else
    goto <bb 44>; [INV]

  <bb 28> :
<L27>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _95 = base->MCR;
  _96 = _95 & 4294966527;
  _97 = _96 | 512;
  base->MCR = _97;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  j = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 42>; [INV]

  <bb 29> :
  # DEBUG BEGIN_STMT
  _98 = j * 8;
  _99 = idFilterTable + _98;
  _100 = _99->isExtendedFrame;
  if (_100 != 0)
    goto <bb 30>; [INV]
  else
    goto <bb 31>; [INV]

  <bb 30> :
  # DEBUG BEGIN_STMT
  _101 = j * 8;
  _102 = idFilterTable + _101;
  _103 = _102->id;
  _104 = _103 >> 21;
  _105 = _104 << 24;
  _106 = i * 4;
  _107 = filterTable + _106;
  _108 = val1 + _105;
  *_107 = _108;
  goto <bb 32>; [INV]

  <bb 31> :
  # DEBUG BEGIN_STMT
  _109 = j * 8;
  _110 = idFilterTable + _109;
  _111 = _110->id;
  _112 = _111 >> 3;
  _113 = _112 << 24;
  _114 = i * 4;
  _115 = filterTable + _114;
  _116 = val1 + _113;
  *_115 = _116;

  <bb 32> :
  # DEBUG BEGIN_STMT
  _117 = j + 1;
  _118 = _117 * 8;
  _119 = idFilterTable + _118;
  _120 = _119->isExtendedFrame;
  if (_120 != 0)
    goto <bb 33>; [INV]
  else
    goto <bb 34>; [INV]

  <bb 33> :
  # DEBUG BEGIN_STMT
  _121 = i * 4;
  _122 = filterTable + _121;
  _123 = *_122;
  _124 = j + 1;
  _125 = _124 * 8;
  _126 = idFilterTable + _125;
  _127 = _126->id;
  _128 = _127 >> 21;
  _129 = _128 << 16;
  _130 = _129 & 16711680;
  _131 = val1 + _130;
  _132 = i * 4;
  _133 = filterTable + _132;
  _134 = _123 | _131;
  *_133 = _134;
  goto <bb 35>; [INV]

  <bb 34> :
  # DEBUG BEGIN_STMT
  _135 = i * 4;
  _136 = filterTable + _135;
  _137 = *_136;
  _138 = j + 1;
  _139 = _138 * 8;
  _140 = idFilterTable + _139;
  _141 = _140->id;
  _142 = _141 >> 3;
  _143 = _142 << 16;
  _144 = _143 & 16711680;
  _145 = val1 + _144;
  _146 = i * 4;
  _147 = filterTable + _146;
  _148 = _137 | _145;
  *_147 = _148;

  <bb 35> :
  # DEBUG BEGIN_STMT
  _149 = j + 2;
  _150 = _149 * 8;
  _151 = idFilterTable + _150;
  _152 = _151->isExtendedFrame;
  if (_152 != 0)
    goto <bb 36>; [INV]
  else
    goto <bb 37>; [INV]

  <bb 36> :
  # DEBUG BEGIN_STMT
  _153 = i * 4;
  _154 = filterTable + _153;
  _155 = *_154;
  _156 = j + 2;
  _157 = _156 * 8;
  _158 = idFilterTable + _157;
  _159 = _158->id;
  _160 = _159 >> 21;
  _161 = _160 << 8;
  _162 = _161 & 65535;
  _163 = val1 + _162;
  _164 = i * 4;
  _165 = filterTable + _164;
  _166 = _155 | _163;
  *_165 = _166;
  goto <bb 38>; [INV]

  <bb 37> :
  # DEBUG BEGIN_STMT
  _167 = i * 4;
  _168 = filterTable + _167;
  _169 = *_168;
  _170 = j + 2;
  _171 = _170 * 8;
  _172 = idFilterTable + _171;
  _173 = _172->id;
  _174 = _173 >> 3;
  _175 = _174 << 8;
  _176 = _175 & 65535;
  _177 = val1 + _176;
  _178 = i * 4;
  _179 = filterTable + _178;
  _180 = _169 | _177;
  *_179 = _180;

  <bb 38> :
  # DEBUG BEGIN_STMT
  _181 = j + 3;
  _182 = _181 * 8;
  _183 = idFilterTable + _182;
  _184 = _183->isExtendedFrame;
  if (_184 != 0)
    goto <bb 39>; [INV]
  else
    goto <bb 40>; [INV]

  <bb 39> :
  # DEBUG BEGIN_STMT
  _185 = i * 4;
  _186 = filterTable + _185;
  _187 = *_186;
  _188 = j + 3;
  _189 = _188 * 8;
  _190 = idFilterTable + _189;
  _191 = _190->id;
  _192 = _191 >> 21;
  _193 = _192 & 255;
  _194 = val1 + _193;
  _195 = i * 4;
  _196 = filterTable + _195;
  _197 = _187 | _194;
  *_196 = _197;
  goto <bb 41>; [INV]

  <bb 40> :
  # DEBUG BEGIN_STMT
  _198 = i * 4;
  _199 = filterTable + _198;
  _200 = *_199;
  _201 = j + 3;
  _202 = _201 * 8;
  _203 = idFilterTable + _202;
  _204 = _203->id;
  _205 = _204 >> 3;
  _206 = _205 & 255;
  _207 = val1 + _206;
  _208 = i * 4;
  _209 = filterTable + _208;
  _210 = _200 | _207;
  *_209 = _210;

  <bb 41> :
  # DEBUG BEGIN_STMT
  j = j + 4;
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 42> :
  # DEBUG BEGIN_STMT
  _211 = numOfFilters + 1;
  _212 = _211 * 8;
  if (i < _212)
    goto <bb 29>; [INV]
  else
    goto <bb 44>; [INV]

  <bb 43> :
<L43>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _213 = base->MCR;
  _214 = _213 | 768;
  base->MCR = _214;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT

  <bb 44> :
<L46>:
  return;

}


FlexCAN_SetOperationMode (struct FLEXCAN_Type * base, Flexcan_Ip_ModesType mode)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) mode;
  switch (_1) <default: <L5> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  _2 = base->CTRL1;
  _3 = _2 & 4294967287;
  base->CTRL1 = _3;
  # DEBUG BEGIN_STMT
  _4 = base->CTRL1;
  _5 = _4 & 4294963199;
  base->CTRL1 = _5;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  _6 = base->CTRL1;
  _7 = _6 | 8;
  base->CTRL1 = _7;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  _8 = base->CTRL1;
  _9 = _8 | 4096;
  base->CTRL1 = _9;
  # DEBUG BEGIN_STMT
  _10 = base->CTRL1;
  _11 = _10 & 4294967287;
  base->CTRL1 = _11;
  # DEBUG BEGIN_STMT
  FlexCAN_SetSelfReception (base, 1);
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT

  <bb 6> :
<L5>:
  return;

}


FlexCAN_SetMaxMsgBuffNum (struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
{
  Flexcan_Ip_StatusType status;
  uint32 valEndRam;
  uint32 valEndMb;
  uint8 can_real_payload;
  uint8 arbitration_field_size;
  volatile uint8 * flexcan_mb_data;
  volatile uint32 * flexcan_mb_id;
  volatile uint32 * flexcan_mb;
  const uint32 * valEndMbPointer;
  const uint32 * RAM;
  uint32 databyte;
  uint8 msgBuffIdx;
  Flexcan_Ip_StatusType D.5807;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  base.11_1 = (long unsigned int) base;
  _2 = base.11_1 + 128;
  RAM = (const uint32 *) _2;
  # DEBUG BEGIN_STMT
  valEndMbPointer = 0B;
  # DEBUG BEGIN_STMT
  flexcan_mb = 0B;
  # DEBUG BEGIN_STMT
  flexcan_mb_id = 0B;
  # DEBUG BEGIN_STMT
  flexcan_mb_data = 0B;
  # DEBUG BEGIN_STMT
  arbitration_field_size = 8;
  # DEBUG BEGIN_STMT
  _3 = maxMsgBuffNum + 4294967295;
  can_real_payload = FlexCAN_GetMbPayloadSize (base, _3);
  # DEBUG BEGIN_STMT
  valEndMb = 0;
  # DEBUG BEGIN_STMT
  valEndRam = 0;
  # DEBUG BEGIN_STMT
  status = 0;
  # DEBUG BEGIN_STMT
  _4 = maxMsgBuffNum != 0;
  DevAssert (_4);
  # DEBUG BEGIN_STMT
  _5 = maxMsgBuffNum + 4294967295;
  valEndMbPointer = FlexCAN_GetMsgBuffRegion (base, _5);
  # DEBUG BEGIN_STMT
  _6 = (long unsigned int) can_real_payload;
  valEndMbPointer.12_7 = (long unsigned int) valEndMbPointer;
  _8 = _6 + valEndMbPointer.12_7;
  _9 = (long unsigned int) arbitration_field_size;
  valEndMb = _8 + _9;
  # DEBUG BEGIN_STMT
  _10 = RAM + 1536;
  valEndRam = (uint32) _10;
  # DEBUG BEGIN_STMT
  if (valEndMb > valEndRam)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  _11 = FlexCAN_GetMaxMbNum (base);
  if (maxMsgBuffNum > _11)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  status = 4;

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (status == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_11 ();
  # DEBUG BEGIN_STMT
  _12 = base->MCR;
  _13 = _12 & 4294967168;
  _14 = maxMsgBuffNum + 4294967295;
  _15 = _14 & 127;
  _16 = _13 | _15;
  base->MCR = _16;
  # DEBUG BEGIN_STMT
  _17 = base->MCR;
  _18 = _17 & 536870912;
  if (_18 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  msgBuffIdx = 0;
  goto <bb 12>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _19 = (long unsigned int) msgBuffIdx;
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, _19);
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  flexcan_mb_data = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  *flexcan_mb = 0;
  # DEBUG BEGIN_STMT
  *flexcan_mb_id = 0;
  # DEBUG BEGIN_STMT
  _20 = (long unsigned int) msgBuffIdx;
  can_real_payload = FlexCAN_GetMbPayloadSize (base, _20);
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _21 = flexcan_mb_data + databyte;
  *_21 = 0;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  _22 = (long unsigned int) can_real_payload;
  if (databyte < _22)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  msgBuffIdx.13_23 = msgBuffIdx;
  msgBuffIdx = msgBuffIdx.13_23 + 1;

  <bb 12> :
  # DEBUG BEGIN_STMT
  _24 = (long unsigned int) msgBuffIdx;
  if (maxMsgBuffNum > _24)
    goto <bb 8>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_11 ();

  <bb 14> :
  # DEBUG BEGIN_STMT
  D.5807 = status;
  return D.5807;

}


FlexCAN_SetTxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId, const uint8 * msgData, const boolean isRemote)
{
  const uint32 * msgData_32;
  volatile uint32 * flexcan_mb_data_32;
  volatile uint8 * flexcan_mb_data;
  volatile uint32 * flexcan_mb_id;
  volatile uint32 * flexcan_mb;
  uint8 payload_size;
  uint8 dlc_value;
  uint32 databyte;
  uint32 flexcan_mb_config;

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  flexcan_mb_data = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  flexcan_mb_data_32 = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  msgData_32 = msgData;
  # DEBUG BEGIN_STMT
  _1 = cs != 0B;
  DevAssert (_1);
  # DEBUG BEGIN_STMT
  *flexcan_mb = 134217728;
  # DEBUG BEGIN_STMT
  *flexcan_mb_id = 0;
  # DEBUG BEGIN_STMT
  _2 = cs->dataLen;
  _3 = (unsigned char) _2;
  _4 = FlexCAN_GetMbPayloadSize (base, msgBuffIdx);
  _5 = _3 <= _4;
  DevAssert (_5);
  # DEBUG BEGIN_STMT
  _6 = cs->dataLen;
  _7 = (unsigned char) _6;
  dlc_value = FlexCAN_ComputeDLCValue (_7);
  # DEBUG BEGIN_STMT
  if (msgData != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _8 = databyte >> 2;
  _9 = _8 * 4;
  _10 = msgData_32 + _9;
  _11 = *_10;
  _12 = _11 >> 24;
  _13 = databyte >> 2;
  _14 = _13 * 4;
  _15 = msgData_32 + _14;
  _16 = *_15;
  _17 = _16 >> 8;
  _18 = _17 & 65280;
  _19 = _12 | _18;
  _20 = databyte >> 2;
  _21 = _20 * 4;
  _22 = msgData_32 + _21;
  _23 = *_22;
  _24 = _23 << 8;
  _25 = _24 & 16711680;
  _26 = _19 | _25;
  _27 = databyte >> 2;
  _28 = _27 * 4;
  _29 = msgData_32 + _28;
  _30 = *_29;
  _31 = _30 << 24;
  _32 = databyte >> 2;
  _33 = _32 * 4;
  _34 = flexcan_mb_data_32 + _33;
  _35 = _26 | _31;
  *_34 = _35;
  # DEBUG BEGIN_STMT
  databyte = databyte + 4;

  <bb 5> :
  # DEBUG BEGIN_STMT
  _36 = cs->dataLen;
  _37 = _36 & 4294967292;
  if (databyte < _37)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _38 = msgData + databyte;
  _39 = databyte ^ 3;
  _40 = flexcan_mb_data + _39;
  _41 = *_38;
  *_40 = _41;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _42 = cs->dataLen;
  if (databyte < _42)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  payload_size = FlexCAN_ComputePayloadSize (dlc_value);
  # DEBUG BEGIN_STMT
  databyte = cs->dataLen;
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _43 = databyte ^ 3;
  _44 = flexcan_mb_data + _43;
  _45 = cs->fd_padding;
  *_44 = _45;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  _46 = (long unsigned int) payload_size;
  if (databyte < _46)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _47 = cs->msgIdType;
  if (_47 == 1)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _48 = *flexcan_mb_id;
  _49 = _48 & 3758096384;
  *flexcan_mb_id = _49;
  # DEBUG BEGIN_STMT
  _50 = *flexcan_mb_id;
  _51 = msgId & 536870911;
  _52 = _50 | _51;
  *flexcan_mb_id = _52;
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config | 6291456;

  <bb 13> :
  # DEBUG BEGIN_STMT
  _53 = cs->msgIdType;
  if (_53 == 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  _54 = *flexcan_mb_id;
  _55 = _54 & 3758358527;
  *flexcan_mb_id = _55;
  # DEBUG BEGIN_STMT
  _56 = *flexcan_mb_id;
  _57 = msgId << 18;
  _58 = _57 & 536608768;
  _59 = _56 | _58;
  *flexcan_mb_id = _59;
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config & 4288675839;

  <bb 15> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config & 4293984255;
  # DEBUG BEGIN_STMT
  _60 = (long unsigned int) dlc_value;
  _61 = _60 << 16;
  _62 = _61 & 983040;
  flexcan_mb_config = flexcan_mb_config | _62;
  # DEBUG BEGIN_STMT
  _63 = cs->code;
  if (_63 != 15)
    goto <bb 16>; [INV]
  else
    goto <bb 26>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  _64 = cs->code;
  if (_64 == 28)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config | 1048576;
  goto <bb 20>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  if (isRemote != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config | 1048576;

  <bb 20> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config & 4043309055;
  # DEBUG BEGIN_STMT
  _65 = cs->fd_enable;
  if (_65 != 0)
    goto <bb 21>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  _66 = cs->code;
  _67 = _66 << 24;
  _68 = _67 & 251658240;
  _69 = flexcan_mb_config | _68;
  flexcan_mb_config = _69 | 2147483648;
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config & 4293918719;
  goto <bb 23>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  _70 = cs->code;
  _71 = _70 << 24;
  _72 = _71 & 251658240;
  flexcan_mb_config = flexcan_mb_config | _72;

  <bb 23> :
  # DEBUG BEGIN_STMT
  _73 = cs->enable_brs;
  if (_73 != 0)
    goto <bb 24>; [INV]
  else
    goto <bb 25>; [INV]

  <bb 24> :
  # DEBUG BEGIN_STMT
  flexcan_mb_config = flexcan_mb_config | 1073741824;

  <bb 25> :
  # DEBUG BEGIN_STMT
  _74 = *flexcan_mb;
  _75 = flexcan_mb_config | _74;
  *flexcan_mb = _75;

  <bb 26> :
  return;

}


FlexCAN_GetMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, struct Flexcan_Ip_MsgBuffType * msgBuff)
{
  uint8 payload_size;
  uint8 flexcan_mb_dlc_value;
  uint32 mbWord;
  uint32 * msgBuff_data_32;
  const uint32 * flexcan_mb_data_32;
  const uint8 * flexcan_mb_data;
  const uint32 * flexcan_mb_id;
  const uint32 * flexcan_mb;
  uint8 i;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  flexcan_mb_data = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  flexcan_mb_data_32 = flexcan_mb + 8;
  # DEBUG BEGIN_STMT
  msgBuff_data_32 = &msgBuff->data;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = *flexcan_mb;
  _2 = _1 >> 16;
  _3 = (unsigned char) _2;
  flexcan_mb_dlc_value = _3 & 15;
  # DEBUG BEGIN_STMT
  payload_size = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value);
  # DEBUG BEGIN_STMT
  _4 = msgBuff != 0B;
  DevAssert (_4);
  # DEBUG BEGIN_STMT
  _5 = FlexCAN_GetMbPayloadSize (base, msgBuffIdx);
  if (payload_size > _5)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  payload_size = FlexCAN_GetMbPayloadSize (base, msgBuffIdx);

  <bb 4> :
  # DEBUG BEGIN_STMT
  msgBuff->dataLen = payload_size;
  # DEBUG BEGIN_STMT
  _6 = *flexcan_mb;
  msgBuff->cs = _6;
  # DEBUG BEGIN_STMT
  _7 = msgBuff->cs;
  _8 = _7 & 2097152;
  if (_8 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _9 = *flexcan_mb_id;
  msgBuff->msgId = _9;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _10 = *flexcan_mb_id;
  _11 = _10 >> 18;
  msgBuff->msgId = _11;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _12 = msgBuff->cs;
  _13 = _12 & 65535;
  msgBuff->time_stamp = _13;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _14 = i >> 2;
  _15 = (unsigned int) _14;
  _16 = _15 * 4;
  _17 = flexcan_mb_data_32 + _16;
  mbWord = *_17;
  # DEBUG BEGIN_STMT
  _18 = mbWord >> 24;
  _19 = mbWord >> 8;
  _20 = _19 & 65280;
  _21 = _18 | _20;
  _22 = mbWord << 8;
  _23 = _22 & 16711680;
  _24 = _21 | _23;
  _25 = mbWord << 24;
  _26 = i >> 2;
  _27 = (unsigned int) _26;
  _28 = _27 * 4;
  _29 = msgBuff_data_32 + _28;
  _30 = _24 | _25;
  *_29 = _30;
  # DEBUG BEGIN_STMT
  i = i + 4;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _31 = (unsigned int) i;
  _32 = (unsigned int) payload_size;
  _33 = _32 & 4294967292;
  if (_31 < _33)
    goto <bb 8>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _34 = i ^ 3;
  _35 = (sizetype) _34;
  _36 = flexcan_mb_data + _35;
  _37 = (int) i;
  _38 = *_36;
  msgBuff->data[_37] = _38;
  # DEBUG BEGIN_STMT
  i.10_39 = i;
  i = i.10_39 + 1;

  <bb 11> :
  # DEBUG BEGIN_STMT
  if (i < payload_size)
    goto <bb 10>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  return;

}


FlexCAN_GetMsgBuffTimestamp (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  const uint32 * flexcan_mb;
  uint32 timestamp;
  uint32 D.5770;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timestamp = 0;
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  _1 = *flexcan_mb;
  timestamp = _1 & 65535;
  # DEBUG BEGIN_STMT
  D.5770 = timestamp;
  return D.5770;

}


FlexCAN_SetRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId)
{
  volatile uint32 * flexcan_mb_id;
  volatile uint32 * flexcan_mb;

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  flexcan_mb_id = flexcan_mb + 4;
  # DEBUG BEGIN_STMT
  _1 = cs != 0B;
  DevAssert (_1);
  # DEBUG BEGIN_STMT
  *flexcan_mb = 0;
  # DEBUG BEGIN_STMT
  *flexcan_mb_id = 0;
  # DEBUG BEGIN_STMT
  _2 = cs->msgIdType;
  if (_2 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = *flexcan_mb;
  _4 = _3 | 2097152;
  *flexcan_mb = _4;
  # DEBUG BEGIN_STMT
  _5 = *flexcan_mb;
  _6 = _5 & 4290772991;
  *flexcan_mb = _6;
  # DEBUG BEGIN_STMT
  _7 = *flexcan_mb_id;
  _8 = _7 & 3758096384;
  *flexcan_mb_id = _8;
  # DEBUG BEGIN_STMT
  _9 = *flexcan_mb_id;
  _10 = msgId & 536870911;
  _11 = _9 | _10;
  *flexcan_mb_id = _11;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _12 = cs->msgIdType;
  if (_12 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _13 = *flexcan_mb;
  _14 = _13 & 4288675839;
  *flexcan_mb = _14;
  # DEBUG BEGIN_STMT
  _15 = *flexcan_mb_id;
  _16 = _15 & 3758358527;
  *flexcan_mb_id = _16;
  # DEBUG BEGIN_STMT
  _17 = *flexcan_mb_id;
  _18 = msgId << 18;
  _19 = _18 & 536608768;
  _20 = _17 | _19;
  *flexcan_mb_id = _20;

  <bb 6> :
  # DEBUG BEGIN_STMT
  _21 = cs->code;
  if (_21 != 15)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _22 = *flexcan_mb;
  _23 = _22 & 4043309055;
  *flexcan_mb = _23;
  # DEBUG BEGIN_STMT
  _24 = *flexcan_mb;
  _25 = cs->code;
  _26 = _25 << 24;
  _27 = _26 & 251658240;
  _28 = _24 | _27;
  *flexcan_mb = _28;

  <bb 8> :
  return;

}


FlexCAN_EnableInterrupts (struct FLEXCAN_Type * pBase, uint8 u8Instance)
{
  uint32 u32MaxMbCrtlNum;

  <bb 2> :
  # DEBUG BEGIN_STMT
  u32MaxMbCrtlNum = FlexCAN_GetMaxMbNum (pBase);
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance;
  _2 = g_FlexCAN_u32ImaskBuff[_1][0];
  pBase->IMASK1 = _2;
  # DEBUG BEGIN_STMT
  if (u32MaxMbCrtlNum > 32)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _3 = (int) u8Instance;
  _4 = g_FlexCAN_u32ImaskBuff[_3][1];
  pBase->IMASK2 = _4;

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (u32MaxMbCrtlNum > 64)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _5 = (int) u8Instance;
  _6 = g_FlexCAN_u32ImaskBuff[_5][2];
  pBase->IMASK3 = _6;

  <bb 6> :
  return;

}


FlexCAN_DisableInterrupts (struct FLEXCAN_Type * pBase)
{
  uint32 u32MaxMbCrtlNum;

  <bb 2> :
  # DEBUG BEGIN_STMT
  u32MaxMbCrtlNum = FlexCAN_GetMaxMbNum (pBase);
  # DEBUG BEGIN_STMT
  pBase->IMASK1 = 0;
  # DEBUG BEGIN_STMT
  if (u32MaxMbCrtlNum > 32)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  pBase->IMASK2 = 0;

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (u32MaxMbCrtlNum > 64)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  pBase->IMASK3 = 0;

  <bb 6> :
  return;

}


FLEXCAN_ClearMsgBuffIntCmd (struct FLEXCAN_Type * pBase, uint8 u8Instance, uint32 mb_idx, boolean bIsIntActive)
{
  uint32 temp;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = mb_idx & 31;
  temp = 1 << _1;
  # DEBUG BEGIN_STMT
  if (mb_idx <= 31)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _2 = pBase->IMASK1;
  _3 = ~temp;
  _4 = (int) u8Instance;
  _5 = _2 & _3;
  g_FlexCAN_u32ImaskBuff[_4][0] = _5;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _6 = (int) u8Instance;
  _7 = g_FlexCAN_u32ImaskBuff[_6][0];
  pBase->IMASK1 = _7;

  <bb 5> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 6> :
  # DEBUG BEGIN_STMT
  _8 = mb_idx + 4294967264;
  if (_8 <= 31)
    goto <bb 7>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _9 = pBase->IMASK2;
  _10 = ~temp;
  _11 = (int) u8Instance;
  _12 = _9 & _10;
  g_FlexCAN_u32ImaskBuff[_11][1] = _12;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _13 = (int) u8Instance;
  _14 = g_FlexCAN_u32ImaskBuff[_13][1];
  pBase->IMASK2 = _14;

  <bb 9> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 10> :
  # DEBUG BEGIN_STMT
  _15 = mb_idx + 4294967232;
  if (_15 <= 31)
    goto <bb 11>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _16 = pBase->IMASK3;
  _17 = ~temp;
  _18 = (int) u8Instance;
  _19 = _16 & _17;
  g_FlexCAN_u32ImaskBuff[_18][2] = _19;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _20 = (int) u8Instance;
  _21 = g_FlexCAN_u32ImaskBuff[_20][2];
  pBase->IMASK3 = _21;

  <bb 13> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 14> :
  return;

}


FlexCAN_SetMsgBuffIntCmd (struct FLEXCAN_Type * base, uint8 u8Instance, uint32 msgBuffIdx, boolean enable, boolean bIsIntActive)
{
  Flexcan_Ip_StatusType stat;
  uint32 temp;
  Flexcan_Ip_StatusType D.5742;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  stat = 0;
  # DEBUG BEGIN_STMT
  _1 = msgBuffIdx & 31;
  temp = 1 << _1;
  # DEBUG BEGIN_STMT
  if (msgBuffIdx <= 31)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  if (enable != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _2 = (int) u8Instance;
  _3 = g_FlexCAN_u32ImaskBuff[_2][0];
  _4 = (int) u8Instance;
  _5 = temp | _3;
  g_FlexCAN_u32ImaskBuff[_4][0] = _5;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _6 = (int) u8Instance;
  _7 = g_FlexCAN_u32ImaskBuff[_6][0];
  base->IMASK1 = _7;

  <bb 6> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _8 = (int) u8Instance;
  _9 = g_FlexCAN_u32ImaskBuff[_8][0];
  _10 = ~temp;
  _11 = (int) u8Instance;
  _12 = _9 & _10;
  g_FlexCAN_u32ImaskBuff[_11][0] = _12;
  # DEBUG BEGIN_STMT
  _13 = (int) u8Instance;
  _14 = g_FlexCAN_u32ImaskBuff[_13][0];
  base->IMASK1 = _14;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 8> :
  # DEBUG BEGIN_STMT
  _15 = msgBuffIdx + 4294967264;
  if (_15 <= 31)
    goto <bb 9>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (enable != 0)
    goto <bb 10>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _16 = (int) u8Instance;
  _17 = g_FlexCAN_u32ImaskBuff[_16][1];
  _18 = (int) u8Instance;
  _19 = temp | _17;
  g_FlexCAN_u32ImaskBuff[_18][1] = _19;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 11>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _20 = (int) u8Instance;
  _21 = g_FlexCAN_u32ImaskBuff[_20][1];
  base->IMASK2 = _21;

  <bb 12> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
  goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _22 = (int) u8Instance;
  _23 = g_FlexCAN_u32ImaskBuff[_22][1];
  _24 = ~temp;
  _25 = (int) u8Instance;
  _26 = _23 & _24;
  g_FlexCAN_u32ImaskBuff[_25][1] = _26;
  # DEBUG BEGIN_STMT
  _27 = (int) u8Instance;
  _28 = g_FlexCAN_u32ImaskBuff[_27][1];
  base->IMASK2 = _28;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 14> :
  # DEBUG BEGIN_STMT
  _29 = msgBuffIdx + 4294967232;
  if (_29 <= 31)
    goto <bb 15>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  if (enable != 0)
    goto <bb 16>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _30 = (int) u8Instance;
  _31 = g_FlexCAN_u32ImaskBuff[_30][2];
  _32 = (int) u8Instance;
  _33 = temp | _31;
  g_FlexCAN_u32ImaskBuff[_32][2] = _33;
  # DEBUG BEGIN_STMT
  if (bIsIntActive != 0)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  _34 = (int) u8Instance;
  _35 = g_FlexCAN_u32ImaskBuff[_34][2];
  base->IMASK3 = _35;

  <bb 18> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();
  goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 ();
  # DEBUG BEGIN_STMT
  _36 = (int) u8Instance;
  _37 = g_FlexCAN_u32ImaskBuff[_36][2];
  _38 = ~temp;
  _39 = (int) u8Instance;
  _40 = _37 & _38;
  g_FlexCAN_u32ImaskBuff[_39][2] = _40;
  # DEBUG BEGIN_STMT
  _41 = (int) u8Instance;
  _42 = g_FlexCAN_u32ImaskBuff[_41][2];
  base->IMASK3 = _42;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 20> :
  # DEBUG BEGIN_STMT
  D.5742 = stat;
  return D.5742;

}


FlexCAN_LockRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  const uint32 * flexcan_mb;
  long unsigned int vol.9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb = FlexCAN_GetMsgBuffRegion (base, msgBuffIdx);
  # DEBUG BEGIN_STMT
  vol.9 = *flexcan_mb;
  return;

}


FlexCAN_GetMbPayloadSize (const struct FLEXCAN_Type * base, uint32 maxMsgBuffNum)
{
  uint8 mb_size;
  uint8 i;
  uint8 maxMbBlockNum;
  uint8 can_real_payload;
  uint32 ramBlockSize;
  uint8 arbitration_field_size;
  uint8 D.5718;

  <bb 2> :
  # DEBUG BEGIN_STMT
  arbitration_field_size = 8;
  # DEBUG BEGIN_STMT
  ramBlockSize = 512;
  # DEBUG BEGIN_STMT
  can_real_payload = 8;
  # DEBUG BEGIN_STMT
  maxMbBlockNum = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  mb_size = 0;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  can_real_payload = FlexCAN_GetPayloadSize (base, i);
  # DEBUG BEGIN_STMT
  mb_size = can_real_payload + arbitration_field_size;
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) mb_size;
  _2 = ramBlockSize / _1;
  _3 = (unsigned char) _2;
  maxMbBlockNum = maxMbBlockNum + _3;
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) maxMbBlockNum;
  if (maxMsgBuffNum < _4)
    goto <bb 6>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  i.8_5 = i;
  i = i.8_5 + 1;

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (i <= 2)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  D.5718 = can_real_payload;
  return D.5718;

}


FlexCAN_GetPayloadSize (const struct FLEXCAN_Type * base, uint8 mbdsrIdx)
{
  uint32 payloadSize;
  uint8 D.5715;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) mbdsrIdx;
  switch (_1) <default: <L3> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  _2 = base->FDCTRL;
  _3 = _2 >> 16;
  _4 = _3 & 3;
  payloadSize = 8 << _4;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _5 = base->FDCTRL;
  _6 = _5 >> 19;
  _7 = _6 & 3;
  payloadSize = 8 << _7;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  _8 = base->FDCTRL;
  _9 = _8 >> 22;
  _10 = _9 & 3;
  payloadSize = 8 << _10;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 6> :
<L3>:
  # DEBUG BEGIN_STMT
  _11 = base->FDCTRL;
  _12 = _11 >> 16;
  _13 = _12 & 3;
  payloadSize = 8 << _13;
  # DEBUG BEGIN_STMT

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.5715 = (uint8) payloadSize;
  return D.5715;

}


FlexCAN_SetPayloadSize (struct FLEXCAN_Type * base, const struct Flexcan_Ip_PayloadSizeType * payloadSize)
{
  uint32 tmp;
  int iftmp.6;
  int iftmp.5;
  int iftmp.4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_IsFDEnabled (base);
  if (_1 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  _2 = payloadSize->payloadBlock0;
  if (_2 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  iftmp.4 = 0;

  <bb 6> :
  _3 = (_Bool) iftmp.4;
  DevAssert (_3);
  # DEBUG BEGIN_STMT
  _4 = FlexCAN_IsFDEnabled (base);
  if (_4 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  _5 = payloadSize->payloadBlock1;
  if (_5 == 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

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

  <bb 9> :
  iftmp.5 = 0;

  <bb 10> :
  _6 = (_Bool) iftmp.5;
  DevAssert (_6);
  # DEBUG BEGIN_STMT
  _7 = FlexCAN_IsFDEnabled (base);
  if (_7 != 0)
    goto <bb 12>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  _8 = payloadSize->payloadBlock2;
  if (_8 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  iftmp.6 = 1;
  goto <bb 14>; [INV]

  <bb 13> :
  iftmp.6 = 0;

  <bb 14> :
  _9 = (_Bool) iftmp.6;
  DevAssert (_9);
  # DEBUG BEGIN_STMT
  _10 = FlexCAN_IsFDEnabled (base);
  if (_10 != 0)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_09 ();
  # DEBUG BEGIN_STMT
  tmp = base->FDCTRL;
  # DEBUG BEGIN_STMT
  tmp = tmp & 4294770687;
  # DEBUG BEGIN_STMT
  _11 = payloadSize->payloadBlock0;
  _12 = (long unsigned int) _11;
  _13 = _12 << 16;
  tmp = tmp | _13;
  # DEBUG BEGIN_STMT
  tmp = tmp & 4293394431;
  # DEBUG BEGIN_STMT
  _14 = payloadSize->payloadBlock1;
  _15 = (long unsigned int) _14;
  _16 = _15 << 19;
  tmp = tmp | _16;
  # DEBUG BEGIN_STMT
  tmp = tmp & 4282384383;
  # DEBUG BEGIN_STMT
  _17 = payloadSize->payloadBlock2;
  _18 = (long unsigned int) _17;
  _19 = _18 << 22;
  tmp = tmp | _19;
  # DEBUG BEGIN_STMT
  base->FDCTRL = tmp;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_09 ();

  <bb 16> :
  return;

}


FlexCAN_EnableRxFifo (struct FLEXCAN_Type * base, uint32 numOfFilters)
{
  Flexcan_Ip_StatusType stat;
  uint16 noOfMbx;
  uint32 i;
  Flexcan_Ip_StatusType D.5691;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_GetMaxMbNum (base);
  noOfMbx = (uint16) _1;
  # DEBUG BEGIN_STMT
  stat = 0;
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = _2 & 2048;
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  stat = 1;

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (stat == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_08 ();
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 | 536870912;
  base->MCR = _5;
  # DEBUG BEGIN_STMT
  _6 = base->CTRL2;
  _7 = _6 & 4043309055;
  _8 = numOfFilters << 24;
  _9 = _8 & 251658240;
  _10 = _7 | _9;
  base->CTRL2 = _10;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_08 ();
  # DEBUG BEGIN_STMT
  base->RXFGMASK = 4294967295;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  base->RXIMR[i] = 536870911;
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _11 = (long unsigned int) noOfMbx;
  if (i < _11)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.5691 = stat;
  return D.5691;

}


FlexCAN_Init (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnResult;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType D.5684;
  long unsigned int D.5675;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = OsIf_GetCounter (0);
  timeStart = _1;
  # DEBUG BEGIN_STMT
  timeElapsed = 0;
  # DEBUG BEGIN_STMT
  uS2Ticks = OsIf_MicrosToTicks (100, 0);
  # DEBUG BEGIN_STMT
  returnResult = 0;
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = _2 | 33554432;
  base->MCR = _3;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  D.5675 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed = D.5675 + timeElapsed;
  # DEBUG BEGIN_STMT
  if (timeElapsed >= uS2Ticks)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  returnResult = 3;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 & 33554432;
  if (_5 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  if (returnResult == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  _6 = base->MCR;
  _7 = _6 | 4096;
  base->MCR = _7;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  FlexCAN_ClearRAM (base);
  # DEBUG BEGIN_STMT
  base->RXMGMASK = 4294967295;
  # DEBUG BEGIN_STMT
  base->RX14MASK = 4294967295;
  # DEBUG BEGIN_STMT
  base->RX15MASK = 4294967295;
  # DEBUG BEGIN_STMT
  base->IMASK1 = 0;
  # DEBUG BEGIN_STMT
  base->IFLAG1 = 4294967295;
  # DEBUG BEGIN_STMT
  _8 = FlexCAN_GetMaxMbNum (base);
  if (_8 > 32)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  base->IMASK2 = 0;
  # DEBUG BEGIN_STMT
  base->IFLAG2 = 4294967295;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _9 = FlexCAN_GetMaxMbNum (base);
  if (_9 > 64)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  base->IMASK3 = 0;
  # DEBUG BEGIN_STMT
  base->IFLAG3 = 4294967295;

  <bb 11> :
  # DEBUG BEGIN_STMT
  base->ESR1 = 3866630;
  # DEBUG BEGIN_STMT
  base->CTRL1 = 0;
  # DEBUG BEGIN_STMT
  base->CTRL2 = 1048576;
  # DEBUG BEGIN_STMT
  base->CBT = 0;
  # DEBUG BEGIN_STMT
  base->EPRS = 0;
  # DEBUG BEGIN_STMT
  base->ENCBT = 0;
  # DEBUG BEGIN_STMT
  base->EDCBT = 0;
  # DEBUG BEGIN_STMT
  base->ETDC = 0;
  # DEBUG BEGIN_STMT
  base->FDCBT = 0;
  # DEBUG BEGIN_STMT
  base->FDCTRL = 2147500288;

  <bb 12> :
  # DEBUG BEGIN_STMT
  D.5684 = returnResult;
  timeStart = {CLOBBER};
  return D.5684;

}


FlexCAN_SetErrIntCmd (struct FLEXCAN_Type * base, flexcan_int_type_t errType, boolean enable)
{
  uint32 temp;

  <bb 2> :
  # DEBUG BEGIN_STMT
  temp = (uint32) errType;
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_06 ();
  # DEBUG BEGIN_STMT
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  if (errType == 16385)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL2;
  _2 = _1 | 2147483648;
  base->CTRL2 = _2;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (errType == 1024)
    goto <bb 7>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  if (errType == 2048)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _3 = base->MCR;
  _4 = _3 | 2097152;
  base->MCR = _4;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _5 = base->CTRL1;
  _6 = temp | _5;
  base->CTRL1 = _6;
  goto <bb 13>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  if (errType == 16385)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _7 = base->CTRL2;
  _8 = _7 & 2147483647;
  base->CTRL2 = _8;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _9 = base->CTRL1;
  _10 = ~temp;
  _11 = _9 & _10;
  base->CTRL1 = _11;
  # DEBUG BEGIN_STMT
  temp = base->CTRL1;
  # DEBUG BEGIN_STMT
  _12 = temp & 3072;
  if (_12 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _13 = base->MCR;
  _14 = _13 & 4292870143;
  base->MCR = _14;

  <bb 13> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_06 ();
  return;

}


FlexCAN_Disable (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnResult;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType D.5658;
  long unsigned int D.5655;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = OsIf_GetCounter (0);
  timeStart = _1;
  # DEBUG BEGIN_STMT
  timeElapsed = 0;
  # DEBUG BEGIN_STMT
  uS2Ticks = OsIf_MicrosToTicks (100, 0);
  # DEBUG BEGIN_STMT
  returnResult = 0;
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = (signed int) _2;
  if (_3 >= 0)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_05 ();
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 | 2147483648;
  base->MCR = _5;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_05 ();
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  D.5655 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed = D.5655 + timeElapsed;
  # DEBUG BEGIN_STMT
  if (timeElapsed >= uS2Ticks)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  returnResult = 3;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _6 = base->MCR;
  _7 = _6 & 1048576;
  if (_7 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.5658 = returnResult;
  timeStart = {CLOBBER};
  return D.5658;

}


FlexCAN_ExitFreezeMode (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnValue;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType D.5650;
  long unsigned int D.5647;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = OsIf_GetCounter (0);
  timeStart = _1;
  # DEBUG BEGIN_STMT
  timeElapsed = 0;
  # DEBUG BEGIN_STMT
  uS2Ticks = OsIf_MicrosToTicks (100, 0);
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_04 ();
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = _2 & 4026531839;
  base->MCR = _3;
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 & 3221225471;
  base->MCR = _5;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_04 ();
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  D.5647 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed = D.5647 + timeElapsed;
  # DEBUG BEGIN_STMT
  if (timeElapsed >= uS2Ticks)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  returnValue = 3;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _6 = base->MCR;
  _7 = _6 & 16777216;
  if (_7 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  D.5650 = returnValue;
  timeStart = {CLOBBER};
  return D.5650;

}


FlexCAN_Enable (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnValue;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType D.5644;
  long unsigned int D.5641;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = OsIf_GetCounter (0);
  timeStart = _1;
  # DEBUG BEGIN_STMT
  timeElapsed = 0;
  # DEBUG BEGIN_STMT
  uS2Ticks = OsIf_MicrosToTicks (100, 0);
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_03 ();
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = _2 & 2147483647;
  base->MCR = _3;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_03 ();
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  D.5641 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed = D.5641 + timeElapsed;
  # DEBUG BEGIN_STMT
  if (timeElapsed >= uS2Ticks)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  returnValue = 3;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 & 16777216;
  if (_5 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  D.5644 = returnValue;
  timeStart = {CLOBBER};
  return D.5644;

}


FlexCAN_EnterFreezeMode (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnResult;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType D.5638;
  long unsigned int D.5635;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = OsIf_GetCounter (0);
  timeStart = _1;
  # DEBUG BEGIN_STMT
  timeElapsed = 0;
  # DEBUG BEGIN_STMT
  uS2Ticks = OsIf_MicrosToTicks (100, 0);
  # DEBUG BEGIN_STMT
  returnResult = 0;
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_02 ();
  # DEBUG BEGIN_STMT
  _2 = base->MCR;
  _3 = _2 | 1073741824;
  base->MCR = _3;
  # DEBUG BEGIN_STMT
  _4 = base->MCR;
  _5 = _4 | 268435456;
  base->MCR = _5;
  # DEBUG BEGIN_STMT
  _6 = base->MCR;
  _7 = (signed int) _6;
  if (_7 < 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _8 = base->MCR;
  _9 = _8 & 2147483647;
  base->MCR = _9;

  <bb 4> :
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_02 ();
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  goto <bb 7>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.5635 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed = D.5635 + timeElapsed;
  # DEBUG BEGIN_STMT
  if (timeElapsed >= uS2Ticks)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  returnResult = 3;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _10 = base->MCR;
  _11 = _10 & 16777216;
  if (_11 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  D.5638 = returnResult;
  timeStart = {CLOBBER};
  return D.5638;

}


FlexCAN_GetMaxMbNum (const struct FLEXCAN_Type * base)
{
  static const uint32 maxMbNum[6] = {96, 64, 64, 32, 32, 32};
  static struct FLEXCAN_Type * const flexcanBase[6] = {1076903936B, 1076920320B, 1076936704B, 1076953088B, 1076969472B, 1076985856B};
  uint32 ret;
  uint32 i;
  uint32 D.5631;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 0;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = flexcanBase[i];
  if (base == _1)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ret = maxMbNum[i];

  <bb 5> :
  # DEBUG BEGIN_STMT
  i = i + 1;

  <bb 6> :
  # DEBUG BEGIN_STMT
  if (i <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  D.5631 = ret;
  return D.5631;

}


FlexCAN_GetMsgBuffRegion (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  volatile uint32 * pAddressRet;
  volatile uint32 * RAM;
  uint8 payload_size;
  uint32 mb_index;
  uint8 maxMbNum;
  uint8 i;
  uint32 msgBuffIdxBackup;
  uint32 ramBlockOffset;
  uint32 ramBlockSize;
  uint8 mb_size;
  uint8 arbitration_field_size;
  volatile uint32 * D.5627;

  <bb 2> :
  # DEBUG BEGIN_STMT
  arbitration_field_size = 8;
  # DEBUG BEGIN_STMT
  mb_size = 0;
  # DEBUG BEGIN_STMT
  ramBlockSize = 512;
  # DEBUG BEGIN_STMT
  ramBlockOffset = 0;
  # DEBUG BEGIN_STMT
  msgBuffIdxBackup = msgBuffIdx;
  # DEBUG BEGIN_STMT
  i = 0;
  # DEBUG BEGIN_STMT
  maxMbNum = 0;
  # DEBUG BEGIN_STMT
  mb_index = 0;
  # DEBUG BEGIN_STMT
  payload_size = 0;
  # DEBUG BEGIN_STMT
  base.0_1 = (long unsigned int) base;
  _2 = base.0_1 + 128;
  RAM = (volatile uint32 *) _2;
  # DEBUG BEGIN_STMT
  pAddressRet = 0B;
  # DEBUG BEGIN_STMT
  i = 0;
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  payload_size = FlexCAN_GetPayloadSize (base, i);
  # DEBUG BEGIN_STMT
  mb_size = payload_size + arbitration_field_size;
  # DEBUG BEGIN_STMT
  _3 = (long unsigned int) mb_size;
  _4 = ramBlockSize / _3;
  maxMbNum = (uint8) _4;
  # DEBUG BEGIN_STMT
  _5 = (long unsigned int) maxMbNum;
  if (msgBuffIdxBackup < _5)
    goto <bb 6>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ramBlockOffset = ramBlockOffset + 128;
  # DEBUG BEGIN_STMT
  _6 = (long unsigned int) maxMbNum;
  msgBuffIdxBackup = msgBuffIdxBackup - _6;
  # DEBUG BEGIN_STMT
  i.1_7 = i;
  i = i.1_7 + 1;

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (i <= 2)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _8 = (long unsigned int) maxMbNum;
  _9 = msgBuffIdxBackup % _8;
  _10 = mb_size >> 2;
  _11 = (long unsigned int) _10;
  _12 = _9 * _11;
  mb_index = ramBlockOffset + _12;
  # DEBUG BEGIN_STMT
  _13 = mb_index * 4;
  pAddressRet = RAM + _13;
  # DEBUG BEGIN_STMT
  D.5627 = pAddressRet;
  return D.5627;

}


FlexCAN_ComputePayloadSize (uint8 dlcValue)
{
  uint8 ret;
  uint8 D.5623;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 8;
  # DEBUG BEGIN_STMT
  if (dlcValue <= 8)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  ret = dlcValue;
  goto <bb 12>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = (int) dlcValue;
  switch (_1) <default: <L13> [INV], case 9: <L2> [INV], case 10: <L3> [INV], case 11: <L4> [INV], case 12: <L5> [INV], case 13: <L6> [INV], case 14: <L7> [INV], case 15: <L8> [INV]>

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  ret = 12;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 6> :
<L3>:
  # DEBUG BEGIN_STMT
  ret = 16;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 7> :
<L4>:
  # DEBUG BEGIN_STMT
  ret = 20;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 8> :
<L5>:
  # DEBUG BEGIN_STMT
  ret = 24;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 9> :
<L6>:
  # DEBUG BEGIN_STMT
  ret = 32;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 10> :
<L7>:
  # DEBUG BEGIN_STMT
  ret = 48;
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

  <bb 11> :
<L8>:
  # DEBUG BEGIN_STMT
  ret = 64;
  # DEBUG BEGIN_STMT

  <bb 12> :
<L13>:
  # DEBUG BEGIN_STMT
  D.5623 = ret;
  return D.5623;

}


FlexCAN_ClearRAM (struct FLEXCAN_Type * base)
{
  volatile uint32 * RAM;
  uint32 RXIMR_size;
  uint32 RAM_size;
  uint32 ram_addr;
  uint32 databyte;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_GetMaxMbNum (base);
  RAM_size = _1 * 4;
  # DEBUG BEGIN_STMT
  RXIMR_size = FlexCAN_GetMaxMbNum (base);
  # DEBUG BEGIN_STMT
  base.2_2 = (long unsigned int) base;
  _3 = base.2_2 + 128;
  RAM = (volatile uint32 *) _3;
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _4 = databyte * 4;
  _5 = RAM + _4;
  *_5 = 0;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (databyte < RAM_size)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  RAM = &base->RXIMR;
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _6 = databyte * 4;
  _7 = RAM + _6;
  *_7 = 0;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 7> :
  # DEBUG BEGIN_STMT
  if (databyte < RXIMR_size)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_01 ();
  # DEBUG BEGIN_STMT
  _8 = base->CTRL2;
  _9 = _8 | 268435456;
  base->CTRL2 = _9;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_01 ();
  # DEBUG BEGIN_STMT
  base.3_10 = (long unsigned int) base;
  ram_addr = base.3_10 + 128;
  # DEBUG BEGIN_STMT
  RAM = (volatile uint32 *) ram_addr;
  # DEBUG BEGIN_STMT
  base->RXMGMASK = 0;
  # DEBUG BEGIN_STMT
  base->RXFGMASK = 0;
  # DEBUG BEGIN_STMT
  base->RX14MASK = 0;
  # DEBUG BEGIN_STMT
  base->RX15MASK = 0;
  # DEBUG BEGIN_STMT
  databyte = 0;
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _11 = databyte * 4;
  _12 = RAM + _11;
  *_12 = 0;
  # DEBUG BEGIN_STMT
  databyte = databyte + 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  if (databyte == 0)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_01 ();
  # DEBUG BEGIN_STMT
  _13 = base->CTRL2;
  _14 = _13 & 4026531839;
  base->CTRL2 = _14;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_01 ();
  return;

}


FlexCAN_ComputeDLCValue (uint8 payloadSize)
{
  static const uint8 payload_code[65] = "\x00\x01\x02\x03\x04\x05\x06\x07\b\t\t\t\t\n\n\n\n\v\v\v\v\f\f\f\f\r\r\r\r\r\r\r\r\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f";
  uint32 ret;
  uint8 D.5798;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret = 255;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (payloadSize <= 64)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = (int) payloadSize;
  _2 = payload_code[_1];
  ret = (uint32) _2;

  <bb 4> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.5798 = (uint8) ret;
  return D.5798;

}


FlexCAN_CanBitSampling (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.23;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL1;
  _2 = _1 & 4294967167;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.23 = 128;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.23 = 0;

  <bb 5> :
  _3 = iftmp.23 | _2;
  base->CTRL1 = _3;
  return;

}


FlexCAN_SetEdgeFilter (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.25;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL2;
  _2 = _1 & 4294965247;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.25 = 0;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.25 = 2048;

  <bb 5> :
  _3 = iftmp.25 | _2;
  base->CTRL2 = _3;
  return;

}


FlexCAN_SetBusOffAutorecovery (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.24;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL1;
  _2 = _1 & 4294967231;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.24 = 0;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.24 = 64;

  <bb 5> :
  _3 = iftmp.24 | _2;
  base->CTRL1 = _3;
  return;

}


FlexCAN_SetProtocolException (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL2;
  _2 = _1 & 4294950911;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.22 = 16384;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.22 = 0;

  <bb 5> :
  _3 = iftmp.22 | _2;
  base->CTRL2 = _3;
  return;

}


FlexCAN_SetEntireFrameArbitrationFieldComparison (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.21;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL2;
  _2 = _1 & 4294901759;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.21 = 65536;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.21 = 0;

  <bb 5> :
  _3 = iftmp.21 | _2;
  base->CTRL2 = _3;
  return;

}


FlexCAN_SetIsoCan (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->CTRL2;
  _2 = _1 & 4294963199;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.20 = 4096;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.20 = 0;

  <bb 5> :
  _3 = iftmp.20 | _2;
  base->CTRL2 = _3;
  return;

}


FlexCAN_IsFDEnabled (const struct FLEXCAN_Type * base)
{
  boolean D.5713;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->MCR;
  _2 = _1 & 2048;
  D.5713 = _2 != 0;
  return D.5713;

}


FlexCAN_SetSelfReception (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int iftmp.14;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = base->MCR;
  _2 = _1 & 4294836223;
  if (enable != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.14 = 0;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.14 = 131072;

  <bb 5> :
  _3 = iftmp.14 | _2;
  base->MCR = _3;
  return;

}


DevAssert (volatile boolean x)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  x.7_1 = x;
  if (x.7_1 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  goto <bb 3>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  return;

}


