FlexCAN_ConfigPN (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
{
  short unsigned int _1;
  <unnamed type> _2;
  <unnamed type> _3;
  <unnamed type> _4;
  <unnamed type> _5;
  unsigned char _6;
  unsigned char _7;
  const uint8[8] * _8;
  const uint8[8] * _9;
  <unnamed type> _10;
  <unnamed type> _11;
  const uint8[8] * _12;
  const uint8[8] * _13;

  <bb 2> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetPNFilteringSelection (pBase_17(D), pPnConfig_18(D));
  # DEBUG BEGIN_STMT
  _1 = pPnConfig_18(D)->u16MatchTimeout;
  FlexCAN_SetPNTimeoutValue (pBase_17(D), _1);
  # DEBUG BEGIN_STMT
  FlexCAN_SetPNIdFilter1 (pBase_17(D), pPnConfig_18(D)->idFilter1);
  # DEBUG BEGIN_STMT
  _2 = pPnConfig_18(D)->eIdFilterType;
  if (_2 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  _3 = pPnConfig_18(D)->eIdFilterType;
  if (_3 == 3)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetPNIdFilter2 (pBase_17(D), pPnConfig_18(D));
  goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetPNIdFilter2Check (pBase_17(D));

  <bb 6> :
  # DEBUG BEGIN_STMT
  _4 = pPnConfig_18(D)->eFilterComb;
  if (_4 == 1)
    goto <bb 8>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  _5 = pPnConfig_18(D)->eFilterComb;
  if (_5 == 3)
    goto <bb 8>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _6 = pPnConfig_18(D)->payloadFilter.u8DlcLow;
  _7 = pPnConfig_18(D)->payloadFilter.u8DlcHigh;
  FlexCAN_SetPNDlcFilter (pBase_17(D), _6, _7);
  # DEBUG BEGIN_STMT
  _8 = &pPnConfig_18(D)->payloadFilter.aPayload1;
  FlexCAN_SetPNPayloadHighFilter1 (pBase_17(D), _8);
  # DEBUG BEGIN_STMT
  _9 = &pPnConfig_18(D)->payloadFilter.aPayload1;
  FlexCAN_SetPNPayloadLowFilter1 (pBase_17(D), _9);
  # DEBUG BEGIN_STMT
  _10 = pPnConfig_18(D)->ePayloadFilterType;
  if (_10 == 0)
    goto <bb 10>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  _11 = pPnConfig_18(D)->ePayloadFilterType;
  if (_11 == 3)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _12 = &pPnConfig_18(D)->payloadFilter.aPayload2;
  FlexCAN_SetPNPayloadHighFilter2 (pBase_17(D), _12);
  # DEBUG BEGIN_STMT
  _13 = &pPnConfig_18(D)->payloadFilter.aPayload2;
  FlexCAN_SetPNPayloadLowFilter2 (pBase_17(D), _13);

  <bb 11> :
  return;

}


FlexCAN_ConfigCtrlOptions (struct FLEXCAN_Type * pBase, uint32 u32Options)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = u32Options_17(D) & 32;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  <bb 19> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetRemoteReqStore (pBase_19(D), 1);
  goto <bb 21>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetRemoteReqStore (pBase_19(D), 0);

  <bb 21> :
  # DEBUG BEGIN_STMT
  _9 = u32Options_17(D) & 16;
  if (_9 != 0)
    goto <bb 22>; [INV]
  else
    goto <bb 23>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEdgeFilter (pBase_19(D), 1);
  goto <bb 24>; [INV]

  <bb 23> :
  # DEBUG BEGIN_STMT
  FlexCAN_SetEdgeFilter (pBase_19(D), 0);

  <bb 24> :
  return;

}


FlexCAN_IsMbOutOfRange (const struct FLEXCAN_Type * pBase, uint8 u8MbIndex, boolean bIsLegacyFifoEn, uint32 u32MaxMbNum)
{
  uint32 u32NumOfMbOccupiedByFiFo;
  uint32 u32NumOfFiFoElement;
  boolean ReturnValue;
  unsigned char _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  boolean _22;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ReturnValue_9 = 0;
  # DEBUG ReturnValue => ReturnValue_9
  # DEBUG BEGIN_STMT
  u32NumOfFiFoElement_10 = 0;
  # DEBUG u32NumOfFiFoElement => u32NumOfFiFoElement_10
  # DEBUG BEGIN_STMT
  u32NumOfMbOccupiedByFiFo_11 = 0;
  # DEBUG u32NumOfMbOccupiedByFiFo => u32NumOfMbOccupiedByFiFo_11
  # DEBUG BEGIN_STMT
  _1 = (unsigned char) u32MaxMbNum_12(D);
  if (u8MbIndex_13(D) >= _1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

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

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

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  ReturnValue_15 = 0;
  # DEBUG ReturnValue => ReturnValue_15

  <bb 8> :
  # ReturnValue_8 = PHI <ReturnValue_21(3), ReturnValue_20(6), ReturnValue_15(7), ReturnValue_9(5)>
  # DEBUG ReturnValue => ReturnValue_8
  # DEBUG BEGIN_STMT
  _22 = ReturnValue_8;
  return _22;

}


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;
  long unsigned int base.11_1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  unsigned char _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  unsigned char _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  const uint32 * _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  long unsigned int _24;
  long unsigned int _25;
  long unsigned int _26;
  long unsigned int _27;
  long unsigned int _28;
  uint32 * _29;
  long unsigned int _30;
  long unsigned int _31;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  base.11_1 = (long unsigned int) base_36(D);
  _2 = base.11_1 + 128;
  flexcan_mb_37 = (const uint32 *) _2;
  # DEBUG flexcan_mb => flexcan_mb_37
  # DEBUG BEGIN_STMT
  flexcan_mb_id_38 = flexcan_mb_37 + 4;
  # DEBUG flexcan_mb_id => flexcan_mb_id_38
  # DEBUG BEGIN_STMT
  flexcan_mb_data_32_39 = flexcan_mb_37 + 8;
  # DEBUG flexcan_mb_data_32 => flexcan_mb_data_32_39
  # DEBUG BEGIN_STMT
  msgData_32_41 = &rxFifo_40(D)->data;
  # DEBUG msgData_32 => msgData_32_41
  # DEBUG BEGIN_STMT
  _3 ={v} *flexcan_mb_37;
  _4 = _3 >> 16;
  _5 = (unsigned char) _4;
  flexcan_mb_dlc_value_43 = _5 & 15;
  # DEBUG flexcan_mb_dlc_value => flexcan_mb_dlc_value_43
  # DEBUG BEGIN_STMT
  can_real_payload_45 = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value_43);
  # DEBUG can_real_payload => can_real_payload_45
  # DEBUG BEGIN_STMT
  if (can_real_payload_45 > 8)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  # can_real_payload_33 = PHI <can_real_payload_45(2), can_real_payload_46(3)>
  # DEBUG can_real_payload => can_real_payload_33
  # DEBUG BEGIN_STMT
  rxFifo_40(D)->dataLen = can_real_payload_33;
  # DEBUG BEGIN_STMT
  _6 ={v} *flexcan_mb_37;
  rxFifo_40(D)->cs = _6;
  # DEBUG BEGIN_STMT
  _7 = rxFifo_40(D)->cs;
  _8 = _7 & 2097152;
  if (_8 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _9 ={v} *flexcan_mb_id_38;
  rxFifo_40(D)->msgId = _9;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _10 ={v} *flexcan_mb_id_38;
  _11 = _10 >> 18;
  rxFifo_40(D)->msgId = _11;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _12 ={v} base_36(D)->RXFIR;
  _13 = (unsigned char) _12;
  rxFifo_40(D)->id_hit = _13;
  # DEBUG BEGIN_STMT
  _14 = rxFifo_40(D)->cs;
  _15 = _14 & 65535;
  rxFifo_40(D)->time_stamp = _15;
  # DEBUG BEGIN_STMT
  DataByte_53 = 0;
  # DEBUG DataByte => DataByte_53
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _16 = DataByte_32 >> 2;
  _17 = _16 * 4;
  _18 = flexcan_mb_data_32_39 + _17;
  MbWord_54 ={v} *_18;
  # DEBUG MbWord => MbWord_54
  # DEBUG BEGIN_STMT
  _19 = MbWord_54 >> 24;
  _20 = MbWord_54 >> 8;
  _21 = _20 & 65280;
  _22 = _19 | _21;
  _23 = MbWord_54 << 8;
  _24 = _23 & 16711680;
  _25 = _22 | _24;
  _26 = MbWord_54 << 24;
  _27 = DataByte_32 >> 2;
  _28 = _27 * 4;
  _29 = msgData_32_41 + _28;
  _30 = _25 | _26;
  *_29 = _30;
  # DEBUG BEGIN_STMT
  DataByte_56 = DataByte_32 + 4;
  # DEBUG DataByte => DataByte_56

  <bb 9> :
  # DataByte_32 = PHI <DataByte_53(7), DataByte_56(8)>
  # DEBUG DataByte => DataByte_32
  # DEBUG BEGIN_STMT
  _31 = (long unsigned int) can_real_payload_33;
  if (DataByte_32 < _31)
    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;
  long unsigned int base.10_1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  const struct Flexcan_Ip_IdTableType * _8;
  _Bool _9;
  long unsigned int _10;
  const struct Flexcan_Ip_IdTableType * _11;
  _Bool _12;
  long unsigned int _13;
  const struct Flexcan_Ip_IdTableType * _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  volatile uint32 * _19;
  long unsigned int _20;
  long unsigned int _21;
  const struct Flexcan_Ip_IdTableType * _22;
  long unsigned int _23;
  long unsigned int _24;
  long unsigned int _25;
  long unsigned int _26;
  volatile uint32 * _27;
  long unsigned int _28;
  long unsigned int _29;
  long unsigned int _30;
  long unsigned int _31;
  long unsigned int _32;
  long unsigned int _33;
  long unsigned int _34;
  const struct Flexcan_Ip_IdTableType * _35;
  _Bool _36;
  sizetype _37;
  sizetype _38;
  const struct Flexcan_Ip_IdTableType * _39;
  _Bool _40;
  long unsigned int _41;
  const struct Flexcan_Ip_IdTableType * _42;
  _Bool _43;
  long unsigned int _44;
  const struct Flexcan_Ip_IdTableType * _45;
  long unsigned int _46;
  long unsigned int _47;
  long unsigned int _48;
  long unsigned int _49;
  long unsigned int _50;
  volatile uint32 * _51;
  long unsigned int _52;
  long unsigned int _53;
  const struct Flexcan_Ip_IdTableType * _54;
  long unsigned int _55;
  long unsigned int _56;
  long unsigned int _57;
  long unsigned int _58;
  volatile uint32 * _59;
  long unsigned int _60;
  sizetype _61;
  sizetype _62;
  const struct Flexcan_Ip_IdTableType * _63;
  _Bool _64;
  long unsigned int _65;
  volatile uint32 * _66;
  long unsigned int _67;
  sizetype _68;
  sizetype _69;
  const struct Flexcan_Ip_IdTableType * _70;
  long unsigned int _71;
  long unsigned int _72;
  long unsigned int _73;
  long unsigned int _74;
  long unsigned int _75;
  volatile uint32 * _76;
  long unsigned int _77;
  long unsigned int _78;
  volatile uint32 * _79;
  long unsigned int _80;
  sizetype _81;
  sizetype _82;
  const struct Flexcan_Ip_IdTableType * _83;
  long unsigned int _84;
  long unsigned int _85;
  long unsigned int _86;
  long unsigned int _87;
  long unsigned int _88;
  volatile uint32 * _89;
  long unsigned int _90;
  long unsigned int _91;
  long unsigned int _92;
  long unsigned int _93;
  long unsigned int _94;
  long unsigned int _95;
  long unsigned int _96;
  const struct Flexcan_Ip_IdTableType * _97;
  _Bool _98;
  long unsigned int _99;
  const struct Flexcan_Ip_IdTableType * _100;
  long unsigned int _101;
  long unsigned int _102;
  long unsigned int _103;
  long unsigned int _104;
  volatile uint32 * _105;
  long unsigned int _106;
  long unsigned int _107;
  const struct Flexcan_Ip_IdTableType * _108;
  long unsigned int _109;
  long unsigned int _110;
  long unsigned int _111;
  long unsigned int _112;
  volatile uint32 * _113;
  long unsigned int _114;
  sizetype _115;
  sizetype _116;
  const struct Flexcan_Ip_IdTableType * _117;
  _Bool _118;
  long unsigned int _119;
  volatile uint32 * _120;
  long unsigned int _121;
  sizetype _122;
  sizetype _123;
  const struct Flexcan_Ip_IdTableType * _124;
  long unsigned int _125;
  long unsigned int _126;
  long unsigned int _127;
  long unsigned int _128;
  long unsigned int _129;
  long unsigned int _130;
  volatile uint32 * _131;
  long unsigned int _132;
  long unsigned int _133;
  volatile uint32 * _134;
  long unsigned int _135;
  sizetype _136;
  sizetype _137;
  const struct Flexcan_Ip_IdTableType * _138;
  long unsigned int _139;
  long unsigned int _140;
  long unsigned int _141;
  long unsigned int _142;
  long unsigned int _143;
  long unsigned int _144;
  volatile uint32 * _145;
  long unsigned int _146;
  sizetype _147;
  sizetype _148;
  const struct Flexcan_Ip_IdTableType * _149;
  _Bool _150;
  long unsigned int _151;
  volatile uint32 * _152;
  long unsigned int _153;
  sizetype _154;
  sizetype _155;
  const struct Flexcan_Ip_IdTableType * _156;
  long unsigned int _157;
  long unsigned int _158;
  long unsigned int _159;
  long unsigned int _160;
  long unsigned int _161;
  long unsigned int _162;
  volatile uint32 * _163;
  long unsigned int _164;
  long unsigned int _165;
  volatile uint32 * _166;
  long unsigned int _167;
  sizetype _168;
  sizetype _169;
  const struct Flexcan_Ip_IdTableType * _170;
  long unsigned int _171;
  long unsigned int _172;
  long unsigned int _173;
  long unsigned int _174;
  long unsigned int _175;
  long unsigned int _176;
  volatile uint32 * _177;
  long unsigned int _178;
  sizetype _179;
  sizetype _180;
  const struct Flexcan_Ip_IdTableType * _181;
  _Bool _182;
  long unsigned int _183;
  volatile uint32 * _184;
  long unsigned int _185;
  sizetype _186;
  sizetype _187;
  const struct Flexcan_Ip_IdTableType * _188;
  long unsigned int _189;
  long unsigned int _190;
  long unsigned int _191;
  long unsigned int _192;
  long unsigned int _193;
  volatile uint32 * _194;
  long unsigned int _195;
  long unsigned int _196;
  volatile uint32 * _197;
  long unsigned int _198;
  sizetype _199;
  sizetype _200;
  const struct Flexcan_Ip_IdTableType * _201;
  long unsigned int _202;
  long unsigned int _203;
  long unsigned int _204;
  long unsigned int _205;
  long unsigned int _206;
  volatile uint32 * _207;
  long unsigned int _208;
  long unsigned int _209;
  long unsigned int _210;
  long unsigned int _211;
  long unsigned int _212;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  Val1_232 = 0;
  # DEBUG Val1 => Val1_232
  Val2_233 = 0;
  # DEBUG Val2 => Val2_233
  Val_234 = 0;
  # DEBUG Val => Val_234
  # DEBUG BEGIN_STMT
  base.10_1 = (long unsigned int) base_235(D);
  _2 = base.10_1 + 224;
  FilterTable_236 = (volatile uint32 *) _2;
  # DEBUG FilterTable => FilterTable_236
  # DEBUG BEGIN_STMT
  _3 ={v} base_235(D)->CTRL2;
  _4 = _3 >> 24;
  NumOfFilters_238 = _4 & 15;
  # DEBUG NumOfFilters => NumOfFilters_238
  # DEBUG BEGIN_STMT
  switch (idFormat_239(D)) <default: <L42> [INV], case 0: <L0> [INV], case 1: <L9> [INV], case 2: <L23> [INV], case 3: <L39> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _5 ={v} base_235(D)->MCR;
  _6 = _5 & 4294966527;
  base_235(D)->MCR ={v} _6;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  i_279 = 0;
  # DEBUG i => i_279
  goto <bb 10>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  Val_280 = 0;
  # DEBUG Val => Val_280
  # DEBUG BEGIN_STMT
  _7 = i_213 * 8;
  _8 = idFilterTable_248(D) + _7;
  _9 = _8->isRemoteFrame;
  if (_9 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  Val_281 = 2147483648;
  # DEBUG Val => Val_281

  <bb 6> :
  # Val_220 = PHI <Val_280(4), Val_281(5)>
  # DEBUG Val => Val_220
  # DEBUG BEGIN_STMT
  _10 = i_213 * 8;
  _11 = idFilterTable_248(D) + _10;
  _12 = _11->isExtendedFrame;
  if (_12 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  Val_283 = Val_220 | 1073741824;
  # DEBUG Val => Val_283
  # DEBUG BEGIN_STMT
  _13 = i_213 * 8;
  _14 = idFilterTable_248(D) + _13;
  _15 = _14->id;
  _16 = _15 << 1;
  _17 = _16 & 1073741823;
  _18 = i_213 * 4;
  _19 = FilterTable_236 + _18;
  _20 = Val_283 + _17;
  *_19 ={v} _20;
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _21 = i_213 * 8;
  _22 = idFilterTable_248(D) + _21;
  _23 = _22->id;
  _24 = _23 << 19;
  _25 = _24 & 1073217536;
  _26 = i_213 * 4;
  _27 = FilterTable_236 + _26;
  _28 = Val_220 + _25;
  *_27 ={v} _28;

  <bb 9> :
  # DEBUG BEGIN_STMT
  i_285 = i_213 + 1;
  # DEBUG i => i_285

  <bb 10> :
  # i_213 = PHI <i_279(3), i_285(9)>
  # DEBUG i => i_213
  # DEBUG BEGIN_STMT
  _29 = NumOfFilters_238 + 1;
  _30 = _29 * 8;
  if (i_213 < _30)
    goto <bb 4>; [INV]
  else
    goto <bb 40>; [INV]

  <bb 11> :
<L9>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _31 ={v} base_235(D)->MCR;
  _32 = _31 & 4294966527;
  _33 = _32 | 256;
  base_235(D)->MCR ={v} _33;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  j_262 = 0;
  # DEBUG j => j_262
  # DEBUG BEGIN_STMT
  i_263 = 0;
  # DEBUG i => i_263
  goto <bb 23>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  Val1_264 = 0;
  # DEBUG Val1 => Val1_264
  # DEBUG BEGIN_STMT
  Val2_265 = 0;
  # DEBUG Val2 => Val2_265
  # DEBUG BEGIN_STMT
  _34 = j_216 * 8;
  _35 = idFilterTable_248(D) + _34;
  _36 = _35->isRemoteFrame;
  if (_36 != 0)
    goto <bb 13>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  Val1_266 = 2147483648;
  # DEBUG Val1 => Val1_266

  <bb 14> :
  # Val1_218 = PHI <Val1_264(12), Val1_266(13)>
  # DEBUG Val1 => Val1_218
  # DEBUG BEGIN_STMT
  _37 = j_216 + 1;
  _38 = _37 * 8;
  _39 = idFilterTable_248(D) + _38;
  _40 = _39->isRemoteFrame;
  if (_40 != 0)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  Val2_267 = 32768;
  # DEBUG Val2 => Val2_267

  <bb 16> :
  # Val2_219 = PHI <Val2_265(14), Val2_267(15)>
  # DEBUG Val2 => Val2_219
  # DEBUG BEGIN_STMT
  _41 = j_216 * 8;
  _42 = idFilterTable_248(D) + _41;
  _43 = _42->isExtendedFrame;
  if (_43 != 0)
    goto <bb 17>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  Val1_269 = Val1_218 | 1073741824;
  # DEBUG Val1 => Val1_269
  # DEBUG BEGIN_STMT
  _44 = j_216 * 8;
  _45 = idFilterTable_248(D) + _44;
  _46 = _45->id;
  _47 = _46 >> 15;
  _48 = _47 << 16;
  _49 = _48 & 1073676288;
  _50 = i_214 * 4;
  _51 = FilterTable_236 + _50;
  _52 = Val1_269 + _49;
  *_51 ={v} _52;
  goto <bb 19>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  _53 = j_216 * 8;
  _54 = idFilterTable_248(D) + _53;
  _55 = _54->id;
  _56 = _55 << 19;
  _57 = _56 & 1073217536;
  _58 = i_214 * 4;
  _59 = FilterTable_236 + _58;
  _60 = Val1_218 + _57;
  *_59 ={v} _60;

  <bb 19> :
  # DEBUG BEGIN_STMT
  _61 = j_216 + 1;
  _62 = _61 * 8;
  _63 = idFilterTable_248(D) + _62;
  _64 = _63->isExtendedFrame;
  if (_64 != 0)
    goto <bb 20>; [INV]
  else
    goto <bb 21>; [INV]

  <bb 20> :
  # DEBUG BEGIN_STMT
  Val2_272 = Val2_219 | 16384;
  # DEBUG Val2 => Val2_272
  # DEBUG BEGIN_STMT
  _65 = i_214 * 4;
  _66 = FilterTable_236 + _65;
  _67 ={v} *_66;
  _68 = j_216 + 1;
  _69 = _68 * 8;
  _70 = idFilterTable_248(D) + _69;
  _71 = _70->id;
  _72 = _71 >> 15;
  _73 = _72 & 16383;
  _74 = Val2_272 + _73;
  _75 = i_214 * 4;
  _76 = FilterTable_236 + _75;
  _77 = _67 | _74;
  *_76 ={v} _77;
  goto <bb 22>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  _78 = i_214 * 4;
  _79 = FilterTable_236 + _78;
  _80 ={v} *_79;
  _81 = j_216 + 1;
  _82 = _81 * 8;
  _83 = idFilterTable_248(D) + _82;
  _84 = _83->id;
  _85 = _84 << 3;
  _86 = _85 & 16376;
  _87 = Val2_219 + _86;
  _88 = i_214 * 4;
  _89 = FilterTable_236 + _88;
  _90 = _80 | _87;
  *_89 ={v} _90;

  <bb 22> :
  # DEBUG BEGIN_STMT
  j_274 = j_216 + 2;
  # DEBUG j => j_274
  # DEBUG BEGIN_STMT
  i_275 = i_214 + 1;
  # DEBUG i => i_275

  <bb 23> :
  # i_214 = PHI <i_263(11), i_275(22)>
  # j_216 = PHI <j_262(11), j_274(22)>
  # DEBUG j => j_216
  # DEBUG i => i_214
  # DEBUG BEGIN_STMT
  _91 = NumOfFilters_238 + 1;
  _92 = _91 * 8;
  if (i_214 < _92)
    goto <bb 12>; [INV]
  else
    goto <bb 40>; [INV]

  <bb 24> :
<L23>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _93 ={v} base_235(D)->MCR;
  _94 = _93 & 4294966527;
  _95 = _94 | 512;
  base_235(D)->MCR ={v} _95;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  j_246 = 0;
  # DEBUG j => j_246
  # DEBUG BEGIN_STMT
  i_247 = 0;
  # DEBUG i => i_247
  goto <bb 38>; [INV]

  <bb 25> :
  # DEBUG BEGIN_STMT
  _96 = j_217 * 8;
  _97 = idFilterTable_248(D) + _96;
  _98 = _97->isExtendedFrame;
  if (_98 != 0)
    goto <bb 26>; [INV]
  else
    goto <bb 27>; [INV]

  <bb 26> :
  # DEBUG BEGIN_STMT
  _99 = j_217 * 8;
  _100 = idFilterTable_248(D) + _99;
  _101 = _100->id;
  _102 = _101 >> 21;
  _103 = _102 << 24;
  _104 = i_215 * 4;
  _105 = FilterTable_236 + _104;
  _106 = Val1_232 + _103;
  *_105 ={v} _106;
  goto <bb 28>; [INV]

  <bb 27> :
  # DEBUG BEGIN_STMT
  _107 = j_217 * 8;
  _108 = idFilterTable_248(D) + _107;
  _109 = _108->id;
  _110 = _109 >> 3;
  _111 = _110 << 24;
  _112 = i_215 * 4;
  _113 = FilterTable_236 + _112;
  _114 = Val1_232 + _111;
  *_113 ={v} _114;

  <bb 28> :
  # DEBUG BEGIN_STMT
  _115 = j_217 + 1;
  _116 = _115 * 8;
  _117 = idFilterTable_248(D) + _116;
  _118 = _117->isExtendedFrame;
  if (_118 != 0)
    goto <bb 29>; [INV]
  else
    goto <bb 30>; [INV]

  <bb 29> :
  # DEBUG BEGIN_STMT
  _119 = i_215 * 4;
  _120 = FilterTable_236 + _119;
  _121 ={v} *_120;
  _122 = j_217 + 1;
  _123 = _122 * 8;
  _124 = idFilterTable_248(D) + _123;
  _125 = _124->id;
  _126 = _125 >> 21;
  _127 = _126 << 16;
  _128 = _127 & 16711680;
  _129 = Val1_232 + _128;
  _130 = i_215 * 4;
  _131 = FilterTable_236 + _130;
  _132 = _121 | _129;
  *_131 ={v} _132;
  goto <bb 31>; [INV]

  <bb 30> :
  # DEBUG BEGIN_STMT
  _133 = i_215 * 4;
  _134 = FilterTable_236 + _133;
  _135 ={v} *_134;
  _136 = j_217 + 1;
  _137 = _136 * 8;
  _138 = idFilterTable_248(D) + _137;
  _139 = _138->id;
  _140 = _139 >> 3;
  _141 = _140 << 16;
  _142 = _141 & 16711680;
  _143 = Val1_232 + _142;
  _144 = i_215 * 4;
  _145 = FilterTable_236 + _144;
  _146 = _135 | _143;
  *_145 ={v} _146;

  <bb 31> :
  # DEBUG BEGIN_STMT
  _147 = j_217 + 2;
  _148 = _147 * 8;
  _149 = idFilterTable_248(D) + _148;
  _150 = _149->isExtendedFrame;
  if (_150 != 0)
    goto <bb 32>; [INV]
  else
    goto <bb 33>; [INV]

  <bb 32> :
  # DEBUG BEGIN_STMT
  _151 = i_215 * 4;
  _152 = FilterTable_236 + _151;
  _153 ={v} *_152;
  _154 = j_217 + 2;
  _155 = _154 * 8;
  _156 = idFilterTable_248(D) + _155;
  _157 = _156->id;
  _158 = _157 >> 21;
  _159 = _158 << 8;
  _160 = _159 & 65535;
  _161 = Val1_232 + _160;
  _162 = i_215 * 4;
  _163 = FilterTable_236 + _162;
  _164 = _153 | _161;
  *_163 ={v} _164;
  goto <bb 34>; [INV]

  <bb 33> :
  # DEBUG BEGIN_STMT
  _165 = i_215 * 4;
  _166 = FilterTable_236 + _165;
  _167 ={v} *_166;
  _168 = j_217 + 2;
  _169 = _168 * 8;
  _170 = idFilterTable_248(D) + _169;
  _171 = _170->id;
  _172 = _171 >> 3;
  _173 = _172 << 8;
  _174 = _173 & 65535;
  _175 = Val1_232 + _174;
  _176 = i_215 * 4;
  _177 = FilterTable_236 + _176;
  _178 = _167 | _175;
  *_177 ={v} _178;

  <bb 34> :
  # DEBUG BEGIN_STMT
  _179 = j_217 + 3;
  _180 = _179 * 8;
  _181 = idFilterTable_248(D) + _180;
  _182 = _181->isExtendedFrame;
  if (_182 != 0)
    goto <bb 35>; [INV]
  else
    goto <bb 36>; [INV]

  <bb 35> :
  # DEBUG BEGIN_STMT
  _183 = i_215 * 4;
  _184 = FilterTable_236 + _183;
  _185 ={v} *_184;
  _186 = j_217 + 3;
  _187 = _186 * 8;
  _188 = idFilterTable_248(D) + _187;
  _189 = _188->id;
  _190 = _189 >> 21;
  _191 = _190 & 255;
  _192 = Val1_232 + _191;
  _193 = i_215 * 4;
  _194 = FilterTable_236 + _193;
  _195 = _185 | _192;
  *_194 ={v} _195;
  goto <bb 37>; [INV]

  <bb 36> :
  # DEBUG BEGIN_STMT
  _196 = i_215 * 4;
  _197 = FilterTable_236 + _196;
  _198 ={v} *_197;
  _199 = j_217 + 3;
  _200 = _199 * 8;
  _201 = idFilterTable_248(D) + _200;
  _202 = _201->id;
  _203 = _202 >> 3;
  _204 = _203 & 255;
  _205 = Val1_232 + _204;
  _206 = i_215 * 4;
  _207 = FilterTable_236 + _206;
  _208 = _198 | _205;
  *_207 ={v} _208;

  <bb 37> :
  # DEBUG BEGIN_STMT
  j_257 = j_217 + 4;
  # DEBUG j => j_257
  # DEBUG BEGIN_STMT
  i_258 = i_215 + 1;
  # DEBUG i => i_258

  <bb 38> :
  # i_215 = PHI <i_247(24), i_258(37)>
  # j_217 = PHI <j_246(24), j_257(37)>
  # DEBUG j => j_217
  # DEBUG i => i_215
  # DEBUG BEGIN_STMT
  _209 = NumOfFilters_238 + 1;
  _210 = _209 * 8;
  if (i_215 < _210)
    goto <bb 25>; [INV]
  else
    goto <bb 40>; [INV]

  <bb 39> :
<L39>:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT
  _211 ={v} base_235(D)->MCR;
  _212 = _211 | 768;
  base_235(D)->MCR ={v} _212;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 ();
  # DEBUG BEGIN_STMT

  <bb 40> :
<L42>:
  return;

}


FlexCAN_SetOperationMode (struct FLEXCAN_Type * base, Flexcan_Ip_ModesType mode)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;

  <bb 2> :
  # DEBUG BEGIN_STMT
  switch (mode_12(D)) <default: <L5> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  _1 ={v} base_14(D)->CTRL1;
  _2 = _1 & 4294967287;
  base_14(D)->CTRL1 ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_14(D)->CTRL1;
  _4 = _3 & 4294963199;
  base_14(D)->CTRL1 ={v} _4;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _5 ={v} base_14(D)->CTRL1;
  _6 = _5 | 8;
  base_14(D)->CTRL1 ={v} _6;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  _7 ={v} base_14(D)->CTRL1;
  _8 = _7 | 4096;
  base_14(D)->CTRL1 ={v} _8;
  # DEBUG BEGIN_STMT
  _9 ={v} base_14(D)->CTRL1;
  _10 = _9 & 4294967287;
  base_14(D)->CTRL1 ={v} _10;
  # DEBUG BEGIN_STMT
  FlexCAN_SetSelfReception (base_14(D), 1);
  # 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;
  long unsigned int base.6_1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int ValEndMbPointer.7_6;
  long unsigned int _7;
  long unsigned int _8;
  const uint32 * _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  volatile uint8 * _20;
  long unsigned int _21;
  unsigned char MsgBuffIdx.8_22;
  long unsigned int _23;
  Flexcan_Ip_StatusType _66;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  base.6_1 = (long unsigned int) base_32(D);
  _2 = base.6_1 + 128;
  RAM_33 = (const uint32 *) _2;
  # DEBUG RAM => RAM_33
  # DEBUG BEGIN_STMT
  ValEndMbPointer_34 = 0B;
  # DEBUG ValEndMbPointer => ValEndMbPointer_34
  # DEBUG BEGIN_STMT
  Flexcan_Mb_35 = 0B;
  # DEBUG Flexcan_Mb => Flexcan_Mb_35
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Id_36 = 0B;
  # DEBUG Flexcan_Mb_Id => Flexcan_Mb_Id_36
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_37 = 0B;
  # DEBUG Flexcan_Mb_Data => Flexcan_Mb_Data_37
  # DEBUG BEGIN_STMT
  Arbitration_Field_Size_38 = 8;
  # DEBUG Arbitration_Field_Size => Arbitration_Field_Size_38
  # DEBUG BEGIN_STMT
  _3 = maxMsgBuffNum_39(D) + 4294967295;
  Can_Real_Payload_42 = FlexCAN_GetMbPayloadSize (base_32(D), _3);
  # DEBUG Can_Real_Payload => Can_Real_Payload_42
  # DEBUG BEGIN_STMT
  ValEndMb_43 = 0;
  # DEBUG ValEndMb => ValEndMb_43
  # DEBUG BEGIN_STMT
  ValEndRam_44 = 0;
  # DEBUG ValEndRam => ValEndRam_44
  # DEBUG BEGIN_STMT
  Status_45 = 0;
  # DEBUG Status => Status_45
  # DEBUG BEGIN_STMT
  _4 = maxMsgBuffNum_39(D) + 4294967295;
  ValEndMbPointer_47 = FlexCAN_GetMsgBuffRegion (base_32(D), _4);
  # DEBUG ValEndMbPointer => ValEndMbPointer_47
  # DEBUG BEGIN_STMT
  _5 = (long unsigned int) Can_Real_Payload_42;
  ValEndMbPointer.7_6 = (long unsigned int) ValEndMbPointer_47;
  _7 = _5 + ValEndMbPointer.7_6;
  _8 = (long unsigned int) Arbitration_Field_Size_38;
  ValEndMb_48 = _7 + _8;
  # DEBUG ValEndMb => ValEndMb_48
  # DEBUG BEGIN_STMT
  _9 = RAM_33 + 512;
  ValEndRam_49 = (uint32) _9;
  # DEBUG ValEndRam => ValEndRam_49
  # DEBUG BEGIN_STMT
  if (ValEndMb_48 > ValEndRam_49)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  _10 = FlexCAN_GetMaxMbNum (base_32(D));
  if (maxMsgBuffNum_39(D) > _10)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  Status_51 = 4;
  # DEBUG Status => Status_51

  <bb 5> :
  # Status_26 = PHI <Status_45(3), Status_51(4)>
  # DEBUG Status => Status_26
  # DEBUG BEGIN_STMT
  if (Status_26 == 0)
    goto <bb 6>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _11 ={v} base_32(D)->MCR;
  _12 = _11 & 4294967168;
  _13 = maxMsgBuffNum_39(D) + 4294967295;
  _14 = _13 & 127;
  _15 = _12 | _14;
  base_32(D)->MCR ={v} _15;
  # DEBUG BEGIN_STMT
  _16 ={v} base_32(D)->MCR;
  _17 = _16 & 536870912;
  if (_17 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 13>; [INV]

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

  <bb 8> :
  # DEBUG BEGIN_STMT
  _18 = (long unsigned int) MsgBuffIdx_24;
  Flexcan_Mb_55 = FlexCAN_GetMsgBuffRegion (base_32(D), _18);
  # DEBUG Flexcan_Mb => Flexcan_Mb_55
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Id_56 = Flexcan_Mb_55 + 4;
  # DEBUG Flexcan_Mb_Id => Flexcan_Mb_Id_56
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_57 = Flexcan_Mb_55 + 8;
  # DEBUG Flexcan_Mb_Data => Flexcan_Mb_Data_57
  # DEBUG BEGIN_STMT
  *Flexcan_Mb_55 ={v} 0;
  # DEBUG BEGIN_STMT
  *Flexcan_Mb_Id_56 ={v} 0;
  # DEBUG BEGIN_STMT
  _19 = (long unsigned int) MsgBuffIdx_24;
  Can_Real_Payload_61 = FlexCAN_GetMbPayloadSize (base_32(D), _19);
  # DEBUG Can_Real_Payload => Can_Real_Payload_61
  # DEBUG BEGIN_STMT
  DataByte_62 = 0;
  # DEBUG DataByte => DataByte_62
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _20 = Flexcan_Mb_Data_57 + DataByte_25;
  *_20 ={v} 0;
  # DEBUG BEGIN_STMT
  DataByte_65 = DataByte_25 + 1;
  # DEBUG DataByte => DataByte_65

  <bb 10> :
  # DataByte_25 = PHI <DataByte_62(8), DataByte_65(9)>
  # DEBUG DataByte => DataByte_25
  # DEBUG BEGIN_STMT
  _21 = (long unsigned int) Can_Real_Payload_61;
  if (DataByte_25 < _21)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  MsgBuffIdx.8_22 = MsgBuffIdx_24;
  MsgBuffIdx_63 = MsgBuffIdx.8_22 + 1;
  # DEBUG MsgBuffIdx => MsgBuffIdx_63

  <bb 12> :
  # MsgBuffIdx_24 = PHI <MsgBuffIdx_53(7), MsgBuffIdx_63(11)>
  # DEBUG MsgBuffIdx => MsgBuffIdx_24
  # DEBUG BEGIN_STMT
  _23 = (long unsigned int) MsgBuffIdx_24;
  if (maxMsgBuffNum_39(D) > _23)
    goto <bb 8>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  # DEBUG BEGIN_STMT
  _66 = Status_26;
  return _66;

}


FlexCAN_SetTxMsgBuff (volatile uint32 * const pMbAddr, 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;
  long unsigned int _1;
  unsigned char _2;
  long unsigned int _3;
  long unsigned int _4;
  const uint32 * _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  const uint32 * _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  const uint32 * _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  const uint32 * _24;
  long unsigned int _25;
  long unsigned int _26;
  long unsigned int _27;
  long unsigned int _28;
  volatile uint32 * _29;
  long unsigned int _30;
  long unsigned int _31;
  long unsigned int _32;
  const uint8 * _33;
  long unsigned int _34;
  volatile uint8 * _35;
  unsigned char _36;
  long unsigned int _37;
  long unsigned int _38;
  volatile uint8 * _39;
  unsigned char _40;
  long unsigned int _41;
  <unnamed type> _42;
  long unsigned int _43;
  long unsigned int _44;
  long unsigned int _45;
  long unsigned int _46;
  long unsigned int _47;
  <unnamed type> _48;
  long unsigned int _49;
  long unsigned int _50;
  long unsigned int _51;
  long unsigned int _52;
  long unsigned int _53;
  long unsigned int _54;
  long unsigned int _55;
  long unsigned int _56;
  long unsigned int _57;
  long unsigned int _58;
  long unsigned int _59;
  _Bool _60;
  long unsigned int _61;
  long unsigned int _62;
  long unsigned int _63;
  long unsigned int _64;
  long unsigned int _65;
  long unsigned int _66;
  long unsigned int _67;
  _Bool _68;
  long unsigned int _69;
  long unsigned int _70;

  <bb 2> :
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_86 = 0;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_86
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  Flexcan_Mb_88 = pMbAddr_87(D);
  # DEBUG Flexcan_Mb => Flexcan_Mb_88
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Id_89 = Flexcan_Mb_88 + 4;
  # DEBUG Flexcan_Mb_Id => Flexcan_Mb_Id_89
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_90 = Flexcan_Mb_88 + 8;
  # DEBUG Flexcan_Mb_Data => Flexcan_Mb_Data_90
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_32_91 = Flexcan_Mb_88 + 8;
  # DEBUG Flexcan_Mb_Data_32 => Flexcan_Mb_Data_32_91
  # DEBUG BEGIN_STMT
  MsgData_32_93 = msgData_92(D);
  # DEBUG MsgData_32 => MsgData_32_93
  # DEBUG BEGIN_STMT
  *Flexcan_Mb_88 ={v} 134217728;
  # DEBUG BEGIN_STMT
  *Flexcan_Mb_Id_89 ={v} 0;
  # DEBUG BEGIN_STMT
  _1 = cs_97(D)->dataLen;
  _2 = (unsigned char) _1;
  Dlc_Value_99 = FlexCAN_ComputeDLCValue (_2);
  # DEBUG Dlc_Value => Dlc_Value_99
  # DEBUG BEGIN_STMT
  if (msgData_92(D) != 0B)
    goto <bb 3>; [INV]
  else
    goto <bb 11>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = DataByte_76 >> 2;
  _4 = _3 * 4;
  _5 = MsgData_32_93 + _4;
  _6 = *_5;
  _7 = _6 >> 24;
  _8 = DataByte_76 >> 2;
  _9 = _8 * 4;
  _10 = MsgData_32_93 + _9;
  _11 = *_10;
  _12 = _11 >> 8;
  _13 = _12 & 65280;
  _14 = _7 | _13;
  _15 = DataByte_76 >> 2;
  _16 = _15 * 4;
  _17 = MsgData_32_93 + _16;
  _18 = *_17;
  _19 = _18 << 8;
  _20 = _19 & 16711680;
  _21 = _14 | _20;
  _22 = DataByte_76 >> 2;
  _23 = _22 * 4;
  _24 = MsgData_32_93 + _23;
  _25 = *_24;
  _26 = _25 << 24;
  _27 = DataByte_76 >> 2;
  _28 = _27 * 4;
  _29 = Flexcan_Mb_Data_32_91 + _28;
  _30 = _21 | _26;
  *_29 ={v} _30;
  # DEBUG BEGIN_STMT
  DataByte_109 = DataByte_76 + 4;
  # DEBUG DataByte => DataByte_109

  <bb 5> :
  # DataByte_76 = PHI <DataByte_100(3), DataByte_109(4)>
  # DEBUG DataByte => DataByte_76
  # DEBUG BEGIN_STMT
  _31 = cs_97(D)->dataLen;
  _32 = _31 & 4294967292;
  if (DataByte_76 < _32)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _33 = msgData_92(D) + DataByte_77;
  _34 = DataByte_77 ^ 3;
  _35 = Flexcan_Mb_Data_90 + _34;
  _36 = *_33;
  *_35 ={v} _36;
  # DEBUG BEGIN_STMT
  DataByte_107 = DataByte_77 + 1;
  # DEBUG DataByte => DataByte_107

  <bb 7> :
  # DataByte_77 = PHI <DataByte_76(5), DataByte_107(6)>
  # DEBUG DataByte => DataByte_77
  # DEBUG BEGIN_STMT
  _37 = cs_97(D)->dataLen;
  if (DataByte_77 < _37)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  Payload_Size_102 = FlexCAN_ComputePayloadSize (Dlc_Value_99);
  # DEBUG Payload_Size => Payload_Size_102
  # DEBUG BEGIN_STMT
  DataByte_103 = cs_97(D)->dataLen;
  # DEBUG DataByte => DataByte_103
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _38 = DataByte_78 ^ 3;
  _39 = Flexcan_Mb_Data_90 + _38;
  _40 = cs_97(D)->fd_padding;
  *_39 ={v} _40;
  # DEBUG BEGIN_STMT
  DataByte_105 = DataByte_78 + 1;
  # DEBUG DataByte => DataByte_105

  <bb 10> :
  # DataByte_78 = PHI <DataByte_103(8), DataByte_105(9)>
  # DEBUG DataByte => DataByte_78
  # DEBUG BEGIN_STMT
  _41 = (long unsigned int) Payload_Size_102;
  if (DataByte_78 < _41)
    goto <bb 9>; [INV]
  else
    goto <bb 11>; [INV]

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

  <bb 12> :
  # DEBUG BEGIN_STMT
  _43 ={v} *Flexcan_Mb_Id_89;
  _44 = _43 & 3758096384;
  *Flexcan_Mb_Id_89 ={v} _44;
  # DEBUG BEGIN_STMT
  _45 ={v} *Flexcan_Mb_Id_89;
  _46 = msgId_111(D) & 536870911;
  _47 = _45 | _46;
  *Flexcan_Mb_Id_89 ={v} _47;
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_113 = Flexcan_Mb_Config_86 | 6291456;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_113

  <bb 13> :
  # Flexcan_Mb_Config_71 = PHI <Flexcan_Mb_Config_86(11), Flexcan_Mb_Config_113(12)>
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_71
  # DEBUG BEGIN_STMT
  _48 = cs_97(D)->msgIdType;
  if (_48 == 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  _49 ={v} *Flexcan_Mb_Id_89;
  _50 = _49 & 3758358527;
  *Flexcan_Mb_Id_89 ={v} _50;
  # DEBUG BEGIN_STMT
  _51 ={v} *Flexcan_Mb_Id_89;
  _52 = msgId_111(D) << 18;
  _53 = _52 & 536608768;
  _54 = _51 | _53;
  *Flexcan_Mb_Id_89 ={v} _54;
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_116 = Flexcan_Mb_Config_71 & 4288675839;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_116

  <bb 15> :
  # Flexcan_Mb_Config_72 = PHI <Flexcan_Mb_Config_71(13), Flexcan_Mb_Config_116(14)>
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_72
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_117 = Flexcan_Mb_Config_72 & 4293984255;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_117
  # DEBUG BEGIN_STMT
  _55 = (long unsigned int) Dlc_Value_99;
  _56 = _55 << 16;
  _57 = _56 & 983040;
  Flexcan_Mb_Config_118 = Flexcan_Mb_Config_117 | _57;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_118
  # DEBUG BEGIN_STMT
  _58 = cs_97(D)->code;
  if (_58 != 15)
    goto <bb 16>; [INV]
  else
    goto <bb 26>; [INV]

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

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

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

  <bb 19> :
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_120 = Flexcan_Mb_Config_118 | 1048576;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_120

  <bb 20> :
  # Flexcan_Mb_Config_73 = PHI <Flexcan_Mb_Config_121(17), Flexcan_Mb_Config_118(18), Flexcan_Mb_Config_120(19)>
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_73
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_122 = Flexcan_Mb_Config_73 & 4043309055;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_122
  # DEBUG BEGIN_STMT
  _60 = cs_97(D)->fd_enable;
  if (_60 != 0)
    goto <bb 21>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  _61 = cs_97(D)->code;
  _62 = _61 << 24;
  _63 = _62 & 251658240;
  _64 = Flexcan_Mb_Config_122 | _63;
  Flexcan_Mb_Config_124 = _64 | 2147483648;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_124
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_125 = Flexcan_Mb_Config_124 & 4293918719;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_125
  goto <bb 23>; [INV]

  <bb 22> :
  # DEBUG BEGIN_STMT
  _65 = cs_97(D)->code;
  _66 = _65 << 24;
  _67 = _66 & 251658240;
  Flexcan_Mb_Config_123 = Flexcan_Mb_Config_122 | _67;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_123

  <bb 23> :
  # Flexcan_Mb_Config_74 = PHI <Flexcan_Mb_Config_125(21), Flexcan_Mb_Config_123(22)>
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_74
  # DEBUG BEGIN_STMT
  _68 = cs_97(D)->enable_brs;
  if (_68 != 0)
    goto <bb 24>; [INV]
  else
    goto <bb 25>; [INV]

  <bb 24> :
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Config_126 = Flexcan_Mb_Config_74 | 1073741824;
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_126

  <bb 25> :
  # Flexcan_Mb_Config_75 = PHI <Flexcan_Mb_Config_74(23), Flexcan_Mb_Config_126(24)>
  # DEBUG Flexcan_Mb_Config => Flexcan_Mb_Config_75
  # DEBUG BEGIN_STMT
  _69 ={v} *Flexcan_Mb_88;
  _70 = Flexcan_Mb_Config_75 | _69;
  *Flexcan_Mb_88 ={v} _70;

  <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;
  long unsigned int _1;
  long unsigned int _2;
  unsigned char _3;
  unsigned char _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  unsigned char _13;
  unsigned int _14;
  unsigned int _15;
  const uint32 * _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  long unsigned int _24;
  unsigned char _25;
  unsigned int _26;
  unsigned int _27;
  uint32 * _28;
  long unsigned int _29;
  unsigned int _30;
  unsigned int _31;
  unsigned int _32;
  unsigned char _33;
  sizetype _34;
  const uint8 * _35;
  int _36;
  unsigned char _37;
  unsigned char i.5_38;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  Flexcan_Mb_50 = FlexCAN_GetMsgBuffRegion (base_47(D), msgBuffIdx_48(D));
  # DEBUG Flexcan_Mb => Flexcan_Mb_50
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Id_51 = Flexcan_Mb_50 + 4;
  # DEBUG Flexcan_Mb_Id => Flexcan_Mb_Id_51
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_52 = Flexcan_Mb_50 + 8;
  # DEBUG Flexcan_Mb_Data => Flexcan_Mb_Data_52
  # DEBUG BEGIN_STMT
  Flexcan_Mb_Data_32_53 = Flexcan_Mb_50 + 8;
  # DEBUG Flexcan_Mb_Data_32 => Flexcan_Mb_Data_32_53
  # DEBUG BEGIN_STMT
  MsgBuff_Data_32_55 = &msgBuff_54(D)->data;
  # DEBUG MsgBuff_Data_32 => MsgBuff_Data_32_55
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 ={v} *Flexcan_Mb_50;
  _2 = _1 >> 16;
  _3 = (unsigned char) _2;
  Flexcan_Mb_Dlc_Value_56 = _3 & 15;
  # DEBUG Flexcan_Mb_Dlc_Value => Flexcan_Mb_Dlc_Value_56
  # DEBUG BEGIN_STMT
  Payload_Size_58 = FlexCAN_ComputePayloadSize (Flexcan_Mb_Dlc_Value_56);
  # DEBUG Payload_Size => Payload_Size_58
  # DEBUG BEGIN_STMT
  _4 = FlexCAN_GetMbPayloadSize (base_47(D), msgBuffIdx_48(D));
  if (Payload_Size_58 > _4)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  Payload_Size_61 = FlexCAN_GetMbPayloadSize (base_47(D), msgBuffIdx_48(D));
  # DEBUG Payload_Size => Payload_Size_61

  <bb 4> :
  # Payload_Size_41 = PHI <Payload_Size_58(2), Payload_Size_61(3)>
  # DEBUG Payload_Size => Payload_Size_41
  # DEBUG BEGIN_STMT
  msgBuff_54(D)->dataLen = Payload_Size_41;
  # DEBUG BEGIN_STMT
  _5 ={v} *Flexcan_Mb_50;
  msgBuff_54(D)->cs = _5;
  # DEBUG BEGIN_STMT
  _6 = msgBuff_54(D)->cs;
  _7 = _6 & 2097152;
  if (_7 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _8 ={v} *Flexcan_Mb_Id_51;
  msgBuff_54(D)->msgId = _8;
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _9 ={v} *Flexcan_Mb_Id_51;
  _10 = _9 >> 18;
  msgBuff_54(D)->msgId = _10;

  <bb 7> :
  # DEBUG BEGIN_STMT
  _11 = msgBuff_54(D)->cs;
  _12 = _11 & 65535;
  msgBuff_54(D)->time_stamp = _12;
  # DEBUG BEGIN_STMT
  i_67 = 0;
  # DEBUG i => i_67
  goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _13 = i_39 >> 2;
  _14 = (unsigned int) _13;
  _15 = _14 * 4;
  _16 = Flexcan_Mb_Data_32_53 + _15;
  MbWord_70 ={v} *_16;
  # DEBUG MbWord => MbWord_70
  # DEBUG BEGIN_STMT
  _17 = MbWord_70 >> 24;
  _18 = MbWord_70 >> 8;
  _19 = _18 & 65280;
  _20 = _17 | _19;
  _21 = MbWord_70 << 8;
  _22 = _21 & 16711680;
  _23 = _20 | _22;
  _24 = MbWord_70 << 24;
  _25 = i_39 >> 2;
  _26 = (unsigned int) _25;
  _27 = _26 * 4;
  _28 = MsgBuff_Data_32_55 + _27;
  _29 = _23 | _24;
  *_28 = _29;
  # DEBUG BEGIN_STMT
  i_72 = i_39 + 4;
  # DEBUG i => i_72

  <bb 9> :
  # i_39 = PHI <i_67(7), i_72(8)>
  # DEBUG i => i_39
  # DEBUG BEGIN_STMT
  _30 = (unsigned int) i_39;
  _31 = (unsigned int) Payload_Size_41;
  _32 = _31 & 4294967292;
  if (_30 < _32)
    goto <bb 8>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _33 = i_40 ^ 3;
  _34 = (sizetype) _33;
  _35 = Flexcan_Mb_Data_52 + _34;
  _36 = (int) i_40;
  _37 ={v} *_35;
  msgBuff_54(D)->data[_36] = _37;
  # DEBUG BEGIN_STMT
  i.5_38 = i_40;
  i_69 = i.5_38 + 1;
  # DEBUG i => i_69

  <bb 11> :
  # i_40 = PHI <i_39(9), i_69(10)>
  # DEBUG i => i_40
  # DEBUG BEGIN_STMT
  if (i_40 < Payload_Size_41)
    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;
  long unsigned int _1;
  uint32 _9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  TimeStamp_2 = 0;
  # DEBUG TimeStamp => TimeStamp_2
  # DEBUG BEGIN_STMT
  Flexcan_Mb_7 = FlexCAN_GetMsgBuffRegion (base_4(D), msgBuffIdx_5(D));
  # DEBUG Flexcan_Mb => Flexcan_Mb_7
  # DEBUG BEGIN_STMT
  _1 ={v} *Flexcan_Mb_7;
  TimeStamp_8 = _1 & 65535;
  # DEBUG TimeStamp => TimeStamp_8
  # DEBUG BEGIN_STMT
  _9 = TimeStamp_8;
  return _9;

}


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;
  <unnamed type> _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  <unnamed type> _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;
  long unsigned int _23;
  long unsigned int _24;
  long unsigned int _25;
  long unsigned int _26;
  long unsigned int _27;

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb_35 = FlexCAN_GetMsgBuffRegion (base_32(D), msgBuffIdx_33(D));
  # DEBUG flexcan_mb => flexcan_mb_35
  # DEBUG BEGIN_STMT
  flexcan_mb_id_36 = flexcan_mb_35 + 4;
  # DEBUG flexcan_mb_id => flexcan_mb_id_36
  # DEBUG BEGIN_STMT
  *flexcan_mb_35 ={v} 0;
  # DEBUG BEGIN_STMT
  *flexcan_mb_id_36 ={v} 0;
  # DEBUG BEGIN_STMT
  _1 = cs_39(D)->msgIdType;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 ={v} *flexcan_mb_35;
  _3 = _2 | 2097152;
  *flexcan_mb_35 ={v} _3;
  # DEBUG BEGIN_STMT
  _4 ={v} *flexcan_mb_35;
  _5 = _4 & 4290772991;
  *flexcan_mb_35 ={v} _5;
  # DEBUG BEGIN_STMT
  _6 ={v} *flexcan_mb_id_36;
  _7 = _6 & 3758096384;
  *flexcan_mb_id_36 ={v} _7;
  # DEBUG BEGIN_STMT
  _8 ={v} *flexcan_mb_id_36;
  _9 = msgId_43(D) & 536870911;
  _10 = _8 | _9;
  *flexcan_mb_id_36 ={v} _10;

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _12 ={v} *flexcan_mb_35;
  _13 = _12 & 4288675839;
  *flexcan_mb_35 ={v} _13;
  # DEBUG BEGIN_STMT
  _14 ={v} *flexcan_mb_id_36;
  _15 = _14 & 3758358527;
  *flexcan_mb_id_36 ={v} _15;
  # DEBUG BEGIN_STMT
  _16 ={v} *flexcan_mb_id_36;
  _17 = msgId_43(D) << 18;
  _18 = _17 & 536608768;
  _19 = _16 | _18;
  *flexcan_mb_id_36 ={v} _19;

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  _21 ={v} *flexcan_mb_35;
  _22 = _21 & 4043309055;
  *flexcan_mb_35 ={v} _22;
  # DEBUG BEGIN_STMT
  _23 ={v} *flexcan_mb_35;
  _24 = cs_39(D)->code;
  _25 = _24 << 24;
  _26 = _25 & 251658240;
  _27 = _23 | _26;
  *flexcan_mb_35 ={v} _27;

  <bb 8> :
  return;

}


FlexCAN_EnableInterrupts (struct FLEXCAN_Type * pBase, uint8 u8Instance)
{
  int _1;
  long unsigned int _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_3(D);
  _2 ={v} FlexCAN_Ip_au32ImaskBuff[_1][0];
  pBase_5(D)->IMASK1 ={v} _2;
  return;

}


FlexCAN_DisableInterrupts (struct FLEXCAN_Type * pBase)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  pBase_2(D)->IMASK1 ={v} 0;
  return;

}


FLEXCAN_ClearMsgBuffIntCmd (struct FLEXCAN_Type * pBase, uint8 u8Instance, uint32 mb_idx, boolean bIsIntActive)
{
  uint32 temp;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  int _4;
  long unsigned int _5;
  int _6;
  long unsigned int _7;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_11 ();
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_14(D)->IMASK1;
  _3 = ~temp_11;
  _4 = (int) u8Instance_15(D);
  _5 = _2 & _3;
  FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
  # DEBUG BEGIN_STMT
  if (bIsIntActive_17(D) != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _6 = (int) u8Instance_15(D);
  _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
  pBase_14(D)->IMASK1 ={v} _7;

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

  <bb 6> :
  return;

}


FlexCAN_SetMsgBuffIntCmd (struct FLEXCAN_Type * base, uint8 u8Instance, uint32 msgBuffIdx, boolean enable, boolean bIsIntActive)
{
  Flexcan_Ip_StatusType stat;
  uint32 temp;
  long unsigned int _1;
  int _2;
  long unsigned int _3;
  int _4;
  long unsigned int _5;
  int _6;
  long unsigned int _7;
  int _8;
  long unsigned int _9;
  long unsigned int _10;
  int _11;
  long unsigned int _12;
  int _13;
  long unsigned int _14;
  Flexcan_Ip_StatusType _33;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  if (enable_21(D) != 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_23(D);
  _3 ={v} FlexCAN_Ip_au32ImaskBuff[_2][0];
  _4 = (int) u8Instance_23(D);
  _5 = temp_19 | _3;
  FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5;
  # DEBUG BEGIN_STMT
  if (bIsIntActive_30(D) != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _6 = (int) u8Instance_23(D);
  _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0];
  base_25(D)->IMASK1 ={v} _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_23(D);
  _9 ={v} FlexCAN_Ip_au32ImaskBuff[_8][0];
  _10 = ~temp_19;
  _11 = (int) u8Instance_23(D);
  _12 = _9 & _10;
  FlexCAN_Ip_au32ImaskBuff[_11][0] ={v} _12;
  # DEBUG BEGIN_STMT
  _13 = (int) u8Instance_23(D);
  _14 ={v} FlexCAN_Ip_au32ImaskBuff[_13][0];
  base_25(D)->IMASK1 ={v} _14;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 ();

  <bb 8> :
  # DEBUG BEGIN_STMT
  _33 = stat_17;
  return _33;

}


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

  <bb 2> :
  # DEBUG BEGIN_STMT
  flexcan_mb_5 = FlexCAN_GetMsgBuffRegion (base_2(D), msgBuffIdx_3(D));
  # DEBUG flexcan_mb => flexcan_mb_5
  # DEBUG BEGIN_STMT
  vol.4_6 ={v} *flexcan_mb_5;
  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;
  long unsigned int _1;
  long unsigned int _2;
  unsigned char _3;
  long unsigned int _4;
  unsigned char i.3_5;
  uint8 _27;

  <bb 2> :
  # DEBUG BEGIN_STMT
  arbitration_field_size_12 = 8;
  # DEBUG arbitration_field_size => arbitration_field_size_12
  # DEBUG BEGIN_STMT
  ramBlockSize_13 = 512;
  # DEBUG ramBlockSize => ramBlockSize_13
  # DEBUG BEGIN_STMT
  can_real_payload_14 = 8;
  # DEBUG can_real_payload => can_real_payload_14
  # DEBUG BEGIN_STMT
  maxMbBlockNum_15 = 0;
  # DEBUG maxMbBlockNum => maxMbBlockNum_15
  # DEBUG BEGIN_STMT
  i_16 = 0;
  # DEBUG i => i_16
  # DEBUG BEGIN_STMT
  mb_size_17 = 0;
  # DEBUG mb_size => mb_size_17
  # DEBUG BEGIN_STMT
  i_18 = 0;
  # DEBUG i => i_18
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  can_real_payload_22 = FlexCAN_GetPayloadSize (base_20(D), i_9);
  # DEBUG can_real_payload => can_real_payload_22
  # DEBUG BEGIN_STMT
  mb_size_23 = can_real_payload_22 + arbitration_field_size_12;
  # DEBUG mb_size => mb_size_23
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) mb_size_23;
  _2 = ramBlockSize_13 / _1;
  _3 = (unsigned char) _2;
  maxMbBlockNum_24 = maxMbBlockNum_8 + _3;
  # DEBUG maxMbBlockNum => maxMbBlockNum_24
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) maxMbBlockNum_24;
  if (maxMsgBuffNum_25(D) < _4)
    goto <bb 6>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  i.3_5 = i_9;
  i_26 = i.3_5 + 1;
  # DEBUG i => i_26

  <bb 5> :
  # can_real_payload_6 = PHI <can_real_payload_14(2), can_real_payload_22(4)>
  # maxMbBlockNum_8 = PHI <maxMbBlockNum_15(2), maxMbBlockNum_24(4)>
  # i_9 = PHI <i_18(2), i_26(4)>
  # DEBUG i => i_9
  # DEBUG maxMbBlockNum => maxMbBlockNum_8
  # DEBUG can_real_payload => can_real_payload_6
  # DEBUG BEGIN_STMT
  if (i_9 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # can_real_payload_7 = PHI <can_real_payload_22(3), can_real_payload_6(5)>
  # DEBUG can_real_payload => can_real_payload_7
  # DEBUG BEGIN_STMT
  _27 = can_real_payload_7;
  return _27;

}


FlexCAN_GetPayloadSize (const struct FLEXCAN_Type * base, uint8 mbdsrIdx)
{
  uint32 payloadSize;
  _Bool _1;
  int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  uint8 _17;

  <bb 2> :
  # DEBUG BEGIN_STMT
  payloadSize_10 = 8;
  # DEBUG payloadSize => payloadSize_10
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_IsFDAvailable (base_12(D));
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _2 = (int) mbdsrIdx_14(D);
  if (_2 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  _3 ={v} base_12(D)->FDCTRL;
  _4 = _3 >> 16;
  _5 = _4 & 3;
  payloadSize_15 = 8 << _5;
  # DEBUG payloadSize => payloadSize_15
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  _6 ={v} base_12(D)->FDCTRL;
  _7 = _6 >> 16;
  _8 = _7 & 3;
  payloadSize_16 = 8 << _8;
  # DEBUG payloadSize => payloadSize_16
  # DEBUG BEGIN_STMT

  <bb 6> :
  # payloadSize_9 = PHI <payloadSize_10(2), payloadSize_15(4), payloadSize_16(5)>
  # DEBUG payloadSize => payloadSize_9
  # DEBUG BEGIN_STMT
  _17 = (uint8) payloadSize_9;
  return _17;

}


FlexCAN_SetPayloadSize (struct FLEXCAN_Type * base, const struct Flexcan_Ip_PayloadSizeType * payloadSize)
{
  uint32 tmp;
  _Bool _1;
  <unnamed type> _2;
  long unsigned int _3;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  tmp_8 ={v} base_6(D)->FDCTRL;
  # DEBUG tmp => tmp_8
  # DEBUG BEGIN_STMT
  tmp_9 = tmp_8 & 4294770687;
  # DEBUG tmp => tmp_9
  # DEBUG BEGIN_STMT
  _2 = payloadSize_10(D)->payloadBlock0;
  _3 = _2 << 16;
  tmp_11 = tmp_9 | _3;
  # DEBUG tmp => tmp_11
  # DEBUG BEGIN_STMT
  base_6(D)->FDCTRL ={v} tmp_11;

  <bb 4> :
  return;

}


FlexCAN_IsFDAvailable (const struct FLEXCAN_Type * base)
{
  boolean returnValue;
  static struct FLEXCAN_Type * const flexcanBase[1] = {1073889280B};
  uint32 i;
  struct FLEXCAN_Type * _1;
  boolean _11;

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

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

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

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

  <bb 6> :
  # i_2 = PHI <i_6(2), i_9(5)>
  # DEBUG i => i_2
  # DEBUG BEGIN_STMT
  if (i_2 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # returnValue_3 = PHI <returnValue_10(4), returnValue_5(6)>
  # DEBUG returnValue => returnValue_3
  # DEBUG BEGIN_STMT
  _11 = returnValue_3;
  return _11;

}


FlexCAN_EnableRxFifo (struct FLEXCAN_Type * base, uint32 numOfFilters)
{
  Flexcan_Ip_StatusType stat;
  uint16 noOfMbx;
  uint32 i;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  Flexcan_Ip_StatusType _29;

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

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

  <bb 4> :
  # stat_13 = PHI <stat_20(2), stat_21(3)>
  # DEBUG stat => stat_13
  # DEBUG BEGIN_STMT
  if (stat_13 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _4 ={v} base_17(D)->MCR;
  _5 = _4 | 536870912;
  base_17(D)->MCR ={v} _5;
  # DEBUG BEGIN_STMT
  _6 ={v} base_17(D)->CTRL2;
  _7 = _6 & 4043309055;
  _8 = numOfFilters_23(D) << 24;
  _9 = _8 & 251658240;
  _10 = _7 | _9;
  base_17(D)->CTRL2 ={v} _10;
  # DEBUG BEGIN_STMT
  base_17(D)->RXFGMASK ={v} 4294967295;
  # DEBUG BEGIN_STMT
  i_26 = 0;
  # DEBUG i => i_26
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  base_17(D)->RXIMR[i_12] ={v} 536870911;
  # DEBUG BEGIN_STMT
  i_28 = i_12 + 1;
  # DEBUG i => i_28

  <bb 7> :
  # i_12 = PHI <i_26(5), i_28(6)>
  # DEBUG i => i_12
  # DEBUG BEGIN_STMT
  _11 = (long unsigned int) noOfMbx_19;
  if (i_12 < _11)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  _29 = stat_13;
  return _29;

}


FlexCAN_Init (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnResult;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  _Bool _8;
  long unsigned int _25;
  Flexcan_Ip_StatusType _42;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  timeElapsed_16 = 0;
  # DEBUG timeElapsed => timeElapsed_16
  # DEBUG BEGIN_STMT
  uS2Ticks_18 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_18
  # DEBUG BEGIN_STMT
  returnResult_19 = 0;
  # DEBUG returnResult => returnResult_19
  # DEBUG BEGIN_STMT
  _1 ={v} base_20(D)->MCR;
  _2 = _1 | 33554432;
  base_20(D)->MCR ={v} _2;
  # DEBUG BEGIN_STMT
  _3 = OsIf_GetCounter (0);
  timeStart = _3;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _25 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_26 = _25 + timeElapsed_9;
  # DEBUG timeElapsed => timeElapsed_26
  # DEBUG BEGIN_STMT
  if (timeElapsed_26 >= uS2Ticks_18)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # timeElapsed_9 = PHI <timeElapsed_16(2), timeElapsed_26(3)>
  # DEBUG timeElapsed => timeElapsed_9
  # DEBUG BEGIN_STMT
  _4 ={v} base_20(D)->MCR;
  _5 = _4 & 33554432;
  if (_5 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # returnResult_10 = PHI <returnResult_27(4), returnResult_19(5)>
  # DEBUG returnResult => returnResult_10
  # DEBUG BEGIN_STMT
  if (returnResult_10 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _6 ={v} base_20(D)->MCR;
  _7 = _6 | 4096;
  base_20(D)->MCR ={v} _7;
  # DEBUG BEGIN_STMT
  FlexCAN_ClearRAM (base_20(D));
  # DEBUG BEGIN_STMT
  base_20(D)->RXMGMASK ={v} 4294967295;
  # DEBUG BEGIN_STMT
  base_20(D)->RX14MASK ={v} 4294967295;
  # DEBUG BEGIN_STMT
  base_20(D)->RX15MASK ={v} 4294967295;
  # DEBUG BEGIN_STMT
  base_20(D)->IMASK1 ={v} 0;
  # DEBUG BEGIN_STMT
  base_20(D)->IFLAG1 ={v} 4294967295;
  # DEBUG BEGIN_STMT
  base_20(D)->ESR1 ={v} 3866630;
  # DEBUG BEGIN_STMT
  base_20(D)->CTRL1 ={v} 0;
  # DEBUG BEGIN_STMT
  base_20(D)->CTRL2 ={v} 1048576;
  # DEBUG BEGIN_STMT
  base_20(D)->CBT ={v} 0;
  # DEBUG BEGIN_STMT
  _8 = FlexCAN_IsFDAvailable (base_20(D));
  if (_8 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  base_20(D)->FDCBT ={v} 0;
  # DEBUG BEGIN_STMT
  base_20(D)->FDCTRL ={v} 2147500288;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _42 = returnResult_10;
  timeStart ={v} {CLOBBER};
  return _42;

}


FlexCAN_SetErrIntCmd (struct FLEXCAN_Type * base, flexcan_int_type_t errType, boolean enable)
{
  uint32 temp;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;

  <bb 2> :
  # DEBUG BEGIN_STMT
  temp_18 = errType_17(D);
  # DEBUG temp => temp_18
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_06 ();
  # DEBUG BEGIN_STMT
  if (enable_21(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_22(D)->CTRL2;
  _2 = _1 | 2147483648;
  base_22(D)->CTRL2 ={v} _2;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

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

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

  <bb 7> :
  # DEBUG BEGIN_STMT
  _3 ={v} base_22(D)->MCR;
  _4 = _3 | 2097152;
  base_22(D)->MCR ={v} _4;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _5 ={v} base_22(D)->CTRL1;
  _6 = temp_18 | _5;
  base_22(D)->CTRL1 ={v} _6;
  goto <bb 13>; [INV]

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

  <bb 10> :
  # DEBUG BEGIN_STMT
  _7 ={v} base_22(D)->CTRL2;
  _8 = _7 & 2147483647;
  base_22(D)->CTRL2 ={v} _8;
  # DEBUG BEGIN_STMT
  goto <bb 13>; [INV]

  <bb 11> :
  # DEBUG BEGIN_STMT
  _9 ={v} base_22(D)->CTRL1;
  _10 = ~temp_18;
  _11 = _9 & _10;
  base_22(D)->CTRL1 ={v} _11;
  # DEBUG BEGIN_STMT
  temp_24 ={v} base_22(D)->CTRL1;
  # DEBUG temp => temp_24
  # DEBUG BEGIN_STMT
  _12 = temp_24 & 3072;
  if (_12 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _13 ={v} base_22(D)->MCR;
  _14 = _13 & 4292870143;
  base_22(D)->MCR ={v} _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;
  long unsigned int _1;
  signed int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _25;
  Flexcan_Ip_StatusType _28;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  timeElapsed_14 = 0;
  # DEBUG timeElapsed => timeElapsed_14
  # DEBUG BEGIN_STMT
  uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_16
  # DEBUG BEGIN_STMT
  returnResult_17 = 0;
  # DEBUG returnResult => returnResult_17
  # DEBUG BEGIN_STMT
  _1 ={v} base_18(D)->MCR;
  _2 = (signed int) _1;
  if (_2 >= 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
  _3 ={v} base_18(D)->MCR;
  _4 = _3 | 2147483648;
  base_18(D)->MCR ={v} _4;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_05 ();
  # DEBUG BEGIN_STMT
  _5 = OsIf_GetCounter (0);
  timeStart = _5;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _25 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_26 = _25 + timeElapsed_8;
  # DEBUG timeElapsed => timeElapsed_26
  # DEBUG BEGIN_STMT
  if (timeElapsed_26 >= uS2Ticks_16)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

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

  <bb 6> :
  # timeElapsed_8 = PHI <timeElapsed_14(3), timeElapsed_26(4)>
  # DEBUG timeElapsed => timeElapsed_8
  # DEBUG BEGIN_STMT
  _6 ={v} base_18(D)->MCR;
  _7 = _6 & 1048576;
  if (_7 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # returnResult_9 = PHI <returnResult_17(2), returnResult_27(5), returnResult_17(6)>
  # DEBUG returnResult => returnResult_9
  # DEBUG BEGIN_STMT
  _28 = returnResult_9;
  timeStart ={v} {CLOBBER};
  return _28;

}


FlexCAN_ExitFreezeMode (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnValue;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _26;
  Flexcan_Ip_StatusType _29;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  timeElapsed_14 = 0;
  # DEBUG timeElapsed => timeElapsed_14
  # DEBUG BEGIN_STMT
  uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_16
  # DEBUG BEGIN_STMT
  returnValue_17 = 0;
  # DEBUG returnValue => returnValue_17
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_04 ();
  # DEBUG BEGIN_STMT
  _1 ={v} base_19(D)->MCR;
  _2 = _1 & 4026531839;
  base_19(D)->MCR ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_19(D)->MCR;
  _4 = _3 & 3221225471;
  base_19(D)->MCR ={v} _4;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_04 ();
  # DEBUG BEGIN_STMT
  _5 = OsIf_GetCounter (0);
  timeStart = _5;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _26 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_27 = _26 + timeElapsed_8;
  # DEBUG timeElapsed => timeElapsed_27
  # DEBUG BEGIN_STMT
  if (timeElapsed_27 >= uS2Ticks_16)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # timeElapsed_8 = PHI <timeElapsed_14(2), timeElapsed_27(3)>
  # DEBUG timeElapsed => timeElapsed_8
  # DEBUG BEGIN_STMT
  _6 ={v} base_19(D)->MCR;
  _7 = _6 & 16777216;
  if (_7 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # returnValue_9 = PHI <returnValue_28(4), returnValue_17(5)>
  # DEBUG returnValue => returnValue_9
  # DEBUG BEGIN_STMT
  _29 = returnValue_9;
  timeStart ={v} {CLOBBER};
  return _29;

}


FlexCAN_Enable (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnValue;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _23;
  Flexcan_Ip_StatusType _26;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  timeElapsed_12 = 0;
  # DEBUG timeElapsed => timeElapsed_12
  # DEBUG BEGIN_STMT
  uS2Ticks_14 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_14
  # DEBUG BEGIN_STMT
  returnValue_15 = 0;
  # DEBUG returnValue => returnValue_15
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_03 ();
  # DEBUG BEGIN_STMT
  _1 ={v} base_17(D)->MCR;
  _2 = _1 & 2147483647;
  base_17(D)->MCR ={v} _2;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_03 ();
  # DEBUG BEGIN_STMT
  _3 = OsIf_GetCounter (0);
  timeStart = _3;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _23 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_24 = _23 + timeElapsed_6;
  # DEBUG timeElapsed => timeElapsed_24
  # DEBUG BEGIN_STMT
  if (timeElapsed_24 >= uS2Ticks_14)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

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

  <bb 5> :
  # timeElapsed_6 = PHI <timeElapsed_12(2), timeElapsed_24(3)>
  # DEBUG timeElapsed => timeElapsed_6
  # DEBUG BEGIN_STMT
  _4 ={v} base_17(D)->MCR;
  _5 = _4 & 16777216;
  if (_5 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # returnValue_7 = PHI <returnValue_25(4), returnValue_15(5)>
  # DEBUG returnValue => returnValue_7
  # DEBUG BEGIN_STMT
  _26 = returnValue_7;
  timeStart ={v} {CLOBBER};
  return _26;

}


FlexCAN_EnterFreezeMode (struct FLEXCAN_Type * base)
{
  Flexcan_Ip_StatusType returnResult;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  signed int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _32;
  Flexcan_Ip_StatusType _35;

  <bb 2> :
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  timeElapsed_19 = 0;
  # DEBUG timeElapsed => timeElapsed_19
  # DEBUG BEGIN_STMT
  uS2Ticks_21 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_21
  # DEBUG BEGIN_STMT
  returnResult_22 = 0;
  # DEBUG returnResult => returnResult_22
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_02 ();
  # DEBUG BEGIN_STMT
  _1 ={v} base_24(D)->MCR;
  _2 = _1 | 1073741824;
  base_24(D)->MCR ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_24(D)->MCR;
  _4 = _3 | 268435456;
  base_24(D)->MCR ={v} _4;
  # DEBUG BEGIN_STMT
  _5 ={v} base_24(D)->MCR;
  _6 = (signed int) _5;
  if (_6 < 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _7 ={v} base_24(D)->MCR;
  _8 = _7 & 2147483647;
  base_24(D)->MCR ={v} _8;

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

  <bb 5> :
  # DEBUG BEGIN_STMT
  _32 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_33 = _32 + timeElapsed_12;
  # DEBUG timeElapsed => timeElapsed_33
  # DEBUG BEGIN_STMT
  if (timeElapsed_33 >= uS2Ticks_21)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

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

  <bb 7> :
  # timeElapsed_12 = PHI <timeElapsed_19(4), timeElapsed_33(5)>
  # DEBUG timeElapsed => timeElapsed_12
  # DEBUG BEGIN_STMT
  _10 ={v} base_24(D)->MCR;
  _11 = _10 & 16777216;
  if (_11 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # returnResult_13 = PHI <returnResult_34(6), returnResult_22(7)>
  # DEBUG returnResult => returnResult_13
  # DEBUG BEGIN_STMT
  _35 = returnResult_13;
  timeStart ={v} {CLOBBER};
  return _35;

}


FlexCAN_GetMaxMbNum (const struct FLEXCAN_Type * base)
{
  static const uint32 maxMbNum[3] = {32, 16, 16};
  static struct FLEXCAN_Type * const flexcanBase[3] = {1073889280B, 1073893376B, 1073917952B};
  uint32 ret;
  uint32 i;
  struct FLEXCAN_Type * _1;
  uint32 _7;

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

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

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

  <bb 5> :
  # ret_3 = PHI <ret_4(3), ret_10(4)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  i_11 = i_2 + 1;
  # DEBUG i => i_11

  <bb 6> :
  # i_2 = PHI <i_6(2), i_11(5)>
  # ret_4 = PHI <ret_5(2), ret_3(5)>
  # DEBUG ret => ret_4
  # DEBUG i => i_2
  # DEBUG BEGIN_STMT
  if (i_2 <= 2)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _7 = ret_4;
  return _7;

}


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;
  long unsigned int base.0_1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  unsigned char i.1_7;
  long unsigned int _8;
  long unsigned int _9;
  unsigned char _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  volatile uint32 * _47;

  <bb 2> :
  # DEBUG BEGIN_STMT
  arbitration_field_size_23 = 8;
  # DEBUG arbitration_field_size => arbitration_field_size_23
  # DEBUG BEGIN_STMT
  mb_size_24 = 0;
  # DEBUG mb_size => mb_size_24
  # DEBUG BEGIN_STMT
  ramBlockSize_25 = 512;
  # DEBUG ramBlockSize => ramBlockSize_25
  # DEBUG BEGIN_STMT
  ramBlockOffset_26 = 0;
  # DEBUG ramBlockOffset => ramBlockOffset_26
  # DEBUG BEGIN_STMT
  msgBuffIdxBackup_28 = msgBuffIdx_27(D);
  # DEBUG msgBuffIdxBackup => msgBuffIdxBackup_28
  # DEBUG BEGIN_STMT
  i_29 = 0;
  # DEBUG i => i_29
  # DEBUG BEGIN_STMT
  maxMbNum_30 = 0;
  # DEBUG maxMbNum => maxMbNum_30
  # DEBUG BEGIN_STMT
  mb_index_31 = 0;
  # DEBUG mb_index => mb_index_31
  # DEBUG BEGIN_STMT
  payload_size_32 = 0;
  # DEBUG payload_size => payload_size_32
  # DEBUG BEGIN_STMT
  base.0_1 = (long unsigned int) base_33(D);
  _2 = base.0_1 + 128;
  RAM_34 = (volatile uint32 *) _2;
  # DEBUG RAM => RAM_34
  # DEBUG BEGIN_STMT
  pAddressRet_35 = 0B;
  # DEBUG pAddressRet => pAddressRet_35
  # DEBUG BEGIN_STMT
  i_36 = 0;
  # DEBUG i => i_36
  goto <bb 5>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  payload_size_39 = FlexCAN_GetPayloadSize (base_33(D), i_18);
  # DEBUG payload_size => payload_size_39
  # DEBUG BEGIN_STMT
  mb_size_40 = payload_size_39 + arbitration_field_size_23;
  # DEBUG mb_size => mb_size_40
  # DEBUG BEGIN_STMT
  _3 = (long unsigned int) mb_size_40;
  _4 = ramBlockSize_25 / _3;
  maxMbNum_41 = (uint8) _4;
  # DEBUG maxMbNum => maxMbNum_41
  # DEBUG BEGIN_STMT
  _5 = (long unsigned int) maxMbNum_41;
  if (msgBuffIdxBackup_17 < _5)
    goto <bb 6>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  ramBlockOffset_42 = ramBlockOffset_16 + 128;
  # DEBUG ramBlockOffset => ramBlockOffset_42
  # DEBUG BEGIN_STMT
  _6 = (long unsigned int) maxMbNum_41;
  msgBuffIdxBackup_43 = msgBuffIdxBackup_17 - _6;
  # DEBUG msgBuffIdxBackup => msgBuffIdxBackup_43
  # DEBUG BEGIN_STMT
  i.1_7 = i_18;
  i_44 = i.1_7 + 1;
  # DEBUG i => i_44

  <bb 5> :
  # mb_size_14 = PHI <mb_size_24(2), mb_size_40(4)>
  # ramBlockOffset_16 = PHI <ramBlockOffset_26(2), ramBlockOffset_42(4)>
  # msgBuffIdxBackup_17 = PHI <msgBuffIdxBackup_28(2), msgBuffIdxBackup_43(4)>
  # i_18 = PHI <i_36(2), i_44(4)>
  # maxMbNum_19 = PHI <maxMbNum_30(2), maxMbNum_41(4)>
  # DEBUG maxMbNum => maxMbNum_19
  # DEBUG i => i_18
  # DEBUG msgBuffIdxBackup => msgBuffIdxBackup_17
  # DEBUG ramBlockOffset => ramBlockOffset_16
  # DEBUG mb_size => mb_size_14
  # DEBUG BEGIN_STMT
  if (i_18 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # mb_size_15 = PHI <mb_size_40(3), mb_size_14(5)>
  # maxMbNum_20 = PHI <maxMbNum_41(3), maxMbNum_19(5)>
  # DEBUG maxMbNum => maxMbNum_20
  # DEBUG mb_size => mb_size_15
  # DEBUG BEGIN_STMT
  _8 = (long unsigned int) maxMbNum_20;
  _9 = msgBuffIdxBackup_17 % _8;
  _10 = mb_size_15 >> 2;
  _11 = (long unsigned int) _10;
  _12 = _9 * _11;
  mb_index_45 = ramBlockOffset_16 + _12;
  # DEBUG mb_index => mb_index_45
  # DEBUG BEGIN_STMT
  _13 = mb_index_45 * 4;
  pAddressRet_46 = RAM_34 + _13;
  # DEBUG pAddressRet => pAddressRet_46
  # DEBUG BEGIN_STMT
  _47 = pAddressRet_46;
  return _47;

}


FlexCAN_ComputePayloadSize (uint8 dlcValue)
{
  uint8 ret;
  int _1;
  uint8 _13;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  ret_12 = dlcValue_4(D);
  # DEBUG ret => ret_12
  goto <bb 12>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _1 = (int) dlcValue_4(D);
  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_11 = 12;
  # DEBUG ret => ret_11
  # DEBUG BEGIN_STMT
  goto <bb 12>; [INV]

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

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

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

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

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

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

  <bb 12> :
  # ret_2 = PHI <ret_12(3), ret_11(5), ret_10(6), ret_9(7), ret_8(8), ret_7(9), ret_6(10), ret_5(11), ret_3(4)>
<L13>:
  # DEBUG ret => ret_2
  # DEBUG BEGIN_STMT
  _13 = ret_2;
  return _13;

}


FlexCAN_ClearRAM (struct FLEXCAN_Type * base)
{
  volatile uint32 * RAM;
  uint32 RXIMR_size;
  uint32 RAM_size;
  uint32 databyte;
  long unsigned int _1;
  long unsigned int base.2_2;
  long unsigned int _3;
  long unsigned int _4;
  volatile uint32 * _5;
  long unsigned int _6;
  volatile uint32 * _7;

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

  <bb 3> :
  # DEBUG BEGIN_STMT
  _4 = databyte_8 * 4;
  _5 = RAM_18 + _4;
  *_5 ={v} 0;
  # DEBUG BEGIN_STMT
  databyte_25 = databyte_8 + 1;
  # DEBUG databyte => databyte_25

  <bb 4> :
  # databyte_8 = PHI <databyte_19(2), databyte_25(3)>
  # DEBUG databyte => databyte_8
  # DEBUG BEGIN_STMT
  if (databyte_8 < RAM_size_15)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  RAM_20 = &base_13(D)->RXIMR;
  # DEBUG RAM => RAM_20
  # DEBUG BEGIN_STMT
  databyte_21 = 0;
  # DEBUG databyte => databyte_21
  goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _6 = databyte_9 * 4;
  _7 = RAM_20 + _6;
  *_7 ={v} 0;
  # DEBUG BEGIN_STMT
  databyte_23 = databyte_9 + 1;
  # DEBUG databyte => databyte_23

  <bb 7> :
  # databyte_9 = PHI <databyte_21(5), databyte_23(6)>
  # DEBUG databyte => databyte_9
  # DEBUG BEGIN_STMT
  if (databyte_9 < RXIMR_size_17)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  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;
  int _1;
  unsigned char _2;
  uint8 _8;

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

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

  <bb 4> :
  # ret_3 = PHI <ret_4(2), ret_7(3)>
  # DEBUG ret => ret_3
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _8 = (uint8) ret_3;
  return _8;

}


FlexCAN_SetPNPayloadLowFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
{
  unsigned char _1;
  long unsigned int _2;
  long unsigned int _3;
  const uint8 * _4;
  unsigned char _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  const uint8 * _10;
  unsigned char _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  const uint8 * _16;
  unsigned char _17;
  long unsigned int _18;
  long unsigned int _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = *pPayload_21(D);
  _2 = (long unsigned int) _1;
  _3 = _2 << 24;
  _4 = pPayload_21(D) + 1;
  _5 = *_4;
  _6 = (long unsigned int) _5;
  _7 = _6 << 16;
  _8 = _7 & 16711680;
  _9 = _3 | _8;
  _10 = pPayload_21(D) + 2;
  _11 = *_10;
  _12 = (long unsigned int) _11;
  _13 = _12 << 8;
  _14 = _13 & 65535;
  _15 = _9 | _14;
  _16 = pPayload_21(D) + 3;
  _17 = *_16;
  _18 = (long unsigned int) _17;
  _19 = _15 | _18;
  pBase_22(D)->PL2_PLMASK_LO ={v} _19;
  return;

}


FlexCAN_SetPNPayloadHighFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
{
  const uint8 * _1;
  unsigned char _2;
  long unsigned int _3;
  long unsigned int _4;
  const uint8 * _5;
  unsigned char _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  const uint8 * _11;
  unsigned char _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  const uint8 * _17;
  unsigned char _18;
  long unsigned int _19;
  long unsigned int _20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = pPayload_21(D) + 4;
  _2 = *_1;
  _3 = (long unsigned int) _2;
  _4 = _3 << 24;
  _5 = pPayload_21(D) + 5;
  _6 = *_5;
  _7 = (long unsigned int) _6;
  _8 = _7 << 16;
  _9 = _8 & 16711680;
  _10 = _4 | _9;
  _11 = pPayload_21(D) + 6;
  _12 = *_11;
  _13 = (long unsigned int) _12;
  _14 = _13 << 8;
  _15 = _14 & 65535;
  _16 = _10 | _15;
  _17 = pPayload_21(D) + 7;
  _18 = *_17;
  _19 = (long unsigned int) _18;
  _20 = _16 | _19;
  pBase_23(D)->PL2_PLMASK_HI ={v} _20;
  return;

}


FlexCAN_SetPNPayloadLowFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
{
  unsigned char _1;
  long unsigned int _2;
  long unsigned int _3;
  const uint8 * _4;
  unsigned char _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  const uint8 * _10;
  unsigned char _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  const uint8 * _16;
  unsigned char _17;
  long unsigned int _18;
  long unsigned int _19;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = *pPayload_21(D);
  _2 = (long unsigned int) _1;
  _3 = _2 << 24;
  _4 = pPayload_21(D) + 1;
  _5 = *_4;
  _6 = (long unsigned int) _5;
  _7 = _6 << 16;
  _8 = _7 & 16711680;
  _9 = _3 | _8;
  _10 = pPayload_21(D) + 2;
  _11 = *_10;
  _12 = (long unsigned int) _11;
  _13 = _12 << 8;
  _14 = _13 & 65535;
  _15 = _9 | _14;
  _16 = pPayload_21(D) + 3;
  _17 = *_16;
  _18 = (long unsigned int) _17;
  _19 = _15 | _18;
  pBase_22(D)->PL1_LO ={v} _19;
  return;

}


FlexCAN_SetPNPayloadHighFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload)
{
  const uint8 * _1;
  unsigned char _2;
  long unsigned int _3;
  long unsigned int _4;
  const uint8 * _5;
  unsigned char _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  const uint8 * _11;
  unsigned char _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  const uint8 * _17;
  unsigned char _18;
  long unsigned int _19;
  long unsigned int _20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = pPayload_21(D) + 4;
  _2 = *_1;
  _3 = (long unsigned int) _2;
  _4 = _3 << 24;
  _5 = pPayload_21(D) + 5;
  _6 = *_5;
  _7 = (long unsigned int) _6;
  _8 = _7 << 16;
  _9 = _8 & 16711680;
  _10 = _4 | _9;
  _11 = pPayload_21(D) + 6;
  _12 = *_11;
  _13 = (long unsigned int) _12;
  _14 = _13 << 8;
  _15 = _14 & 65535;
  _16 = _10 | _15;
  _17 = pPayload_21(D) + 7;
  _18 = *_17;
  _19 = (long unsigned int) _18;
  _20 = _16 | _19;
  pBase_23(D)->PL1_HI ={v} _20;
  return;

}


FlexCAN_SetPNDlcFilter (struct FLEXCAN_Type * pBase, uint8 u8DlcLow, uint8 u8DlcHigh)
{
  uint32 tmp;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  tmp_8 ={v} pBase_7(D)->FLT_DLC;
  # DEBUG tmp => tmp_8
  # DEBUG BEGIN_STMT
  tmp_9 = tmp_8 & 4293984240;
  # DEBUG tmp => tmp_9
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) u8DlcHigh_10(D);
  _2 = _1 & 15;
  tmp_11 = tmp_9 | _2;
  # DEBUG tmp => tmp_11
  # DEBUG BEGIN_STMT
  _3 = (long unsigned int) u8DlcLow_12(D);
  _4 = _3 << 16;
  _5 = _4 & 983040;
  tmp_13 = tmp_11 | _5;
  # DEBUG tmp => tmp_13
  # DEBUG BEGIN_STMT
  pBase_7(D)->FLT_DLC ={v} tmp_13;
  return;

}


FlexCAN_SetPNIdFilter2 (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
{
  uint32 u32Tmp;
  _Bool _1;
  _Bool _2;
  _Bool _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int iftmp.23_10;
  long unsigned int iftmp.24_11;
  long unsigned int iftmp.23_17;
  long unsigned int iftmp.23_18;
  long unsigned int iftmp.24_20;
  long unsigned int iftmp.24_21;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  u32Tmp_14 ={v} pBase_13(D)->FLT_ID2_IDMASK;
  # DEBUG u32Tmp => u32Tmp_14
  # DEBUG BEGIN_STMT
  u32Tmp_15 = u32Tmp_14 & 2147483648;
  # DEBUG u32Tmp => u32Tmp_15
  # DEBUG BEGIN_STMT
  _1 = pPnConfig_16(D)->idFilter2.bExtendedId;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.23_17 = 0;

  <bb 5> :
  # iftmp.23_10 = PHI <iftmp.23_18(3), iftmp.23_17(4)>
  u32Tmp_19 = iftmp.23_10 | u32Tmp_15;
  # DEBUG u32Tmp => u32Tmp_19
  # DEBUG BEGIN_STMT
  _2 = pPnConfig_16(D)->idFilter2.bRemoteFrame;
  if (_2 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  iftmp.24_21 = 536870912;
  goto <bb 8>; [INV]

  <bb 7> :
  iftmp.24_20 = 0;

  <bb 8> :
  # iftmp.24_11 = PHI <iftmp.24_21(6), iftmp.24_20(7)>
  u32Tmp_22 = iftmp.24_11 | u32Tmp_19;
  # DEBUG u32Tmp => u32Tmp_22
  # DEBUG BEGIN_STMT
  _3 = pPnConfig_16(D)->idFilter1.bExtendedId;
  if (_3 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _4 = pPnConfig_16(D)->idFilter2.u32Id;
  _5 = _4 & 536870911;
  u32Tmp_24 = u32Tmp_22 | _5;
  # DEBUG u32Tmp => u32Tmp_24
  goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _6 = pPnConfig_16(D)->idFilter2.u32Id;
  _7 = _6 << 18;
  _8 = _7 & 536870911;
  u32Tmp_23 = u32Tmp_22 | _8;
  # DEBUG u32Tmp => u32Tmp_23

  <bb 11> :
  # u32Tmp_9 = PHI <u32Tmp_24(9), u32Tmp_23(10)>
  # DEBUG u32Tmp => u32Tmp_9
  # DEBUG BEGIN_STMT
  pBase_13(D)->FLT_ID2_IDMASK ={v} u32Tmp_9;
  return;

}


FlexCAN_SetPNIdFilter2Check (struct FLEXCAN_Type * pBase)
{
  long unsigned int _1;
  long unsigned int _2;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} pBase_4(D)->FLT_ID2_IDMASK;
  _2 = _1 | 1610612736;
  pBase_4(D)->FLT_ID2_IDMASK ={v} _2;
  return;

}


FlexCAN_SetPNIdFilter1 (struct FLEXCAN_Type * pBase, struct Flexcan_Ip_PnIdFilterType idFilter)
{
  uint32 u32Tmp;
  _Bool _1;
  _Bool _2;
  _Bool _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int iftmp.21_10;
  long unsigned int iftmp.22_11;
  long unsigned int iftmp.21_16;
  long unsigned int iftmp.21_17;
  long unsigned int iftmp.22_19;
  long unsigned int iftmp.22_20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  u32Tmp_14 ={v} pBase_13(D)->FLT_ID1;
  # DEBUG u32Tmp => u32Tmp_14
  # DEBUG BEGIN_STMT
  u32Tmp_15 = u32Tmp_14 & 2147483648;
  # DEBUG u32Tmp => u32Tmp_15
  # DEBUG BEGIN_STMT
  _1 = idFilter.bExtendedId;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.21_16 = 0;

  <bb 5> :
  # iftmp.21_10 = PHI <iftmp.21_17(3), iftmp.21_16(4)>
  u32Tmp_18 = iftmp.21_10 | u32Tmp_15;
  # DEBUG u32Tmp => u32Tmp_18
  # DEBUG BEGIN_STMT
  _2 = idFilter.bRemoteFrame;
  if (_2 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  iftmp.22_20 = 536870912;
  goto <bb 8>; [INV]

  <bb 7> :
  iftmp.22_19 = 0;

  <bb 8> :
  # iftmp.22_11 = PHI <iftmp.22_20(6), iftmp.22_19(7)>
  u32Tmp_21 = iftmp.22_11 | u32Tmp_18;
  # DEBUG u32Tmp => u32Tmp_21
  # DEBUG BEGIN_STMT
  _3 = idFilter.bExtendedId;
  if (_3 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  _4 = idFilter.u32Id;
  _5 = _4 & 536870911;
  u32Tmp_23 = u32Tmp_21 | _5;
  # DEBUG u32Tmp => u32Tmp_23
  goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _6 = idFilter.u32Id;
  _7 = _6 << 18;
  _8 = _7 & 536870911;
  u32Tmp_22 = u32Tmp_21 | _8;
  # DEBUG u32Tmp => u32Tmp_22

  <bb 11> :
  # u32Tmp_9 = PHI <u32Tmp_23(9), u32Tmp_22(10)>
  # DEBUG u32Tmp => u32Tmp_9
  # DEBUG BEGIN_STMT
  pBase_13(D)->FLT_ID1 ={v} u32Tmp_9;
  return;

}


FlexCAN_SetPNTimeoutValue (struct FLEXCAN_Type * pBase, uint16 u16TimeoutValue)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} pBase_6(D)->CTRL2_PN;
  _2 = _1 & 4294901760;
  _3 = (long unsigned int) u16TimeoutValue_7(D);
  _4 = _2 | _3;
  pBase_6(D)->CTRL2_PN ={v} _4;
  return;

}


FlexCAN_SetPNFilteringSelection (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig)
{
  uint32 u32Tmp;
  _Bool _1;
  _Bool _2;
  short unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  <unnamed type> _7;
  long unsigned int _8;
  <unnamed type> _9;
  long unsigned int _10;
  long unsigned int _11;
  <unnamed type> _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int iftmp.19_15;
  long unsigned int iftmp.20_16;
  long unsigned int iftmp.19_22;
  long unsigned int iftmp.19_23;
  long unsigned int iftmp.20_25;
  long unsigned int iftmp.20_26;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  u32Tmp_19 ={v} pBase_18(D)->CTRL1_PN;
  # DEBUG u32Tmp => u32Tmp_19
  # DEBUG BEGIN_STMT
  u32Tmp_20 = u32Tmp_19 & 4294705344;
  # DEBUG u32Tmp => u32Tmp_20
  # DEBUG BEGIN_STMT
  _1 = pPnConfig_21(D)->bWakeUpTimeout;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.19_23 = 131072;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.19_22 = 0;

  <bb 5> :
  # iftmp.19_15 = PHI <iftmp.19_23(3), iftmp.19_22(4)>
  u32Tmp_24 = iftmp.19_15 | u32Tmp_20;
  # DEBUG u32Tmp => u32Tmp_24
  # DEBUG BEGIN_STMT
  _2 = pPnConfig_21(D)->bWakeUpMatch;
  if (_2 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  iftmp.20_26 = 65536;
  goto <bb 8>; [INV]

  <bb 7> :
  iftmp.20_25 = 0;

  <bb 8> :
  # iftmp.20_16 = PHI <iftmp.20_26(6), iftmp.20_25(7)>
  u32Tmp_27 = iftmp.20_16 | u32Tmp_24;
  # DEBUG u32Tmp => u32Tmp_27
  # DEBUG BEGIN_STMT
  _3 = pPnConfig_21(D)->u16NumMatches;
  _4 = (long unsigned int) _3;
  _5 = _4 << 8;
  _6 = _5 & 65535;
  u32Tmp_28 = u32Tmp_27 | _6;
  # DEBUG u32Tmp => u32Tmp_28
  # DEBUG BEGIN_STMT
  _7 = pPnConfig_21(D)->eFilterComb;
  _8 = _7 & 3;
  u32Tmp_29 = u32Tmp_28 | _8;
  # DEBUG u32Tmp => u32Tmp_29
  # DEBUG BEGIN_STMT
  _9 = pPnConfig_21(D)->eIdFilterType;
  _10 = _9 << 2;
  _11 = _10 & 12;
  u32Tmp_30 = u32Tmp_29 | _11;
  # DEBUG u32Tmp => u32Tmp_30
  # DEBUG BEGIN_STMT
  _12 = pPnConfig_21(D)->ePayloadFilterType;
  _13 = _12 << 4;
  _14 = _13 & 48;
  u32Tmp_31 = u32Tmp_30 | _14;
  # DEBUG u32Tmp => u32Tmp_31
  # DEBUG BEGIN_STMT
  pBase_18(D)->CTRL1_PN ={v} u32Tmp_31;
  return;

}


FlexCAN_CanBitSampling (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.15_4;
  long unsigned int iftmp.15_8;
  long unsigned int iftmp.15_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL1;
  _2 = _1 & 4294967167;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.15_8 = 0;

  <bb 5> :
  # iftmp.15_4 = PHI <iftmp.15_9(3), iftmp.15_8(4)>
  _3 = iftmp.15_4 | _2;
  base_6(D)->CTRL1 ={v} _3;
  return;

}


FlexCAN_SetEdgeFilter (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.18_4;
  long unsigned int iftmp.18_8;
  long unsigned int iftmp.18_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL2;
  _2 = _1 & 4294965247;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.18_8 = 2048;

  <bb 5> :
  # iftmp.18_4 = PHI <iftmp.18_9(3), iftmp.18_8(4)>
  _3 = iftmp.18_4 | _2;
  base_6(D)->CTRL2 ={v} _3;
  return;

}


FlexCAN_SetBusOffAutorecovery (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.16_4;
  long unsigned int iftmp.16_8;
  long unsigned int iftmp.16_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL1;
  _2 = _1 & 4294967231;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.16_8 = 64;

  <bb 5> :
  # iftmp.16_4 = PHI <iftmp.16_9(3), iftmp.16_8(4)>
  _3 = iftmp.16_4 | _2;
  base_6(D)->CTRL1 ={v} _3;
  return;

}


FlexCAN_SetRemoteReqStore (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.17_4;
  long unsigned int iftmp.17_8;
  long unsigned int iftmp.17_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL2;
  _2 = _1 & 4294836223;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.17_9 = 131072;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.17_8 = 0;

  <bb 5> :
  # iftmp.17_4 = PHI <iftmp.17_9(3), iftmp.17_8(4)>
  _3 = iftmp.17_4 | _2;
  base_6(D)->CTRL2 ={v} _3;
  return;

}


FlexCAN_SetProtocolException (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.14_4;
  long unsigned int iftmp.14_8;
  long unsigned int iftmp.14_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL2;
  _2 = _1 & 4294950911;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.14_8 = 0;

  <bb 5> :
  # iftmp.14_4 = PHI <iftmp.14_9(3), iftmp.14_8(4)>
  _3 = iftmp.14_4 | _2;
  base_6(D)->CTRL2 ={v} _3;
  return;

}


FlexCAN_SetEntireFrameArbitrationFieldComparison (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.13_4;
  long unsigned int iftmp.13_8;
  long unsigned int iftmp.13_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL2;
  _2 = _1 & 4294901759;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.13_8 = 0;

  <bb 5> :
  # iftmp.13_4 = PHI <iftmp.13_9(3), iftmp.13_8(4)>
  _3 = iftmp.13_4 | _2;
  base_6(D)->CTRL2 ={v} _3;
  return;

}


FlexCAN_SetIsoCan (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.12_4;
  long unsigned int iftmp.12_8;
  long unsigned int iftmp.12_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL2;
  _2 = _1 & 4294963199;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.12_8 = 0;

  <bb 5> :
  # iftmp.12_4 = PHI <iftmp.12_9(3), iftmp.12_8(4)>
  _3 = iftmp.12_4 | _2;
  base_6(D)->CTRL2 ={v} _3;
  return;

}


FlexCAN_IsFDEnabled (const struct FLEXCAN_Type * base)
{
  long unsigned int _1;
  long unsigned int _2;
  boolean _5;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_4(D)->MCR;
  _2 = _1 & 2048;
  _5 = _2 != 0;
  return _5;

}


FlexCAN_SetSelfReception (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.9_4;
  long unsigned int iftmp.9_8;
  long unsigned int iftmp.9_9;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->MCR;
  _2 = _1 & 4294836223;
  if (enable_7(D) != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

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

  <bb 4> :
  iftmp.9_8 = 131072;

  <bb 5> :
  # iftmp.9_4 = PHI <iftmp.9_9(3), iftmp.9_8(4)>
  _3 = iftmp.9_4 | _2;
  base_6(D)->MCR ={v} _3;
  return;

}


