Can_Ipw_ProcessPN (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_IcomConfigsType * pIcomConfig)
{
  uint8 u8NumOfWmb;
  uint8 u8WmbIndex;
  struct Flexcan_Ip_MsgBuffType ReceivedDataBuffer;
  static struct PduInfoType CanIf_PduInfo;
  static struct Can_HwType CanIf_Mailbox;
  uint8 iftmp.11;

  <bb 2> :
  u8WmbIndex = 0;
  u8NumOfWmb = 0;
  _1 = pIcomConfig->pCanIcomRxMessageConfigs;
  _2 = _1->pFlexcanIpPnConfig;
  _3 = _2->u16NumMatches;
  if (_3 <= 3)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _4 = pIcomConfig->pCanIcomRxMessageConfigs;
  _5 = _4->pFlexcanIpPnConfig;
  _6 = _5->u16NumMatches;
  iftmp.11 = (uint8) _6;
  goto <bb 5>; [INV]

  <bb 4> :
  iftmp.11 = 4;

  <bb 5> :
  u8NumOfWmb = iftmp.11;
  u8WmbIndex = 0;
  goto <bb 9>; [INV]

  <bb 6> :
  _7 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_GetWMB (_7, u8WmbIndex, &ReceivedDataBuffer);
  _8 = ReceivedDataBuffer.msgId;
  CanIf_Mailbox.CanId = _8;
  _9 = ReceivedDataBuffer.cs;
  _10 = _9 & 2097152;
  if (_10 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  _11 = CanIf_Mailbox.CanId;
  _12 = _11 | 2147483648;
  CanIf_Mailbox.CanId = _12;

  <bb 8> :
  _13 = pIcomConfig->u8CanIcomConfigId;
  _14 = (short unsigned int) _13;
  CanIf_Mailbox.Hoh = _14;
  _15 = Can_pControllerConfig->Can_u8AbstControllerID;
  CanIf_Mailbox.ControllerId = _15;
  _16 = ReceivedDataBuffer.dataLen;
  _17 = (long unsigned int) _16;
  CanIf_PduInfo.SduLength = _17;
  CanIf_PduInfo.SduDataPtr = &ReceivedDataBuffer.data[0];
  CanIf_RxIndication (&CanIf_Mailbox, &CanIf_PduInfo);
  u8WmbIndex.12_18 = u8WmbIndex;
  u8WmbIndex = u8WmbIndex.12_18 + 1;

  <bb 9> :
  if (u8WmbIndex < u8NumOfWmb)
    goto <bb 6>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  ReceivedDataBuffer = {CLOBBER};
  return;

}


Can_Ipw_SetIcomConfiguration (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_IcomConfigsType * pIcomConfig)
{
  Std_ReturnType ReturnValue;
  Std_ReturnType D.7175;

  <bb 2> :
  ReturnValue = 1;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  if (_1 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  _2 = Can_pControllerConfig->Can_u8ControllerOffset;
  _3 = FlexCAN_Ip_EnterFreezeMode_Privileged (_2);
  if (_3 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  _4 = Can_pControllerConfig->Can_u8ControllerOffset;
  _5 = pIcomConfig->pCanIcomRxMessageConfigs;
  _6 = _5->pFlexcanIpPnConfig;
  FlexCAN_Ip_ConfigPN_Privileged (_4, 1, _6);
  _7 = Can_pControllerConfig->Can_u8ControllerOffset;
  _8 = FlexCAN_Ip_ExitFreezeMode_Privileged (_7);
  _9 = _8 != 0;
  ReturnValue = (Std_ReturnType) _9;

  <bb 5> :
  D.7175 = ReturnValue;

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

}


Can_Ipw_DeactivateIcomConfiguration (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  Std_ReturnType ReturnValue;
  boolean IsStart;
  Std_ReturnType D.7169;

  <bb 2> :
  IsStart = 1;
  ReturnValue = 1;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  if (_1 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 3> :
  _2 = Can_pControllerConfig->Can_u8ControllerOffset;
  IsStart = FlexCAN_Ip_GetStartMode_Privileged (_2);
  _3 = Can_pControllerConfig->Can_u8ControllerOffset;
  _4 = FlexCAN_Ip_EnterFreezeMode_Privileged (_3);
  if (_4 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  _5 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ConfigPN_Privileged (_5, 0, 0B);
  if (IsStart != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _6 = Can_pControllerConfig->Can_u8ControllerOffset;
  _7 = FlexCAN_Ip_ExitFreezeMode_Privileged (_6);
  _8 = _7 != 0;
  ReturnValue = (Std_ReturnType) _8;
  goto <bb 7>; [INV]

  <bb 6> :
  _9 = Can_pControllerConfig->Can_u8ControllerOffset;
  _10 = FlexCAN_Ip_SetStopMode_Privileged (_9);
  _11 = _10 != 0;
  ReturnValue = (Std_ReturnType) _11;

  <bb 7> :
  D.7169 = ReturnValue;

  <bb 8> :
<L7>:
  return D.7169;

}


Can_Ipw_MainFunction_Mode (const struct Can_ControllerConfigType * Can_pControllerConfig, Can_ControllerStateType * Can_pControllerState)
{
  <bb 2> :
  _1 = *Can_pControllerState;
  if (_1 == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  _2 = Can_pControllerConfig->Can_u8ControllerOffset;
  _3 = FlexCAN_Ip_GetStartMode_Privileged (_2);
  _4 = ~_3;
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 4> :
  *Can_pControllerState = 2;
  _5 = Can_pControllerConfig->Can_u8AbstControllerID;
  CanIf_ControllerModeIndication (_5, 2);
  goto <bb 8>; [INV]

  <bb 5> :
  _6 = *Can_pControllerState;
  if (_6 == 2)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
  _7 = Can_pControllerConfig->Can_u8ControllerOffset;
  _8 = FlexCAN_Ip_GetStartMode_Privileged (_7);
  if (_8 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  *Can_pControllerState = 1;
  _9 = Can_pControllerConfig->Can_u8AbstControllerID;
  CanIf_ControllerModeIndication (_9, 1);

  <bb 8> :
  return;

}


Can_Ipw_MainFunction_BusOff (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_MainFunctionBusOff_Privileged (_1);
  return;

}


Can_Ipw_MainFunction_Read (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig)
{
  static struct PduInfoType CanIf_PduInfo;
  static struct Can_HwType CanIf_Mailbox;
  static struct Flexcan_Ip_MsgBuffType ReceivedDataBuffer;

  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  _2 = FlexCAN_Ip_GetStopMode_Privileged (_1);
  _3 = ~_2;
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 3> :
  _4 = Can_pHwObjectConfig->Can_eReceiveType;
  if (_4 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  _5 = Can_pControllerConfig->Can_u8ControllerOffset;
  _6 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _7 = Can_pHwObjectConfig->Can_bHwObjectUsesPolling;
  FlexCAN_Ip_Receive (_5, _6, &ReceivedDataBuffer, _7);
  _8 = Can_pControllerConfig->Can_u8ControllerOffset;
  _9 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  FlexCAN_Ip_MainFunctionRead (_8, _9);
  _10 = Can_pControllerConfig->Can_u8ControllerOffset;
  _11 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _12 = FlexCAN_Ip_GetTransferStatus (_10, _11);
  if (_12 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 5> :
  Can_Ipw_ParseData (&CanIf_Mailbox, &CanIf_PduInfo, &ReceivedDataBuffer, Can_pControllerConfig, Can_pHwObjectConfig);
  goto <bb 8>; [INV]

  <bb 6> :
  _13 = Can_pHwObjectConfig->Can_eReceiveType;
  if (_13 == 1)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  Can_Ipw_ProcessLegacyFifoPolling (&CanIf_Mailbox, &CanIf_PduInfo, &ReceivedDataBuffer, Can_pControllerConfig, Can_pHwObjectConfig);

  <bb 8> :
  return;

}


Can_Ipw_MainFunction_Write (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig)
{
  uint8 u8ObjIdx;

  <bb 2> :
  u8ObjIdx = 0;

  <bb 3> :
  _1 = Can_pControllerConfig->Can_u8ControllerID;
  _2 = (int) _1;
  _3 = &Can_Ipw_xStatus0;
  _4 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _5 = (int) _4;
  _6 = (int) u8ObjIdx;
  _7 = _5 + _6;
  _8 = _3->mbs[_7].state;
  if (_8 == 2)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  _9 = Can_pControllerConfig->Can_u8ControllerOffset;
  _10 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _11 = u8ObjIdx + _10;
  FlexCAN_Ip_MainFunctionWrite (_9, _11);
  _12 = Can_pControllerConfig->Can_u8ControllerOffset;
  _13 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _14 = u8ObjIdx + _13;
  _15 = FlexCAN_Ip_GetTransferStatus (_12, _14);
  if (_15 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _16 = Can_pControllerConfig->Can_u8ControllerID;
  _17 = (int) _16;
  _18 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _19 = (int) _18;
  _20 = (int) u8ObjIdx;
  _21 = _19 + _20;
  _22 = Can_Ipw_au16TxPduId[_17][_21];
  CanIf_TxConfirmation (_22);

  <bb 6> :
  u8ObjIdx.10_23 = u8ObjIdx;
  u8ObjIdx = u8ObjIdx.10_23 + 1;
  _24 = Can_pHwObjectConfig->Can_u8ObjectCount;
  if (u8ObjIdx < _24)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  return;

}


Can_Ipw_AbortMb (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig)
{
  uint8 u8Idx;

  <bb 2> :
  u8Idx = 0;

  <bb 3> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  _2 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _3 = u8Idx + _2;
  FlexCAN_Ip_AbortTransfer (_1, _3);
  u8Idx.9_4 = u8Idx;
  u8Idx = u8Idx.9_4 + 1;
  _5 = Can_pHwObjectConfig->Can_u8ObjectCount;
  if (u8Idx < _5)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  return;

}


Can_Ipw_InitRx (const struct Can_ControllerConfigType * Can_pController)
{
  struct Flexcan_Ip_DataInfoType DataInfo;
  const struct Can_HwObjectConfigType * Can_pHwObject;
  uint8 u8HwObjRefIdx;
  Std_ReturnType D.7135;

  <bb 2> :
  u8HwObjRefIdx = 0;
  _1 = Can_pController->Can_u8ControllerOffset;
  FlexCAN_Ip_SetRxMaskType_Privileged (_1, 1);
  u8HwObjRefIdx = 0;
  goto <bb 11>; [INV]

  <bb 3> :
  _2 = Can_pController->Can_ppHwObject;
  _3 = (unsigned int) u8HwObjRefIdx;
  _4 = _3 * 4;
  _5 = _2 + _4;
  Can_pHwObject = *_5;
  _6 = Can_pHwObject->Can_eReceiveType;
  if (_6 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 4> :
  DataInfo.fd_enable = 0;
  DataInfo.data_length = 0;
  _7 = Can_pHwObject->Can_IdMessage;
  if (_7 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  DataInfo.msg_id_type = 1;
  goto <bb 7>; [INV]

  <bb 6> :
  DataInfo.msg_id_type = 0;

  <bb 7> :
  _8 = Can_pController->Can_u8ControllerOffset;
  _9 = Can_pHwObject->Can_u8HwBufferIndex;
  _10 = Can_pHwObject->Can_pHwFilterConfig;
  _11 = _10->Can_u32HwFilterCode;
  FlexCAN_Ip_ConfigRxMb (_8, _9, &DataInfo, _11);
  _12 = Can_pController->Can_u8ControllerOffset;
  _13 = Can_pHwObject->Can_u8HwBufferIndex;
  _14 = Can_pHwObject->Can_pHwFilterConfig;
  _15 = _14->Can_u32HwFilterMask;
  FlexCAN_Ip_SetRxIndividualMask_Privileged (_12, _13, _15);

  <bb 8> :
  _16 = Can_pHwObject->Can_eReceiveType;
  if (_16 == 1)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  Can_Ipw_InitLegacyFifoFilter (Can_pController, Can_pHwObject);

  <bb 10> :
  u8HwObjRefIdx.8_17 = u8HwObjRefIdx;
  u8HwObjRefIdx = u8HwObjRefIdx.8_17 + 1;

  <bb 11> :
  _18 = Can_pController->Can_u8HwObjectRefCount;
  if (u8HwObjRefIdx < _18)
    goto <bb 3>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  _19 = Can_pController->Can_u8ControllerOffset;
  _20 = FlexCAN_Ip_SetStopMode_Privileged (_19);
  _21 = _20 != 0;
  D.7135 = (Std_ReturnType) _21;
  DataInfo = {CLOBBER};

  <bb 13> :
<L11>:
  return D.7135;

}


Can_Ipw_Write (const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig, const struct Can_PduType * PduInfo)
{
  uint8 u8ObjIdx;
  struct Flexcan_Ip_DataInfoType DataInfo;
  Flexcan_Ip_StatusType eRetVal;
  Std_ReturnType iftmp.7;
  Std_ReturnType D.7121;

  <bb 2> :
  eRetVal = 1;
  u8ObjIdx = 0;
  DataInfo.msg_id_type = 0;
  DataInfo.data_length = 0;
  DataInfo.fd_padding = 0;
  DataInfo.fd_enable = 0;
  DataInfo.enable_brs = 0;
  DataInfo.is_remote = 0;
  DataInfo.is_polling = 0;
  _1 = Can_pHwObjectConfig->Can_eReceiveType;
  if (_1 == 3)
    goto <bb 3>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 3> :
  _2 = PduInfo->id;
  _3 = _2 >> 31;
  DataInfo.msg_id_type = _3;
  _4 = PduInfo->length;
  _5 = (long unsigned int) _4;
  DataInfo.data_length = _5;
  _6 = Can_pHwObjectConfig->Can_u8PaddingValue;
  DataInfo.fd_padding = _6;
  _7 = PduInfo->id;
  _8 = _7 >> 30;
  _9 = (int) _8;
  _10 = _9 & 1;
  _11 = _10 != 0;
  DataInfo.fd_enable = _11;
  _12 = Can_pControllerConfig->Can_pBaudrateConfig;
  _13 = Can_pControllerConfig->Can_u8ControllerID;
  _14 = (int) _13;
  _15 = Can_au16ControllerBaudRateSel[_14];
  _16 = (unsigned int) _15;
  _17 = _16 * 24;
  _18 = _12 + _17;
  _19 = _18->Can_bBitRateSwitch;
  DataInfo.enable_brs = _19;
  DataInfo.is_remote = 0;
  _20 = Can_pHwObjectConfig->Can_bHwObjectUsesPolling;
  DataInfo.is_polling = _20;

  <bb 4> :
  _21 = Can_pControllerConfig->Can_u8ControllerOffset;
  _22 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _23 = u8ObjIdx + _22;
  eRetVal = FlexCAN_Ip_GetTransferStatus (_21, _23);
  if (eRetVal == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _24 = Can_pControllerConfig->Can_u8ControllerID;
  _25 = (int) _24;
  _26 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _27 = (int) _26;
  _28 = (int) u8ObjIdx;
  _29 = _27 + _28;
  _30 = PduInfo->swPduHandle;
  Can_Ipw_au16TxPduId[_25][_29] = _30;
  _31 = Can_pControllerConfig->Can_u8ControllerOffset;
  _32 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _33 = u8ObjIdx + _32;
  _34 = PduInfo->id;
  _35 = PduInfo->sdu;
  eRetVal = FlexCAN_Ip_Send (_31, _33, &DataInfo, _34, _35);

  <bb 6> :
  u8ObjIdx.6_36 = u8ObjIdx;
  u8ObjIdx = u8ObjIdx.6_36 + 1;
  _37 = Can_pHwObjectConfig->Can_u8ObjectCount;
  if (u8ObjIdx < _37)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  if (eRetVal == 2)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

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

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

  <bb 10> :
  eRetVal = 1;

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

  <bb 12> :
  iftmp.7 = (Std_ReturnType) eRetVal;
  goto <bb 14>; [INV]

  <bb 13> :
  iftmp.7 = 2;

  <bb 14> :
  D.7121 = iftmp.7;
  DataInfo = {CLOBBER};

  <bb 15> :
<L15>:
  return D.7121;

}


Can_Ipw_GetControllerRxErrorCounter (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  uint8 D.7110;

  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  D.7110 = FlexCAN_Ip_GetControllerRxErrorCounter (_1);

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

}


Can_Ipw_GetControllerTxErrorCounter (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  uint8 D.7108;

  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  D.7108 = FlexCAN_Ip_GetControllerTxErrorCounter (_1);

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

}


Can_Ipw_GetControllerErrorState (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  uint32 Error;
  uint8 D.7106;

  <bb 2> :
  Error = 0;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  Error = FlexCAN_Ip_GetErrorStatus (_1);
  _2 = Error >> 4;
  _3 = (unsigned char) _2;
  D.7106 = _3 & 3;

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

}


Can_Ipw_EnableControllerInterrupts (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerID;
  _2 = (int) _1;
  _3 = Can_Ipw_abIsInterruptEnabled[_2];
  _4 = ~_3;
  if (_4 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _5 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_EnableInterrupts_Privileged (_5);
  _6 = Can_pControllerConfig->Can_u8ControllerID;
  _7 = (int) _6;
  Can_Ipw_abIsInterruptEnabled[_7] = 1;

  <bb 4> :
  return;

}


Can_Ipw_DisableControllerInterrupts (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerID;
  _2 = (int) _1;
  _3 = Can_Ipw_abIsInterruptEnabled[_2];
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _4 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_DisableInterrupts_Privileged (_4);
  _5 = Can_pControllerConfig->Can_u8ControllerID;
  _6 = (int) _5;
  Can_Ipw_abIsInterruptEnabled[_6] = 0;

  <bb 4> :
  return;

}


Can_Ipw_SetControllerToStopMode (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  uint8 u8Idx;
  const struct Can_HwObjectConfigType * Can_pHwObject;
  uint8 u8HwObjRefIdx;
  Std_ReturnType eReturnValue;
  Std_ReturnType D.7100;

  <bb 2> :
  u8HwObjRefIdx = 0;
  u8Idx = 0;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  _2 = FlexCAN_Ip_EnterFreezeMode_Privileged (_1);
  if (_2 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 3> :
  _3 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ConfigPN_Privileged (_3, 0, 0B);
  _4 = Can_pControllerConfig->Can_u8ControllerID;
  _5 = (int) _4;
  _6 = Can_Ipw_abIsInterruptEnabled[_5];
  if (_6 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  _7 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_DisableInterrupts_Privileged (_7);

  <bb 5> :
  u8HwObjRefIdx = 0;
  goto <bb 11>; [INV]

  <bb 6> :
  _8 = Can_pControllerConfig->Can_ppHwObject;
  _9 = (unsigned int) u8HwObjRefIdx;
  _10 = _9 * 4;
  _11 = _8 + _10;
  Can_pHwObject = *_11;
  _12 = Can_pHwObject->Can_eReceiveType;
  if (_12 == 3)
    goto <bb 7>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 7> :
  u8Idx = 0;

  <bb 8> :
  _13 = Can_pControllerConfig->Can_u8ControllerOffset;
  _14 = Can_pHwObject->Can_u8HwBufferIndex;
  _15 = u8Idx + _14;
  FlexCAN_Ip_AbortTransfer (_13, _15);
  u8Idx.4_16 = u8Idx;
  u8Idx = u8Idx.4_16 + 1;
  _17 = Can_pHwObject->Can_u8ObjectCount;
  if (u8Idx < _17)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  _18 = Can_pControllerConfig->Can_u8ControllerOffset;
  _19 = Can_pHwObject->Can_u8HwBufferIndex;
  FlexCAN_Ip_AbortTransfer (_18, _19);

  <bb 10> :
  u8HwObjRefIdx.5_20 = u8HwObjRefIdx;
  u8HwObjRefIdx = u8HwObjRefIdx.5_20 + 1;

  <bb 11> :
  _21 = Can_pControllerConfig->Can_u8HwObjectRefCount;
  if (u8HwObjRefIdx < _21)
    goto <bb 6>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  _22 = Can_pControllerConfig->Can_u8ControllerOffset;
  _23 = FlexCAN_Ip_SetStopMode_Privileged (_22);
  eReturnValue = (Std_ReturnType) _23;
  goto <bb 14>; [INV]

  <bb 13> :
  eReturnValue = 1;

  <bb 14> :
  D.7100 = eReturnValue;

  <bb 15> :
<L13>:
  return D.7100;

}


Can_Ipw_SetControllerToStartMode (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  Flexcan_Ip_StatusType eRetVal;
  const struct Can_HwObjectConfigType * Can_pHwObject;
  uint8 u8HwObjRefIdx;
  Std_ReturnType D.7090;

  <bb 2> :
  u8HwObjRefIdx = 0;
  Can_pHwObject = 0B;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  eRetVal = FlexCAN_Ip_EnterFreezeMode_Privileged (_1);
  if (eRetVal == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 3> :
  _2 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ConfigPN_Privileged (_2, 0, 0B);
  u8HwObjRefIdx = 0;
  goto <bb 7>; [INV]

  <bb 4> :
  _3 = Can_pControllerConfig->Can_ppHwObject;
  _4 = (unsigned int) u8HwObjRefIdx;
  _5 = _4 * 4;
  _6 = _3 + _5;
  Can_pHwObject = *_6;
  _7 = Can_pHwObject->Can_eReceiveType;
  if (_7 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _8 = Can_pControllerConfig->Can_u8ControllerOffset;
  Can_Ipw_SetRxMb (_8, Can_pHwObject);

  <bb 6> :
  u8HwObjRefIdx.3_9 = u8HwObjRefIdx;
  u8HwObjRefIdx = u8HwObjRefIdx.3_9 + 1;

  <bb 7> :
  _10 = Can_pControllerConfig->Can_u8HwObjectRefCount;
  if (u8HwObjRefIdx < _10)
    goto <bb 4>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  _11 = Can_Ipw_SetControlerErrorInit (Can_pControllerConfig);
  _12 = _11 != 0;
  eRetVal = (Flexcan_Ip_StatusType) _12;

  <bb 9> :
  D.7090 = (Std_ReturnType) eRetVal;

  <bb 10> :
<L7>:
  return D.7090;

}


Can_Ipw_SetControlerErrorInit (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  Flexcan_Ip_StatusType eRetVal;
  Std_ReturnType D.7084;

  <bb 2> :
  eRetVal = 0;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ClearErrorStatus (_1, 3866630);
  _2 = Can_pControllerConfig->Can_u8ControllerID;
  _3 = (int) _2;
  _4 = Can_Ipw_abIsInterruptEnabled[_3];
  if (_4 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _5 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_EnableInterrupts_Privileged (_5);

  <bb 4> :
  _6 = Can_pControllerConfig->Can_u8ControllerOffset;
  eRetVal = FlexCAN_Ip_SetStartMode_Privileged (_6);
  _7 = Can_pControllerConfig->HwChannelIpConfig;
  _8 = _7->pFlexcanIpHwConfig;
  _9 = _8->ctrlOptions;
  _10 = _9 & 4;
  if (_10 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

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

  <bb 6> :
  _11 = Can_pControllerConfig->Can_u8ControllerOffset;
  eRetVal = FlexCAN_Ip_ManualBusOffRecovery (_11);

  <bb 7> :
  D.7084 = (Std_ReturnType) eRetVal;

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

}


Can_Ipw_SetBaudrate (const struct Can_ControllerConfigType * Can_pControllerConfig, uint16 BaudRateConfigID)
{
  struct Flexcan_Ip_TimeSegmentType FlexCANTimeSeg;
  Flexcan_Ip_StatusType eRetVal;
  Std_ReturnType D.7075;

  <bb 2> :
  eRetVal = 1;
  _1 = Can_pControllerConfig->Can_u8ControllerID;
  _2 = (int) _1;
  Can_au16ControllerBaudRateSel[_2] = BaudRateConfigID;
  _3 = Can_pControllerConfig->Can_u8ControllerOffset;
  eRetVal = FlexCAN_Ip_EnterFreezeMode_Privileged (_3);
  if (eRetVal == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  _4 = Can_pControllerConfig->Can_pBaudrateConfig;
  _5 = (unsigned int) BaudRateConfigID;
  _6 = _5 * 24;
  _7 = _4 + _6;
  _8 = _7->Can_NominalBitRate.Can_u16Prescaler;
  _9 = (long unsigned int) _8;
  FlexCANTimeSeg.preDivider = _9;
  _10 = Can_pControllerConfig->Can_pBaudrateConfig;
  _11 = (unsigned int) BaudRateConfigID;
  _12 = _11 * 24;
  _13 = _10 + _12;
  _14 = _13->Can_NominalBitRate.Can_u8PropSeg;
  _15 = (long unsigned int) _14;
  FlexCANTimeSeg.propSeg = _15;
  _16 = Can_pControllerConfig->Can_pBaudrateConfig;
  _17 = (unsigned int) BaudRateConfigID;
  _18 = _17 * 24;
  _19 = _16 + _18;
  _20 = _19->Can_NominalBitRate.Can_u8PhaseSeg1;
  _21 = (long unsigned int) _20;
  FlexCANTimeSeg.phaseSeg1 = _21;
  _22 = Can_pControllerConfig->Can_pBaudrateConfig;
  _23 = (unsigned int) BaudRateConfigID;
  _24 = _23 * 24;
  _25 = _22 + _24;
  _26 = _25->Can_NominalBitRate.Can_u8PhaseSeg2;
  _27 = (long unsigned int) _26;
  FlexCANTimeSeg.phaseSeg2 = _27;
  _28 = Can_pControllerConfig->Can_pBaudrateConfig;
  _29 = (unsigned int) BaudRateConfigID;
  _30 = _29 * 24;
  _31 = _28 + _30;
  _32 = _31->Can_NominalBitRate.Can_u8ResyncJumpWidth;
  _33 = (long unsigned int) _32;
  FlexCANTimeSeg.rJumpwidth = _33;
  _34 = Can_pControllerConfig->Can_u8ControllerOffset;
  _35 = Can_pControllerConfig->Can_pBaudrateConfig;
  _36 = (unsigned int) BaudRateConfigID;
  _37 = _36 * 24;
  _38 = _35 + _37;
  _39 = _38->Can_bEnhanceCBTEnable;
  FlexCAN_Ip_SetBitrate_Privileged (_34, &FlexCANTimeSeg, _39);
  _40 = Can_pControllerConfig->Can_pBaudrateConfig;
  _41 = (unsigned int) BaudRateConfigID;
  _42 = _41 * 24;
  _43 = _40 + _42;
  _44 = _43->Can_DataBitRate.Can_u16Prescaler;
  _45 = (long unsigned int) _44;
  FlexCANTimeSeg.preDivider = _45;
  _46 = Can_pControllerConfig->Can_pBaudrateConfig;
  _47 = (unsigned int) BaudRateConfigID;
  _48 = _47 * 24;
  _49 = _46 + _48;
  _50 = _49->Can_bFDFrame;
  if (_50 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  _51 = Can_pControllerConfig->Can_pBaudrateConfig;
  _52 = (unsigned int) BaudRateConfigID;
  _53 = _52 * 24;
  _54 = _51 + _53;
  _55 = _54->Can_DataBitRate.Can_u8PropSeg;
  _56 = (long unsigned int) _55;
  FlexCANTimeSeg.propSeg = _56;
  _57 = Can_pControllerConfig->Can_pBaudrateConfig;
  _58 = (unsigned int) BaudRateConfigID;
  _59 = _58 * 24;
  _60 = _57 + _59;
  _61 = _60->Can_DataBitRate.Can_u8PhaseSeg1;
  _62 = (long unsigned int) _61;
  FlexCANTimeSeg.phaseSeg1 = _62;
  _63 = Can_pControllerConfig->Can_pBaudrateConfig;
  _64 = (unsigned int) BaudRateConfigID;
  _65 = _64 * 24;
  _66 = _63 + _65;
  _67 = _66->Can_DataBitRate.Can_u8PhaseSeg2;
  _68 = (long unsigned int) _67;
  FlexCANTimeSeg.phaseSeg2 = _68;
  _69 = Can_pControllerConfig->Can_pBaudrateConfig;
  _70 = (unsigned int) BaudRateConfigID;
  _71 = _70 * 24;
  _72 = _69 + _71;
  _73 = _72->Can_DataBitRate.Can_u8ResyncJumpWidth;
  _74 = (long unsigned int) _73;
  FlexCANTimeSeg.rJumpwidth = _74;
  _75 = Can_pControllerConfig->Can_u8ControllerOffset;
  _76 = Can_pControllerConfig->Can_pBaudrateConfig;
  _77 = (unsigned int) BaudRateConfigID;
  _78 = _77 * 24;
  _79 = _76 + _78;
  _80 = _79->Can_bBitRateSwitch;
  FlexCAN_Ip_SetBitrateCbt_Privileged (_75, &FlexCANTimeSeg, _80);
  _81 = Can_pControllerConfig->Can_u8ControllerOffset;
  _82 = Can_pControllerConfig->Can_pBaudrateConfig;
  _83 = (unsigned int) BaudRateConfigID;
  _84 = _83 * 24;
  _85 = _82 + _84;
  _86 = _85->Can_bTrcvDelayEnable;
  _87 = Can_pControllerConfig->Can_pBaudrateConfig;
  _88 = (unsigned int) BaudRateConfigID;
  _89 = _88 * 24;
  _90 = _87 + _89;
  _91 = _90->Can_u8TrcvDelayCompOffset;
  FlexCAN_Ip_SetTDCOffset_Privileged (_81, _86, _91);

  <bb 5> :
  _92 = Can_pControllerConfig->Can_u8ControllerOffset;
  _93 = Can_pControllerConfig->Can_pBaudrateConfig;
  _94 = (unsigned int) BaudRateConfigID;
  _95 = _94 * 24;
  _96 = _93 + _95;
  _97 = _96->Can_u8TxArbitrationStartDelay;
  FlexCAN_Ip_SetTxArbitrationStartDelay_Privileged (_92, _97);
  _98 = Can_pControllerConfig->Can_u8ControllerOffset;
  eRetVal = FlexCAN_Ip_SetStopMode_Privileged (_98);

  <bb 6> :
  _99 = eRetVal != 0;
  D.7075 = (Std_ReturnType) _99;
  FlexCANTimeSeg = {CLOBBER};

  <bb 7> :
<L5>:
  return D.7075;

}


Can_Ipw_DeInit (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  <bb 2> :
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_Deinit_Privileged (_1);
  return;

}


Can_Ipw_Init (const struct Can_ControllerConfigType * Can_pControllerConfig)
{
  Std_ReturnType eRetVal;
  Std_ReturnType D.7069;

  <bb 2> :
  eRetVal = 1;
  _1 = Can_pControllerConfig->Can_u8ControllerID;
  _2 = (int) _1;
  _3 = Can_pControllerConfig->Can_u16DefaultBaudrateID;
  Can_au16ControllerBaudRateSel[_2] = _3;
  _4 = Can_pControllerConfig->Can_u8ControllerOffset;
  _5 = Can_pControllerConfig->Can_u8ControllerID;
  _6 = (int) _5;
  _7 = &Can_Ipw_xStatus0;
  _8 = Can_pControllerConfig->HwChannelIpConfig;
  _9 = _8->pFlexcanIpHwConfig;
  _10 = FlexCAN_Ip_Init_Privileged (_4, _7, _9);
  eRetVal = (Std_ReturnType) _10;
  _11 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_DisableInterrupts_Privileged (_11);
  _12 = Can_pControllerConfig->Can_u8ControllerID;
  _13 = (int) _12;
  Can_Ipw_abIsInterruptEnabled[_13] = 1;
  if (eRetVal == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  _14 = Can_pControllerConfig->Can_pBaudrateConfig;
  _15 = Can_pControllerConfig->Can_u16DefaultBaudrateID;
  _16 = (unsigned int) _15;
  _17 = _16 * 24;
  _18 = _14 + _17;
  _19 = _18->Can_bFDFrame;
  if (_19 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  _20 = Can_pControllerConfig->Can_u8ControllerOffset;
  _21 = Can_pControllerConfig->Can_pBaudrateConfig;
  _22 = Can_pControllerConfig->Can_u16DefaultBaudrateID;
  _23 = (unsigned int) _22;
  _24 = _23 * 24;
  _25 = _21 + _24;
  _26 = _25->Can_bTrcvDelayEnable;
  _27 = Can_pControllerConfig->Can_pBaudrateConfig;
  _28 = Can_pControllerConfig->Can_u16DefaultBaudrateID;
  _29 = (unsigned int) _28;
  _30 = _29 * 24;
  _31 = _27 + _30;
  _32 = _31->Can_u8TrcvDelayCompOffset;
  FlexCAN_Ip_SetTDCOffset_Privileged (_20, _26, _32);

  <bb 5> :
  _33 = Can_pControllerConfig->Can_u8ControllerOffset;
  _34 = Can_pControllerConfig->Can_pBaudrateConfig;
  _35 = Can_pControllerConfig->Can_u16DefaultBaudrateID;
  _36 = (unsigned int) _35;
  _37 = _36 * 24;
  _38 = _34 + _37;
  _39 = _38->Can_u8TxArbitrationStartDelay;
  FlexCAN_Ip_SetTxArbitrationStartDelay_Privileged (_33, _39);

  <bb 6> :
  D.7069 = eRetVal;

  <bb 7> :
<L4>:
  return D.7069;

}


Can_Ipw_SetRxMb (const uint8 u8Controller, const struct Can_HwObjectConfigType * Can_pHwObject)
{
  struct Flexcan_Ip_DataInfoType dataInfo;

  <bb 2> :
  dataInfo.fd_enable = 0;
  dataInfo.data_length = 0;
  _1 = Can_pHwObject->Can_IdMessage;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  dataInfo.msg_id_type = 1;
  goto <bb 5>; [INV]

  <bb 4> :
  dataInfo.msg_id_type = 0;

  <bb 5> :
  _2 = Can_pHwObject->Can_u8HwBufferIndex;
  _3 = Can_pHwObject->Can_pHwFilterConfig;
  _4 = _3->Can_u32HwFilterCode;
  FlexCAN_Ip_ConfigRxMb (u8Controller, _2, &dataInfo, _4);
  dataInfo = {CLOBBER};
  return;

}


Can_Ipw_ProcessLegacyFifoPolling (struct Can_HwType * CanIf_Mailbox, struct PduInfoType * CanIf_PduInfo, struct Flexcan_Ip_MsgBuffType * pReceivedDataBuffer, const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig)
{
  boolean returnResult;
  uint8 u8ObjIdx;

  <bb 2> :
  u8ObjIdx = 0;
  returnResult = 1;
  _1 = Can_pControllerConfig->Can_u8ControllerOffset;
  returnResult = FlexCAN_Ip_GetBuffStatusFlag (_1, 5);
  goto <bb 14>; [INV]

  <bb 3> :
  u8ObjIdx.2_2 = u8ObjIdx;
  u8ObjIdx = u8ObjIdx.2_2 + 1;
  _3 = Can_pControllerConfig->Can_u8ControllerOffset;
  _4 = FlexCAN_Ip_GetBuffStatusFlag (_3, 7);
  if (_4 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  Det_ReportRuntimeError (80, 0, 8, 1);
  _5 = Can_pControllerConfig->Can_pLegacyFiFoOvfNotif;
  if (_5 != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  _6 = Can_pControllerConfig->Can_pLegacyFiFoOvfNotif;
  _6 ();

  <bb 6> :
  _7 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ClearBuffStatusFlag (_7, 7);

  <bb 7> :
  _8 = Can_pControllerConfig->Can_u8ControllerOffset;
  _9 = FlexCAN_Ip_GetBuffStatusFlag (_8, 6);
  if (_9 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 8> :
  _10 = Can_pControllerConfig->Can_pLegacyFiFoWarnNotif;
  if (_10 != 0B)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  _11 = Can_pControllerConfig->Can_pLegacyFiFoWarnNotif;
  _11 ();

  <bb 10> :
  _12 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_ClearBuffStatusFlag (_12, 6);

  <bb 11> :
  _13 = Can_pControllerConfig->Can_u8ControllerOffset;
  FlexCAN_Ip_RxFifo (_13, pReceivedDataBuffer);
  _14 = Can_pControllerConfig->Can_u8ControllerOffset;
  _15 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  FlexCAN_Ip_MainFunctionRead (_14, _15);
  _16 = Can_pControllerConfig->Can_u8ControllerOffset;
  _17 = Can_pHwObjectConfig->Can_u8HwBufferIndex;
  _18 = FlexCAN_Ip_GetTransferStatus (_16, _17);
  if (_18 == 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  Can_Ipw_ParseData (CanIf_Mailbox, CanIf_PduInfo, pReceivedDataBuffer, Can_pControllerConfig, Can_pHwObjectConfig);

  <bb 13> :
  _19 = Can_pControllerConfig->Can_u8ControllerOffset;
  returnResult = FlexCAN_Ip_GetBuffStatusFlag (_19, 5);

  <bb 14> :
  _20 = Can_pHwObjectConfig->Can_u8ObjectCount;
  if (u8ObjIdx < _20)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  if (returnResult != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 16> :
  return;

}


Can_Ipw_InitLegacyFifoFilter (const struct Can_ControllerConfigType * Can_pController, const struct Can_HwObjectConfigType * Can_pHwObject)
{
  struct Flexcan_Ip_IdTableType RxFifoFilters[128];
  Flexcan_Ip_RxFifoIdElementFormatType eElementFormat;
  uint8 u8FiFoFilterIndvCount;
  uint32 u32HwFilterMask;
  uint8 u8HwFilterCount;
  uint8 u8FilterIdx;

  <bb 2> :
  u8FilterIdx = 0;
  u8HwFilterCount = 0;
  u32HwFilterMask = 0;
  u8FiFoFilterIndvCount = 0;
  eElementFormat = 0;
  _1 = Can_pHwObject->Can_u8HwFilterCount;
  _2 = _1 / 4;
  _3 = (unsigned int) _2;
  _4 = _3 + 6;
  if (_4 <= 32)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _5 = Can_pHwObject->Can_u8HwFilterCount;
  _6 = _5 / 4;
  u8FiFoFilterIndvCount = _6 + 6;
  goto <bb 5>; [INV]

  <bb 4> :
  u8FiFoFilterIndvCount = 32;

  <bb 5> :
  u8FilterIdx = 0;
  goto <bb 18>; [INV]

  <bb 6> :
  _7 = Can_pController->Can_eLegacyAcceptanceMode;
  if (_7 == 0)
    goto <bb 7>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 7> :
  u8HwFilterCount = Can_pHwObject->Can_u8HwFilterCount;
  u32HwFilterMask = 3221225472;
  eElementFormat = 0;
  _8 = Can_pHwObject->Can_IdMessage;
  if (_8 != 0)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  _9 = Can_pHwObject->Can_pHwFilterConfig;
  _10 = (unsigned int) u8FilterIdx;
  _11 = _10 * 8;
  _12 = _9 + _11;
  _13 = _12->Can_u32HwFilterMask;
  _14 = _13 << 1;
  u32HwFilterMask = u32HwFilterMask | _14;
  goto <bb 17>; [INV]

  <bb 9> :
  _15 = Can_pHwObject->Can_pHwFilterConfig;
  _16 = (unsigned int) u8FilterIdx;
  _17 = _16 * 8;
  _18 = _15 + _17;
  _19 = _18->Can_u32HwFilterMask;
  _20 = _19 << 19;
  u32HwFilterMask = u32HwFilterMask | _20;
  goto <bb 17>; [INV]

  <bb 10> :
  _21 = Can_pController->Can_eLegacyAcceptanceMode;
  if (_21 == 1)
    goto <bb 11>; [INV]
  else
    goto <bb 14>; [INV]

  <bb 11> :
  _22 = Can_pHwObject->Can_u8HwFilterCount;
  u8HwFilterCount = _22 * 2;
  u32HwFilterMask = 3221274624;
  eElementFormat = 1;
  _23 = Can_pHwObject->Can_IdMessage;
  if (_23 != 0)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  _24 = Can_pHwObject->Can_pHwFilterConfig;
  _25 = (unsigned int) u8FilterIdx;
  _26 = _25 * 16;
  _27 = _24 + _26;
  _28 = _27->Can_u32HwFilterMask;
  _29 = _28 >> 15;
  _30 = _29 << 16;
  u32HwFilterMask = u32HwFilterMask | _30;
  _31 = Can_pHwObject->Can_pHwFilterConfig;
  _32 = (unsigned int) u8FilterIdx;
  _33 = _32 * 16;
  _34 = _33 + 8;
  _35 = _31 + _34;
  _36 = _35->Can_u32HwFilterMask;
  _37 = _36 >> 15;
  u32HwFilterMask = u32HwFilterMask | _37;
  goto <bb 17>; [INV]

  <bb 13> :
  _38 = Can_pHwObject->Can_pHwFilterConfig;
  _39 = (unsigned int) u8FilterIdx;
  _40 = _39 * 16;
  _41 = _38 + _40;
  _42 = _41->Can_u32HwFilterMask;
  _43 = _42 << 19;
  u32HwFilterMask = u32HwFilterMask | _43;
  _44 = Can_pHwObject->Can_pHwFilterConfig;
  _45 = (unsigned int) u8FilterIdx;
  _46 = _45 * 16;
  _47 = _46 + 8;
  _48 = _44 + _47;
  _49 = _48->Can_u32HwFilterMask;
  _50 = _49 << 3;
  u32HwFilterMask = u32HwFilterMask | _50;
  goto <bb 17>; [INV]

  <bb 14> :
  _51 = Can_pHwObject->Can_u8HwFilterCount;
  u8HwFilterCount = _51 * 4;
  u32HwFilterMask = 0;
  eElementFormat = 2;
  _52 = Can_pHwObject->Can_IdMessage;
  if (_52 != 0)
    goto <bb 15>; [INV]
  else
    goto <bb 16>; [INV]

  <bb 15> :
  _53 = Can_pHwObject->Can_pHwFilterConfig;
  _54 = (unsigned int) u8FilterIdx;
  _55 = _54 * 32;
  _56 = _53 + _55;
  _57 = _56->Can_u32HwFilterMask;
  _58 = _57 >> 21;
  _59 = _58 << 24;
  u32HwFilterMask = u32HwFilterMask | _59;
  _60 = Can_pHwObject->Can_pHwFilterConfig;
  _61 = (unsigned int) u8FilterIdx;
  _62 = _61 * 32;
  _63 = _62 + 8;
  _64 = _60 + _63;
  _65 = _64->Can_u32HwFilterMask;
  _66 = _65 >> 21;
  _67 = _66 << 16;
  u32HwFilterMask = u32HwFilterMask | _67;
  _68 = Can_pHwObject->Can_pHwFilterConfig;
  _69 = (unsigned int) u8FilterIdx;
  _70 = _69 * 32;
  _71 = _70 + 16;
  _72 = _68 + _71;
  _73 = _72->Can_u32HwFilterMask;
  _74 = _73 >> 21;
  _75 = _74 << 8;
  u32HwFilterMask = u32HwFilterMask | _75;
  _76 = Can_pHwObject->Can_pHwFilterConfig;
  _77 = (unsigned int) u8FilterIdx;
  _78 = _77 * 32;
  _79 = _78 + 24;
  _80 = _76 + _79;
  _81 = _80->Can_u32HwFilterMask;
  _82 = _81 >> 21;
  u32HwFilterMask = u32HwFilterMask | _82;
  goto <bb 17>; [INV]

  <bb 16> :
  _83 = Can_pHwObject->Can_pHwFilterConfig;
  _84 = (unsigned int) u8FilterIdx;
  _85 = _84 * 32;
  _86 = _83 + _85;
  _87 = _86->Can_u32HwFilterMask;
  _88 = _87 >> 3;
  _89 = _88 << 24;
  u32HwFilterMask = u32HwFilterMask | _89;
  _90 = Can_pHwObject->Can_pHwFilterConfig;
  _91 = (unsigned int) u8FilterIdx;
  _92 = _91 * 32;
  _93 = _92 + 8;
  _94 = _90 + _93;
  _95 = _94->Can_u32HwFilterMask;
  _96 = _95 >> 3;
  _97 = _96 << 16;
  u32HwFilterMask = u32HwFilterMask | _97;
  _98 = Can_pHwObject->Can_pHwFilterConfig;
  _99 = (unsigned int) u8FilterIdx;
  _100 = _99 * 32;
  _101 = _100 + 16;
  _102 = _98 + _101;
  _103 = _102->Can_u32HwFilterMask;
  _104 = _103 >> 3;
  _105 = _104 << 8;
  u32HwFilterMask = u32HwFilterMask | _105;
  _106 = Can_pHwObject->Can_pHwFilterConfig;
  _107 = (unsigned int) u8FilterIdx;
  _108 = _107 * 32;
  _109 = _108 + 24;
  _110 = _106 + _109;
  _111 = _110->Can_u32HwFilterMask;
  _112 = _111 >> 3;
  u32HwFilterMask = u32HwFilterMask | _112;

  <bb 17> :
  _113 = Can_pController->Can_u8ControllerOffset;
  FlexCAN_Ip_SetRxIndividualMask_Privileged (_113, u8FilterIdx, u32HwFilterMask);
  u8FilterIdx.0_114 = u8FilterIdx;
  u8FilterIdx = u8FilterIdx.0_114 + 1;

  <bb 18> :
  if (u8FilterIdx < u8FiFoFilterIndvCount)
    goto <bb 19>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 19> :
  _115 = Can_pHwObject->Can_u8HwFilterCount;
  if (u8FilterIdx < _115)
    goto <bb 6>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 20> :
  _116 = Can_pController->Can_u8ControllerOffset;
  _117 = Can_pController->Can_u32LegacyGlobalMask;
  FlexCAN_Ip_SetRxFifoGlobalMask_Privileged (_116, _117);
  u8FilterIdx = 0;
  goto <bb 25>; [INV]

  <bb 21> :
  _118 = Can_pHwObject->Can_pHwFilterConfig;
  _119 = (unsigned int) u8FilterIdx;
  _120 = _119 * 8;
  _121 = _118 + _120;
  _122 = (int) u8FilterIdx;
  _123 = _121->Can_u32HwFilterCode;
  RxFifoFilters[_122].id = _123;
  _124 = Can_pHwObject->Can_IdMessage;
  if (_124 != 0)
    goto <bb 22>; [INV]
  else
    goto <bb 23>; [INV]

  <bb 22> :
  _125 = (int) u8FilterIdx;
  RxFifoFilters[_125].isExtendedFrame = 1;
  goto <bb 24>; [INV]

  <bb 23> :
  _126 = (int) u8FilterIdx;
  RxFifoFilters[_126].isExtendedFrame = 0;

  <bb 24> :
  _127 = (int) u8FilterIdx;
  RxFifoFilters[_127].isRemoteFrame = 0;
  u8FilterIdx.1_128 = u8FilterIdx;
  u8FilterIdx = u8FilterIdx.1_128 + 1;

  <bb 25> :
  if (u8FilterIdx < u8HwFilterCount)
    goto <bb 21>; [INV]
  else
    goto <bb 26>; [INV]

  <bb 26> :
  _129 = Can_pController->Can_u8ControllerOffset;
  FlexCAN_Ip_ConfigRxFifo_Privileged (_129, eElementFormat, &RxFifoFilters[0]);
  RxFifoFilters = {CLOBBER};
  return;

}


Can_Ipw_ParseData (struct Can_HwType * CanIf_Mailbox, struct PduInfoType * CanIf_PduInfo, struct Flexcan_Ip_MsgBuffType * pReceivedDataBuffer, const struct Can_ControllerConfigType * Can_pControllerConfig, const struct Can_HwObjectConfigType * Can_pHwObjectConfig)
{
  <bb 2> :
  _1 = pReceivedDataBuffer->msgId;
  CanIf_Mailbox->CanId = _1;
  _2 = pReceivedDataBuffer->cs;
  _3 = _2 & 2097152;
  if (_3 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _4 = CanIf_Mailbox->CanId;
  _5 = _4 | 2147483648;
  CanIf_Mailbox->CanId = _5;

  <bb 4> :
  _6 = Can_pHwObjectConfig->Can_eReceiveType;
  if (_6 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 5> :
  _7 = pReceivedDataBuffer->cs;
  _8 = _7 & 251658240;
  if (_8 == 100663296)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  Det_ReportRuntimeError (80, 0, 8, 1);

  <bb 7> :
  _9 = Can_pHwObjectConfig->Can_eReceiveType;
  if (_9 != 1)
    goto <bb 8>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 8> :
  _10 = pReceivedDataBuffer->cs;
  _11 = (signed int) _10;
  if (_11 < 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 9> :
  _12 = CanIf_Mailbox->CanId;
  _13 = _12 | 1073741824;
  CanIf_Mailbox->CanId = _13;

  <bb 10> :
  _14 = Can_pHwObjectConfig->Can_HwObjectID;
  CanIf_Mailbox->Hoh = _14;
  _15 = Can_pControllerConfig->Can_u8AbstControllerID;
  CanIf_Mailbox->ControllerId = _15;
  _16 = pReceivedDataBuffer->dataLen;
  _17 = (long unsigned int) _16;
  CanIf_PduInfo->SduLength = _17;
  _18 = &pReceivedDataBuffer->data[0];
  CanIf_PduInfo->SduDataPtr = _18;
  CanIf_RxIndication (CanIf_Mailbox, CanIf_PduInfo);
  return;

}


