FlexCAN_GetMsgBuffIntStatusFlag.part.0 (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  uint8 flag;
  uint32 mask;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _6;
  long unsigned int _7;
  unsigned char _8;

  <bb 4> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  mask_2 ={v} base_1(D)->IMASK1;
  # DEBUG mask => mask_2
  # DEBUG BEGIN_STMT
  _3 ={v} base_1(D)->IFLAG1;
  _4 = mask_2 & _3;
  _6 = msgBuffIdx_5(D);
  _7 = _4 >> _6;
  _8 = (unsigned char) _7;
  flag_9 = _8 & 1;
  # DEBUG flag => flag_9

  <bb 3> [local count: 1073741824]:
  # flag_10 = PHI <flag_9(2)>
  # DEBUG flag => flag_10
  # DEBUG BEGIN_STMT
  return flag_10;

}


FlexCAN_Ip_ManualBusOffRecovery (uint8 Instance)
{
  Flexcan_Ip_StatusType RetVal;
  uint32 uS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  struct FLEXCAN_Type * Base;
  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;
  long unsigned int _12;
  long unsigned int _30;

  <bb 2> [local count: 696142619]:
  # DEBUG BEGIN_STMT
  _1 = (int) Instance_17(D);
  Base_19 = Flexcan_Ip_apxBase[_1];
  # DEBUG Base => Base_19
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  uS2Ticks_22 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_22
  # DEBUG BEGIN_STMT
  # DEBUG RetVal => 1
  # DEBUG BEGIN_STMT
  _2 ={v} Base_19->CTRL1;
  _3 = _2 & 64;
  if (_3 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 3> [local count: 348071309]:
  # DEBUG BEGIN_STMT
  # DEBUG RetVal => 0
  # DEBUG BEGIN_STMT
  _4 ={v} Base_19->ESR1;
  _5 = _4 & 32;
  if (_5 != 0)
    goto <bb 4>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 4> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_20 ();
  # DEBUG BEGIN_STMT
  _6 ={v} Base_19->CTRL1;
  _7 = _6 & 4294967231;
  Base_19->CTRL1 ={v} _7;
  # DEBUG BEGIN_STMT
  _8 ={v} Base_19->CTRL1;
  _9 = _8 | 64;
  Base_19->CTRL1 ={v} _9;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_20 ();
  # DEBUG BEGIN_STMT
  _10 = OsIf_GetCounter (0);
  timeStart = _10;
  # DEBUG BEGIN_STMT
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _30 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_31 = timeElapsed_13 + _30;
  # DEBUG timeElapsed => timeElapsed_31
  # DEBUG BEGIN_STMT
  if (uS2Ticks_22 <= timeElapsed_31)
    goto <bb 7>; [5.50%]
  else
    goto <bb 8>; [94.50%]

  <bb 8> [local count: 958878292]:

  <bb 6> [local count: 1073741824]:
  # timeElapsed_13 = PHI <0(4), timeElapsed_31(8)>
  # DEBUG timeElapsed => timeElapsed_13
  # DEBUG BEGIN_STMT
  _11 ={v} Base_19->ESR1;
  _12 = _11 & 32;
  if (_12 != 0)
    goto <bb 5>; [94.50%]
  else
    goto <bb 7>; [5.50%]

  <bb 7> [local count: 696142619]:
  # RetVal_14 = PHI <1(2), 0(3), 3(5), 0(6)>
  # DEBUG RetVal => RetVal_14
  # DEBUG BEGIN_STMT
  timeStart ={v} {CLOBBER};
  return RetVal_14;

}


FlexCAN_WakeUp_IRQHandler (uint8 u8Instance)
{
  const struct Flexcan_Ip_StateType * pState;
  struct FLEXCAN_Type * pBase;
  int _1;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _2;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _3;
  long unsigned int _12;
  long unsigned int _13;
  unsigned char _14;
  unsigned char _15;
  long unsigned int _16;
  long unsigned int _17;
  unsigned char _18;
  unsigned char _19;
  long unsigned int _20;
  long unsigned int _21;
  unsigned char _22;
  unsigned char _23;
  long unsigned int _24;
  long unsigned int _25;
  unsigned char _26;
  unsigned char _27;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_6(D);
  pBase_8 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_8
  # DEBUG BEGIN_STMT
  pState_9 = Flexcan_Ip_apxState[_1];
  # DEBUG pState => pState_9
  # DEBUG BEGIN_STMT
  if (pState_9 != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 11>; [30.00%]

  <bb 3> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_GetWTOF
  # DEBUG BEGIN_STMT
  _12 ={v} MEM[(const struct FLEXCAN_Type *)pBase_8].WU_MTC;
  _13 = _12 >> 17;
  _14 = (unsigned char) _13;
  _15 = _14 & 1;
  # DEBUG pBase => NULL
  if (_15 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 4> [local count: 375809639]:
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_ClearWTOF
  # DEBUG BEGIN_STMT
  pBase_8->WU_MTC ={v} 131072;
  # DEBUG pBase => NULL
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_GetWTOIE
  # DEBUG BEGIN_STMT
  _16 ={v} MEM[(const struct FLEXCAN_Type *)pBase_8].CTRL1_PN;
  _17 = _16 >> 17;
  _18 = (unsigned char) _17;
  _19 = _18 & 1;
  # DEBUG pBase => NULL
  if (_19 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 5> [local count: 187904819]:
  _2 = pState_9->callback;
  if (_2 != 0B)
    goto <bb 6>; [70.00%]
  else
    goto <bb 7>; [30.00%]

  <bb 6> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _2 (u8Instance_6(D), 5, 0, pState_9);

  <bb 7> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_GetWUMF
  # DEBUG BEGIN_STMT
  _20 ={v} MEM[(const struct FLEXCAN_Type *)pBase_8].WU_MTC;
  _21 = _20 >> 16;
  _22 = (unsigned char) _21;
  _23 = _22 & 1;
  # DEBUG pBase => NULL
  if (_23 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 8> [local count: 375809639]:
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_ClearWUMF
  # DEBUG BEGIN_STMT
  pBase_8->WU_MTC ={v} 65536;
  # DEBUG pBase => NULL
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_GetWUMIE
  # DEBUG BEGIN_STMT
  _24 ={v} MEM[(const struct FLEXCAN_Type *)pBase_8].CTRL1_PN;
  _25 = _24 >> 16;
  _26 = (unsigned char) _25;
  _27 = _26 & 1;
  # DEBUG pBase => NULL
  if (_27 != 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 9> [local count: 187904819]:
  _3 = pState_9->callback;
  if (_3 != 0B)
    goto <bb 10>; [70.00%]
  else
    goto <bb 12>; [30.00%]

  <bb 10> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _3 (u8Instance_6(D), 6, 0, pState_9);
  goto <bb 12>; [100.00%]

  <bb 11> [local count: 322122547]:
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_ClearWTOF
  # DEBUG BEGIN_STMT
  pBase_8->WU_MTC ={v} 131072;
  # DEBUG pBase => NULL
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_8
  # DEBUG INLINE_ENTRY FlexCAN_ClearWUMF
  # DEBUG BEGIN_STMT
  pBase_8->WU_MTC ={v} 65536;

  <bb 12> [local count: 1073741824]:
  # DEBUG pBase => NULL
  return;

}


FlexCAN_Ip_GetWMB (uint8 u8Instance, uint8 u8WmbIndex, struct Flexcan_Ip_MsgBuffType * pWmb)
{
  uint32 pWmbData;
  const struct FLEXCAN_Type * pBase;
  int _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;
  long unsigned int _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;
  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;
  unsigned char _27;
  unsigned char _28;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_30(D);
  pBase_32 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_32
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => &pWmb_33(D)->data[0]
  # DEBUG pTmp => D#1
  # DEBUG BEGIN_STMT
  _2 = (int) u8WmbIndex_34(D);
  pWmbData_35 ={v} pBase_32->WMB[_2].WMBn_D03;
  # DEBUG pWmbData => pWmbData_35
  # DEBUG BEGIN_STMT
  _3 = pWmbData_35 >> 24;
  _4 = pWmbData_35 >> 8;
  _5 = _4 & 65280;
  _6 = _3 | _5;
  _7 = pWmbData_35 << 8;
  _8 = _7 & 16711680;
  _9 = _6 | _8;
  _10 = pWmbData_35 << 24;
  _11 = _9 | _10;
  MEM[(uint32 *)pWmb_33(D) + 8B] = _11;
  # DEBUG BEGIN_STMT
  # DEBUG D#2 => &pWmb_33(D)->data[4]
  # DEBUG pTmp => D#2
  # DEBUG BEGIN_STMT
  pWmbData_37 ={v} pBase_32->WMB[_2].WMBn_D47;
  # DEBUG pWmbData => pWmbData_37
  # DEBUG BEGIN_STMT
  _12 = pWmbData_37 >> 24;
  _13 = pWmbData_37 >> 8;
  _14 = _13 & 65280;
  _15 = _12 | _14;
  _16 = pWmbData_37 << 8;
  _17 = _16 & 16711680;
  _18 = _15 | _17;
  _19 = pWmbData_37 << 24;
  _20 = _18 | _19;
  MEM[(uint32 *)pWmb_33(D) + 12B] = _20;
  # DEBUG BEGIN_STMT
  _21 ={v} pBase_32->WMB[_2].WMBn_CS;
  pWmb_33(D)->cs = _21;
  # DEBUG BEGIN_STMT
  _22 = _21 & 2097152;
  if (_22 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _23 ={v} pBase_32->WMB[_2].WMBn_ID;
  pWmb_33(D)->msgId = _23;
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _24 ={v} pBase_32->WMB[_2].WMBn_ID;
  _25 = _24 >> 18;
  pWmb_33(D)->msgId = _25;

  <bb 5> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _26 = _21 >> 16;
  _27 = (unsigned char) _26;
  _28 = _27 & 15;
  pWmb_33(D)->dataLen = _28;
  return;

}


FlexCAN_Ip_ConfigPN_Privileged (uint8 u8Instance, boolean bEnable, const struct Flexcan_Ip_PnConfigType * pPnConfig)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _21;
  signed int _22;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_8(D);
  pBase_10 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_10
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_10
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _21 ={v} MEM[(const struct FLEXCAN_Type *)pBase_10].MCR;
  _22 = (signed int) _21;
  # DEBUG pBase => NULL
  # DEBUG disabled => _22 < 0
  # DEBUG BEGIN_STMT
  if (u8Instance_8(D) == 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  if (_22 < 0)
    goto <bb 4>; [25.50%]
  else
    goto <bb 5>; [74.50%]

  <bb 4> [local count: 136902083]:
  # DEBUG BEGIN_STMT
  result_12 = FlexCAN_Enable (pBase_10);
  # DEBUG result => result_12
  # DEBUG BEGIN_STMT
  if (result_12 == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 5> [local count: 468419871]:
  # result_23 = PHI <result_12(4), 0(3)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  if (bEnable_13(D) != 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 6> [local count: 154578557]:
  # DEBUG BEGIN_STMT
  FlexCAN_ConfigPN (pBase_10, pPnConfig_14(D));

  <bb 7> [local count: 468419871]:
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_12 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetPN (pBase_10, bEnable_13(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_12 ();

  <bb 8> [local count: 536870913]:
  # result_2 = PHI <result_12(4), result_23(7)>
  # DEBUG BEGIN_STMT
  if (_22 < 0)
    goto <bb 9>; [25.50%]
  else
    goto <bb 11>; [74.50%]

  <bb 9> [local count: 136902083]:
  # DEBUG BEGIN_STMT
  status_20 = FlexCAN_Disable (pBase_10);
  # DEBUG status => status_20
  # DEBUG BEGIN_STMT
  if (status_20 != 0)
    goto <bb 10>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 10> [local count: 68451041]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_20

  <bb 11> [local count: 1073741824]:
  # result_4 = PHI <result_2(9), 1(2), result_2(8), status_20(10)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_GetListenOnlyMode (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _5;
  long unsigned int _6;
  _Bool _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  base_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_4
  # DEBUG BEGIN_STMT
  # DEBUG base => base_4
  # DEBUG INLINE_ENTRY FlexCAN_IsListenOnlyModeEnabled
  # DEBUG BEGIN_STMT
  _5 ={v} base_4->CTRL1;
  _6 = _5 & 8;
  _7 = _6 != 0;
  # DEBUG base => NULL
  return _7;

}


FlexCAN_Ip_SetListenOnlyMode_Privileged (uint8 instance, const boolean enable)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _18;
  signed int _19;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _18 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _19 = (signed int) _18;
  # DEBUG pBase => NULL
  # DEBUG disabled => _19 < 0
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_20 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_10 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetListenOnlyMode (pBase_9, enable_13(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_10 ();

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_20(4)>
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_17 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_17
  # DEBUG BEGIN_STMT
  if (status_17 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_17

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_17(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SetRxMb15Mask_Privileged (uint8 instance, uint32 mask)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _16;
  signed int _17;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _16 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _17 = (signed int) _16;
  # DEBUG pBase => NULL
  # DEBUG disabled => _17 < 0
  # DEBUG BEGIN_STMT
  if (_17 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 936839741]:
  # result_18 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  pBase_9->RX15MASK ={v} mask_12(D);

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_18(4)>
  # DEBUG BEGIN_STMT
  if (_17 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_15 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_15
  # DEBUG BEGIN_STMT
  if (status_15 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_15

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_15(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SetRxMb14Mask_Privileged (uint8 instance, uint32 mask)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _16;
  signed int _17;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _16 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _17 = (signed int) _16;
  # DEBUG pBase => NULL
  # DEBUG disabled => _17 < 0
  # DEBUG BEGIN_STMT
  if (_17 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 936839741]:
  # result_18 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  pBase_9->RX14MASK ={v} mask_12(D);

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_18(4)>
  # DEBUG BEGIN_STMT
  if (_17 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_15 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_15
  # DEBUG BEGIN_STMT
  if (status_15 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_15

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_15(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_AbortTransfer (uint8 u8Instance, uint8 mb_idx)
{
  Flexcan_Ip_StatusType result;
  const struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * pBase;
  int _1;
  int _2;
  <unnamed type> _3;
  long unsigned int _4;
  _Bool _5;
  <unnamed type> _6;
  <unnamed type> _7;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_12(D);
  pBase_14 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_14
  # DEBUG BEGIN_STMT
  state_15 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_15
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  if (mb_idx_16(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 3> [local count: 536870911]:
  # DEBUG BEGIN_STMT
  _2 = (int) mb_idx_16(D);
  _3 ={v} state_15->mbs[_2].state;
  if (_3 == 0)
    goto <bb 8>; [52.23%]
  else
    goto <bb 4>; [47.77%]

  <bb 4> [local count: 256463234]:
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) mb_idx_16(D);
  _5 = state_15->isIntActive;
  FLEXCAN_ClearMsgBuffIntCmd (pBase_14, u8Instance_12(D), _4, _5);
  # DEBUG BEGIN_STMT
  _6 ={v} state_15->mbs[_2].state;
  if (_6 == 2)
    goto <bb 5>; [20.24%]
  else
    goto <bb 6>; [79.76%]

  <bb 5> [local count: 51908159]:
  # DEBUG BEGIN_STMT
  result_19 = FlexCAN_AbortTxTransfer (u8Instance_12(D), mb_idx_16(D));
  # DEBUG result => result_19

  <bb 6> [local count: 256463234]:
  # result_8 = PHI <0(4), result_19(5)>
  # DEBUG result => result_8
  # DEBUG BEGIN_STMT
  _7 ={v} state_15->mbs[_2].state;
  if (_7 == 1)
    goto <bb 7>; [20.24%]
  else
    goto <bb 8>; [79.76%]

  <bb 7> [local count: 51908159]:
  # DEBUG BEGIN_STMT
  FlexCAN_AbortRxTransfer (u8Instance_12(D), mb_idx_16(D));

  <bb 8> [local count: 1073741824]:
  # result_9 = PHI <0(2), 5(3), result_8(6), result_8(7)>
  # DEBUG result => result_9
  # DEBUG BEGIN_STMT
  return result_9;

}


FlexCAN_Ip_SetErrorInt_Privileged (uint8 u8Instance, Flexcan_Ip_ErrorIntType type, boolean enable)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _21;
  signed int _22;

  <bb 2> [local count: 1073554488]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _21 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _22 = (signed int) _21;
  # DEBUG pBase => NULL
  # DEBUG disabled => _22 < 0
  # DEBUG BEGIN_STMT
  if (_22 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273756394]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 4> [local count: 936676291]:
  # result_23 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  switch (type_12(D)) <default: <L16> [16.67%], case 0: <L6> [16.67%], case 1: <L7> [16.67%], case 2: <L4> [16.67%], case 3: <L5> [16.67%], case 4: <L3> [16.67%]>

  <bb 5> [local count: 156143938]:
<L3>:
  # DEBUG BEGIN_STMT
  FlexCAN_SetErrIntCmd (pBase_9, 32768, enable_13(D));
  # DEBUG BEGIN_STMT
  goto <bb 10>; [100.00%]

  <bb 6> [local count: 156143938]:
<L4>:
  # DEBUG BEGIN_STMT
  FlexCAN_SetErrIntCmd (pBase_9, 16384, enable_13(D));
  # DEBUG BEGIN_STMT
  goto <bb 10>; [100.00%]

  <bb 7> [local count: 156143938]:
<L5>:
  # DEBUG BEGIN_STMT
  FlexCAN_SetErrIntCmd (pBase_9, 16385, enable_13(D));
  # DEBUG BEGIN_STMT
  goto <bb 10>; [100.00%]

  <bb 8> [local count: 156143938]:
<L6>:
  # DEBUG BEGIN_STMT
  FlexCAN_SetErrIntCmd (pBase_9, 1024, enable_13(D));
  # DEBUG BEGIN_STMT
  goto <bb 10>; [100.00%]

  <bb 9> [local count: 156143938]:
<L7>:
  # DEBUG BEGIN_STMT
  FlexCAN_SetErrIntCmd (pBase_9, 2048, enable_13(D));
  # DEBUG BEGIN_STMT

  <bb 10> [local count: 1073741824]:
  # result_2 = PHI <result_11(3), result_23(5), result_23(6), result_23(7), result_23(8), result_23(9), result_23(4)>
<L16>:
  # DEBUG BEGIN_STMT
  if (_22 < 0)
    goto <bb 11>; [25.50%]
  else
    goto <bb 13>; [74.50%]

  <bb 11> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_20 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_20
  # DEBUG BEGIN_STMT
  if (status_20 != 0)
    goto <bb 12>; [50.00%]
  else
    goto <bb 13>; [50.00%]

  <bb 12> [local count: 136902083]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_20

  <bb 13> [local count: 1073741824]:
  # result_4 = PHI <result_2(10), result_2(11), status_20(12)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_DisableInterrupts_Privileged (uint8 u8Instance)
{
  struct Flexcan_Ip_StateType * state;
  Flexcan_Ip_StatusType result;
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _10;
  signed int _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  # DEBUG result => 1
  # DEBUG BEGIN_STMT
  state_7 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_7
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_6
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _10 ={v} MEM[(const struct FLEXCAN_Type *)pBase_6].MCR;
  _11 = (signed int) _10;
  # DEBUG pBase => NULL
  if (_11 >= 0)
    goto <bb 3>; [41.48%]
  else
    goto <bb 4>; [58.52%]

  <bb 3> [local count: 445388109]:
  # DEBUG BEGIN_STMT
  FlexCAN_DisableInterrupts (pBase_6);
  # DEBUG BEGIN_STMT
  state_7->isIntActive = 0;
  # DEBUG BEGIN_STMT
  # DEBUG result => 0

  <bb 4> [local count: 1073741824]:
  # result_2 = PHI <1(2), 0(3)>
  # DEBUG result => result_2
  # DEBUG BEGIN_STMT
  return result_2;

}


FlexCAN_Ip_EnableInterrupts_Privileged (uint8 u8Instance)
{
  struct Flexcan_Ip_StateType * state;
  Flexcan_Ip_StatusType result;
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _10;
  signed int _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  # DEBUG result => 1
  # DEBUG BEGIN_STMT
  state_7 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_7
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_6
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _10 ={v} MEM[(const struct FLEXCAN_Type *)pBase_6].MCR;
  _11 = (signed int) _10;
  # DEBUG pBase => NULL
  if (_11 >= 0)
    goto <bb 3>; [41.48%]
  else
    goto <bb 4>; [58.52%]

  <bb 3> [local count: 445388109]:
  # DEBUG BEGIN_STMT
  FlexCAN_EnableInterrupts (pBase_6, u8Instance_4(D));
  # DEBUG BEGIN_STMT
  state_7->isIntActive = 1;
  # DEBUG BEGIN_STMT
  # DEBUG result => 0

  <bb 4> [local count: 1073741824]:
  # result_2 = PHI <1(2), 0(3)>
  # DEBUG result => result_2
  # DEBUG BEGIN_STMT
  return result_2;

}


FlexCAN_Ip_ClearBuffStatusFlag (uint8 instance, uint8 msgBuffIdx)
{
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_3(D);
  pBase_5 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_5
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) msgBuffIdx_6(D);
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_5, _2);
  return;

}


FlexCAN_Ip_GetBuffStatusFlag (uint8 instance, uint8 msgBuffIdx)
{
  const struct FLEXCAN_Type * pBase;
  boolean returnResult;
  int _1;
  long unsigned int _2;
  unsigned char _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG returnResult => 1
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) msgBuffIdx_7(D);
  _3 = FlexCAN_GetBuffStatusFlag (pBase_6, _2);
  returnResult_9 = _3 == 1;
  # DEBUG returnResult => returnResult_9
  # DEBUG BEGIN_STMT
  return returnResult_9;

}


FlexCAN_Ip_SetTxArbitrationStartDelay_Privileged (uint8 instance, uint8 value)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _18;
  signed int _19;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _18 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _19 = (signed int) _18;
  # DEBUG pBase => NULL
  # DEBUG disabled => _19 < 0
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_20 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_17 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetTxArbitrationStartDelay (pBase_9, value_13(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_17 ();

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_20(4)>
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_17 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_17
  # DEBUG BEGIN_STMT
  if (status_17 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_17

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_17(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SetTDCOffset_Privileged (uint8 instance, boolean enable, uint8 offset)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _19;
  signed int _20;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _19 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _20 = (signed int) _19;
  # DEBUG pBase => NULL
  # DEBUG disabled => _20 < 0
  # DEBUG BEGIN_STMT
  if (_20 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_21 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_16 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetTDCOffset (pBase_9, enable_13(D), offset_14(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_16 ();

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_21(4)>
  # DEBUG BEGIN_STMT
  if (_20 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_18 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_18
  # DEBUG BEGIN_STMT
  if (status_18 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_18

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_18(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_GetBitrateFD (uint8 instance, struct Flexcan_Ip_TimeSegmentType * bitrate)
{
  const struct FLEXCAN_Type * pBase;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  pBase_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_4
  # DEBUG BEGIN_STMT
  # DEBUG enhCbt => 0
  # DEBUG BEGIN_STMT
  FlexCAN_GetFDTimeSegments (pBase_4, bitrate_5(D));
  # DEBUG BEGIN_STMT
  return 0;

}


FlexCAN_Ip_SetBitrateCbt_Privileged (uint8 instance, const struct Flexcan_Ip_TimeSegmentType * bitrate, boolean bitRateSwitch)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _20;
  long unsigned int _21;
  _Bool _22;
  long unsigned int _23;
  signed int _24;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _23 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _24 = (signed int) _23;
  # DEBUG pBase => NULL
  # DEBUG disabled => _24 < 0
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsFDEnabled
  # DEBUG BEGIN_STMT
  _20 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _21 = _20 & 2048;
  _22 = _21 != 0;
  # DEBUG base => NULL
  # DEBUG fd_enable => _22
  # DEBUG BEGIN_STMT
  if (_24 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_25 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_15 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetFDEnabled (pBase_9, _22, bitRateSwitch_13(D));
  # DEBUG BEGIN_STMT
  FlexCAN_SetFDTimeSegments (pBase_9, bitrate_15(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_15 ();

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_25(4)>
  # DEBUG BEGIN_STMT
  if (_24 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_19 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_19
  # DEBUG BEGIN_STMT
  if (status_19 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_19

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_19(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_GetTDCValue (uint8 u8Instance)
{
  const struct FLEXCAN_Type * pBase;
  uint8 value;
  int _1;
  long unsigned int _2;
  unsigned char _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG value => 0
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_6->FDCTRL;
  _3 = (unsigned char) _2;
  value_7 = _3 & 63;
  # DEBUG value => value_7
  # DEBUG BEGIN_STMT
  return value_7;

}


FlexCAN_Ip_GetTDCFail (uint8 u8Instance)
{
  const struct FLEXCAN_Type * pBase;
  boolean value;
  int _1;
  long unsigned int _2;
  long unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG value => 0
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_6->FDCTRL;
  _3 = _2 & 16384;
  value_7 = _3 != 0;
  # DEBUG value => value_7
  # DEBUG BEGIN_STMT
  return value_7;

}


FlexCAN_Ip_ClearTDCFail (uint8 u8Instance)
{
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _2;
  long unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_09 ();
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_6->FDCTRL;
  _3 = _2 | 16384;
  pBase_6->FDCTRL ={v} _3;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_09 ();
  return;

}


FlexCAN_Ip_GetBitrate (uint8 instance, struct Flexcan_Ip_TimeSegmentType * bitrate)
{
  const struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _9;
  signed int _10;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_3(D);
  pBase_5 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_5
  # DEBUG BEGIN_STMT
  # DEBUG enhCbt => 0
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_5
  # DEBUG INLINE_ENTRY FlexCAN_IsExCbtEnabled
  # DEBUG BEGIN_STMT
  _9 ={v} pBase_5->CBT;
  _10 = (signed int) _9;
  # DEBUG pBase => NULL
  if (_10 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234148]:
  # DEBUG BEGIN_STMT
  FlexCAN_GetExtendedTimeSegments (pBase_5, bitrate_6(D));
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 633507677]:
  # DEBUG BEGIN_STMT
  FlexCAN_GetTimeSegments (pBase_5, bitrate_6(D));

  <bb 5> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return 0;

}


FlexCAN_Ip_SetBitrate_Privileged (uint8 instance, const struct Flexcan_Ip_TimeSegmentType * bitrate, boolean enhExt)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _20;
  signed int _21;
  long unsigned int _22;
  signed int _23;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_8(D);
  pBase_10 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_10
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_10
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _20 ={v} MEM[(const struct FLEXCAN_Type *)pBase_10].MCR;
  _21 = (signed int) _20;
  # DEBUG pBase => NULL
  # DEBUG disabled => _21 < 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (_21 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_12 = FlexCAN_Enable (pBase_10);
  # DEBUG result => result_12
  # DEBUG BEGIN_STMT
  if (result_12 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_7 = PHI <result_12(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_14 ();
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_10
  # DEBUG INLINE_ENTRY FlexCAN_IsExCbtEnabled
  # DEBUG BEGIN_STMT
  _22 ={v} MEM[(const struct FLEXCAN_Type *)pBase_10].CBT;
  _23 = (signed int) _22;
  # DEBUG pBase => NULL
  if (_23 < 0)
    goto <bb 5>; [41.00%]
  else
    goto <bb 6>; [59.00%]

  <bb 5> [local count: 349986147]:
  # DEBUG BEGIN_STMT
  FlexCAN_SetExtendedTimeSegments (pBase_10, bitrate_14(D));
  goto <bb 7>; [100.00%]

  <bb 6> [local count: 503638602]:
  # DEBUG BEGIN_STMT
  FlexCAN_SetTimeSegments (pBase_10, bitrate_14(D));

  <bb 7> [local count: 853624749]:
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_14 ();

  <bb 8> [local count: 1073741823]:
  # result_24 = PHI <result_12(3), result_7(7)>
  # DEBUG BEGIN_STMT
  if (_21 < 0)
    goto <bb 9>; [25.50%]
  else
    goto <bb 11>; [74.50%]

  <bb 9> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_19 = FlexCAN_Disable (pBase_10);
  # DEBUG status => status_19
  # DEBUG BEGIN_STMT
  if (status_19 != 0)
    goto <bb 10>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 10> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_19

  <bb 11> [local count: 1073741824]:
  # result_3 = PHI <result_24(8), result_24(9), status_19(10)>
  # DEBUG result => result_3
  # DEBUG BEGIN_STMT
  return result_3;

}


FlexCAN_Ip_SetRxMaskType_Privileged (uint8 instance, Flexcan_Ip_RxMaskType type)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _18;
  signed int _19;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _18 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _19 = (signed int) _18;
  # DEBUG pBase => NULL
  # DEBUG disabled => _19 < 0
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_20 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_08 ();
  # DEBUG BEGIN_STMT
  FlexCAN_SetRxMaskType (pBase_9, type_13(D));
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_08 ();

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_20(4)>
  # DEBUG BEGIN_STMT
  if (_19 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_17 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_17
  # DEBUG BEGIN_STMT
  if (status_17 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_17

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_17(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SetStopMode_Privileged (uint8 instance)
{
  Flexcan_Ip_StatusType status;
  struct FLEXCAN_Type * pBase;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  status_8 = FlexCAN_EnterFreezeMode (pBase_6);
  # DEBUG status => status_8
  # DEBUG BEGIN_STMT
  if (status_8 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  status_10 = FlexCAN_Disable (pBase_6);
  # DEBUG status => status_10

  <bb 4> [local count: 1073741824]:
  # status_2 = PHI <status_8(2), status_10(3)>
  # DEBUG status => status_2
  # DEBUG BEGIN_STMT
  return status_2;

}


FlexCAN_Ip_SetStartMode_Privileged (uint8 instance)
{
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  Flexcan_Ip_StatusType _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  pBase_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_6
  # DEBUG BEGIN_STMT
  SchM_Enter_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_6->MCR;
  _3 = _2 & 2147483647;
  pBase_6->MCR ={v} _3;
  # DEBUG BEGIN_STMT
  SchM_Exit_Can_CAN_EXCLUSIVE_AREA_07 ();
  # DEBUG BEGIN_STMT
  _11 = FlexCAN_ExitFreezeMode (pBase_6);
  return _11;

}


FlexCAN_Ip_GetStartMode_Privileged (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  boolean _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  base_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_6
  # DEBUG BEGIN_STMT
  _2 ={v} base_6->MCR;
  _3 = _2 & 17825792;
  _7 = _3 == 0;
  return _7;

}


FlexCAN_Ip_GetStopMode_Privileged (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  boolean _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  base_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_6
  # DEBUG BEGIN_STMT
  _2 ={v} base_6->MCR;
  _3 = _2 & 1048576;
  _7 = _3 != 0;
  return _7;

}


FlexCAN_Ip_MainFunctionWrite (uint8 instance, uint8 mb_idx)
{
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  unsigned char _3;
  int _4;
  long unsigned int _5;
  long unsigned int vol.5_17;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  base_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_9
  # DEBUG BEGIN_STMT
  state_10 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_10
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) mb_idx_11(D);
  _3 = FlexCAN_GetBuffStatusFlag (base_9, _2);
  if (_3 != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _4 = (int) mb_idx_11(D);
  _5 = FlexCAN_GetMsgBuffTimestamp (base_9, _2);
  state_10->mbs[_4].time_stamp = _5;
  # DEBUG BEGIN_STMT
  # DEBUG base => base_9
  # DEBUG INLINE_ENTRY FlexCAN_UnlockRxMsgBuff
  # DEBUG BEGIN_STMT
  vol.5_17 ={v} MEM[(const struct FLEXCAN_Type *)base_9].TIMER;
  # DEBUG base => NULL
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_9, _2);
  # DEBUG BEGIN_STMT
  state_10->mbs[_4].state ={v} 0;

  <bb 4> [local count: 1073741824]:
  return;

}


FlexCAN_Ip_MainFunctionBusOff_Privileged (uint8 instance)
{
  uint32 u32ErrStatus;
  const struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  Flexcan_Ip_StatusType eRetVal;
  int _1;
  long unsigned int _2;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eRetVal => 1
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  base_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_9
  # DEBUG BEGIN_STMT
  state_10 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_10
  # DEBUG BEGIN_STMT
  # DEBUG u32ErrStatus => 0
  # DEBUG BEGIN_STMT
  u32ErrStatus_11 ={v} base_9->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_11
  # DEBUG BEGIN_STMT
  _2 = u32ErrStatus_11 & 4;
  if (_2 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _3 = state_10->error_callback;
  if (_3 != 0B)
    goto <bb 4>; [70.00%]
  else
    goto <bb 5>; [30.00%]

  <bb 4> [local count: 375809639]:
  # DEBUG BEGIN_STMT
  _3 (instance_7(D), 9, u32ErrStatus_11, state_10);

  <bb 5> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  base_9->ESR1 ={v} 4;
  # DEBUG BEGIN_STMT
  # DEBUG eRetVal => 0

  <bb 6> [local count: 1073741824]:
  # eRetVal_4 = PHI <1(2), 0(5)>
  # DEBUG eRetVal => eRetVal_4
  # DEBUG BEGIN_STMT
  return eRetVal_4;

}


FlexCAN_Ip_MainFunctionRead (uint8 instance, uint8 mb_idx)
{
  uint32 flag;
  const struct Flexcan_Ip_StateType * state;
  const struct FLEXCAN_Type * base;
  int _1;
  _Bool _2;
  long unsigned int _3;
  unsigned char _4;
  int _5;
  <unnamed type> _6;
  long unsigned int _16;
  long unsigned int _18;
  unsigned char _19;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_8(D);
  base_10 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_10
  # DEBUG BEGIN_STMT
  state_11 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_11
  # DEBUG BEGIN_STMT
  _2 = state_11->bIsLegacyFifoEn;
  if (_2 != 0)
    goto <bb 3>; [67.00%]
  else
    goto <bb 7>; [33.00%]

  <bb 3> [local count: 719407023]:
  if (mb_idx_12(D) <= 7)
    goto <bb 4>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 4> [local count: 359703511]:
  # DEBUG BEGIN_STMT
  if (mb_idx_12(D) == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 5> [local count: 179851756]:
  # DEBUG BEGIN_STMT
  # DEBUG base => base_10
  # DEBUG msgBuffIdx => 5
  # DEBUG INLINE_ENTRY FlexCAN_GetBuffStatusFlag
  # DEBUG BEGIN_STMT
  # DEBUG flag => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _16 ={v} base_10->IFLAG1;
  _18 = _16 >> 5;
  flag_17 = _18 & 1;
  # DEBUG flag => flag_17
  # DEBUG BEGIN_STMT
  _19 = (unsigned char) flag_17;
  # DEBUG base => NULL
  # DEBUG msgBuffIdx => NULL
  # DEBUG flag => NULL
  if (_19 != 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 10>; [67.00%]

  <bb 6> [local count: 59351079]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxFIFO (instance_8(D), 5);
  goto <bb 10>; [100.00%]

  <bb 7> [local count: 714038314]:
  # DEBUG BEGIN_STMT
  _3 = (long unsigned int) mb_idx_12(D);
  _4 = FlexCAN_GetBuffStatusFlag (base_10, _3);
  if (_4 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 8> [local count: 357019157]:
  # DEBUG BEGIN_STMT
  _5 = (int) mb_idx_12(D);
  _6 ={v} state_11->mbs[_5].state;
  if (_6 == 1)
    goto <bb 9>; [20.24%]
  else
    goto <bb 10>; [79.76%]

  <bb 9> [local count: 72260677]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxMB (instance_8(D), _3);

  <bb 10> [local count: 1073741824]:
  return;

}


FlexCAN_Ip_Deinit_Privileged (uint8 instance)
{
  Flexcan_Ip_StatusType result;
  struct FLEXCAN_Type * base;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_3(D);
  base_5 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_5
  # DEBUG BEGIN_STMT
  # DEBUG result => 1
  # DEBUG BEGIN_STMT
  result_7 = FlexCAN_EnterFreezeMode (base_5);
  # DEBUG result => result_7
  # DEBUG BEGIN_STMT
  if (result_7 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  FlexCAN_SetRegDefaultVal (base_5);
  # DEBUG BEGIN_STMT
  FlexCAN_Disable (base_5);
  # DEBUG BEGIN_STMT
  Flexcan_Ip_apxState[_1] = 0B;

  <bb 4> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return result_7;

}


FlexCAN_Ip_SetRxFifoGlobalMask_Privileged (uint8 instance, uint32 mask)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _15;
  signed int _16;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _15 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _16 = (signed int) _15;
  # DEBUG pBase => NULL
  # DEBUG disabled => _16 < 0
  # DEBUG BEGIN_STMT
  if (_16 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 936839741]:
  # result_17 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_9
  # DEBUG Mask => mask_12(D)
  # DEBUG INLINE_ENTRY FlexCAN_SetRxFifoGlobalMask
  # DEBUG BEGIN_STMT
  pBase_9->RXFGMASK ={v} mask_12(D);

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_17(4)>
  # DEBUG base => NULL
  # DEBUG Mask => NULL
  # DEBUG BEGIN_STMT
  if (_16 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_14 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_14
  # DEBUG BEGIN_STMT
  if (status_14 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_14

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_14(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SetRxIndividualMask_Privileged (uint8 instance, uint8 mb_idx, uint32 mask)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _4;
  long unsigned int _17;
  signed int _18;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_8(D);
  pBase_10 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_10
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_10
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _17 ={v} MEM[(const struct FLEXCAN_Type *)pBase_10].MCR;
  _18 = (signed int) _17;
  # DEBUG pBase => NULL
  # DEBUG disabled => _18 < 0
  # DEBUG BEGIN_STMT
  if (_18 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  result_12 = FlexCAN_Enable (pBase_10);
  # DEBUG result => result_12
  # DEBUG BEGIN_STMT
  if (result_12 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 936839741]:
  # result_19 = PHI <result_12(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) mb_idx_13(D);
  # DEBUG base => pBase_10
  # DEBUG msgBuffIdx => _4
  # DEBUG mask => mask_14(D)
  # DEBUG INLINE_ENTRY FlexCAN_SetRxIndividualMask
  # DEBUG BEGIN_STMT
  pBase_10->RXIMR[_4] ={v} mask_14(D);

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_12(3), result_19(4)>
  # DEBUG base => NULL
  # DEBUG msgBuffIdx => NULL
  # DEBUG mask => NULL
  # DEBUG BEGIN_STMT
  if (_18 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_16 = FlexCAN_Disable (pBase_10);
  # DEBUG status => status_16
  # DEBUG BEGIN_STMT
  if (status_16 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_16

  <bb 8> [local count: 1073741824]:
  # result_5 = PHI <result_2(5), result_2(6), status_16(7)>
  # DEBUG result => result_5
  # DEBUG BEGIN_STMT
  return result_5;

}


FlexCAN_Ip_ExitFreezeMode_Privileged (uint8 instance)
{
  struct FLEXCAN_Type * base;
  int _1;
  Flexcan_Ip_StatusType _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  base_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_4
  # DEBUG BEGIN_STMT
  _6 = FlexCAN_ExitFreezeMode (base_4);
  return _6;

}


FlexCAN_Ip_EnterFreezeMode_Privileged (uint8 instance)
{
  struct FLEXCAN_Type * base;
  int _1;
  Flexcan_Ip_StatusType _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  base_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_4
  # DEBUG BEGIN_STMT
  _6 = FlexCAN_EnterFreezeMode (base_4);
  return _6;

}


FlexCAN_Ip_SetRxMbGlobalMask_Privileged (uint8 instance, uint32 mask)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _15;
  signed int _16;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _15 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _16 = (signed int) _15;
  # DEBUG pBase => NULL
  # DEBUG disabled => _16 < 0
  # DEBUG BEGIN_STMT
  if (_16 < 0)
    goto <bb 3>; [25.50%]
  else
    goto <bb 4>; [74.50%]

  <bb 3> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 936839741]:
  # result_17 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_9
  # DEBUG Mask => mask_12(D)
  # DEBUG INLINE_ENTRY FlexCAN_SetRxMsgBuffGlobalMask
  # DEBUG BEGIN_STMT
  pBase_9->RXMGMASK ={v} mask_12(D);

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_17(4)>
  # DEBUG base => NULL
  # DEBUG Mask => NULL
  # DEBUG BEGIN_STMT
  if (_16 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_14 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_14
  # DEBUG BEGIN_STMT
  if (status_14 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_14

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_14(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_SendBlocking (uint8 instance, uint8 mb_idx, const struct Flexcan_Ip_DataInfoType * tx_info, uint32 msg_id, const uint8 * mb_data, uint32 timeout_ms)
{
  volatile uint32 * flexcan_mb;
  uint32 flexcan_mb_config;
  uint32 uS2Ticks;
  uint32 mS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  unsigned char _6;
  int _7;
  <unnamed type> _8;
  long unsigned int _9;
  unsigned char _10;
  long unsigned int _11;
  long unsigned int _12;
  int _13;
  long unsigned int _44;
  long unsigned int _59;

  <bb 2> [local count: 348071309]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) instance_26(D);
  base_28 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_28
  # DEBUG BEGIN_STMT
  state_29 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_29
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  _3 = timeout_ms_31(D) * 1000;
  mS2Ticks_33 = OsIf_MicrosToTicks (_3, 0);
  # DEBUG mS2Ticks => mS2Ticks_33
  # DEBUG BEGIN_STMT
  # DEBUG uS2Ticks => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb => 0B
  # DEBUG BEGIN_STMT
  result_39 = FlexCAN_StartSendData (instance_26(D), mb_idx_34(D), tx_info_35(D), msg_id_36(D), mb_data_37(D));
  # DEBUG result => result_39
  # DEBUG BEGIN_STMT
  if (result_39 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 16>; [67.00%]

  <bb 3> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  _4 = OsIf_GetCounter (0);
  timeStart = _4;
  # DEBUG BEGIN_STMT
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _44 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_45 = timeElapsed_18 + _44;
  # DEBUG timeElapsed => timeElapsed_45
  # DEBUG BEGIN_STMT
  if (mS2Ticks_33 <= timeElapsed_45)
    goto <bb 6>; [5.50%]
  else
    goto <bb 18>; [94.50%]

  <bb 18> [local count: 958878292]:

  <bb 5> [local count: 1073741824]:
  # timeElapsed_18 = PHI <0(3), timeElapsed_45(18)>
  # DEBUG timeElapsed => timeElapsed_18
  # DEBUG BEGIN_STMT
  _5 = (long unsigned int) mb_idx_34(D);
  _6 = FlexCAN_GetBuffStatusFlag (base_28, _5);
  if (_6 != 1)
    goto <bb 4>; [94.50%]
  else
    goto <bb 6>; [5.50%]

  <bb 6> [local count: 114863532]:
  # result_14 = PHI <3(4), 0(5)>
  # _2 = PHI <_5(4), _5(5)>
  # DEBUG result => result_14
  # DEBUG BEGIN_STMT
  if (result_14 == 3)
    goto <bb 7>; [34.00%]
  else
    goto <bb 15>; [66.00%]

  <bb 7> [local count: 39053601]:
  _7 = (int) mb_idx_34(D);
  _8 ={v} state_29->mbs[_7].state;
  if (_8 != 0)
    goto <bb 8>; [33.00%]
  else
    goto <bb 15>; [67.00%]

  <bb 8> [local count: 12887688]:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_28, _2);
  # DEBUG BEGIN_STMT
  flexcan_mb_48 = FlexCAN_GetMsgBuffRegion (base_28, _2);
  # DEBUG flexcan_mb => flexcan_mb_48
  # DEBUG BEGIN_STMT
  flexcan_mb_config_49 ={v} *flexcan_mb_48;
  # DEBUG flexcan_mb_config => flexcan_mb_config_49
  # DEBUG BEGIN_STMT
  flexcan_mb_config_50 = flexcan_mb_config_49 & 4043309055;
  # DEBUG flexcan_mb_config => flexcan_mb_config_50
  # DEBUG BEGIN_STMT
  flexcan_mb_config_51 = flexcan_mb_config_50 | 150994944;
  # DEBUG flexcan_mb_config => flexcan_mb_config_51
  # DEBUG BEGIN_STMT
  *flexcan_mb_48 ={v} flexcan_mb_config_51;
  # DEBUG BEGIN_STMT
  uS2Ticks_54 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_54
  # DEBUG BEGIN_STMT
  _9 = OsIf_GetCounter (0);
  timeStart = _9;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  goto <bb 10>; [100.00%]

  <bb 9> [local count: 113847772]:
  # DEBUG BEGIN_STMT
  _59 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_60 = timeElapsed_19 + _59;
  # DEBUG timeElapsed => timeElapsed_60
  # DEBUG BEGIN_STMT
  if (uS2Ticks_54 <= timeElapsed_60)
    goto <bb 11>; [5.50%]
  else
    goto <bb 17>; [94.50%]

  <bb 17> [local count: 107586144]:

  <bb 10> [local count: 120473832]:
  # timeElapsed_19 = PHI <0(8), timeElapsed_60(17)>
  # DEBUG timeElapsed => timeElapsed_19
  # DEBUG BEGIN_STMT
  _10 = FlexCAN_GetBuffStatusFlag (base_28, _2);
  if (_10 == 0)
    goto <bb 9>; [94.50%]
  else
    goto <bb 11>; [5.50%]

  <bb 11> [local count: 12887688]:
  # DEBUG result => 3
  # DEBUG BEGIN_STMT
  flexcan_mb_config_61 ={v} *flexcan_mb_48;
  # DEBUG flexcan_mb_config => flexcan_mb_config_61
  # DEBUG BEGIN_STMT
  _11 = flexcan_mb_config_61 >> 24;
  _12 = _11 & 15;
  if (_12 == 8)
    goto <bb 12>; [34.00%]
  else
    goto <bb 13>; [66.00%]

  <bb 12> [local count: 4381814]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0

  <bb 13> [local count: 12887688]:
  # result_15 = PHI <3(11), 0(12)>
  # DEBUG result => result_15
  # DEBUG BEGIN_STMT
  if (_12 == 9)
    goto <bb 14>; [34.00%]
  else
    goto <bb 15>; [66.00%]

  <bb 14> [local count: 4381814]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 3

  <bb 15> [local count: 114863532]:
  # result_16 = PHI <result_14(6), 3(7), result_15(13), 3(14)>
  # DEBUG result => result_16
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_28, _2);
  # DEBUG BEGIN_STMT
  _13 = (int) mb_idx_34(D);
  state_29->mbs[_13].state ={v} 0;

  <bb 16> [local count: 348071309]:
  # result_17 = PHI <result_39(2), result_16(15)>
  # DEBUG result => result_17
  # DEBUG BEGIN_STMT
  timeStart ={v} {CLOBBER};
  return result_17;

}


FlexCAN_BusOff_IRQHandler (uint8 instance)
{
  boolean isSpuriousInt;
  uint32 u32ErrStatus;
  const struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_21(D);
  base_23 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_23
  # DEBUG BEGIN_STMT
  state_24 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_24
  # DEBUG BEGIN_STMT
  # DEBUG u32ErrStatus => 0
  # DEBUG BEGIN_STMT
  # DEBUG isSpuriousInt => 1
  # DEBUG BEGIN_STMT
  if (state_24 != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 16>; [30.00%]

  <bb 3> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  u32ErrStatus_25 ={v} base_23->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_25
  # DEBUG BEGIN_STMT
  _2 = u32ErrStatus_25 & 131072;
  if (_2 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 4> [local count: 375809639]:
  _3 ={v} base_23->CTRL1;
  _4 = _3 & 2048;
  if (_4 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 5> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  base_23->ESR1 ={v} 131072;
  # DEBUG BEGIN_STMT
  _5 = state_24->error_callback;
  if (_5 != 0B)
    goto <bb 6>; [70.00%]
  else
    goto <bb 7>; [30.00%]

  <bb 6> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _5 (instance_21(D), 11, u32ErrStatus_25, state_24);
  # DEBUG BEGIN_STMT
  u32ErrStatus_28 ={v} base_23->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_28

  <bb 7> [local count: 751619278]:
  # u32ErrStatus_14 = PHI <u32ErrStatus_25(3), u32ErrStatus_25(4), u32ErrStatus_28(6), u32ErrStatus_25(5)>
  # isSpuriousInt_16 = PHI <1(3), 1(4), 0(6), 0(5)>
  # DEBUG isSpuriousInt => isSpuriousInt_16
  # DEBUG u32ErrStatus => u32ErrStatus_14
  # DEBUG BEGIN_STMT
  _6 = u32ErrStatus_14 & 65536;
  if (_6 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 8> [local count: 375809639]:
  _7 ={v} base_23->CTRL1;
  _8 = _7 & 1024;
  if (_8 != 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 9> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  base_23->ESR1 ={v} 65536;
  # DEBUG BEGIN_STMT
  _9 = state_24->error_callback;
  if (_9 != 0B)
    goto <bb 10>; [70.00%]
  else
    goto <bb 11>; [30.00%]

  <bb 10> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _9 (instance_21(D), 10, u32ErrStatus_14, state_24);
  # DEBUG BEGIN_STMT
  u32ErrStatus_31 ={v} base_23->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_31

  <bb 11> [local count: 751619278]:
  # u32ErrStatus_15 = PHI <u32ErrStatus_14(7), u32ErrStatus_14(8), u32ErrStatus_31(10), u32ErrStatus_14(9)>
  # isSpuriousInt_17 = PHI <isSpuriousInt_16(7), isSpuriousInt_16(8), 0(10), 0(9)>
  # DEBUG isSpuriousInt => isSpuriousInt_17
  # DEBUG u32ErrStatus => u32ErrStatus_15
  # DEBUG BEGIN_STMT
  _10 = u32ErrStatus_15 & 4;
  if (_10 != 0)
    goto <bb 12>; [50.00%]
  else
    goto <bb 15>; [50.00%]

  <bb 12> [local count: 375809639]:
  _11 ={v} base_23->CTRL1;
  _12 = _11 & 32768;
  if (_12 != 0)
    goto <bb 13>; [50.00%]
  else
    goto <bb 15>; [50.00%]

  <bb 13> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  base_23->ESR1 ={v} 4;
  # DEBUG BEGIN_STMT
  _13 = state_24->error_callback;
  if (_13 != 0B)
    goto <bb 14>; [70.00%]
  else
    goto <bb 17>; [30.00%]

  <bb 14> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _13 (instance_21(D), 9, u32ErrStatus_15, state_24);
  goto <bb 17>; [100.00%]

  <bb 15> [local count: 563714459]:
  # DEBUG isSpuriousInt => isSpuriousInt_17
  # DEBUG BEGIN_STMT
  if (isSpuriousInt_17 != 0)
    goto <bb 16>; [50.00%]
  else
    goto <bb 17>; [50.00%]

  <bb 16> [local count: 603979777]:
  # DEBUG isSpuriousInt => NULL
  # DEBUG BEGIN_STMT
  base_23->ESR1 ={v} 720900;

  <bb 17> [local count: 1073741824]:
  # DEBUG isSpuriousInt => NULL
  return;

}


FlexCAN_Error_IRQHandler (uint8 instance)
{
  boolean isSpuriousInt;
  uint32 u32ErrStatus;
  const struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _5;
  long unsigned int _6;
  long unsigned int _7;
  signed int _8;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _9;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_14(D);
  pBase_16 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_16
  # DEBUG BEGIN_STMT
  state_17 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_17
  # DEBUG BEGIN_STMT
  # DEBUG u32ErrStatus => 0
  # DEBUG BEGIN_STMT
  # DEBUG isSpuriousInt => 1
  # DEBUG BEGIN_STMT
  if (state_17 != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 12>; [30.00%]

  <bb 3> [local count: 751619277]:
  # DEBUG BEGIN_STMT
  u32ErrStatus_18 ={v} pBase_16->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_18
  # DEBUG BEGIN_STMT
  _2 = u32ErrStatus_18 & 2;
  if (_2 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 4> [local count: 375809638]:
  _3 ={v} pBase_16->CTRL1;
  _4 = _3 & 16384;
  if (_4 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 5> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  pBase_16->ESR1 ={v} 2;
  # DEBUG BEGIN_STMT
  _5 = state_17->error_callback;
  if (_5 != 0B)
    goto <bb 6>; [70.00%]
  else
    goto <bb 7>; [30.00%]

  <bb 6> [local count: 131533373]:
  # DEBUG BEGIN_STMT
  _5 (instance_14(D), 7, u32ErrStatus_18, state_17);
  # DEBUG BEGIN_STMT
  u32ErrStatus_21 ={v} pBase_16->ESR1;
  # DEBUG u32ErrStatus => u32ErrStatus_21

  <bb 7> [local count: 751619277]:
  # u32ErrStatus_10 = PHI <u32ErrStatus_18(3), u32ErrStatus_18(4), u32ErrStatus_21(6), u32ErrStatus_18(5)>
  # isSpuriousInt_11 = PHI <1(3), 1(4), 0(6), 0(5)>
  # DEBUG isSpuriousInt => isSpuriousInt_11
  # DEBUG u32ErrStatus => u32ErrStatus_10
  # DEBUG BEGIN_STMT
  _6 = u32ErrStatus_10 & 1048576;
  if (_6 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 8> [local count: 375809638]:
  _7 ={v} pBase_16->CTRL2;
  _8 = (signed int) _7;
  if (_8 < 0)
    goto <bb 9>; [41.00%]
  else
    goto <bb 11>; [59.00%]

  <bb 9> [local count: 154081952]:
  # DEBUG BEGIN_STMT
  pBase_16->ESR1 ={v} 1048576;
  # DEBUG BEGIN_STMT
  _9 = state_17->error_callback;
  if (_9 != 0B)
    goto <bb 10>; [70.00%]
  else
    goto <bb 13>; [30.00%]

  <bb 10> [local count: 107857366]:
  # DEBUG BEGIN_STMT
  _9 (instance_14(D), 8, u32ErrStatus_10, state_17);
  goto <bb 13>; [100.00%]

  <bb 11> [local count: 597537325]:
  # DEBUG isSpuriousInt => isSpuriousInt_11
  # DEBUG BEGIN_STMT
  if (isSpuriousInt_11 != 0)
    goto <bb 12>; [50.00%]
  else
    goto <bb 13>; [50.00%]

  <bb 12> [local count: 620891210]:
  # DEBUG isSpuriousInt => NULL
  # DEBUG BEGIN_STMT
  pBase_16->ESR1 ={v} 3145730;

  <bb 13> [local count: 1073741824]:
  # DEBUG isSpuriousInt => NULL
  return;

}


FlexCAN_Ip_GetControllerRxErrorCounter (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  uint8 _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  base_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_6
  # DEBUG BEGIN_STMT
  _2 ={v} base_6->ECR;
  _3 = _2 >> 8;
  _7 = (uint8) _3;
  return _7;

}


FlexCAN_Ip_GetControllerTxErrorCounter (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  long unsigned int _2;
  uint8 _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_3(D);
  base_5 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_5
  # DEBUG BEGIN_STMT
  _2 ={v} base_5->ECR;
  _6 = (uint8) _2;
  return _6;

}


FlexCAN_Ip_GetErrorStatus (uint8 instance)
{
  const struct FLEXCAN_Type * base;
  int _1;
  uint32 _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  base_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_4
  # DEBUG BEGIN_STMT
  _5 ={v} base_4->ESR1;
  return _5;

}


FlexCAN_Ip_ClearErrorStatus (uint8 instance, uint32 error)
{
  struct FLEXCAN_Type * base;
  int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_2(D);
  base_4 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_4
  # DEBUG BEGIN_STMT
  base_4->ESR1 ={v} error_5(D);
  return;

}


FlexCAN_IRQHandler (uint8 instance, uint32 startMbIdx, uint32 endMbIdx)
{
  uint32 mb_idx;
  const struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  uint32 flag_reg;
  uint32 u32MbHandle;
  int _1;
  unsigned char _3;
  unsigned char _4;
  _Bool _5;
  <unnamed type> _6;
  <unnamed type> _7;
  unsigned char _8;
  <unnamed type> _9;

  <bb 2> [local count: 214818650]:
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => 0
  # DEBUG BEGIN_STMT
  # DEBUG flag_reg => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_20(D);
  base_22 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_22
  # DEBUG BEGIN_STMT
  state_23 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_23
  # DEBUG BEGIN_STMT
  # DEBUG bIsSpuriousInt => 1
  # DEBUG BEGIN_STMT
  # DEBUG mb_idx => endMbIdx_24(D)
  # DEBUG BEGIN_STMT
  if (state_23 != 0B)
    goto <bb 3>; [53.47%]
  else
    goto <bb 22>; [46.53%]

  <bb 22> [local count: 99955118]:
  goto <bb 20>; [100.00%]

  <bb 3> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  _3 = FlexCAN_GetMsgBuffIntStatusFlag (base_22, endMbIdx_24(D));
  flag_reg_29 = (uint32) _3;
  # DEBUG flag_reg => flag_reg_29
  # DEBUG BEGIN_STMT
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 958878294]:
  # DEBUG BEGIN_STMT
  mb_idx_30 = mb_idx_12 + 4294967295;
  # DEBUG mb_idx => mb_idx_30
  # DEBUG BEGIN_STMT
  _4 = FlexCAN_GetMsgBuffIntStatusFlag (base_22, mb_idx_30);
  flag_reg_32 = (uint32) _4;
  # DEBUG flag_reg => flag_reg_32

  <bb 5> [local count: 1073741824]:
  # flag_reg_11 = PHI <flag_reg_29(3), flag_reg_32(4)>
  # mb_idx_12 = PHI <endMbIdx_24(D)(3), mb_idx_30(4)>
  # DEBUG mb_idx => mb_idx_12
  # DEBUG flag_reg => flag_reg_11
  # DEBUG BEGIN_STMT
  if (flag_reg_11 == 0)
    goto <bb 6>; [94.50%]
  else
    goto <bb 7>; [5.50%]

  <bb 6> [local count: 1014686025]:
  if (mb_idx_12 > startMbIdx_25(D))
    goto <bb 4>; [94.50%]
  else
    goto <bb 7>; [5.50%]

  <bb 7> [local count: 114863532]:
  # flag_reg_2 = PHI <flag_reg_11(5), 0(6)>
  # mb_idx_19 = PHI <mb_idx_12(5), mb_idx_12(6)>
  # DEBUG BEGIN_STMT
  if (flag_reg_2 != 0)
    goto <bb 9>; [67.00%]
  else
    goto <bb 8>; [33.00%]

  <bb 8> [local count: 37904965]:
  # DEBUG bIsSpuriousInt => 1
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  FlexCAN_ProcessSpuriousInterruptMB (instance_20(D), startMbIdx_25(D), endMbIdx_24(D));
  goto <bb 21>; [100.00%]

  <bb 9> [local count: 76958566]:
  # DEBUG BEGIN_STMT
  # DEBUG bIsSpuriousInt => 0
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => mb_idx_19
  # DEBUG BEGIN_STMT
  _5 = state_23->bIsLegacyFifoEn;
  if (_5 != 0)
    goto <bb 10>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 10> [local count: 38479283]:
  if (mb_idx_19 <= 7)
    goto <bb 11>; [33.00%]
  else
    goto <bb 12>; [67.00%]

  <bb 11> [local count: 12698163]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxFIFO (instance_20(D), mb_idx_19);
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => 0
  goto <bb 14>; [100.00%]

  <bb 12> [local count: 64260403]:
  # DEBUG BEGIN_STMT
  _6 ={v} state_23->mbs[mb_idx_19].state;
  if (_6 == 1)
    goto <bb 13>; [20.24%]
  else
    goto <bb 14>; [79.76%]

  <bb 13> [local count: 13006306]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxMB (instance_20(D), mb_idx_19);

  <bb 14> [local count: 76958566]:
  # u32MbHandle_10 = PHI <0(11), mb_idx_19(12), mb_idx_19(13)>
  # DEBUG u32MbHandle => u32MbHandle_10
  # DEBUG BEGIN_STMT
  _7 ={v} state_23->mbs[u32MbHandle_10].state;
  if (_7 == 2)
    goto <bb 15>; [20.24%]
  else
    goto <bb 16>; [79.76%]

  <bb 15> [local count: 15576414]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerTxMB (instance_20(D), mb_idx_19);

  <bb 16> [local count: 76958566]:
  # DEBUG BEGIN_STMT
  _8 = FlexCAN_GetMsgBuffIntStatusFlag (base_22, mb_idx_19);
  if (_8 != 0)
    goto <bb 17>; [50.00%]
  else
    goto <bb 21>; [50.00%]

  <bb 17> [local count: 38479283]:
  # DEBUG BEGIN_STMT
  _9 ={v} state_23->mbs[u32MbHandle_10].state;
  if (_9 == 0)
    goto <bb 18>; [33.00%]
  else
    goto <bb 21>; [67.00%]

  <bb 18> [local count: 12698163]:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_22, mb_idx_19);
  # DEBUG bIsSpuriousInt => 0
  # DEBUG BEGIN_STMT
  goto <bb 21>; [100.00%]

  <bb 19> [local count: 808727776]:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_22, mb_idx_13);
  # DEBUG BEGIN_STMT
  mb_idx_27 = mb_idx_13 + 1;
  # DEBUG mb_idx => mb_idx_27

  <bb 20> [local count: 908682895]:
  # mb_idx_13 = PHI <mb_idx_27(19), startMbIdx_25(D)(22)>
  # DEBUG mb_idx => mb_idx_13
  # DEBUG BEGIN_STMT
  if (mb_idx_13 <= endMbIdx_24(D))
    goto <bb 19>; [89.00%]
  else
    goto <bb 21>; [11.00%]

  <bb 21> [local count: 214818651]:
  # DEBUG bIsSpuriousInt => NULL
  return;

}


FlexCAN_CompleteRxMessageFifoData (uint8 instance)
{
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  <unnamed type> _2;
  _Bool _3;
  _Bool _4;
  _Bool _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  base_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_9
  # DEBUG BEGIN_STMT
  state_10 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_10
  # DEBUG BEGIN_STMT
  _2 = state_10->transferType;
  if (_2 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _3 = state_10->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_9, instance_7(D), 5, 0, _3);
  # DEBUG BEGIN_STMT
  _4 = state_10->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_9, instance_7(D), 6, 0, _4);
  # DEBUG BEGIN_STMT
  _5 = state_10->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_9, instance_7(D), 7, 0, _5);

  <bb 4> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  state_10->mbs[0].pMBmessage = 0B;
  # DEBUG BEGIN_STMT
  state_10->mbs[0].state ={v} 0;
  return;

}


FlexCAN_Ip_GetTransferStatus (uint8 instance, uint8 mb_idx)
{
  Flexcan_Ip_StatusType status;
  const struct Flexcan_Ip_StateType * state;
  int _1;
  int _2;
  <unnamed type> _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_5(D);
  state_7 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_7
  # DEBUG BEGIN_STMT
  # DEBUG status => 1
  # DEBUG BEGIN_STMT
  if (mb_idx_8(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _2 = (int) mb_idx_8(D);
  _3 ={v} state_7->mbs[_2].state;
  if (_3 == 0)
    goto <bb 5>; [65.00%]
  else
    goto <bb 4>; [35.00%]

  <bb 4> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  # DEBUG status => 2

  <bb 5> [local count: 1073741824]:
  # status_4 = PHI <1(2), 0(3), 2(4)>
  # DEBUG status => status_4
  # DEBUG BEGIN_STMT
  return status_4;

}


FlexCAN_Ip_ConfigRemoteResponseMb (uint8 instance, uint8 mb_idx, const struct Flexcan_Ip_DataInfoType * tx_info, uint32 msg_id, const uint8 * mb_data)
{
  volatile uint32 * pMbAddr;
  const struct Flexcan_Ip_StateType * const state;
  struct FLEXCAN_Type * pBase;
  struct Flexcan_Ip_MsbuffCodeStatusType cs;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _2;
  <unnamed type> _3;
  long unsigned int _4;
  _Bool _5;
  _Bool _6;
  _Bool _7;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) instance_10(D);
  pBase_12 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_12
  # DEBUG BEGIN_STMT
  state_13 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_13
  # DEBUG BEGIN_STMT
  # DEBUG pMbAddr => 0B
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = tx_info_14(D)->data_length;
  cs.dataLen = _2;
  # DEBUG BEGIN_STMT
  _3 = tx_info_14(D)->msg_id_type;
  cs.msgIdType = _3;
  # DEBUG BEGIN_STMT
  cs.code = 10;
  # DEBUG BEGIN_STMT
  cs.fd_enable = 0;
  # DEBUG BEGIN_STMT
  cs.enable_brs = 0;
  # DEBUG BEGIN_STMT
  cs.fd_padding = 0;
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) mb_idx_21(D);
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_12, _4);
  # DEBUG BEGIN_STMT
  pMbAddr_24 = FlexCAN_GetMsgBuffRegion (pBase_12, _4);
  # DEBUG pMbAddr => pMbAddr_24
  # DEBUG BEGIN_STMT
  _5 = tx_info_14(D)->is_remote;
  FlexCAN_SetTxMsgBuff (pMbAddr_24, &cs, msg_id_25(D), mb_data_26(D), _5);
  # DEBUG BEGIN_STMT
  _6 = tx_info_14(D)->is_polling;
  if (_6 != 0)
    goto <bb 4>; [67.00%]
  else
    goto <bb 3>; [33.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _7 = state_13->isIntActive;
  result_29 = FlexCAN_SetMsgBuffIntCmd (pBase_12, instance_10(D), _4, 1, _7);
  # DEBUG result => result_29

  <bb 4> [local count: 1073741824]:
  # result_8 = PHI <result_29(3), 0(2)>
  # DEBUG result => result_8
  # DEBUG BEGIN_STMT
  cs ={v} {CLOBBER};
  return result_8;

}


FlexCAN_Ip_ConfigRxFifo_Privileged (uint8 instance, Flexcan_Ip_RxFifoIdElementFormatType id_format, const struct Flexcan_Ip_IdTableType * id_filter_table)
{
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType status;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _17;
  signed int _18;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  # DEBUG status => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_7(D);
  pBase_9 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_9
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_9
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _17 ={v} MEM[(const struct FLEXCAN_Type *)pBase_9].MCR;
  _18 = (signed int) _17;
  # DEBUG pBase => NULL
  # DEBUG disabled => _18 < 0
  # DEBUG BEGIN_STMT
  if (_18 < 0)
    goto <bb 3>; [41.00%]
  else
    goto <bb 4>; [59.00%]

  <bb 3> [local count: 440234147]:
  # DEBUG BEGIN_STMT
  result_11 = FlexCAN_Enable (pBase_9);
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  if (result_11 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 853624749]:
  # result_19 = PHI <result_11(3), 0(2)>
  # DEBUG result => NULL
  # DEBUG BEGIN_STMT
  FlexCAN_SetRxFifoFilter (pBase_9, id_format_12(D), id_filter_table_13(D));

  <bb 5> [local count: 1073741823]:
  # result_2 = PHI <result_11(3), result_19(4)>
  # DEBUG BEGIN_STMT
  if (_18 < 0)
    goto <bb 6>; [25.50%]
  else
    goto <bb 8>; [74.50%]

  <bb 6> [local count: 273804165]:
  # DEBUG BEGIN_STMT
  status_16 = FlexCAN_Disable (pBase_9);
  # DEBUG status => status_16
  # DEBUG BEGIN_STMT
  if (status_16 != 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 136902082]:
  # DEBUG BEGIN_STMT
  # DEBUG result => status_16

  <bb 8> [local count: 1073741824]:
  # result_4 = PHI <result_2(5), result_2(6), status_16(7)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_Ip_RxFifoBlocking (uint8 instance, struct Flexcan_Ip_MsgBuffType * data, uint32 timeout)
{
  Flexcan_Ip_StatusType result;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  result_7 = FlexCAN_StartRxMessageFifoData (instance_4(D), data_5(D));
  # DEBUG result => result_7
  # DEBUG BEGIN_STMT
  if (result_7 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  result_10 = FlexCAN_ProccessLegacyRxFIFO (instance_4(D), timeout_8(D));
  # DEBUG result => result_10

  <bb 4> [local count: 1073741824]:
  # result_1 = PHI <result_7(2), result_10(3)>
  # DEBUG result => result_1
  # DEBUG BEGIN_STMT
  return result_1;

}


FlexCAN_Ip_RxFifo (uint8 instance, struct Flexcan_Ip_MsgBuffType * data)
{
  Flexcan_Ip_StatusType result;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  result_5 = FlexCAN_StartRxMessageFifoData (instance_2(D), data_3(D));
  # DEBUG result => result_5
  # DEBUG BEGIN_STMT
  return result_5;

}


FlexCAN_Ip_ReceiveBlocking (uint8 instance, uint8 mb_idx, struct Flexcan_Ip_MsgBuffType * data, boolean isPolling, uint32 u32TimeoutMs)
{
  const struct FLEXCAN_Type * base;
  struct Flexcan_Ip_StateType * state;
  uint32 mS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType result;
  long unsigned int _1;
  int _2;
  long unsigned int _3;
  long unsigned int _4;
  unsigned char _5;
  int _6;
  <unnamed type> _7;
  int _8;
  <unnamed type> _9;
  long unsigned int _35;

  <bb 2> [local count: 348071309]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  _1 = u32TimeoutMs_19(D) * 1000;
  mS2Ticks_21 = OsIf_MicrosToTicks (_1, 0);
  # DEBUG mS2Ticks => mS2Ticks_21
  # DEBUG BEGIN_STMT
  _2 = (int) instance_22(D);
  state_23 = Flexcan_Ip_apxState[_2];
  # DEBUG state => state_23
  # DEBUG BEGIN_STMT
  base_24 = Flexcan_Ip_apxBase[_2];
  # DEBUG base => base_24
  # DEBUG BEGIN_STMT
  result_29 = FlexCAN_StartRxMessageBufferData (instance_22(D), mb_idx_25(D), data_26(D), isPolling_27(D));
  # DEBUG result => result_29
  # DEBUG BEGIN_STMT
  if (result_29 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 9>; [67.00%]

  <bb 3> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  _3 = OsIf_GetCounter (0);
  timeStart = _3;
  # DEBUG BEGIN_STMT
  goto <bb 8>; [100.00%]

  <bb 4> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  if (isPolling_27(D) != 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 5> [local count: 334846388]:
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) mb_idx_25(D);
  _5 = FlexCAN_GetBuffStatusFlag (base_24, _4);
  if (_5 != 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 6> [local count: 110499308]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxMB (instance_22(D), _4);

  <bb 7> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _35 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_36 = timeElapsed_12 + _35;
  # DEBUG timeElapsed => timeElapsed_36
  # DEBUG BEGIN_STMT
  if (mS2Ticks_21 <= timeElapsed_36)
    goto <bb 9>; [5.50%]
  else
    goto <bb 14>; [94.50%]

  <bb 14> [local count: 958878292]:

  <bb 8> [local count: 1073741824]:
  # timeElapsed_12 = PHI <0(3), timeElapsed_36(14)>
  # DEBUG timeElapsed => timeElapsed_12
  # DEBUG BEGIN_STMT
  _6 = (int) mb_idx_25(D);
  _7 ={v} state_23->mbs[_6].state;
  if (_7 == 1)
    goto <bb 4>; [94.50%]
  else
    goto <bb 9>; [5.50%]

  <bb 9> [local count: 348071309]:
  # result_10 = PHI <result_29(2), 3(7), 0(8)>
  # DEBUG result => result_10
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (result_10 != 4)
    goto <bb 10>; [66.00%]
  else
    goto <bb 13>; [34.00%]

  <bb 10> [local count: 229727064]:
  if (result_10 != 2)
    goto <bb 11>; [66.00%]
  else
    goto <bb 13>; [34.00%]

  <bb 11> [local count: 151619862]:
  # DEBUG BEGIN_STMT
  _8 = (int) mb_idx_25(D);
  _9 ={v} state_23->mbs[_8].state;
  if (_9 == 0)
    goto <bb 13>; [65.00%]
  else
    goto <bb 12>; [35.00%]

  <bb 12> [local count: 53066952]:
  # DEBUG BEGIN_STMT
  state_23->mbs[_8].state ={v} 0;
  # DEBUG BEGIN_STMT
  # DEBUG result => 3

  <bb 13> [local count: 348071309]:
  # result_11 = PHI <result_10(9), result_10(10), 0(11), 3(12)>
  # DEBUG result => result_11
  # DEBUG BEGIN_STMT
  timeStart ={v} {CLOBBER};
  return result_11;

}


FlexCAN_Ip_Receive (uint8 instance, uint8 mb_idx, struct Flexcan_Ip_MsgBuffType * data, boolean isPolling)
{
  Flexcan_Ip_StatusType result;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  result_7 = FlexCAN_StartRxMessageBufferData (instance_2(D), mb_idx_3(D), data_4(D), isPolling_5(D));
  # DEBUG result => result_7
  # DEBUG BEGIN_STMT
  return result_7;

}


FlexCAN_Ip_ConfigRxMb (uint8 instance, uint8 mb_idx, const struct Flexcan_Ip_DataInfoType * rx_info, uint32 msg_id)
{
  struct FLEXCAN_Type * base;
  struct Flexcan_Ip_MsbuffCodeStatusType cs;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  <unnamed type> _4;
  _Bool _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) instance_6(D);
  base_8 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_8
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) mb_idx_9(D);
  FlexCAN_ClearMsgBuffIntStatusFlag (base_8, _2);
  # DEBUG BEGIN_STMT
  _3 = rx_info_11(D)->data_length;
  cs.dataLen = _3;
  # DEBUG BEGIN_STMT
  _4 = rx_info_11(D)->msg_id_type;
  cs.msgIdType = _4;
  # DEBUG BEGIN_STMT
  _5 = rx_info_11(D)->fd_enable;
  cs.fd_enable = _5;
  # DEBUG BEGIN_STMT
  cs.code = 15;
  # DEBUG BEGIN_STMT
  FlexCAN_SetRxMsgBuff (base_8, _2, &cs, msg_id_16(D));
  # DEBUG BEGIN_STMT
  cs.code = 0;
  # DEBUG BEGIN_STMT
  FlexCAN_SetRxMsgBuff (base_8, _2, &cs, msg_id_16(D));
  # DEBUG BEGIN_STMT
  cs.code = 4;
  # DEBUG BEGIN_STMT
  FlexCAN_SetRxMsgBuff (base_8, _2, &cs, msg_id_16(D));
  # DEBUG BEGIN_STMT
  cs ={v} {CLOBBER};
  return 0;

}


FlexCAN_Ip_Send (uint8 instance, uint8 mb_idx, const struct Flexcan_Ip_DataInfoType * tx_info, uint32 msg_id, const uint8 * mb_data)
{
  const struct FLEXCAN_Type * base;
  Flexcan_Ip_StatusType result;
  int _1;
  long unsigned int _13;
  long unsigned int _14;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 1
  # DEBUG BEGIN_STMT
  _1 = (int) instance_4(D);
  base_6 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_6
  # DEBUG BEGIN_STMT
  # DEBUG base => base_6
  # DEBUG INLINE_ENTRY FlexCAN_IsListenOnlyModeEnabled
  # DEBUG BEGIN_STMT
  _13 ={v} base_6->CTRL1;
  _14 = _13 & 8;
  # DEBUG base => NULL
  if (_14 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  result_12 = FlexCAN_StartSendData (instance_4(D), mb_idx_7(D), tx_info_8(D), msg_id_9(D), mb_data_10(D));
  # DEBUG result => result_12

  <bb 4> [local count: 1073741824]:
  # result_2 = PHI <1(2), result_12(3)>
  # DEBUG result => result_2
  # DEBUG BEGIN_STMT
  return result_2;

}


FlexCAN_Ip_Init_Privileged (uint8 Flexcan_Ip_u8Instance, struct Flexcan_Ip_StateType * Flexcan_Ip_pState, const struct Flexcan_Ip_ConfigType * Flexcan_Ip_pData)
{
  uint32 i;
  struct FLEXCAN_Type * pBase;
  Flexcan_Ip_StatusType eResult;
  int _1;
  _Bool _2;
  _Bool _3;
  const struct Flexcan_Ip_TimeSegmentType * _4;
  const struct Flexcan_Ip_TimeSegmentType * _5;
  const struct Flexcan_Ip_TimeSegmentType * _6;
  <unnamed type> _7;
  <unnamed type> _8;
  void (*<T626>) (uint8, Flexcan_Ip_EventType, uint32, const struct Flexcan_Ip_StateType *) _9;
  void (*<T626>) (uint8, Flexcan_Ip_EventType, uint32, const struct Flexcan_Ip_StateType *) _10;
  _Bool _11;
  long unsigned int _12;

  <bb 2> [local count: 98589024]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  _1 = (int) Flexcan_Ip_u8Instance_17(D);
  pBase_19 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_19
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  eResult_22 = FlexCAN_InitController (pBase_19, Flexcan_Ip_pData_20(D));
  # DEBUG eResult => eResult_22
  # DEBUG BEGIN_STMT
  if (eResult_22 == 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 10>; [67.00%]

  <bb 3> [local count: 32534378]:
  # DEBUG BEGIN_STMT
  _2 = Flexcan_Ip_pData_20(D)->fd_enable;
  FlexCAN_EnableExtCbt (pBase_19, _2);
  # DEBUG BEGIN_STMT
  _3 = Flexcan_Ip_pData_20(D)->fd_enable;
  if (_3 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 16267189]:
  # DEBUG BEGIN_STMT
  _4 = &Flexcan_Ip_pData_20(D)->bitrate;
  FlexCAN_SetExtendedTimeSegments (pBase_19, _4);
  # DEBUG BEGIN_STMT
  _5 = &Flexcan_Ip_pData_20(D)->bitrate_cbt;
  FlexCAN_SetFDTimeSegments (pBase_19, _5);
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 16267189]:
  # DEBUG BEGIN_STMT
  _6 = &Flexcan_Ip_pData_20(D)->bitrate;
  FlexCAN_SetTimeSegments (pBase_19, _6);

  <bb 6> [local count: 32534378]:
  # DEBUG BEGIN_STMT
  _7 = Flexcan_Ip_pData_20(D)->flexcanMode;
  FlexCAN_SetOperationMode (pBase_19, _7);
  # DEBUG BEGIN_STMT
  # DEBUG i => 0
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 1041207447]:
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->mbs[i_13].isPolling = 1;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->mbs[i_13].pMBmessage = 0B;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->mbs[i_13].state ={v} 0;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->mbs[i_13].time_stamp = 0;
  # DEBUG BEGIN_STMT
  i_42 = i_13 + 1;
  # DEBUG i => i_42

  <bb 8> [local count: 1073741824]:
  # i_13 = PHI <0(6), i_42(7)>
  # DEBUG i => i_13
  # DEBUG BEGIN_STMT
  if (i_13 != 32)
    goto <bb 7>; [96.97%]
  else
    goto <bb 9>; [3.03%]

  <bb 9> [local count: 32534377]:
  # DEBUG BEGIN_STMT
  _8 = Flexcan_Ip_pData_20(D)->transfer_type;
  Flexcan_Ip_pState_28(D)->transferType = _8;
  # DEBUG BEGIN_STMT
  _9 = Flexcan_Ip_pData_20(D)->Callback;
  Flexcan_Ip_pState_28(D)->callback = _9;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->callbackParam = 0B;
  # DEBUG BEGIN_STMT
  _10 = Flexcan_Ip_pData_20(D)->ErrorCallback;
  Flexcan_Ip_pState_28(D)->error_callback = _10;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->errorCallbackParam = 0B;
  # DEBUG BEGIN_STMT
  _11 = Flexcan_Ip_pData_20(D)->is_rx_fifo_needed;
  Flexcan_Ip_pState_28(D)->bIsLegacyFifoEn = _11;
  # DEBUG BEGIN_STMT
  _12 = Flexcan_Ip_pData_20(D)->max_num_mb;
  Flexcan_Ip_pState_28(D)->u32MaxMbNum = _12;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_pState_28(D)->isIntActive = 1;
  # DEBUG BEGIN_STMT
  Flexcan_Ip_apxState[_1] = Flexcan_Ip_pState_28(D);

  <bb 10> [local count: 98589023]:
  # DEBUG BEGIN_STMT
  return eResult_22;

}


FlexCAN_AbortRxTransfer (uint8 u8Instance, uint8 mb_idx)
{
  volatile uint32 * flexcan_mb;
  uint32 flexcan_mb_config;
  uint32 val2;
  uint32 val1;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * pBase;
  int _1;
  int _2;
  _Bool _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  _Bool _7;
  long unsigned int _8;
  long unsigned int _9;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_12(D);
  pBase_14 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_14
  # DEBUG BEGIN_STMT
  state_15 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_15
  # DEBUG BEGIN_STMT
  # DEBUG val1 => 0
  # DEBUG BEGIN_STMT
  # DEBUG val2 => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb => 0B
  # DEBUG BEGIN_STMT
  _2 = (int) mb_idx_16(D);
  state_15->mbs[_2].state ={v} 0;
  # DEBUG BEGIN_STMT
  _3 = state_15->bIsLegacyFifoEn;
  if (_3 != 0)
    goto <bb 3>; [67.00%]
  else
    goto <bb 7>; [33.00%]

  <bb 3> [local count: 719407022]:
  # DEBUG BEGIN_STMT
  _4 ={v} pBase_14->CTRL2;
  _5 = _4 >> 24;
  val1_25 = _5 & 15;
  # DEBUG val1 => val1_25
  # DEBUG BEGIN_STMT
  val2_26 = RxFifoOcuppiedLastMsgBuff (val1_25);
  # DEBUG val2 => val2_26
  # DEBUG BEGIN_STMT
  _6 = (long unsigned int) mb_idx_16(D);
  if (_6 > val2_26)
    goto <bb 4>; [33.00%]
  else
    goto <bb 5>; [67.00%]

  <bb 4> [local count: 237404317]:
  # DEBUG BEGIN_STMT
  flexcan_mb_28 = FlexCAN_GetMsgBuffRegion (pBase_14, _6);
  # DEBUG flexcan_mb => flexcan_mb_28
  # DEBUG BEGIN_STMT
  flexcan_mb_config_29 ={v} *flexcan_mb_28;
  # DEBUG flexcan_mb_config => flexcan_mb_config_29
  # DEBUG BEGIN_STMT
  flexcan_mb_config_30 = flexcan_mb_config_29 & 4043309055;
  # DEBUG flexcan_mb_config => flexcan_mb_config_30
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => flexcan_mb_config_30
  # DEBUG BEGIN_STMT
  *flexcan_mb_28 ={v} flexcan_mb_config_30;
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => flexcan_mb_config_30
  # DEBUG BEGIN_STMT
  flexcan_mb_config_32 = flexcan_mb_config_30 | 67108864;
  # DEBUG flexcan_mb_config => flexcan_mb_config_32
  # DEBUG BEGIN_STMT
  *flexcan_mb_28 ={v} flexcan_mb_config_32;

  <bb 5> [local count: 719407022]:
  # DEBUG BEGIN_STMT
  if (mb_idx_16(D) == 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 8>; [67.00%]

  <bb 6> [local count: 237404317]:
  # DEBUG BEGIN_STMT
  _7 = state_15->isIntActive;
  FLEXCAN_ClearMsgBuffIntCmd (pBase_14, u8Instance_12(D), 5, _7);
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _8 = (long unsigned int) mb_idx_16(D);
  flexcan_mb_19 = FlexCAN_GetMsgBuffRegion (pBase_14, _8);
  # DEBUG flexcan_mb => flexcan_mb_19
  # DEBUG BEGIN_STMT
  flexcan_mb_config_20 ={v} *flexcan_mb_19;
  # DEBUG flexcan_mb_config => flexcan_mb_config_20
  # DEBUG BEGIN_STMT
  flexcan_mb_config_21 = flexcan_mb_config_20 & 4043309055;
  # DEBUG flexcan_mb_config => flexcan_mb_config_21
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => flexcan_mb_config_21
  # DEBUG BEGIN_STMT
  *flexcan_mb_19 ={v} flexcan_mb_config_21;
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => flexcan_mb_config_21
  # DEBUG BEGIN_STMT
  flexcan_mb_config_23 = flexcan_mb_config_21 | 67108864;
  # DEBUG flexcan_mb_config => flexcan_mb_config_23
  # DEBUG BEGIN_STMT
  *flexcan_mb_19 ={v} flexcan_mb_config_23;

  <bb 8> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _9 = (long unsigned int) mb_idx_16(D);
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_14, _9);
  return;

}


FlexCAN_AbortTxTransfer (uint8 u8Instance, uint8 mb_idx)
{
  volatile uint32 * flexcan_mb;
  uint32 uS2Ticks;
  uint32 flexcan_mb_config;
  uint32 timeElapsed;
  uint32 timeStart;
  Flexcan_Ip_StatusType result;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * pBase;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  unsigned char _4;
  long unsigned int _5;
  long unsigned int _6;
  int _7;
  long unsigned int _32;

  <bb 2> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_14(D);
  pBase_16 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_16
  # DEBUG BEGIN_STMT
  state_17 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_17
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb_config => 0
  # DEBUG BEGIN_STMT
  # DEBUG uS2Ticks => 0
  # DEBUG BEGIN_STMT
  # DEBUG flexcan_mb => 0B
  # DEBUG BEGIN_STMT
  _2 = (long unsigned int) mb_idx_19(D);
  flexcan_mb_21 = FlexCAN_GetMsgBuffRegion (pBase_16, _2);
  # DEBUG flexcan_mb => flexcan_mb_21
  # DEBUG BEGIN_STMT
  flexcan_mb_config_22 ={v} *flexcan_mb_21;
  # DEBUG flexcan_mb_config => flexcan_mb_config_22
  # DEBUG BEGIN_STMT
  flexcan_mb_config_23 = flexcan_mb_config_22 & 4043309055;
  # DEBUG flexcan_mb_config => flexcan_mb_config_23
  # DEBUG BEGIN_STMT
  flexcan_mb_config_24 = flexcan_mb_config_23 | 150994944;
  # DEBUG flexcan_mb_config => flexcan_mb_config_24
  # DEBUG BEGIN_STMT
  *flexcan_mb_21 ={v} flexcan_mb_config_24;
  # DEBUG BEGIN_STMT
  uS2Ticks_27 = OsIf_MicrosToTicks (1000000, 0);
  # DEBUG uS2Ticks => uS2Ticks_27
  # DEBUG BEGIN_STMT
  _3 = OsIf_GetCounter (0);
  timeStart = _3;
  # DEBUG BEGIN_STMT
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _32 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_33 = timeElapsed_11 + _32;
  # DEBUG timeElapsed => timeElapsed_33
  # DEBUG BEGIN_STMT
  if (uS2Ticks_27 <= timeElapsed_33)
    goto <bb 5>; [5.50%]
  else
    goto <bb 11>; [94.50%]

  <bb 11> [local count: 958878293]:

  <bb 4> [local count: 1073741824]:
  # timeElapsed_11 = PHI <0(2), timeElapsed_33(11)>
  # DEBUG timeElapsed => timeElapsed_11
  # DEBUG BEGIN_STMT
  _4 = FlexCAN_GetBuffStatusFlag (pBase_16, _2);
  if (_4 == 0)
    goto <bb 3>; [94.50%]
  else
    goto <bb 5>; [5.50%]

  <bb 5> [local count: 114863532]:
  # result_8 = PHI <3(3), 0(4)>
  # DEBUG result => result_8
  # DEBUG BEGIN_STMT
  if (result_8 != 3)
    goto <bb 6>; [66.00%]
  else
    goto <bb 10>; [34.00%]

  <bb 6> [local count: 75809931]:
  # DEBUG BEGIN_STMT
  flexcan_mb_config_34 ={v} *flexcan_mb_21;
  # DEBUG flexcan_mb_config => flexcan_mb_config_34
  # DEBUG BEGIN_STMT
  _5 = flexcan_mb_config_34 >> 24;
  _6 = _5 & 15;
  if (_6 == 8)
    goto <bb 7>; [34.00%]
  else
    goto <bb 8>; [66.00%]

  <bb 7> [local count: 25775377]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 5

  <bb 8> [local count: 75809931]:
  # result_9 = PHI <result_8(6), 5(7)>
  # DEBUG result => result_9
  # DEBUG BEGIN_STMT
  if (_6 == 9)
    goto <bb 9>; [34.00%]
  else
    goto <bb 10>; [66.00%]

  <bb 9> [local count: 25775377]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0

  <bb 10> [local count: 114863532]:
  # result_10 = PHI <result_8(5), result_9(8), 0(9)>
  # DEBUG result => result_10
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_16, _2);
  # DEBUG BEGIN_STMT
  _7 = (int) mb_idx_19(D);
  state_17->mbs[_7].state ={v} 0;
  # DEBUG BEGIN_STMT
  timeStart ={v} {CLOBBER};
  return result_10;

}


FlexCAN_ProcessSpuriousInterruptMB (uint8 instance, uint32 startMbIdx, uint32 endMbIdx)
{
  uint32 u32MbHandle;
  uint32 mb_idx;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  unsigned char _2;
  unsigned char _3;
  _Bool _4;
  _Bool _5;
  <unnamed type> _6;

  <bb 2> [local count: 118111602]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_11(D);
  base_13 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_13
  # DEBUG BEGIN_STMT
  state_14 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_14
  # DEBUG BEGIN_STMT
  # DEBUG mb_idx => 0
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => 0
  # DEBUG BEGIN_STMT
  # DEBUG mb_idx => startMbIdx_15(D)
  goto <bb 12>; [100.00%]

  <bb 3> [local count: 955630223]:
  # DEBUG BEGIN_STMT
  _2 = FlexCAN_GetBuffStatusFlag (base_13, mb_idx_7);
  if (_2 != 0)
    goto <bb 4>; [33.00%]
  else
    goto <bb 11>; [67.00%]

  <bb 4> [local count: 315357973]:
  _3 = FlexCAN_GetBuffStatusImask (base_13, mb_idx_7);
  if (_3 == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 5> [local count: 157678987]:
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => mb_idx_7
  # DEBUG BEGIN_STMT
  _4 = state_14->bIsLegacyFifoEn;
  if (_4 != 0)
    goto <bb 6>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 6> [local count: 78839493]:
  if (mb_idx_7 <= 7)
    goto <bb 7>; [50.00%]
  else
    goto <bb 8>; [50.00%]

  <bb 7> [local count: 39419747]:
  # DEBUG BEGIN_STMT
  # DEBUG u32MbHandle => 0

  <bb 8> [local count: 157678987]:
  # u32MbHandle_8 = PHI <mb_idx_7(5), mb_idx_7(6), 0(7)>
  # DEBUG u32MbHandle => u32MbHandle_8
  # DEBUG BEGIN_STMT
  _5 = state_14->mbs[u32MbHandle_8].isPolling;
  if (_5 != 0)
    goto <bb 11>; [67.00%]
  else
    goto <bb 9>; [33.00%]

  <bb 9> [local count: 52034066]:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_13, mb_idx_7);
  # DEBUG BEGIN_STMT
  _6 ={v} state_14->mbs[u32MbHandle_8].state;
  if (_6 == 2)
    goto <bb 10>; [34.00%]
  else
    goto <bb 11>; [66.00%]

  <bb 10> [local count: 17691582]:
  # DEBUG BEGIN_STMT
  state_14->mbs[u32MbHandle_8].state ={v} 0;
  # DEBUG BEGIN_STMT
  state_14->mbs[u32MbHandle_8].isPolling = 1;

  <bb 11> [local count: 955630223]:
  # DEBUG BEGIN_STMT
  mb_idx_22 = mb_idx_7 + 1;
  # DEBUG mb_idx => mb_idx_22

  <bb 12> [local count: 1073741824]:
  # mb_idx_7 = PHI <startMbIdx_15(D)(2), mb_idx_22(11)>
  # DEBUG mb_idx => mb_idx_7
  # DEBUG BEGIN_STMT
  if (mb_idx_7 <= endMbIdx_16(D))
    goto <bb 3>; [89.00%]
  else
    goto <bb 13>; [11.00%]

  <bb 13> [local count: 118111601]:
  return;

}


FlexCAN_IRQHandlerRxFIFO (uint8 instance, uint32 mb_idx)
{
  struct Flexcan_Ip_MsgBuffType data;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  struct Flexcan_Ip_MsgBuffType * _2;
  <unnamed type> _3;
  struct Flexcan_Ip_MsgBuffType * _4;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _5;
  <unnamed type> _6;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _7;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _8;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_12(D);
  base_14 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_14
  # DEBUG BEGIN_STMT
  state_15 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_15
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _2 = state_15->mbs[0].pMBmessage;
  if (_2 == 0B)
    goto <bb 3>; [30.00%]
  else
    goto <bb 4>; [70.00%]

  <bb 3> [local count: 322122547]:
  # DEBUG BEGIN_STMT
  state_15->mbs[0].pMBmessage = &data;

  <bb 4> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  switch (mb_idx_17(D)) <default: <L17> [25.00%], case 5: <L2> [25.00%], case 6: <L9> [25.00%], case 7: <L12> [25.00%]>

  <bb 5> [local count: 268435456]:
<L2>:
  # DEBUG BEGIN_STMT
  _3 ={v} state_15->mbs[0].state;
  if (_3 == 1)
    goto <bb 6>; [20.24%]
  else
    goto <bb 14>; [79.76%]

  <bb 6> [local count: 54331336]:
  # DEBUG BEGIN_STMT
  _4 = state_15->mbs[0].pMBmessage;
  FlexCAN_ReadRxFifo (base_14, _4);
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_14, mb_idx_17(D));
  # DEBUG BEGIN_STMT
  state_15->mbs[0].state ={v} 0;
  # DEBUG BEGIN_STMT
  _5 = state_15->callback;
  if (_5 != 0B)
    goto <bb 7>; [70.00%]
  else
    goto <bb 8>; [30.00%]

  <bb 7> [local count: 38031935]:
  # DEBUG BEGIN_STMT
  _5 (instance_12(D), 1, 0, state_15);

  <bb 8> [local count: 54331336]:
  # DEBUG BEGIN_STMT
  _6 ={v} state_15->mbs[0].state;
  if (_6 == 0)
    goto <bb 9>; [33.00%]
  else
    goto <bb 14>; [67.00%]

  <bb 9> [local count: 17929341]:
  # DEBUG BEGIN_STMT
  state_15->mbs[0].isPolling = 1;
  # DEBUG BEGIN_STMT
  FlexCAN_CompleteRxMessageFifoData (instance_12(D));
  goto <bb 14>; [100.00%]

  <bb 10> [local count: 268435456]:
<L9>:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_14, mb_idx_17(D));
  # DEBUG BEGIN_STMT
  _7 = state_15->callback;
  if (_7 != 0B)
    goto <bb 11>; [70.00%]
  else
    goto <bb 14>; [30.00%]

  <bb 11> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  _7 (instance_12(D), 2, 0, state_15);
  goto <bb 14>; [100.00%]

  <bb 12> [local count: 268435456]:
<L12>:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_14, mb_idx_17(D));
  # DEBUG BEGIN_STMT
  _8 = state_15->callback;
  if (_8 != 0B)
    goto <bb 13>; [70.00%]
  else
    goto <bb 14>; [30.00%]

  <bb 13> [local count: 187904819]:
  # DEBUG BEGIN_STMT
  _8 (instance_12(D), 3, 0, state_15);

  <bb 14> [local count: 1073741824]:
<L17>:
  data ={v} {CLOBBER};
  return;

}


FlexCAN_IRQHandlerTxMB (uint8 u8Instance, uint32 u32MbIdx)
{
  boolean bCurrentIntStat;
  struct Flexcan_Ip_MsgBuffType mb;
  struct Flexcan_Ip_StateType * pState;
  struct FLEXCAN_Type * pBase;
  int _1;
  _Bool _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _8;
  <unnamed type> _9;
  _Bool _10;
  _Bool _11;
  _Bool _12;
  _Bool _13;
  long unsigned int vol.5_36;
  long unsigned int vol.5_37;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_17(D);
  pBase_19 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_19
  # DEBUG BEGIN_STMT
  pState_20 = Flexcan_Ip_apxState[_1];
  # DEBUG pState => pState_20
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG bCurrentIntStat => 0
  # DEBUG BEGIN_STMT
  _2 = pState_20->mbs[u32MbIdx_21(D)].isRemote;
  if (_2 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 3> [local count: 536870911]:
  # DEBUG BEGIN_STMT
  FlexCAN_LockRxMsgBuff (pBase_19, u32MbIdx_21(D));
  # DEBUG BEGIN_STMT
  FlexCAN_GetMsgBuff (pBase_19, u32MbIdx_21(D), &mb);
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_19
  # DEBUG INLINE_ENTRY FlexCAN_UnlockRxMsgBuff
  # DEBUG BEGIN_STMT
  vol.5_36 ={v} MEM[(const struct FLEXCAN_Type *)pBase_19].TIMER;
  # DEBUG base => NULL
  # DEBUG BEGIN_STMT
  _3 = mb.time_stamp;
  pState_20->mbs[u32MbIdx_21(D)].time_stamp = _3;
  # DEBUG BEGIN_STMT
  _4 = mb.cs;
  _5 = _4 >> 24;
  _6 = _5 & 15;
  if (_6 == 4)
    goto <bb 4>; [20.24%]
  else
    goto <bb 6>; [79.76%]

  <bb 4> [local count: 108662672]:
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_19, u32MbIdx_21(D));
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 536870911]:
  # DEBUG BEGIN_STMT
  _7 = FlexCAN_GetMsgBuffTimestamp (pBase_19, u32MbIdx_21(D));
  pState_20->mbs[u32MbIdx_21(D)].time_stamp = _7;
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_19
  # DEBUG INLINE_ENTRY FlexCAN_UnlockRxMsgBuff
  # DEBUG BEGIN_STMT
  vol.5_37 ={v} MEM[(const struct FLEXCAN_Type *)pBase_19].TIMER;
  # DEBUG base => NULL
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (pBase_19, u32MbIdx_21(D));

  <bb 6> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  pState_20->mbs[u32MbIdx_21(D)].state ={v} 0;
  # DEBUG BEGIN_STMT
  bCurrentIntStat_30 = pState_20->mbs[u32MbIdx_21(D)].isPolling;
  # DEBUG bCurrentIntStat => bCurrentIntStat_30
  # DEBUG BEGIN_STMT
  _8 = pState_20->callback;
  if (_8 != 0B)
    goto <bb 7>; [70.00%]
  else
    goto <bb 8>; [30.00%]

  <bb 7> [local count: 751619278]:
  # DEBUG BEGIN_STMT
  _8 (u8Instance_17(D), 4, u32MbIdx_21(D), pState_20);

  <bb 8> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _9 ={v} pState_20->mbs[u32MbIdx_21(D)].state;
  if (_9 == 0)
    goto <bb 9>; [50.00%]
  else
    goto <bb 11>; [50.00%]

  <bb 9> [local count: 536870913]:
  _10 = pState_20->mbs[u32MbIdx_21(D)].isPolling;
  if (_10 != 0)
    goto <bb 11>; [67.00%]
  else
    goto <bb 10>; [33.00%]

  <bb 10> [local count: 177167401]:
  # DEBUG BEGIN_STMT
  pState_20->mbs[u32MbIdx_21(D)].isPolling = 1;
  # DEBUG BEGIN_STMT
  _11 = pState_20->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (pBase_19, u8Instance_17(D), u32MbIdx_21(D), 0, _11);
  goto <bb 14>; [100.00%]

  <bb 11> [local count: 896574424]:
  # DEBUG BEGIN_STMT
  if (bCurrentIntStat_30 != 0)
    goto <bb 14>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 12> [local count: 448287211]:
  _12 = pState_20->mbs[u32MbIdx_21(D)].isPolling;
  if (_12 != 0)
    goto <bb 13>; [33.00%]
  else
    goto <bb 14>; [67.00%]

  <bb 13> [local count: 147934780]:
  # DEBUG BEGIN_STMT
  _13 = pState_20->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (pBase_19, u8Instance_17(D), u32MbIdx_21(D), 0, _13);

  <bb 14> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  mb ={v} {CLOBBER};
  return;

}


FlexCAN_IRQHandlerRxMB (uint8 instance, uint32 mb_idx)
{
  volatile uint32 * flexcan_mb;
  boolean bIsCriticalSectionNeeded;
  boolean bCurrentIntStat;
  struct Flexcan_Ip_MsgBuffType data;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  struct Flexcan_Ip_MsgBuffType * _2;
  _Bool _3;
  _Bool _4;
  struct Flexcan_Ip_MsgBuffType * _5;
  _Bool _6;
  struct Flexcan_Ip_MsgBuffType * _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  void (*<T620>) (uint8, Flexcan_Ip_EventType, uint32, const struct FlexCANState *) _15;
  <unnamed type> _16;
  _Bool _17;
  _Bool _18;
  _Bool _19;
  _Bool _20;
  long unsigned int vol.5_50;

  <bb 2> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _1 = (int) instance_28(D);
  base_30 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_30
  # DEBUG BEGIN_STMT
  state_31 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_31
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG bCurrentIntStat => 0
  # DEBUG BEGIN_STMT
  _2 = state_31->mbs[mb_idx_32(D)].pMBmessage;
  if (_2 == 0B)
    goto <bb 3>; [30.00%]
  else
    goto <bb 4>; [70.00%]

  <bb 3> [local count: 322122547]:
  # DEBUG BEGIN_STMT
  state_31->mbs[mb_idx_32(D)].pMBmessage = &data;

  <bb 4> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  # DEBUG bIsCriticalSectionNeeded => 0
  # DEBUG BEGIN_STMT
  _3 = state_31->mbs[mb_idx_32(D)].isPolling;
  if (_3 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 5> [local count: 536870911]:
  # DEBUG BEGIN_STMT
  _4 = state_31->bIsLegacyFifoEn;
  if (_4 != 0)
    goto <bb 6>; [50.00%]
  else
    goto <bb 7>; [50.00%]

  <bb 6> [local count: 268435456]:
  # DEBUG BEGIN_STMT
  # DEBUG bIsCriticalSectionNeeded => 1
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" cpsid i");

  <bb 7> [local count: 1073741823]:
  # bIsCriticalSectionNeeded_21 = PHI <0(4), 0(5), 1(6)>
  # DEBUG bIsCriticalSectionNeeded => bIsCriticalSectionNeeded_21
  # DEBUG BEGIN_STMT
  FlexCAN_LockRxMsgBuff (base_30, mb_idx_32(D));
  # DEBUG BEGIN_STMT
  _5 = state_31->mbs[mb_idx_32(D)].pMBmessage;
  FlexCAN_GetMsgBuff (base_30, mb_idx_32(D), _5);
  # DEBUG BEGIN_STMT
  FlexCAN_ClearMsgBuffIntStatusFlag (base_30, mb_idx_32(D));
  # DEBUG BEGIN_STMT
  _6 = state_31->bIsLegacyFifoEn;
  if (_6 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 10>; [50.00%]

  <bb 8> [local count: 536870911]:
  _7 = state_31->mbs[mb_idx_32(D)].pMBmessage;
  _8 = _7->cs;
  _9 = _8 >> 24;
  _10 = _9 & 15;
  if (_10 == 0)
    goto <bb 9>; [33.00%]
  else
    goto <bb 10>; [67.00%]

  <bb 9> [local count: 177167401]:
  # DEBUG BEGIN_STMT
  flexcan_mb_39 = FlexCAN_GetMsgBuffRegion (base_30, mb_idx_32(D));
  # DEBUG flexcan_mb => flexcan_mb_39
  # DEBUG BEGIN_STMT
  _11 ={v} *flexcan_mb_39;
  _12 = _11 & 4043309055;
  *flexcan_mb_39 ={v} _12;
  # DEBUG BEGIN_STMT
  _13 ={v} *flexcan_mb_39;
  _14 = _13 | 67108864;
  *flexcan_mb_39 ={v} _14;
  goto <bb 11>; [100.00%]

  <bb 10> [local count: 896574422]:
  # DEBUG BEGIN_STMT
  # DEBUG base => base_30
  # DEBUG INLINE_ENTRY FlexCAN_UnlockRxMsgBuff
  # DEBUG BEGIN_STMT
  vol.5_50 ={v} MEM[(const struct FLEXCAN_Type *)base_30].TIMER;

  <bb 11> [local count: 1073741823]:
  # DEBUG base => NULL
  # DEBUG BEGIN_STMT
  if (bIsCriticalSectionNeeded_21 != 0)
    goto <bb 12>; [50.00%]
  else
    goto <bb 13>; [50.00%]

  <bb 12> [local count: 536870911]:
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" cpsie i");

  <bb 13> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  state_31->mbs[mb_idx_32(D)].state ={v} 0;
  # DEBUG BEGIN_STMT
  bCurrentIntStat_44 = state_31->mbs[mb_idx_32(D)].isPolling;
  # DEBUG bCurrentIntStat => bCurrentIntStat_44
  # DEBUG BEGIN_STMT
  _15 = state_31->callback;
  if (_15 != 0B)
    goto <bb 14>; [70.00%]
  else
    goto <bb 15>; [30.00%]

  <bb 14> [local count: 751619277]:
  # DEBUG BEGIN_STMT
  _15 (instance_28(D), 0, mb_idx_32(D), state_31);

  <bb 15> [local count: 1073741823]:
  # DEBUG BEGIN_STMT
  _16 ={v} state_31->mbs[mb_idx_32(D)].state;
  if (_16 == 0)
    goto <bb 16>; [50.00%]
  else
    goto <bb 18>; [50.00%]

  <bb 16> [local count: 536870911]:
  _17 = state_31->mbs[mb_idx_32(D)].isPolling;
  if (_17 != 0)
    goto <bb 18>; [67.00%]
  else
    goto <bb 17>; [33.00%]

  <bb 17> [local count: 177167401]:
  # DEBUG BEGIN_STMT
  state_31->mbs[mb_idx_32(D)].isPolling = 1;
  # DEBUG BEGIN_STMT
  _18 = state_31->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_30, instance_28(D), mb_idx_32(D), 0, _18);
  goto <bb 21>; [100.00%]

  <bb 18> [local count: 896574422]:
  # DEBUG BEGIN_STMT
  if (bCurrentIntStat_44 != 0)
    goto <bb 21>; [50.00%]
  else
    goto <bb 19>; [50.00%]

  <bb 19> [local count: 448287211]:
  _19 = state_31->mbs[mb_idx_32(D)].isPolling;
  if (_19 != 0)
    goto <bb 20>; [33.00%]
  else
    goto <bb 21>; [67.00%]

  <bb 20> [local count: 147934780]:
  # DEBUG BEGIN_STMT
  _20 = state_31->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_30, instance_28(D), mb_idx_32(D), 0, _20);

  <bb 21> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  data ={v} {CLOBBER};
  return;

}


FlexCAN_StartRxMessageFifoData (uint8 instance, struct Flexcan_Ip_MsgBuffType * data)
{
  Flexcan_Ip_StatusType eResult;
  struct Flexcan_Ip_StateType * state;
  struct FLEXCAN_Type * base;
  int _1;
  <unnamed type> _2;
  <unnamed type> _3;
  _Bool _4;
  _Bool _5;
  _Bool _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG base => 0B
  # DEBUG BEGIN_STMT
  # DEBUG state => 0B
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_10(D);
  base_12 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_12
  # DEBUG BEGIN_STMT
  state_13 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_13
  # DEBUG BEGIN_STMT
  _2 ={v} state_13->mbs[0].state;
  if (_2 != 0)
    goto <bb 7>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  state_13->mbs[0].state ={v} 1;
  # DEBUG BEGIN_STMT
  _3 = state_13->transferType;
  if (_3 == 1)
    goto <bb 4>; [34.00%]
  else
    goto <bb 5>; [66.00%]

  <bb 4> [local count: 237296943]:
  # DEBUG BEGIN_STMT
  state_13->mbs[0].isPolling = 1;

  <bb 5> [local count: 697932187]:
  # DEBUG BEGIN_STMT
  state_13->mbs[0].pMBmessage = data_16(D);
  # DEBUG BEGIN_STMT
  if (_3 == 0)
    goto <bb 6>; [33.00%]
  else
    goto <bb 7>; [67.00%]

  <bb 6> [local count: 230317621]:
  # DEBUG BEGIN_STMT
  state_13->mbs[0].isPolling = 0;
  # DEBUG BEGIN_STMT
  _4 = state_13->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_12, instance_10(D), 6, 1, _4);
  # DEBUG BEGIN_STMT
  _5 = state_13->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_12, instance_10(D), 7, 1, _5);
  # DEBUG BEGIN_STMT
  _6 = state_13->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (base_12, instance_10(D), 5, 1, _6);

  <bb 7> [local count: 1073741824]:
  # eResult_7 = PHI <2(2), 0(5), 0(6)>
  # DEBUG eResult => eResult_7
  # DEBUG BEGIN_STMT
  return eResult_7;

}


FlexCAN_StartSendData (uint8 Flexcan_Ip_u8Instance, uint8 mb_idx, const struct Flexcan_Ip_DataInfoType * tx_info, uint32 msg_id, const uint8 * mb_data)
{
  volatile uint32 * pMbAddr;
  struct FLEXCAN_Type * base;
  struct Flexcan_Ip_StateType * state;
  struct Flexcan_Ip_MsbuffCodeStatusType cs;
  Flexcan_Ip_StatusType eResult;
  int _1;
  int _2;
  <unnamed type> _3;
  long unsigned int _4;
  _Bool _5;
  _Bool _6;
  long unsigned int _7;
  <unnamed type> _8;
  _Bool _9;
  unsigned char _10;
  _Bool _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = (int) Flexcan_Ip_u8Instance_15(D);
  state_17 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_17
  # DEBUG BEGIN_STMT
  base_18 = Flexcan_Ip_apxBase[_1];
  # DEBUG base => base_18
  # DEBUG BEGIN_STMT
  # DEBUG pMbAddr => 0B
  # DEBUG BEGIN_STMT
  _2 = (int) mb_idx_19(D);
  _3 ={v} state_17->mbs[_2].state;
  if (_3 != 0)
    goto <bb 7>; [52.23%]
  else
    goto <bb 3>; [47.77%]

  <bb 3> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  _4 = (long unsigned int) mb_idx_19(D);
  FlexCAN_ClearMsgBuffIntStatusFlag (base_18, _4);
  # DEBUG BEGIN_STMT
  state_17->mbs[_2].state ={v} 2;
  # DEBUG BEGIN_STMT
  state_17->mbs[_2].time_stamp = 0;
  # DEBUG BEGIN_STMT
  _5 = tx_info_23(D)->is_polling;
  state_17->mbs[_2].isPolling = _5;
  # DEBUG BEGIN_STMT
  _6 = tx_info_23(D)->is_remote;
  state_17->mbs[_2].isRemote = _6;
  # DEBUG BEGIN_STMT
  _7 = tx_info_23(D)->data_length;
  cs.dataLen = _7;
  # DEBUG BEGIN_STMT
  _8 = tx_info_23(D)->msg_id_type;
  cs.msgIdType = _8;
  # DEBUG BEGIN_STMT
  _9 = tx_info_23(D)->fd_enable;
  cs.fd_enable = _9;
  # DEBUG BEGIN_STMT
  _10 = tx_info_23(D)->fd_padding;
  cs.fd_padding = _10;
  # DEBUG BEGIN_STMT
  _11 = tx_info_23(D)->enable_brs;
  cs.enable_brs = _11;
  # DEBUG BEGIN_STMT
  if (_6 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 256463235]:
  # DEBUG BEGIN_STMT
  cs.code = 28;
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 256463235]:
  # DEBUG BEGIN_STMT
  cs.code = 12;

  <bb 6> [local count: 512926469]:
  # DEBUG BEGIN_STMT
  pMbAddr_34 = FlexCAN_GetMsgBuffRegion (base_18, _4);
  # DEBUG pMbAddr => pMbAddr_34
  # DEBUG BEGIN_STMT
  FlexCAN_SetTxMsgBuff (pMbAddr_34, &cs, msg_id_35(D), mb_data_36(D), 0);

  <bb 7> [local count: 1073741824]:
  # eResult_12 = PHI <2(2), 0(6)>
  # DEBUG eResult => eResult_12
  # DEBUG BEGIN_STMT
  cs ={v} {CLOBBER};
  return eResult_12;

}


FlexCAN_StartRxMessageBufferData (uint8 instance, uint8 mb_idx, struct Flexcan_Ip_MsgBuffType * data, boolean isPolling)
{
  struct Flexcan_Ip_StateType * state;
  Flexcan_Ip_StatusType result;
  int _1;
  int _2;
  <unnamed type> _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG result => 0
  # DEBUG BEGIN_STMT
  _1 = (int) instance_6(D);
  state_8 = Flexcan_Ip_apxState[_1];
  # DEBUG state => state_8
  # DEBUG BEGIN_STMT
  _2 = (int) mb_idx_9(D);
  _3 ={v} state_8->mbs[_2].state;
  if (_3 != 0)
    goto <bb 4>; [35.00%]
  else
    goto <bb 3>; [65.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  state_8->mbs[_2].state ={v} 1;
  # DEBUG BEGIN_STMT
  state_8->mbs[_2].pMBmessage = data_11(D);
  # DEBUG BEGIN_STMT
  state_8->mbs[_2].isPolling = isPolling_13(D);

  <bb 4> [local count: 1073741824]:
  # result_4 = PHI <2(2), 0(3)>
  # DEBUG result => result_4
  # DEBUG BEGIN_STMT
  return result_4;

}


FlexCAN_ProccessLegacyRxFIFO (uint8 u8Instance, uint32 u32TimeoutMs)
{
  uint32 u32intType;
  uint32 mS2Ticks;
  uint32 timeElapsed;
  uint32 timeStart;
  struct FLEXCAN_Type * pBase;
  struct Flexcan_Ip_StateType * pState;
  Flexcan_Ip_StatusType eResult;
  int _1;
  long unsigned int _2;
  long unsigned int _3;
  <unnamed type> _4;
  unsigned char _5;
  <unnamed type> _6;
  <unnamed type> _7;
  _Bool _8;
  _Bool _9;
  _Bool _10;
  <unnamed type> _11;
  long unsigned int _37;

  <bb 2> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  _1 = (int) u8Instance_23(D);
  pState_25 = Flexcan_Ip_apxState[_1];
  # DEBUG pState => pState_25
  # DEBUG BEGIN_STMT
  pBase_26 = Flexcan_Ip_apxBase[_1];
  # DEBUG pBase => pBase_26
  # DEBUG BEGIN_STMT
  timeStart = 0;
  # DEBUG BEGIN_STMT
  # DEBUG timeElapsed => 0
  # DEBUG BEGIN_STMT
  _2 = u32TimeoutMs_28(D) * 1000;
  mS2Ticks_30 = OsIf_MicrosToTicks (_2, 0);
  # DEBUG mS2Ticks => mS2Ticks_30
  # DEBUG BEGIN_STMT
  # DEBUG u32intType => 0
  # DEBUG BEGIN_STMT
  _3 = OsIf_GetCounter (0);
  timeStart = _3;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [100.00%]

  <bb 3> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _4 = pState_25->transferType;
  if (_4 == 1)
    goto <bb 17>; [16.00%]
  else
    goto <bb 8>; [84.00%]

  <bb 17> [local count: 162349764]:
  goto <bb 7>; [100.00%]

  <bb 4> [local count: 487049291]:
  # DEBUG BEGIN_STMT
  _5 = FlexCAN_GetBuffStatusFlag (pBase_26, u32intType_15);
  if (_5 != 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 6>; [67.00%]

  <bb 5> [local count: 160726266]:
  # DEBUG BEGIN_STMT
  FlexCAN_IRQHandlerRxFIFO (u8Instance_23(D), u32intType_15);

  <bb 6> [local count: 487049291]:
  # DEBUG BEGIN_STMT
  u32intType_35 = u32intType_15 + 4294967295;
  # DEBUG u32intType => u32intType_35

  <bb 7> [local count: 649399056]:
  # u32intType_15 = PHI <u32intType_35(6), 7(17)>
  # DEBUG u32intType => u32intType_15
  # DEBUG BEGIN_STMT
  if (u32intType_15 > 4)
    goto <bb 4>; [75.00%]
  else
    goto <bb 8>; [25.00%]

  <bb 8> [local count: 1014686025]:
  # DEBUG BEGIN_STMT
  _37 = OsIf_GetElapsed (&timeStart, 0);
  timeElapsed_38 = timeElapsed_14 + _37;
  # DEBUG timeElapsed => timeElapsed_38
  # DEBUG BEGIN_STMT
  if (mS2Ticks_30 <= timeElapsed_38)
    goto <bb 10>; [5.50%]
  else
    goto <bb 18>; [94.50%]

  <bb 18> [local count: 958878293]:

  <bb 9> [local count: 1073741824]:
  # timeElapsed_14 = PHI <0(2), timeElapsed_38(18)>
  # DEBUG timeElapsed => timeElapsed_14
  # DEBUG BEGIN_STMT
  _6 ={v} pState_25->mbs[0].state;
  if (_6 == 1)
    goto <bb 3>; [94.50%]
  else
    goto <bb 10>; [5.50%]

  <bb 10> [local count: 114863532]:
  # eResult_12 = PHI <3(8), 0(9)>
  # DEBUG eResult => eResult_12
  # DEBUG BEGIN_STMT
  if (eResult_12 == 3)
    goto <bb 11>; [34.00%]
  else
    goto <bb 13>; [66.00%]

  <bb 11> [local count: 39053601]:
  _7 = pState_25->transferType;
  if (_7 != 1)
    goto <bb 12>; [48.88%]
  else
    goto <bb 13>; [51.12%]

  <bb 12> [local count: 19089400]:
  # DEBUG BEGIN_STMT
  _8 = pState_25->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (pBase_26, u8Instance_23(D), 5, 0, _8);
  # DEBUG BEGIN_STMT
  _9 = pState_25->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (pBase_26, u8Instance_23(D), 6, 0, _9);
  # DEBUG BEGIN_STMT
  _10 = pState_25->isIntActive;
  FlexCAN_SetMsgBuffIntCmd (pBase_26, u8Instance_23(D), 7, 0, _10);

  <bb 13> [local count: 114863532]:
  # DEBUG BEGIN_STMT
  _11 ={v} pState_25->mbs[0].state;
  switch (_11) <default: <L18> [33.33%], case 0: <L22> [33.33%], case 1: <L16> [33.33%]>

  <bb 14> [local count: 38284015]:
<L16>:
  # DEBUG BEGIN_STMT
  pState_25->mbs[0].state ={v} 0;
  # DEBUG BEGIN_STMT
  goto <bb 16>; [100.00%]

  <bb 15> [local count: 38284015]:
<L18>:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 1
  # DEBUG BEGIN_STMT

  <bb 16> [local count: 114852045]:
  # eResult_13 = PHI <eResult_12(14), 0(13), 1(15)>
<L22>:
  # DEBUG eResult => eResult_13
  # DEBUG BEGIN_STMT
  timeStart ={v} {CLOBBER};
  return eResult_13;

}


FlexCAN_InitController (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_ConfigType * Flexcan_Ip_pData)
{
  Flexcan_Ip_StatusType eResult;
  _Bool _1;
  long unsigned int _2;
  long unsigned int _3;
  _Bool _4;
  _Bool _5;
  _Bool _6;
  long unsigned int _7;
  long unsigned int _31;
  signed int _32;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  # DEBUG pBase => pBase_14(D)
  # DEBUG INLINE_ENTRY FlexCAN_IsEnabled
  # DEBUG BEGIN_STMT
  _31 ={v} MEM[(const struct FLEXCAN_Type *)pBase_14(D)].MCR;
  _32 = (signed int) _31;
  # DEBUG pBase => NULL
  if (_32 >= 0)
    goto <bb 4>; [59.00%]
  else
    goto <bb 7>; [41.00%]

  <bb 4> [local count: 633507677]:
  # DEBUG BEGIN_STMT
  eResult_16 = FlexCAN_EnterFreezeMode (pBase_14(D));
  # DEBUG eResult => eResult_16
  # DEBUG BEGIN_STMT
  if (eResult_16 == 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 6>; [67.00%]

  <bb 5> [local count: 209057533]:
  # DEBUG BEGIN_STMT
  eResult_18 = FlexCAN_Disable (pBase_14(D));
  # DEBUG eResult => eResult_18

  <bb 6> [local count: 633507677]:
  # eResult_8 = PHI <eResult_18(5), eResult_16(4)>
  # DEBUG eResult => eResult_8
  # DEBUG BEGIN_STMT
  if (eResult_8 == 0)
    goto <bb 7>; [50.00%]
  else
    goto <bb 12>; [50.00%]

  <bb 7> [local count: 756987987]:
  # DEBUG eResult => NULL
  # DEBUG BEGIN_STMT
  _1 = Flexcan_Ip_pData_19(D)->is_pe_clock;
  FlexCAN_SetClkSrc (pBase_14(D), _1);
  # DEBUG BEGIN_STMT
  _2 ={v} pBase_14(D)->MCR;
  _3 = _2 & 2147483647;
  pBase_14(D)->MCR ={v} _3;
  # DEBUG BEGIN_STMT
  eResult_23 = FlexCAN_Init (pBase_14(D));
  # DEBUG eResult => eResult_23
  # DEBUG BEGIN_STMT
  if (eResult_23 != 0)
    goto <bb 8>; [50.00%]
  else
    goto <bb 9>; [50.00%]

  <bb 8> [local count: 378493993]:
  # DEBUG BEGIN_STMT
  FlexCAN_EnterFreezeMode (pBase_14(D));
  # DEBUG BEGIN_STMT
  FlexCAN_Disable (pBase_14(D));
  goto <bb 12>; [100.00%]

  <bb 9> [local count: 378493993]:
  # DEBUG BEGIN_STMT
  _4 = FlexCAN_IsFDAvailable (pBase_14(D));
  if (_4 != 0)
    goto <bb 10>; [33.00%]
  else
    goto <bb 11>; [67.00%]

  <bb 10> [local count: 124903018]:
  # DEBUG BEGIN_STMT
  _5 = Flexcan_Ip_pData_19(D)->fd_enable;
  _6 = Flexcan_Ip_pData_19(D)->bitRateSwitch;
  FlexCAN_SetFDEnabled (pBase_14(D), _5, _6);

  <bb 11> [local count: 378493993]:
  # DEBUG BEGIN_STMT
  _7 = Flexcan_Ip_pData_19(D)->ctrlOptions;
  FlexCAN_ConfigCtrlOptions (pBase_14(D), _7);
  # DEBUG BEGIN_STMT
  eResult_28 = FlexCAN_InitCtroll (pBase_14(D), Flexcan_Ip_pData_19(D));
  # DEBUG eResult => eResult_28

  <bb 12> [local count: 1073741824]:
  # eResult_9 = PHI <eResult_8(6), eResult_23(8), eResult_28(11)>
  # DEBUG eResult => eResult_9
  # DEBUG BEGIN_STMT
  return eResult_9;

}


FlexCAN_InitCtroll (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_ConfigType * Flexcan_Ip_pData)
{
  Flexcan_Ip_StatusType eResult;
  <unnamed type> _1;
  const struct Flexcan_Ip_PayloadSizeType * _2;
  long unsigned int _3;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  _1 = Flexcan_Ip_pData_7(D)->flexcanMode;
  if (_1 != 2)
    goto <bb 3>; [66.00%]
  else
    goto <bb 4>; [34.00%]

  <bb 3> [local count: 708669605]:
  # DEBUG BEGIN_STMT
  # DEBUG base => pBase_8(D)
  # DEBUG enable => 0
  # DEBUG INLINE_ENTRY FlexCAN_SetSelfReception
  # DEBUG BEGIN_STMT
  _15 ={v} pBase_8(D)->MCR;
  _16 = _15 & 4294836223;
  _17 = _16 | 131072;
  pBase_8(D)->MCR ={v} _17;

  <bb 4> [local count: 1073741824]:
  # DEBUG base => NULL
  # DEBUG enable => NULL
  # DEBUG BEGIN_STMT
  eResult_10 = FlexCAN_InitRxFifo (pBase_8(D), Flexcan_Ip_pData_7(D));
  # DEBUG eResult => eResult_10
  # DEBUG BEGIN_STMT
  if (eResult_10 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  FlexCAN_EnterFreezeMode (pBase_8(D));
  # DEBUG BEGIN_STMT
  FlexCAN_Disable (pBase_8(D));
  goto <bb 7>; [100.00%]

  <bb 6> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _2 = &Flexcan_Ip_pData_7(D)->payload;
  FlexCAN_SetPayloadSize (pBase_8(D), _2);
  # DEBUG BEGIN_STMT
  _3 = Flexcan_Ip_pData_7(D)->max_num_mb;
  FlexCAN_SetMaxMsgBuffNum (pBase_8(D), _3);

  <bb 7> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return eResult_10;

}


FlexCAN_InitRxFifo (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_ConfigType * Flexcan_Ip_pData)
{
  Flexcan_Ip_StatusType eResult;
  _Bool _1;
  <unnamed type> _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG eResult => 0
  # DEBUG BEGIN_STMT
  _1 = Flexcan_Ip_pData_6(D)->is_rx_fifo_needed;
  if (_1 != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  _2 = Flexcan_Ip_pData_6(D)->num_id_filters;
  eResult_9 = FlexCAN_EnableRxFifo (pBase_7(D), _2);
  # DEBUG eResult => eResult_9

  <bb 4> [local count: 1073741824]:
  # eResult_3 = PHI <0(2), eResult_9(3)>
  # DEBUG eResult => eResult_3
  # DEBUG BEGIN_STMT
  return eResult_3;

}


FlexCAN_SetPN (struct FLEXCAN_Type * pBase, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.7_4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} pBase_6(D)->MCR;
  _2 = _1 & 4294950911;
  if (enable_7(D) != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.7_4 = PHI <16384(2), 0(3)>
  _3 = _2 | iftmp.7_4;
  pBase_6(D)->MCR ={v} _3;
  return;

}


FlexCAN_SetRegDefaultVal (struct FLEXCAN_Type * base)
{
  _Bool _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = FlexCAN_IsFDAvailable (base_4(D));
  if (_1 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  base_4(D)->FDCBT ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->FDCTRL ={v} 2147500288;

  <bb 4> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  base_4(D)->IFLAG1 ={v} 4294967295;
  # DEBUG BEGIN_STMT
  base_4(D)->IMASK1 ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->CBT ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->CTRL2 ={v} 1048576;
  # DEBUG BEGIN_STMT
  base_4(D)->ESR1 ={v} 241670;
  # DEBUG BEGIN_STMT
  base_4(D)->ECR ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->TIMER ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->CTRL1 ={v} 0;
  # DEBUG BEGIN_STMT
  base_4(D)->MCR ={v} 3633315855;
  return;

}


FlexCAN_SetRxMaskType (struct FLEXCAN_Type * base, Flexcan_Ip_RxMaskType type)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  if (type_6(D) == 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_8(D)->MCR;
  _2 = _1 & 4294901759;
  base_8(D)->MCR ={v} _2;
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _3 ={v} base_8(D)->MCR;
  _4 = _3 | 65536;
  base_8(D)->MCR ={v} _4;

  <bb 5> [local count: 1073741824]:
  return;

}


FlexCAN_SetTxArbitrationStartDelay (struct FLEXCAN_Type * base, uint8 tasd)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_8(D)->CTRL2;
  _2 = _1 & 4278714367;
  _3 = (long unsigned int) tasd_9(D);
  _4 = _3 << 19;
  _5 = _4 & 16252928;
  _6 = _2 | _5;
  base_8(D)->CTRL2 ={v} _6;
  return;

}


FlexCAN_GetMsgBuffIntStatusFlag (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  uint8 flag;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG flag => 0
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (msgBuffIdx_3(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870912]:
  flag_6 = FlexCAN_GetMsgBuffIntStatusFlag.part.0 (base_5(D), msgBuffIdx_3(D));

  <bb 4> [local count: 1073741824]:
  # flag_1 = PHI <0(2), flag_6(3)>
  # DEBUG flag => flag_1
  # DEBUG BEGIN_STMT
  return flag_1;

}


FlexCAN_SetClkSrc (struct FLEXCAN_Type * base, boolean enable)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.0_4;

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

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.0_4 = PHI <8192(2), 0(3)>
  _3 = _2 | iftmp.0_4;
  base_6(D)->CTRL1 ={v} _3;
  return;

}


RxFifoOcuppiedLastMsgBuff (uint32 x)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  uint32 _5;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = x_4(D) + 1;
  _2 = _1 * 8;
  _3 = _2 >> 2;
  _5 = _3 + 5;
  return _5;

}


FlexCAN_EnableExtCbt (struct FLEXCAN_Type * base, boolean enableCBT)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.4_4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CBT;
  _2 = _1 & 2147483647;
  if (enableCBT_7(D) != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.4_4 = PHI <2147483648(2), 0(3)>
  _3 = _2 | iftmp.4_4;
  base_6(D)->CBT ={v} _3;
  return;

}


FlexCAN_GetFDTimeSegments (const struct FLEXCAN_Type * base, struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_16(D)->FDCBT;
  _2 = _1 >> 20;
  _3 = _2 & 1023;
  timeSeg_17(D)->preDivider = _3;
  # DEBUG BEGIN_STMT
  _4 ={v} base_16(D)->FDCBT;
  _5 = _4 >> 10;
  _6 = _5 & 31;
  timeSeg_17(D)->propSeg = _6;
  # DEBUG BEGIN_STMT
  _7 ={v} base_16(D)->FDCBT;
  _8 = _7 >> 5;
  _9 = _8 & 7;
  timeSeg_17(D)->phaseSeg1 = _9;
  # DEBUG BEGIN_STMT
  _10 ={v} base_16(D)->FDCBT;
  _11 = _10 & 7;
  timeSeg_17(D)->phaseSeg2 = _11;
  # DEBUG BEGIN_STMT
  _12 ={v} base_16(D)->FDCBT;
  _13 = _12 >> 16;
  _14 = _13 & 7;
  timeSeg_17(D)->rJumpwidth = _14;
  return;

}


FlexCAN_GetTimeSegments (const struct FLEXCAN_Type * base, struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  long unsigned int _12;
  long unsigned int _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_15(D)->CTRL1;
  _2 = _1 >> 24;
  timeSeg_16(D)->preDivider = _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_15(D)->CTRL1;
  _4 = _3 & 7;
  timeSeg_16(D)->propSeg = _4;
  # DEBUG BEGIN_STMT
  _5 ={v} base_15(D)->CTRL1;
  _6 = _5 >> 19;
  _7 = _6 & 7;
  timeSeg_16(D)->phaseSeg1 = _7;
  # DEBUG BEGIN_STMT
  _8 ={v} base_15(D)->CTRL1;
  _9 = _8 >> 16;
  _10 = _9 & 7;
  timeSeg_16(D)->phaseSeg2 = _10;
  # DEBUG BEGIN_STMT
  _11 ={v} base_15(D)->CTRL1;
  _12 = _11 >> 22;
  _13 = _12 & 3;
  timeSeg_16(D)->rJumpwidth = _13;
  return;

}


FlexCAN_GetExtendedTimeSegments (const struct FLEXCAN_Type * base, struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_16(D)->CBT;
  _2 = _1 >> 21;
  _3 = _2 & 1023;
  timeSeg_17(D)->preDivider = _3;
  # DEBUG BEGIN_STMT
  _4 ={v} base_16(D)->CBT;
  _5 = _4 >> 10;
  _6 = _5 & 63;
  timeSeg_17(D)->propSeg = _6;
  # DEBUG BEGIN_STMT
  _7 ={v} base_16(D)->CBT;
  _8 = _7 >> 5;
  _9 = _8 & 31;
  timeSeg_17(D)->phaseSeg1 = _9;
  # DEBUG BEGIN_STMT
  _10 ={v} base_16(D)->CBT;
  _11 = _10 & 31;
  timeSeg_17(D)->phaseSeg2 = _11;
  # DEBUG BEGIN_STMT
  _12 ={v} base_16(D)->CBT;
  _13 = _12 >> 16;
  _14 = _13 & 31;
  timeSeg_17(D)->rJumpwidth = _14;
  return;

}


FlexCAN_SetExtendedTimeSegments (struct FLEXCAN_Type * base, const struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  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;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_24(D)->CBT;
  _2 = _1 & 2147483648;
  base_24(D)->CBT ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_24(D)->CBT;
  _4 = timeSeg_26(D)->propSeg;
  _5 = _4 << 10;
  _6 = _5 & 65535;
  _7 = timeSeg_26(D)->phaseSeg2;
  _8 = _7 & 31;
  _9 = _6 | _8;
  _10 = timeSeg_26(D)->phaseSeg1;
  _11 = _10 << 5;
  _12 = _11 & 992;
  _13 = _9 | _12;
  _14 = timeSeg_26(D)->preDivider;
  _15 = _14 << 21;
  _16 = _15 & 2145386496;
  _17 = _13 | _16;
  _18 = timeSeg_26(D)->rJumpwidth;
  _19 = _18 << 16;
  _20 = _19 & 2031616;
  _21 = _17 | _20;
  _22 = _3 | _21;
  base_24(D)->CBT ={v} _22;
  return;

}


FlexCAN_SetTimeSegments (struct FLEXCAN_Type * base, const struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  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;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_23(D)->CTRL1;
  _2 = _1 & 65528;
  base_23(D)->CTRL1 ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_23(D)->CTRL1;
  _4 = timeSeg_25(D)->propSeg;
  _5 = _4 & 7;
  _6 = timeSeg_25(D)->phaseSeg2;
  _7 = _6 << 16;
  _8 = _7 & 458752;
  _9 = _5 | _8;
  _10 = timeSeg_25(D)->phaseSeg1;
  _11 = _10 << 19;
  _12 = _11 & 3670016;
  _13 = _9 | _12;
  _14 = timeSeg_25(D)->preDivider;
  _15 = _14 << 24;
  _16 = _13 | _15;
  _17 = timeSeg_25(D)->rJumpwidth;
  _18 = _17 << 22;
  _19 = _18 & 12582912;
  _20 = _16 | _19;
  _21 = _3 | _20;
  base_23(D)->CTRL1 ={v} _21;
  return;

}


FlexCAN_SetFDTimeSegments (struct FLEXCAN_Type * base, const struct Flexcan_Ip_TimeSegmentType * timeSeg)
{
  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;
  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;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_24(D)->FDCBT;
  _2 = _1 & 3221783320;
  base_24(D)->FDCBT ={v} _2;
  # DEBUG BEGIN_STMT
  _3 ={v} base_24(D)->FDCBT;
  _4 = timeSeg_26(D)->propSeg;
  _5 = _4 << 10;
  _6 = _5 & 31744;
  _7 = timeSeg_26(D)->phaseSeg2;
  _8 = _7 & 7;
  _9 = _6 | _8;
  _10 = timeSeg_26(D)->phaseSeg1;
  _11 = _10 << 5;
  _12 = _11 & 255;
  _13 = _9 | _12;
  _14 = timeSeg_26(D)->preDivider;
  _15 = _14 << 20;
  _16 = _15 & 1072693248;
  _17 = _13 | _16;
  _18 = timeSeg_26(D)->rJumpwidth;
  _19 = _18 << 16;
  _20 = _19 & 458752;
  _21 = _17 | _20;
  _22 = _3 | _21;
  base_24(D)->FDCBT ={v} _22;
  return;

}


FlexCAN_GetBuffStatusImask (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  uint32 u32Imask;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  uint8 _10;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG u32Imask => 0
  # DEBUG BEGIN_STMT
  if (msgBuffIdx_6(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_8(D)->IMASK1;
  _2 = msgBuffIdx_6(D);
  _3 = 1 << _2;
  _4 = _1 & _3;
  u32Imask_9 = _4 >> _2;
  # DEBUG u32Imask => u32Imask_9

  <bb 4> [local count: 1073741824]:
  # u32Imask_5 = PHI <0(2), u32Imask_9(3)>
  # DEBUG u32Imask => u32Imask_5
  # DEBUG BEGIN_STMT
  _10 = (uint8) u32Imask_5;
  return _10;

}


FlexCAN_GetBuffStatusFlag (const struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  uint32 flag;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int _4;
  uint8 _10;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG flag => 0
  # DEBUG BEGIN_STMT
  if (msgBuffIdx_6(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_8(D)->IFLAG1;
  _2 = msgBuffIdx_6(D);
  _3 = 1 << _2;
  _4 = _1 & _3;
  flag_9 = _4 >> _2;
  # DEBUG flag => flag_9

  <bb 4> [local count: 1073741824]:
  # flag_5 = PHI <0(2), flag_9(3)>
  # DEBUG flag => flag_5
  # DEBUG BEGIN_STMT
  _10 = (uint8) flag_5;
  return _10;

}


FlexCAN_ClearMsgBuffIntStatusFlag (struct FLEXCAN_Type * base, uint32 msgBuffIdx)
{
  uint32 flag;
  long unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 = msgBuffIdx_3(D) & 31;
  flag_4 = 1 << _1;
  # DEBUG flag => flag_4
  # DEBUG BEGIN_STMT
  if (msgBuffIdx_3(D) <= 31)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  base_6(D)->IFLAG1 ={v} flag_4;

  <bb 4> [local count: 1073741824]:
  return;

}


FlexCAN_SetListenOnlyMode (struct FLEXCAN_Type * base, boolean enableListenOnly)
{
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  long unsigned int iftmp.6_4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_6(D)->CTRL1;
  _2 = _1 & 4294967287;
  if (enableListenOnly_7(D) != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.6_4 = PHI <8(2), 0(3)>
  _3 = _2 | iftmp.6_4;
  base_6(D)->CTRL1 ={v} _3;
  return;

}


FlexCAN_SetFDEnabled (struct FLEXCAN_Type * base, boolean enableFD, boolean enableBRS)
{
  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 iftmp.1_9;
  long unsigned int iftmp.2_10;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _1 ={v} base_12(D)->MCR;
  _2 = _1 & 4294965247;
  if (enableFD_13(D) != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.1_9 = PHI <2048(2), 0(3)>
  _3 = _2 | iftmp.1_9;
  base_12(D)->MCR ={v} _3;
  # DEBUG BEGIN_STMT
  _4 ={v} base_12(D)->FDCTRL;
  _5 = _4 & 2147483647;
  if (enableBRS_15(D) != 0)
    goto <bb 6>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 5> [local count: 536870913]:

  <bb 6> [local count: 1073741824]:
  # iftmp.2_10 = PHI <2147483648(4), 0(5)>
  _6 = _5 | iftmp.2_10;
  base_12(D)->FDCTRL ={v} _6;
  # DEBUG BEGIN_STMT
  _7 ={v} base_12(D)->FDCTRL;
  _8 = _7 & 4294926591;
  base_12(D)->FDCTRL ={v} _8;
  return;

}


FlexCAN_SetTDCOffset (struct FLEXCAN_Type * base, boolean enable, uint8 offset)
{
  uint32 tmp;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  tmp_7 ={v} base_6(D)->FDCTRL;
  # DEBUG tmp => tmp_7
  # DEBUG BEGIN_STMT
  tmp_8 = tmp_7 & 4294926591;
  # DEBUG tmp => tmp_8
  # DEBUG BEGIN_STMT
  if (enable_9(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  tmp_10 = tmp_8 | 32768;
  # DEBUG tmp => tmp_10
  # DEBUG BEGIN_STMT
  _1 = (long unsigned int) offset_11(D);
  _2 = _1 << 8;
  _3 = _2 & 7936;
  tmp_12 = _3 | tmp_10;
  # DEBUG tmp => tmp_12

  <bb 4> [local count: 1073741824]:
  # tmp_4 = PHI <tmp_8(2), tmp_12(3)>
  # DEBUG tmp => tmp_4
  # DEBUG BEGIN_STMT
  base_6(D)->FDCTRL ={v} tmp_4;
  return;

}


