FlexCAN_ConfigPN (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig) { short unsigned int _1; _2; _3; _4; _5; unsigned char _6; unsigned char _7; const uint8[8] * _8; const uint8[8] * _9; _10; _11; const uint8[8] * _12; const uint8[8] * _13; : FlexCAN_SetPNFilteringSelection (pBase_17(D), pPnConfig_18(D)); _1 = pPnConfig_18(D)->u16MatchTimeout; FlexCAN_SetPNTimeoutValue (pBase_17(D), _1); FlexCAN_SetPNIdFilter1 (pBase_17(D), pPnConfig_18(D)->idFilter1); _2 = pPnConfig_18(D)->eIdFilterType; if (_2 == 0) goto ; [INV] else goto ; [INV] : _3 = pPnConfig_18(D)->eIdFilterType; if (_3 == 3) goto ; [INV] else goto ; [INV] : FlexCAN_SetPNIdFilter2 (pBase_17(D), pPnConfig_18(D)); goto ; [INV] : FlexCAN_SetPNIdFilter2Check (pBase_17(D)); : _4 = pPnConfig_18(D)->eFilterComb; if (_4 == 1) goto ; [INV] else goto ; [INV] : _5 = pPnConfig_18(D)->eFilterComb; if (_5 == 3) goto ; [INV] else goto ; [INV] : _6 = pPnConfig_18(D)->payloadFilter.u8DlcLow; _7 = pPnConfig_18(D)->payloadFilter.u8DlcHigh; FlexCAN_SetPNDlcFilter (pBase_17(D), _6, _7); _8 = &pPnConfig_18(D)->payloadFilter.aPayload1; FlexCAN_SetPNPayloadHighFilter1 (pBase_17(D), _8); _9 = &pPnConfig_18(D)->payloadFilter.aPayload1; FlexCAN_SetPNPayloadLowFilter1 (pBase_17(D), _9); _10 = pPnConfig_18(D)->ePayloadFilterType; if (_10 == 0) goto ; [INV] else goto ; [INV] : _11 = pPnConfig_18(D)->ePayloadFilterType; if (_11 == 3) goto ; [INV] else goto ; [INV] : _12 = &pPnConfig_18(D)->payloadFilter.aPayload2; FlexCAN_SetPNPayloadHighFilter2 (pBase_17(D), _12); _13 = &pPnConfig_18(D)->payloadFilter.aPayload2; FlexCAN_SetPNPayloadLowFilter2 (pBase_17(D), _13); : return; } FlexCAN_ConfigCtrlOptions (struct FLEXCAN_Type * pBase, uint32 u32Options) { long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; : _1 = u32Options_17(D) & 32; if (_1 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetIsoCan (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetIsoCan (pBase_19(D), 0); : _2 = u32Options_17(D) & 64; if (_2 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetEntireFrameArbitrationFieldComparison (pBase_19(D), 0); : _3 = u32Options_17(D) & 8; if (_3 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetProtocolException (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetProtocolException (pBase_19(D), 0); : _4 = u32Options_17(D) & 2; if (_4 != 0) goto ; [INV] else goto ; [INV] : _5 ={v} pBase_19(D)->MCR; _6 = _5 & 2048; if (_6 == 0) goto ; [INV] else goto ; [INV] : FlexCAN_CanBitSampling (pBase_19(D), 1); goto ; [INV] : FlexCAN_CanBitSampling (pBase_19(D), 0); : _7 = u32Options_17(D) & 4; if (_7 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetBusOffAutorecovery (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetBusOffAutorecovery (pBase_19(D), 0); : _8 = u32Options_17(D) & 1; if (_8 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetRemoteReqStore (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetRemoteReqStore (pBase_19(D), 0); : _9 = u32Options_17(D) & 16; if (_9 != 0) goto ; [INV] else goto ; [INV] : FlexCAN_SetEdgeFilter (pBase_19(D), 1); goto ; [INV] : FlexCAN_SetEdgeFilter (pBase_19(D), 0); : return; } FlexCAN_IsMbOutOfRange (const struct FLEXCAN_Type * pBase, uint8 u8MbIndex, boolean bIsLegacyFifoEn, uint32 u32MaxMbNum) { uint32 u32NumOfMbOccupiedByFiFo; uint32 u32NumOfFiFoElement; boolean ReturnValue; boolean D.7600; unsigned char _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; boolean _22; : ReturnValue_9 = 0; u32NumOfFiFoElement_10 = 0; u32NumOfMbOccupiedByFiFo_11 = 0; _1 = (unsigned char) u32MaxMbNum_12(D); if (u8MbIndex_13(D) >= _1) goto ; [INV] else goto ; [INV] : ReturnValue_21 = 1; goto ; [INV] : if (bIsLegacyFifoEn_14(D) != 0) goto ; [INV] else goto ; [INV] : _2 ={v} pBase_17(D)->CTRL2; _3 = _2 >> 24; u32NumOfFiFoElement_18 = _3 & 15; _4 = u32NumOfFiFoElement_18 + 1; _5 = _4 * 8; _6 = _5 / 4; u32NumOfMbOccupiedByFiFo_19 = _6 + 5; _7 = (long unsigned int) u8MbIndex_13(D); if (u32NumOfMbOccupiedByFiFo_19 >= _7) goto ; [INV] else goto ; [INV] : ReturnValue_20 = 1; goto ; [INV] : ReturnValue_15 = 0; : # ReturnValue_8 = PHI _22 = ReturnValue_8; : : return _22; } FlexCAN_ReadRxFifo (const struct FLEXCAN_Type * base, struct Flexcan_Ip_MsgBuffType * rxFifo) { uint8 can_real_payload; uint8 flexcan_mb_dlc_value; uint32 * msgData_32; const uint32 * flexcan_mb_data_32; const uint32 * flexcan_mb_id; const uint32 * flexcan_mb; uint32 MbWord; uint32 DataByte; long unsigned int base.14_1; long unsigned int _2; long unsigned int _3; long unsigned int _4; unsigned char _5; _Bool _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; unsigned char _14; long unsigned int _15; long unsigned int _16; long unsigned int _17; long unsigned int _18; const uint32 * _19; long unsigned int _20; long unsigned int _21; long unsigned int _22; long unsigned int _23; long unsigned int _24; long unsigned int _25; long unsigned int _26; long unsigned int _27; long unsigned int _28; long unsigned int _29; uint32 * _30; long unsigned int _31; long unsigned int _32; : base.14_1 = (long unsigned int) base_37(D); _2 = base.14_1 + 128; flexcan_mb_38 = (const uint32 *) _2; flexcan_mb_id_39 = flexcan_mb_38 + 4; flexcan_mb_data_32_40 = flexcan_mb_38 + 8; msgData_32_42 = &rxFifo_41(D)->data; _3 ={v} *flexcan_mb_38; _4 = _3 >> 16; _5 = (unsigned char) _4; flexcan_mb_dlc_value_44 = _5 & 15; can_real_payload_46 = FlexCAN_ComputePayloadSize (flexcan_mb_dlc_value_44); _6 = rxFifo_41(D) != 0B; DevAssert (_6); if (can_real_payload_46 > 8) goto ; [INV] else goto ; [INV] : can_real_payload_48 = 8; : # can_real_payload_34 = PHI rxFifo_41(D)->dataLen = can_real_payload_34; _7 ={v} *flexcan_mb_38; rxFifo_41(D)->cs = _7; _8 = rxFifo_41(D)->cs; _9 = _8 & 2097152; if (_9 != 0) goto ; [INV] else goto ; [INV] : _10 ={v} *flexcan_mb_id_39; rxFifo_41(D)->msgId = _10; goto ; [INV] : _11 ={v} *flexcan_mb_id_39; _12 = _11 >> 18; rxFifo_41(D)->msgId = _12; : _13 ={v} base_37(D)->RXFIR; _14 = (unsigned char) _13; rxFifo_41(D)->id_hit = _14; _15 = rxFifo_41(D)->cs; _16 = _15 & 65535; rxFifo_41(D)->time_stamp = _16; DataByte_55 = 0; goto ; [INV] : _17 = DataByte_33 >> 2; _18 = _17 * 4; _19 = flexcan_mb_data_32_40 + _18; MbWord_56 ={v} *_19; _20 = MbWord_56 >> 24; _21 = MbWord_56 >> 8; _22 = _21 & 65280; _23 = _20 | _22; _24 = MbWord_56 << 8; _25 = _24 & 16711680; _26 = _23 | _25; _27 = MbWord_56 << 24; _28 = DataByte_33 >> 2; _29 = _28 * 4; _30 = msgData_32_42 + _29; _31 = _26 | _27; *_30 = _31; DataByte_58 = DataByte_33 + 4; : # DataByte_33 = PHI _32 = (long unsigned int) can_real_payload_34; if (DataByte_33 < _32) goto ; [INV] else goto ; [INV] : return; } FlexCAN_SetRxFifoFilter (struct FLEXCAN_Type * base, Flexcan_Ip_RxFifoIdElementFormatType idFormat, const struct Flexcan_Ip_IdTableType * idFilterTable) { volatile uint32 * FilterTable; uint32 Val; uint32 Val2; uint32 Val1; uint32 NumOfFilters; uint32 j; uint32 i; int iftmp.13; long unsigned int base.12_1; long unsigned int _2; _Bool _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; const struct Flexcan_Ip_IdTableType * _9; _Bool _10; long unsigned int _11; const struct Flexcan_Ip_IdTableType * _12; _Bool _13; long unsigned int _14; const struct Flexcan_Ip_IdTableType * _15; long unsigned int _16; long unsigned int _17; long unsigned int _18; long unsigned int _19; volatile uint32 * _20; long unsigned int _21; long unsigned int _22; const struct Flexcan_Ip_IdTableType * _23; long unsigned int _24; long unsigned int _25; long unsigned int _26; long unsigned int _27; volatile uint32 * _28; long unsigned int _29; long unsigned int _30; long unsigned int _31; long unsigned int _32; long unsigned int _33; long unsigned int _34; long unsigned int _35; const struct Flexcan_Ip_IdTableType * _36; _Bool _37; sizetype _38; sizetype _39; const struct Flexcan_Ip_IdTableType * _40; _Bool _41; long unsigned int _42; const struct Flexcan_Ip_IdTableType * _43; _Bool _44; long unsigned int _45; const struct Flexcan_Ip_IdTableType * _46; long unsigned int _47; long unsigned int _48; long unsigned int _49; long unsigned int _50; long unsigned int _51; volatile uint32 * _52; long unsigned int _53; long unsigned int _54; const struct Flexcan_Ip_IdTableType * _55; long unsigned int _56; long unsigned int _57; long unsigned int _58; long unsigned int _59; volatile uint32 * _60; long unsigned int _61; sizetype _62; sizetype _63; const struct Flexcan_Ip_IdTableType * _64; _Bool _65; long unsigned int _66; volatile uint32 * _67; long unsigned int _68; sizetype _69; sizetype _70; const struct Flexcan_Ip_IdTableType * _71; long unsigned int _72; long unsigned int _73; long unsigned int _74; long unsigned int _75; long unsigned int _76; volatile uint32 * _77; long unsigned int _78; long unsigned int _79; volatile uint32 * _80; long unsigned int _81; sizetype _82; sizetype _83; const struct Flexcan_Ip_IdTableType * _84; long unsigned int _85; long unsigned int _86; long unsigned int _87; long unsigned int _88; long unsigned int _89; volatile uint32 * _90; long unsigned int _91; long unsigned int _92; long unsigned int _93; long unsigned int _94; long unsigned int _95; long unsigned int _96; long unsigned int _97; const struct Flexcan_Ip_IdTableType * _98; _Bool _99; long unsigned int _100; const struct Flexcan_Ip_IdTableType * _101; long unsigned int _102; long unsigned int _103; long unsigned int _104; long unsigned int _105; volatile uint32 * _106; long unsigned int _107; long unsigned int _108; const struct Flexcan_Ip_IdTableType * _109; long unsigned int _110; long unsigned int _111; long unsigned int _112; long unsigned int _113; volatile uint32 * _114; long unsigned int _115; sizetype _116; sizetype _117; const struct Flexcan_Ip_IdTableType * _118; _Bool _119; long unsigned int _120; volatile uint32 * _121; long unsigned int _122; sizetype _123; sizetype _124; const struct Flexcan_Ip_IdTableType * _125; long unsigned int _126; long unsigned int _127; long unsigned int _128; long unsigned int _129; long unsigned int _130; long unsigned int _131; volatile uint32 * _132; long unsigned int _133; long unsigned int _134; volatile uint32 * _135; long unsigned int _136; sizetype _137; sizetype _138; const struct Flexcan_Ip_IdTableType * _139; long unsigned int _140; long unsigned int _141; long unsigned int _142; long unsigned int _143; long unsigned int _144; long unsigned int _145; volatile uint32 * _146; long unsigned int _147; sizetype _148; sizetype _149; const struct Flexcan_Ip_IdTableType * _150; _Bool _151; long unsigned int _152; volatile uint32 * _153; long unsigned int _154; sizetype _155; sizetype _156; const struct Flexcan_Ip_IdTableType * _157; long unsigned int _158; long unsigned int _159; long unsigned int _160; long unsigned int _161; long unsigned int _162; long unsigned int _163; volatile uint32 * _164; long unsigned int _165; long unsigned int _166; volatile uint32 * _167; long unsigned int _168; sizetype _169; sizetype _170; const struct Flexcan_Ip_IdTableType * _171; long unsigned int _172; long unsigned int _173; long unsigned int _174; long unsigned int _175; long unsigned int _176; long unsigned int _177; volatile uint32 * _178; long unsigned int _179; sizetype _180; sizetype _181; const struct Flexcan_Ip_IdTableType * _182; _Bool _183; long unsigned int _184; volatile uint32 * _185; long unsigned int _186; sizetype _187; sizetype _188; const struct Flexcan_Ip_IdTableType * _189; long unsigned int _190; long unsigned int _191; long unsigned int _192; long unsigned int _193; long unsigned int _194; volatile uint32 * _195; long unsigned int _196; long unsigned int _197; volatile uint32 * _198; long unsigned int _199; sizetype _200; sizetype _201; const struct Flexcan_Ip_IdTableType * _202; long unsigned int _203; long unsigned int _204; long unsigned int _205; long unsigned int _206; long unsigned int _207; volatile uint32 * _208; long unsigned int _209; long unsigned int _210; long unsigned int _211; long unsigned int _212; long unsigned int _213; int iftmp.13_222; int iftmp.13_241; int iftmp.13_242; : Val1_234 = 0; Val2_235 = 0; Val_236 = 0; base.12_1 = (long unsigned int) base_237(D); _2 = base.12_1 + 224; FilterTable_238 = (volatile uint32 *) _2; if (idFilterTable_239(D) != 0B) goto ; [INV] else goto ; [INV] : if (idFormat_240(D) == 3) goto ; [INV] else goto ; [INV] : iftmp.13_242 = 1; goto ; [INV] : iftmp.13_241 = 0; : # iftmp.13_222 = PHI _3 = (_Bool) iftmp.13_222; DevAssert (_3); _4 ={v} base_237(D)->CTRL2; _5 = _4 >> 24; NumOfFilters_245 = _5 & 15; switch (idFormat_240(D)) [INV], case 0: [INV], case 1: [INV], case 2: [INV], case 3: [INV]> : : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 (); _6 ={v} base_237(D)->MCR; _7 = _6 & 4294966527; base_237(D)->MCR ={v} _7; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 (); i_284 = 0; goto ; [INV] : Val_285 = 0; _8 = i_214 * 8; _9 = idFilterTable_239(D) + _8; _10 = _9->isRemoteFrame; if (_10 != 0) goto ; [INV] else goto ; [INV] : Val_286 = 2147483648; : # Val_221 = PHI _11 = i_214 * 8; _12 = idFilterTable_239(D) + _11; _13 = _12->isExtendedFrame; if (_13 != 0) goto ; [INV] else goto ; [INV] : Val_288 = Val_221 | 1073741824; _14 = i_214 * 8; _15 = idFilterTable_239(D) + _14; _16 = _15->id; _17 = _16 << 1; _18 = _17 & 1073741823; _19 = i_214 * 4; _20 = FilterTable_238 + _19; _21 = Val_288 + _18; *_20 ={v} _21; goto ; [INV] : _22 = i_214 * 8; _23 = idFilterTable_239(D) + _22; _24 = _23->id; _25 = _24 << 19; _26 = _25 & 1073217536; _27 = i_214 * 4; _28 = FilterTable_238 + _27; _29 = Val_221 + _26; *_28 ={v} _29; : i_290 = i_214 + 1; : # i_214 = PHI _30 = NumOfFilters_245 + 1; _31 = _30 * 8; if (i_214 < _31) goto ; [INV] else goto ; [INV] : goto ; [INV] : : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 (); _32 ={v} base_237(D)->MCR; _33 = _32 & 4294966527; _34 = _33 | 256; base_237(D)->MCR ={v} _34; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 (); j_267 = 0; i_268 = 0; goto ; [INV] : Val1_269 = 0; Val2_270 = 0; _35 = j_217 * 8; _36 = idFilterTable_239(D) + _35; _37 = _36->isRemoteFrame; if (_37 != 0) goto ; [INV] else goto ; [INV] : Val1_271 = 2147483648; : # Val1_219 = PHI _38 = j_217 + 1; _39 = _38 * 8; _40 = idFilterTable_239(D) + _39; _41 = _40->isRemoteFrame; if (_41 != 0) goto ; [INV] else goto ; [INV] : Val2_272 = 32768; : # Val2_220 = PHI _42 = j_217 * 8; _43 = idFilterTable_239(D) + _42; _44 = _43->isExtendedFrame; if (_44 != 0) goto ; [INV] else goto ; [INV] : Val1_274 = Val1_219 | 1073741824; _45 = j_217 * 8; _46 = idFilterTable_239(D) + _45; _47 = _46->id; _48 = _47 >> 15; _49 = _48 << 16; _50 = _49 & 1073676288; _51 = i_215 * 4; _52 = FilterTable_238 + _51; _53 = Val1_274 + _50; *_52 ={v} _53; goto ; [INV] : _54 = j_217 * 8; _55 = idFilterTable_239(D) + _54; _56 = _55->id; _57 = _56 << 19; _58 = _57 & 1073217536; _59 = i_215 * 4; _60 = FilterTable_238 + _59; _61 = Val1_219 + _58; *_60 ={v} _61; : _62 = j_217 + 1; _63 = _62 * 8; _64 = idFilterTable_239(D) + _63; _65 = _64->isExtendedFrame; if (_65 != 0) goto ; [INV] else goto ; [INV] : Val2_277 = Val2_220 | 16384; _66 = i_215 * 4; _67 = FilterTable_238 + _66; _68 ={v} *_67; _69 = j_217 + 1; _70 = _69 * 8; _71 = idFilterTable_239(D) + _70; _72 = _71->id; _73 = _72 >> 15; _74 = _73 & 16383; _75 = Val2_277 + _74; _76 = i_215 * 4; _77 = FilterTable_238 + _76; _78 = _68 | _75; *_77 ={v} _78; goto ; [INV] : _79 = i_215 * 4; _80 = FilterTable_238 + _79; _81 ={v} *_80; _82 = j_217 + 1; _83 = _82 * 8; _84 = idFilterTable_239(D) + _83; _85 = _84->id; _86 = _85 << 3; _87 = _86 & 16376; _88 = Val2_220 + _87; _89 = i_215 * 4; _90 = FilterTable_238 + _89; _91 = _81 | _88; *_90 ={v} _91; : j_279 = j_217 + 2; i_280 = i_215 + 1; : # i_215 = PHI # j_217 = PHI _92 = NumOfFilters_245 + 1; _93 = _92 * 8; if (i_215 < _93) goto ; [INV] else goto ; [INV] : goto ; [INV] : : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 (); _94 ={v} base_237(D)->MCR; _95 = _94 & 4294966527; _96 = _95 | 512; base_237(D)->MCR ={v} _96; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 (); j_252 = 0; i_253 = 0; goto ; [INV] : _97 = j_218 * 8; _98 = idFilterTable_239(D) + _97; _99 = _98->isExtendedFrame; if (_99 != 0) goto ; [INV] else goto ; [INV] : _100 = j_218 * 8; _101 = idFilterTable_239(D) + _100; _102 = _101->id; _103 = _102 >> 21; _104 = _103 << 24; _105 = i_216 * 4; _106 = FilterTable_238 + _105; _107 = Val1_234 + _104; *_106 ={v} _107; goto ; [INV] : _108 = j_218 * 8; _109 = idFilterTable_239(D) + _108; _110 = _109->id; _111 = _110 >> 3; _112 = _111 << 24; _113 = i_216 * 4; _114 = FilterTable_238 + _113; _115 = Val1_234 + _112; *_114 ={v} _115; : _116 = j_218 + 1; _117 = _116 * 8; _118 = idFilterTable_239(D) + _117; _119 = _118->isExtendedFrame; if (_119 != 0) goto ; [INV] else goto ; [INV] : _120 = i_216 * 4; _121 = FilterTable_238 + _120; _122 ={v} *_121; _123 = j_218 + 1; _124 = _123 * 8; _125 = idFilterTable_239(D) + _124; _126 = _125->id; _127 = _126 >> 21; _128 = _127 << 16; _129 = _128 & 16711680; _130 = Val1_234 + _129; _131 = i_216 * 4; _132 = FilterTable_238 + _131; _133 = _122 | _130; *_132 ={v} _133; goto ; [INV] : _134 = i_216 * 4; _135 = FilterTable_238 + _134; _136 ={v} *_135; _137 = j_218 + 1; _138 = _137 * 8; _139 = idFilterTable_239(D) + _138; _140 = _139->id; _141 = _140 >> 3; _142 = _141 << 16; _143 = _142 & 16711680; _144 = Val1_234 + _143; _145 = i_216 * 4; _146 = FilterTable_238 + _145; _147 = _136 | _144; *_146 ={v} _147; : _148 = j_218 + 2; _149 = _148 * 8; _150 = idFilterTable_239(D) + _149; _151 = _150->isExtendedFrame; if (_151 != 0) goto ; [INV] else goto ; [INV] : _152 = i_216 * 4; _153 = FilterTable_238 + _152; _154 ={v} *_153; _155 = j_218 + 2; _156 = _155 * 8; _157 = idFilterTable_239(D) + _156; _158 = _157->id; _159 = _158 >> 21; _160 = _159 << 8; _161 = _160 & 65535; _162 = Val1_234 + _161; _163 = i_216 * 4; _164 = FilterTable_238 + _163; _165 = _154 | _162; *_164 ={v} _165; goto ; [INV] : _166 = i_216 * 4; _167 = FilterTable_238 + _166; _168 ={v} *_167; _169 = j_218 + 2; _170 = _169 * 8; _171 = idFilterTable_239(D) + _170; _172 = _171->id; _173 = _172 >> 3; _174 = _173 << 8; _175 = _174 & 65535; _176 = Val1_234 + _175; _177 = i_216 * 4; _178 = FilterTable_238 + _177; _179 = _168 | _176; *_178 ={v} _179; : _180 = j_218 + 3; _181 = _180 * 8; _182 = idFilterTable_239(D) + _181; _183 = _182->isExtendedFrame; if (_183 != 0) goto ; [INV] else goto ; [INV] : _184 = i_216 * 4; _185 = FilterTable_238 + _184; _186 ={v} *_185; _187 = j_218 + 3; _188 = _187 * 8; _189 = idFilterTable_239(D) + _188; _190 = _189->id; _191 = _190 >> 21; _192 = _191 & 255; _193 = Val1_234 + _192; _194 = i_216 * 4; _195 = FilterTable_238 + _194; _196 = _186 | _193; *_195 ={v} _196; goto ; [INV] : _197 = i_216 * 4; _198 = FilterTable_238 + _197; _199 ={v} *_198; _200 = j_218 + 3; _201 = _200 * 8; _202 = idFilterTable_239(D) + _201; _203 = _202->id; _204 = _203 >> 3; _205 = _204 & 255; _206 = Val1_234 + _205; _207 = i_216 * 4; _208 = FilterTable_238 + _207; _209 = _199 | _206; *_208 ={v} _209; : j_262 = j_218 + 4; i_263 = i_216 + 1; : # i_216 = PHI # j_218 = PHI _210 = NumOfFilters_245 + 1; _211 = _210 * 8; if (i_216 < _211) goto ; [INV] else goto ; [INV] : goto ; [INV] : : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_13 (); _212 ={v} base_237(D)->MCR; _213 = _212 | 768; base_237(D)->MCR ={v} _213; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_13 (); goto ; [INV] : : : return; } FlexCAN_SetOperationMode (struct FLEXCAN_Type * base, Flexcan_Ip_ModesType mode) { long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; : switch (mode_12(D)) [INV], case 0: [INV], case 1: [INV], case 2: [INV]> : : _1 ={v} base_14(D)->CTRL1; _2 = _1 & 4294967287; base_14(D)->CTRL1 ={v} _2; _3 ={v} base_14(D)->CTRL1; _4 = _3 & 4294963199; base_14(D)->CTRL1 ={v} _4; goto ; [INV] : : _5 ={v} base_14(D)->CTRL1; _6 = _5 | 8; base_14(D)->CTRL1 ={v} _6; goto ; [INV] : : _7 ={v} base_14(D)->CTRL1; _8 = _7 | 4096; base_14(D)->CTRL1 ={v} _8; _9 ={v} base_14(D)->CTRL1; _10 = _9 & 4294967287; base_14(D)->CTRL1 ={v} _10; FlexCAN_SetSelfReception (base_14(D), 1); goto ; [INV] : : : return; } FlexCAN_SetMaxMsgBuffNum (struct FLEXCAN_Type * base, uint32 maxMsgBuffNum) { Flexcan_Ip_StatusType Status; uint32 ValEndRam; uint32 ValEndMb; uint8 Can_Real_Payload; uint8 Arbitration_Field_Size; volatile uint8 * Flexcan_Mb_Data; volatile uint32 * Flexcan_Mb_Id; volatile uint32 * Flexcan_Mb; const uint32 * ValEndMbPointer; const uint32 * RAM; uint32 DataByte; uint8 MsgBuffIdx; Flexcan_Ip_StatusType D.7549; long unsigned int base.8_1; long unsigned int _2; long unsigned int _3; _Bool _4; long unsigned int _5; long unsigned int _6; long unsigned int ValEndMbPointer.9_7; long unsigned int _8; long unsigned int _9; const uint32 * _10; long unsigned int _11; long unsigned int _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; long unsigned int _16; long unsigned int _17; long unsigned int _18; long unsigned int _19; long unsigned int _20; volatile uint8 * _21; long unsigned int _22; unsigned char MsgBuffIdx.10_23; long unsigned int _24; Flexcan_Ip_StatusType _68; : base.8_1 = (long unsigned int) base_33(D); _2 = base.8_1 + 128; RAM_34 = (const uint32 *) _2; ValEndMbPointer_35 = 0B; Flexcan_Mb_36 = 0B; Flexcan_Mb_Id_37 = 0B; Flexcan_Mb_Data_38 = 0B; Arbitration_Field_Size_39 = 8; _3 = maxMsgBuffNum_40(D) + 4294967295; Can_Real_Payload_43 = FlexCAN_GetMbPayloadSize (base_33(D), _3); ValEndMb_44 = 0; ValEndRam_45 = 0; Status_46 = 0; _4 = maxMsgBuffNum_40(D) != 0; DevAssert (_4); _5 = maxMsgBuffNum_40(D) + 4294967295; ValEndMbPointer_49 = FlexCAN_GetMsgBuffRegion (base_33(D), _5); _6 = (long unsigned int) Can_Real_Payload_43; ValEndMbPointer.9_7 = (long unsigned int) ValEndMbPointer_49; _8 = _6 + ValEndMbPointer.9_7; _9 = (long unsigned int) Arbitration_Field_Size_39; ValEndMb_50 = _8 + _9; _10 = RAM_34 + 512; ValEndRam_51 = (uint32) _10; if (ValEndMb_50 > ValEndRam_51) goto ; [INV] else goto ; [INV] : _11 = FlexCAN_GetMaxMbNum (base_33(D)); if (maxMsgBuffNum_40(D) > _11) goto ; [INV] else goto ; [INV] : Status_53 = 4; : # Status_27 = PHI if (Status_27 == 0) goto ; [INV] else goto ; [INV] : _12 ={v} base_33(D)->MCR; _13 = _12 & 4294967168; _14 = maxMsgBuffNum_40(D) + 4294967295; _15 = _14 & 127; _16 = _13 | _15; base_33(D)->MCR ={v} _16; _17 ={v} base_33(D)->MCR; _18 = _17 & 536870912; if (_18 == 0) goto ; [INV] else goto ; [INV] : MsgBuffIdx_55 = 0; goto ; [INV] : _19 = (long unsigned int) MsgBuffIdx_25; Flexcan_Mb_57 = FlexCAN_GetMsgBuffRegion (base_33(D), _19); Flexcan_Mb_Id_58 = Flexcan_Mb_57 + 4; Flexcan_Mb_Data_59 = Flexcan_Mb_57 + 8; *Flexcan_Mb_57 ={v} 0; *Flexcan_Mb_Id_58 ={v} 0; _20 = (long unsigned int) MsgBuffIdx_25; Can_Real_Payload_63 = FlexCAN_GetMbPayloadSize (base_33(D), _20); DataByte_64 = 0; goto ; [INV] : _21 = Flexcan_Mb_Data_59 + DataByte_26; *_21 ={v} 0; DataByte_67 = DataByte_26 + 1; : # DataByte_26 = PHI _22 = (long unsigned int) Can_Real_Payload_63; if (DataByte_26 < _22) goto ; [INV] else goto ; [INV] : MsgBuffIdx.10_23 = MsgBuffIdx_25; MsgBuffIdx_65 = MsgBuffIdx.10_23 + 1; : # MsgBuffIdx_25 = PHI _24 = (long unsigned int) MsgBuffIdx_25; if (maxMsgBuffNum_40(D) > _24) goto ; [INV] else goto ; [INV] : _68 = Status_27; : : return _68; } FlexCAN_SetTxMsgBuff (volatile uint32 * const pMbAddr, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId, const uint8 * msgData, const boolean isRemote) { const uint32 * MsgData_32; volatile uint32 * Flexcan_Mb_Data_32; volatile uint8 * Flexcan_Mb_Data; volatile uint32 * Flexcan_Mb_Id; volatile uint32 * Flexcan_Mb; uint8 Payload_Size; uint8 Dlc_Value; uint32 DataByte; uint32 Flexcan_Mb_Config; _Bool _1; long unsigned int _2; unsigned char _3; long unsigned int _4; long unsigned int _5; const uint32 * _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; const uint32 * _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; const uint32 * _18; long unsigned int _19; long unsigned int _20; long unsigned int _21; long unsigned int _22; long unsigned int _23; long unsigned int _24; const uint32 * _25; long unsigned int _26; long unsigned int _27; long unsigned int _28; long unsigned int _29; volatile uint32 * _30; long unsigned int _31; long unsigned int _32; long unsigned int _33; const uint8 * _34; long unsigned int _35; volatile uint8 * _36; unsigned char _37; long unsigned int _38; long unsigned int _39; volatile uint8 * _40; unsigned char _41; long unsigned int _42; _43; long unsigned int _44; long unsigned int _45; long unsigned int _46; long unsigned int _47; long unsigned int _48; _49; long unsigned int _50; long unsigned int _51; long unsigned int _52; long unsigned int _53; long unsigned int _54; long unsigned int _55; long unsigned int _56; long unsigned int _57; long unsigned int _58; long unsigned int _59; long unsigned int _60; _Bool _61; long unsigned int _62; long unsigned int _63; long unsigned int _64; long unsigned int _65; long unsigned int _66; long unsigned int _67; long unsigned int _68; _Bool _69; long unsigned int _70; long unsigned int _71; : Flexcan_Mb_Config_87 = 0; Flexcan_Mb_89 = pMbAddr_88(D); Flexcan_Mb_Id_90 = Flexcan_Mb_89 + 4; Flexcan_Mb_Data_91 = Flexcan_Mb_89 + 8; Flexcan_Mb_Data_32_92 = Flexcan_Mb_89 + 8; MsgData_32_94 = msgData_93(D); _1 = cs_95(D) != 0B; DevAssert (_1); *Flexcan_Mb_89 ={v} 134217728; *Flexcan_Mb_Id_90 ={v} 0; _2 = cs_95(D)->dataLen; _3 = (unsigned char) _2; Dlc_Value_101 = FlexCAN_ComputeDLCValue (_3); if (msgData_93(D) != 0B) goto ; [INV] else goto ; [INV] : DataByte_102 = 0; goto ; [INV] : _4 = DataByte_77 >> 2; _5 = _4 * 4; _6 = MsgData_32_94 + _5; _7 = *_6; _8 = _7 >> 24; _9 = DataByte_77 >> 2; _10 = _9 * 4; _11 = MsgData_32_94 + _10; _12 = *_11; _13 = _12 >> 8; _14 = _13 & 65280; _15 = _8 | _14; _16 = DataByte_77 >> 2; _17 = _16 * 4; _18 = MsgData_32_94 + _17; _19 = *_18; _20 = _19 << 8; _21 = _20 & 16711680; _22 = _15 | _21; _23 = DataByte_77 >> 2; _24 = _23 * 4; _25 = MsgData_32_94 + _24; _26 = *_25; _27 = _26 << 24; _28 = DataByte_77 >> 2; _29 = _28 * 4; _30 = Flexcan_Mb_Data_32_92 + _29; _31 = _22 | _27; *_30 ={v} _31; DataByte_111 = DataByte_77 + 4; : # DataByte_77 = PHI _32 = cs_95(D)->dataLen; _33 = _32 & 4294967292; if (DataByte_77 < _33) goto ; [INV] else goto ; [INV] : goto ; [INV] : _34 = msgData_93(D) + DataByte_78; _35 = DataByte_78 ^ 3; _36 = Flexcan_Mb_Data_91 + _35; _37 = *_34; *_36 ={v} _37; DataByte_109 = DataByte_78 + 1; : # DataByte_78 = PHI _38 = cs_95(D)->dataLen; if (DataByte_78 < _38) goto ; [INV] else goto ; [INV] : Payload_Size_104 = FlexCAN_ComputePayloadSize (Dlc_Value_101); DataByte_105 = cs_95(D)->dataLen; goto ; [INV] : _39 = DataByte_79 ^ 3; _40 = Flexcan_Mb_Data_91 + _39; _41 = cs_95(D)->fd_padding; *_40 ={v} _41; DataByte_107 = DataByte_79 + 1; : # DataByte_79 = PHI _42 = (long unsigned int) Payload_Size_104; if (DataByte_79 < _42) goto ; [INV] else goto ; [INV] : _43 = cs_95(D)->msgIdType; if (_43 == 1) goto ; [INV] else goto ; [INV] : _44 ={v} *Flexcan_Mb_Id_90; _45 = _44 & 3758096384; *Flexcan_Mb_Id_90 ={v} _45; _46 ={v} *Flexcan_Mb_Id_90; _47 = msgId_113(D) & 536870911; _48 = _46 | _47; *Flexcan_Mb_Id_90 ={v} _48; Flexcan_Mb_Config_115 = Flexcan_Mb_Config_87 | 6291456; : # Flexcan_Mb_Config_72 = PHI _49 = cs_95(D)->msgIdType; if (_49 == 0) goto ; [INV] else goto ; [INV] : _50 ={v} *Flexcan_Mb_Id_90; _51 = _50 & 3758358527; *Flexcan_Mb_Id_90 ={v} _51; _52 ={v} *Flexcan_Mb_Id_90; _53 = msgId_113(D) << 18; _54 = _53 & 536608768; _55 = _52 | _54; *Flexcan_Mb_Id_90 ={v} _55; Flexcan_Mb_Config_118 = Flexcan_Mb_Config_72 & 4288675839; : # Flexcan_Mb_Config_73 = PHI Flexcan_Mb_Config_119 = Flexcan_Mb_Config_73 & 4293984255; _56 = (long unsigned int) Dlc_Value_101; _57 = _56 << 16; _58 = _57 & 983040; Flexcan_Mb_Config_120 = Flexcan_Mb_Config_119 | _58; _59 = cs_95(D)->code; if (_59 != 15) goto ; [INV] else goto ; [INV] : _60 = cs_95(D)->code; if (_60 == 28) goto ; [INV] else goto ; [INV] : Flexcan_Mb_Config_123 = Flexcan_Mb_Config_120 | 1048576; goto ; [INV] : if (isRemote_121(D) != 0) goto ; [INV] else goto ; [INV] : Flexcan_Mb_Config_122 = Flexcan_Mb_Config_120 | 1048576; : # Flexcan_Mb_Config_74 = PHI Flexcan_Mb_Config_124 = Flexcan_Mb_Config_74 & 4043309055; _61 = cs_95(D)->fd_enable; if (_61 != 0) goto ; [INV] else goto ; [INV] : _62 = cs_95(D)->code; _63 = _62 << 24; _64 = _63 & 251658240; _65 = Flexcan_Mb_Config_124 | _64; Flexcan_Mb_Config_126 = _65 | 2147483648; Flexcan_Mb_Config_127 = Flexcan_Mb_Config_126 & 4293918719; goto ; [INV] : _66 = cs_95(D)->code; _67 = _66 << 24; _68 = _67 & 251658240; Flexcan_Mb_Config_125 = Flexcan_Mb_Config_124 | _68; : # Flexcan_Mb_Config_75 = PHI _69 = cs_95(D)->enable_brs; if (_69 != 0) goto ; [INV] else goto ; [INV] : Flexcan_Mb_Config_128 = Flexcan_Mb_Config_75 | 1073741824; : # Flexcan_Mb_Config_76 = PHI _70 ={v} *Flexcan_Mb_89; _71 = Flexcan_Mb_Config_76 | _70; *Flexcan_Mb_89 ={v} _71; : return; } FlexCAN_GetMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, struct Flexcan_Ip_MsgBuffType * msgBuff) { uint8 Payload_Size; uint8 Flexcan_Mb_Dlc_Value; uint32 MbWord; uint32 * MsgBuff_Data_32; const uint32 * Flexcan_Mb_Data_32; const uint8 * Flexcan_Mb_Data; const uint32 * Flexcan_Mb_Id; const uint32 * Flexcan_Mb; uint8 i; long unsigned int _1; long unsigned int _2; unsigned char _3; _Bool _4; unsigned char _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; long unsigned int _11; long unsigned int _12; long unsigned int _13; unsigned char _14; unsigned int _15; unsigned int _16; const uint32 * _17; long unsigned int _18; long unsigned int _19; long unsigned int _20; long unsigned int _21; long unsigned int _22; long unsigned int _23; long unsigned int _24; long unsigned int _25; unsigned char _26; unsigned int _27; unsigned int _28; uint32 * _29; long unsigned int _30; unsigned int _31; unsigned int _32; unsigned int _33; unsigned char _34; sizetype _35; const uint8 * _36; int _37; unsigned char _38; unsigned char i.7_39; : Flexcan_Mb_51 = FlexCAN_GetMsgBuffRegion (base_48(D), msgBuffIdx_49(D)); Flexcan_Mb_Id_52 = Flexcan_Mb_51 + 4; Flexcan_Mb_Data_53 = Flexcan_Mb_51 + 8; Flexcan_Mb_Data_32_54 = Flexcan_Mb_51 + 8; MsgBuff_Data_32_56 = &msgBuff_55(D)->data; _1 ={v} *Flexcan_Mb_51; _2 = _1 >> 16; _3 = (unsigned char) _2; Flexcan_Mb_Dlc_Value_57 = _3 & 15; Payload_Size_59 = FlexCAN_ComputePayloadSize (Flexcan_Mb_Dlc_Value_57); _4 = msgBuff_55(D) != 0B; DevAssert (_4); _5 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D)); if (Payload_Size_59 > _5) goto ; [INV] else goto ; [INV] : Payload_Size_63 = FlexCAN_GetMbPayloadSize (base_48(D), msgBuffIdx_49(D)); : # Payload_Size_42 = PHI msgBuff_55(D)->dataLen = Payload_Size_42; _6 ={v} *Flexcan_Mb_51; msgBuff_55(D)->cs = _6; _7 = msgBuff_55(D)->cs; _8 = _7 & 2097152; if (_8 != 0) goto ; [INV] else goto ; [INV] : _9 ={v} *Flexcan_Mb_Id_52; msgBuff_55(D)->msgId = _9; goto ; [INV] : _10 ={v} *Flexcan_Mb_Id_52; _11 = _10 >> 18; msgBuff_55(D)->msgId = _11; : _12 = msgBuff_55(D)->cs; _13 = _12 & 65535; msgBuff_55(D)->time_stamp = _13; i_69 = 0; goto ; [INV] : _14 = i_40 >> 2; _15 = (unsigned int) _14; _16 = _15 * 4; _17 = Flexcan_Mb_Data_32_54 + _16; MbWord_72 ={v} *_17; _18 = MbWord_72 >> 24; _19 = MbWord_72 >> 8; _20 = _19 & 65280; _21 = _18 | _20; _22 = MbWord_72 << 8; _23 = _22 & 16711680; _24 = _21 | _23; _25 = MbWord_72 << 24; _26 = i_40 >> 2; _27 = (unsigned int) _26; _28 = _27 * 4; _29 = MsgBuff_Data_32_56 + _28; _30 = _24 | _25; *_29 = _30; i_74 = i_40 + 4; : # i_40 = PHI _31 = (unsigned int) i_40; _32 = (unsigned int) Payload_Size_42; _33 = _32 & 4294967292; if (_31 < _33) goto ; [INV] else goto ; [INV] : goto ; [INV] : _34 = i_41 ^ 3; _35 = (sizetype) _34; _36 = Flexcan_Mb_Data_53 + _35; _37 = (int) i_41; _38 ={v} *_36; msgBuff_55(D)->data[_37] = _38; i.7_39 = i_41; i_71 = i.7_39 + 1; : # i_41 = PHI if (i_41 < Payload_Size_42) goto ; [INV] else goto ; [INV] : return; } FlexCAN_GetMsgBuffTimestamp (const struct FLEXCAN_Type * base, uint32 msgBuffIdx) { const uint32 * Flexcan_Mb; uint32 TimeStamp; uint32 D.7517; long unsigned int _1; uint32 _9; : TimeStamp_2 = 0; Flexcan_Mb_7 = FlexCAN_GetMsgBuffRegion (base_4(D), msgBuffIdx_5(D)); _1 ={v} *Flexcan_Mb_7; TimeStamp_8 = _1 & 65535; _9 = TimeStamp_8; : : return _9; } FlexCAN_SetRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx, const struct Flexcan_Ip_MsbuffCodeStatusType * cs, uint32 msgId) { volatile uint32 * flexcan_mb_id; volatile uint32 * flexcan_mb; _Bool _1; _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; _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; long unsigned int _16; long unsigned int _17; long unsigned int _18; long unsigned int _19; long unsigned int _20; long unsigned int _21; long unsigned int _22; long unsigned int _23; long unsigned int _24; long unsigned int _25; long unsigned int _26; long unsigned int _27; long unsigned int _28; : flexcan_mb_36 = FlexCAN_GetMsgBuffRegion (base_33(D), msgBuffIdx_34(D)); flexcan_mb_id_37 = flexcan_mb_36 + 4; _1 = cs_38(D) != 0B; DevAssert (_1); *flexcan_mb_36 ={v} 0; *flexcan_mb_id_37 ={v} 0; _2 = cs_38(D)->msgIdType; if (_2 == 1) goto ; [INV] else goto ; [INV] : _3 ={v} *flexcan_mb_36; _4 = _3 | 2097152; *flexcan_mb_36 ={v} _4; _5 ={v} *flexcan_mb_36; _6 = _5 & 4290772991; *flexcan_mb_36 ={v} _6; _7 ={v} *flexcan_mb_id_37; _8 = _7 & 3758096384; *flexcan_mb_id_37 ={v} _8; _9 ={v} *flexcan_mb_id_37; _10 = msgId_45(D) & 536870911; _11 = _9 | _10; *flexcan_mb_id_37 ={v} _11; : _12 = cs_38(D)->msgIdType; if (_12 == 0) goto ; [INV] else goto ; [INV] : _13 ={v} *flexcan_mb_36; _14 = _13 & 4288675839; *flexcan_mb_36 ={v} _14; _15 ={v} *flexcan_mb_id_37; _16 = _15 & 3758358527; *flexcan_mb_id_37 ={v} _16; _17 ={v} *flexcan_mb_id_37; _18 = msgId_45(D) << 18; _19 = _18 & 536608768; _20 = _17 | _19; *flexcan_mb_id_37 ={v} _20; : _21 = cs_38(D)->code; if (_21 != 15) goto ; [INV] else goto ; [INV] : _22 ={v} *flexcan_mb_36; _23 = _22 & 4043309055; *flexcan_mb_36 ={v} _23; _24 ={v} *flexcan_mb_36; _25 = cs_38(D)->code; _26 = _25 << 24; _27 = _26 & 251658240; _28 = _24 | _27; *flexcan_mb_36 ={v} _28; : return; } FlexCAN_EnableInterrupts (struct FLEXCAN_Type * pBase, uint8 u8Instance) { int _1; long unsigned int _2; : _1 = (int) u8Instance_3(D); _2 ={v} FlexCAN_Ip_au32ImaskBuff[_1][0]; pBase_5(D)->IMASK1 ={v} _2; return; } FlexCAN_DisableInterrupts (struct FLEXCAN_Type * pBase) { : pBase_2(D)->IMASK1 ={v} 0; return; } FLEXCAN_ClearMsgBuffIntCmd (struct FLEXCAN_Type * pBase, uint8 u8Instance, uint32 mb_idx, boolean bIsIntActive) { uint32 temp; long unsigned int _1; long unsigned int _2; long unsigned int _3; int _4; long unsigned int _5; int _6; long unsigned int _7; : _1 = mb_idx_10(D) & 31; temp_11 = 1 << _1; if (mb_idx_10(D) <= 31) goto ; [INV] else goto ; [INV] : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_11 (); _2 ={v} pBase_14(D)->IMASK1; _3 = ~temp_11; _4 = (int) u8Instance_15(D); _5 = _2 & _3; FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5; if (bIsIntActive_17(D) != 0) goto ; [INV] else goto ; [INV] : _6 = (int) u8Instance_15(D); _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0]; pBase_14(D)->IMASK1 ={v} _7; : SchM_Exit_Can_CAN_EXCLUSIVE_AREA_11 (); : return; } FlexCAN_SetMsgBuffIntCmd (struct FLEXCAN_Type * base, uint8 u8Instance, uint32 msgBuffIdx, boolean enable, boolean bIsIntActive) { Flexcan_Ip_StatusType stat; uint32 temp; Flexcan_Ip_StatusType D.7505; long unsigned int _1; int _2; long unsigned int _3; int _4; long unsigned int _5; int _6; long unsigned int _7; int _8; long unsigned int _9; long unsigned int _10; int _11; long unsigned int _12; int _13; long unsigned int _14; Flexcan_Ip_StatusType _33; : stat_17 = 0; _1 = msgBuffIdx_18(D) & 31; temp_19 = 1 << _1; if (msgBuffIdx_18(D) <= 31) goto ; [INV] else goto ; [INV] : if (enable_21(D) != 0) goto ; [INV] else goto ; [INV] : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 (); _2 = (int) u8Instance_23(D); _3 ={v} FlexCAN_Ip_au32ImaskBuff[_2][0]; _4 = (int) u8Instance_23(D); _5 = temp_19 | _3; FlexCAN_Ip_au32ImaskBuff[_4][0] ={v} _5; if (bIsIntActive_30(D) != 0) goto ; [INV] else goto ; [INV] : _6 = (int) u8Instance_23(D); _7 ={v} FlexCAN_Ip_au32ImaskBuff[_6][0]; base_25(D)->IMASK1 ={v} _7; : SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 (); goto ; [INV] : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_18 (); _8 = (int) u8Instance_23(D); _9 ={v} FlexCAN_Ip_au32ImaskBuff[_8][0]; _10 = ~temp_19; _11 = (int) u8Instance_23(D); _12 = _9 & _10; FlexCAN_Ip_au32ImaskBuff[_11][0] ={v} _12; _13 = (int) u8Instance_23(D); _14 ={v} FlexCAN_Ip_au32ImaskBuff[_13][0]; base_25(D)->IMASK1 ={v} _14; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_18 (); : _33 = stat_17; : : return _33; } FlexCAN_LockRxMsgBuff (const struct FLEXCAN_Type * base, uint32 msgBuffIdx) { const uint32 * flexcan_mb; long unsigned int vol.6; long unsigned int vol.6_6; : flexcan_mb_5 = FlexCAN_GetMsgBuffRegion (base_2(D), msgBuffIdx_3(D)); vol.6_6 ={v} *flexcan_mb_5; return; } FlexCAN_GetMbPayloadSize (const struct FLEXCAN_Type * base, uint32 maxMsgBuffNum) { uint8 mb_size; uint8 i; uint8 maxMbBlockNum; uint8 can_real_payload; uint32 ramBlockSize; uint8 arbitration_field_size; uint8 D.7495; long unsigned int _1; long unsigned int _2; unsigned char _3; long unsigned int _4; unsigned char i.5_5; uint8 _27; : arbitration_field_size_12 = 8; ramBlockSize_13 = 512; can_real_payload_14 = 8; maxMbBlockNum_15 = 0; i_16 = 0; mb_size_17 = 0; i_18 = 0; goto ; [INV] : can_real_payload_22 = FlexCAN_GetPayloadSize (base_20(D), i_9); mb_size_23 = can_real_payload_22 + arbitration_field_size_12; _1 = (long unsigned int) mb_size_23; _2 = ramBlockSize_13 / _1; _3 = (unsigned char) _2; maxMbBlockNum_24 = maxMbBlockNum_8 + _3; _4 = (long unsigned int) maxMbBlockNum_24; if (maxMsgBuffNum_25(D) < _4) goto ; [INV] else goto ; [INV] : goto ; [INV] : i.5_5 = i_9; i_26 = i.5_5 + 1; : # can_real_payload_6 = PHI # maxMbBlockNum_8 = PHI # i_9 = PHI if (i_9 == 0) goto ; [INV] else goto ; [INV] : # can_real_payload_7 = PHI _27 = can_real_payload_7; : : return _27; } FlexCAN_GetPayloadSize (const struct FLEXCAN_Type * base, uint8 mbdsrIdx) { uint32 payloadSize; uint8 D.7491; _Bool _1; int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; uint8 _17; : payloadSize_10 = 8; _1 = FlexCAN_IsFDAvailable (base_12(D)); if (_1 != 0) goto ; [INV] else goto ; [INV] : _2 = (int) mbdsrIdx_14(D); if (_2 == 0) goto ; [INV] else goto ; [INV] : : _3 ={v} base_12(D)->FDCTRL; _4 = _3 >> 16; _5 = _4 & 3; payloadSize_15 = 8 << _5; goto ; [INV] : : _6 ={v} base_12(D)->FDCTRL; _7 = _6 >> 16; _8 = _7 & 3; payloadSize_16 = 8 << _8; : # payloadSize_9 = PHI _17 = (uint8) payloadSize_9; : : return _17; } FlexCAN_SetPayloadSize (struct FLEXCAN_Type * base, const struct Flexcan_Ip_PayloadSizeType * payloadSize) { uint32 tmp; int iftmp.3; _Bool _1; _2; _Bool _3; _Bool _4; _5; long unsigned int _6; int iftmp.3_7; int iftmp.3_13; int iftmp.3_14; : _1 = FlexCAN_IsFDEnabled (base_10(D)); if (_1 != 0) goto ; [INV] else goto ; [INV] : _2 = payloadSize_12(D)->payloadBlock0; if (_2 == 0) goto ; [INV] else goto ; [INV] : iftmp.3_14 = 1; goto ; [INV] : iftmp.3_13 = 0; : # iftmp.3_7 = PHI _3 = (_Bool) iftmp.3_7; DevAssert (_3); _4 = FlexCAN_IsFDEnabled (base_10(D)); if (_4 != 0) goto ; [INV] else goto ; [INV] : tmp_17 ={v} base_10(D)->FDCTRL; tmp_18 = tmp_17 & 4294770687; _5 = payloadSize_12(D)->payloadBlock0; _6 = _5 << 16; tmp_19 = tmp_18 | _6; base_10(D)->FDCTRL ={v} tmp_19; : return; } FlexCAN_IsFDAvailable (const struct FLEXCAN_Type * base) { boolean returnValue; static struct FLEXCAN_Type * const flexcanBase[1] = {1073889280B}; uint32 i; boolean D.7475; struct FLEXCAN_Type * _1; boolean _11; : i_4 = 0; returnValue_5 = 0; i_6 = 0; goto ; [INV] : _1 = flexcanBase[i_2]; if (base_8(D) == _1) goto ; [INV] else goto ; [INV] : returnValue_10 = 1; goto ; [INV] : i_9 = i_2 + 1; : # i_2 = PHI if (i_2 == 0) goto ; [INV] else goto ; [INV] : # returnValue_3 = PHI _11 = returnValue_3; : : return _11; } FlexCAN_EnableRxFifo (struct FLEXCAN_Type * base, uint32 numOfFilters) { Flexcan_Ip_StatusType stat; uint16 noOfMbx; uint32 i; Flexcan_Ip_StatusType D.7471; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; long unsigned int _11; Flexcan_Ip_StatusType _29; : _1 = FlexCAN_GetMaxMbNum (base_17(D)); noOfMbx_19 = (uint16) _1; stat_20 = 0; _2 ={v} base_17(D)->MCR; _3 = _2 & 2048; if (_3 != 0) goto ; [INV] else goto ; [INV] : stat_21 = 1; : # stat_13 = PHI if (stat_13 == 0) goto ; [INV] else goto ; [INV] : _4 ={v} base_17(D)->MCR; _5 = _4 | 536870912; base_17(D)->MCR ={v} _5; _6 ={v} base_17(D)->CTRL2; _7 = _6 & 4043309055; _8 = numOfFilters_23(D) << 24; _9 = _8 & 251658240; _10 = _7 | _9; base_17(D)->CTRL2 ={v} _10; base_17(D)->RXFGMASK ={v} 4294967295; i_26 = 0; goto ; [INV] : base_17(D)->RXIMR[i_12] ={v} 536870911; i_28 = i_12 + 1; : # i_12 = PHI _11 = (long unsigned int) noOfMbx_19; if (i_12 < _11) goto ; [INV] else goto ; [INV] : _29 = stat_13; : : return _29; } FlexCAN_Init (struct FLEXCAN_Type * base) { Flexcan_Ip_StatusType returnResult; uint32 uS2Ticks; uint32 timeElapsed; uint32 timeStart; Flexcan_Ip_StatusType D.7464; long unsigned int D.7457; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; _Bool _8; long unsigned int _25; Flexcan_Ip_StatusType _42; : timeStart = 0; timeElapsed_16 = 0; uS2Ticks_18 = OsIf_MicrosToTicks (1000000, 0); returnResult_19 = 0; _1 ={v} base_20(D)->MCR; _2 = _1 | 33554432; base_20(D)->MCR ={v} _2; _3 = OsIf_GetCounter (0); timeStart = _3; goto ; [INV] : _25 = OsIf_GetElapsed (&timeStart, 0); timeElapsed_26 = _25 + timeElapsed_9; if (timeElapsed_26 >= uS2Ticks_18) goto ; [INV] else goto ; [INV] : returnResult_27 = 3; goto ; [INV] : # timeElapsed_9 = PHI _4 ={v} base_20(D)->MCR; _5 = _4 & 33554432; if (_5 != 0) goto ; [INV] else goto ; [INV] : # returnResult_10 = PHI if (returnResult_10 == 0) goto ; [INV] else goto ; [INV] : _6 ={v} base_20(D)->MCR; _7 = _6 | 4096; base_20(D)->MCR ={v} _7; FlexCAN_ClearRAM (base_20(D)); base_20(D)->RXMGMASK ={v} 4294967295; base_20(D)->RX14MASK ={v} 4294967295; base_20(D)->RX15MASK ={v} 4294967295; base_20(D)->IMASK1 ={v} 0; base_20(D)->IFLAG1 ={v} 4294967295; base_20(D)->ESR1 ={v} 3866630; base_20(D)->CTRL1 ={v} 0; base_20(D)->CTRL2 ={v} 1048576; base_20(D)->CBT ={v} 0; _8 = FlexCAN_IsFDAvailable (base_20(D)); if (_8 != 0) goto ; [INV] else goto ; [INV] : base_20(D)->FDCBT ={v} 0; base_20(D)->FDCTRL ={v} 2147500288; : _42 = returnResult_10; timeStart ={v} {CLOBBER}; : : return _42; } FlexCAN_SetErrIntCmd (struct FLEXCAN_Type * base, flexcan_int_type_t errType, boolean enable) { uint32 temp; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; long unsigned int _11; long unsigned int _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; : temp_19 = errType_18(D); SchM_Enter_Can_CAN_EXCLUSIVE_AREA_06 (); if (enable_22(D) != 0) goto ; [INV] else goto ; [INV] : if (errType_18(D) == 16385) goto ; [INV] else goto ; [INV] : _1 ={v} base_23(D)->CTRL2; _2 = _1 | 2147483648; base_23(D)->CTRL2 ={v} _2; goto ; [INV] : if (errType_18(D) == 1024) goto ; [INV] else goto ; [INV] : if (errType_18(D) == 2048) goto ; [INV] else goto ; [INV] : _3 ={v} base_23(D)->MCR; _4 = _3 | 2097152; base_23(D)->MCR ={v} _4; : _5 ={v} base_23(D)->CTRL1; _6 = temp_19 | _5; base_23(D)->CTRL1 ={v} _6; goto ; [INV] : if (errType_18(D) == 16385) goto ; [INV] else goto ; [INV] : _7 ={v} base_23(D)->CTRL2; _8 = _7 & 2147483647; base_23(D)->CTRL2 ={v} _8; goto ; [INV] : _9 ={v} base_23(D)->CTRL1; _10 = ~temp_19; _11 = _9 & _10; base_23(D)->CTRL1 ={v} _11; temp_25 ={v} base_23(D)->CTRL1; _12 = temp_25 & 1024; if (_12 == 0) goto ; [INV] else goto ; [INV] : _13 = temp_25 & 2048; if (_13 == 0) goto ; [INV] else goto ; [INV] : _14 ={v} base_23(D)->MCR; _15 = _14 & 4292870143; base_23(D)->MCR ={v} _15; : SchM_Exit_Can_CAN_EXCLUSIVE_AREA_06 (); return; } FlexCAN_Disable (struct FLEXCAN_Type * base) { Flexcan_Ip_StatusType returnResult; uint32 uS2Ticks; uint32 timeElapsed; uint32 timeStart; Flexcan_Ip_StatusType D.7438; long unsigned int D.7435; long unsigned int _1; signed int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _25; Flexcan_Ip_StatusType _28; : timeStart = 0; timeElapsed_14 = 0; uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0); returnResult_17 = 0; _1 ={v} base_18(D)->MCR; _2 = (signed int) _1; if (_2 >= 0) goto ; [INV] else goto ; [INV] : SchM_Enter_Can_CAN_EXCLUSIVE_AREA_05 (); _3 ={v} base_18(D)->MCR; _4 = _3 | 2147483648; base_18(D)->MCR ={v} _4; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_05 (); _5 = OsIf_GetCounter (0); timeStart = _5; goto ; [INV] : _25 = OsIf_GetElapsed (&timeStart, 0); timeElapsed_26 = _25 + timeElapsed_8; if (timeElapsed_26 >= uS2Ticks_16) goto ; [INV] else goto ; [INV] : returnResult_27 = 3; goto ; [INV] : # timeElapsed_8 = PHI _6 ={v} base_18(D)->MCR; _7 = _6 & 1048576; if (_7 == 0) goto ; [INV] else goto ; [INV] : # returnResult_9 = PHI _28 = returnResult_9; timeStart ={v} {CLOBBER}; : : return _28; } FlexCAN_ExitFreezeMode (struct FLEXCAN_Type * base) { Flexcan_Ip_StatusType returnValue; uint32 uS2Ticks; uint32 timeElapsed; uint32 timeStart; Flexcan_Ip_StatusType D.7430; long unsigned int D.7427; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _26; Flexcan_Ip_StatusType _29; : timeStart = 0; timeElapsed_14 = 0; uS2Ticks_16 = OsIf_MicrosToTicks (1000000, 0); returnValue_17 = 0; SchM_Enter_Can_CAN_EXCLUSIVE_AREA_04 (); _1 ={v} base_19(D)->MCR; _2 = _1 & 4026531839; base_19(D)->MCR ={v} _2; _3 ={v} base_19(D)->MCR; _4 = _3 & 3221225471; base_19(D)->MCR ={v} _4; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_04 (); _5 = OsIf_GetCounter (0); timeStart = _5; goto ; [INV] : _26 = OsIf_GetElapsed (&timeStart, 0); timeElapsed_27 = _26 + timeElapsed_8; if (timeElapsed_27 >= uS2Ticks_16) goto ; [INV] else goto ; [INV] : returnValue_28 = 3; goto ; [INV] : # timeElapsed_8 = PHI _6 ={v} base_19(D)->MCR; _7 = _6 & 16777216; if (_7 != 0) goto ; [INV] else goto ; [INV] : # returnValue_9 = PHI _29 = returnValue_9; timeStart ={v} {CLOBBER}; : : return _29; } FlexCAN_Enable (struct FLEXCAN_Type * base) { Flexcan_Ip_StatusType returnValue; uint32 uS2Ticks; uint32 timeElapsed; uint32 timeStart; Flexcan_Ip_StatusType D.7424; long unsigned int D.7421; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _23; Flexcan_Ip_StatusType _26; : timeStart = 0; timeElapsed_12 = 0; uS2Ticks_14 = OsIf_MicrosToTicks (1000000, 0); returnValue_15 = 0; SchM_Enter_Can_CAN_EXCLUSIVE_AREA_03 (); _1 ={v} base_17(D)->MCR; _2 = _1 & 2147483647; base_17(D)->MCR ={v} _2; SchM_Exit_Can_CAN_EXCLUSIVE_AREA_03 (); _3 = OsIf_GetCounter (0); timeStart = _3; goto ; [INV] : _23 = OsIf_GetElapsed (&timeStart, 0); timeElapsed_24 = _23 + timeElapsed_6; if (timeElapsed_24 >= uS2Ticks_14) goto ; [INV] else goto ; [INV] : returnValue_25 = 3; goto ; [INV] : # timeElapsed_6 = PHI _4 ={v} base_17(D)->MCR; _5 = _4 & 16777216; if (_5 == 0) goto ; [INV] else goto ; [INV] : # returnValue_7 = PHI _26 = returnValue_7; timeStart ={v} {CLOBBER}; : : return _26; } FlexCAN_EnterFreezeMode (struct FLEXCAN_Type * base) { Flexcan_Ip_StatusType returnResult; uint32 uS2Ticks; uint32 timeElapsed; uint32 timeStart; Flexcan_Ip_StatusType D.7418; long unsigned int D.7415; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; signed int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; long unsigned int _11; long unsigned int _32; Flexcan_Ip_StatusType _35; : timeStart = 0; timeElapsed_19 = 0; uS2Ticks_21 = OsIf_MicrosToTicks (1000000, 0); returnResult_22 = 0; SchM_Enter_Can_CAN_EXCLUSIVE_AREA_02 (); _1 ={v} base_24(D)->MCR; _2 = _1 | 1073741824; base_24(D)->MCR ={v} _2; _3 ={v} base_24(D)->MCR; _4 = _3 | 268435456; base_24(D)->MCR ={v} _4; _5 ={v} base_24(D)->MCR; _6 = (signed int) _5; if (_6 < 0) goto ; [INV] else goto ; [INV] : _7 ={v} base_24(D)->MCR; _8 = _7 & 2147483647; base_24(D)->MCR ={v} _8; : SchM_Exit_Can_CAN_EXCLUSIVE_AREA_02 (); _9 = OsIf_GetCounter (0); timeStart = _9; goto ; [INV] : _32 = OsIf_GetElapsed (&timeStart, 0); timeElapsed_33 = _32 + timeElapsed_12; if (timeElapsed_33 >= uS2Ticks_21) goto ; [INV] else goto ; [INV] : returnResult_34 = 3; goto ; [INV] : # timeElapsed_12 = PHI _10 ={v} base_24(D)->MCR; _11 = _10 & 16777216; if (_11 == 0) goto ; [INV] else goto ; [INV] : # returnResult_13 = PHI _35 = returnResult_13; timeStart ={v} {CLOBBER}; : : return _35; } FlexCAN_GetMaxMbNum (const struct FLEXCAN_Type * base) { static const uint32 maxMbNum[3] = {32, 16, 16}; static struct FLEXCAN_Type * const flexcanBase[3] = {1073889280B, 1073893376B, 1073917952B}; uint32 ret; uint32 i; uint32 D.7411; struct FLEXCAN_Type * _1; uint32 _7; : ret_5 = 0; i_6 = 0; goto ; [INV] : _1 = flexcanBase[i_2]; if (base_9(D) == _1) goto ; [INV] else goto ; [INV] : ret_10 = maxMbNum[i_2]; : # ret_3 = PHI i_11 = i_2 + 1; : # i_2 = PHI # ret_4 = PHI if (i_2 <= 2) goto ; [INV] else goto ; [INV] : _7 = ret_4; : : return _7; } FlexCAN_GetMsgBuffRegion (const struct FLEXCAN_Type * base, uint32 msgBuffIdx) { volatile uint32 * pAddressRet; volatile uint32 * RAM; uint8 payload_size; uint32 mb_index; uint8 maxMbNum; uint8 i; uint32 msgBuffIdxBackup; uint32 ramBlockOffset; uint32 ramBlockSize; uint8 mb_size; uint8 arbitration_field_size; volatile uint32 * D.7407; long unsigned int base.1_1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; unsigned char i.2_7; long unsigned int _8; long unsigned int _9; unsigned char _10; long unsigned int _11; long unsigned int _12; long unsigned int _13; volatile uint32 * _47; : arbitration_field_size_23 = 8; mb_size_24 = 0; ramBlockSize_25 = 512; ramBlockOffset_26 = 0; msgBuffIdxBackup_28 = msgBuffIdx_27(D); i_29 = 0; maxMbNum_30 = 0; mb_index_31 = 0; payload_size_32 = 0; base.1_1 = (long unsigned int) base_33(D); _2 = base.1_1 + 128; RAM_34 = (volatile uint32 *) _2; pAddressRet_35 = 0B; i_36 = 0; goto ; [INV] : payload_size_39 = FlexCAN_GetPayloadSize (base_33(D), i_18); mb_size_40 = payload_size_39 + arbitration_field_size_23; _3 = (long unsigned int) mb_size_40; _4 = ramBlockSize_25 / _3; maxMbNum_41 = (uint8) _4; _5 = (long unsigned int) maxMbNum_41; if (msgBuffIdxBackup_17 < _5) goto ; [INV] else goto ; [INV] : goto ; [INV] : ramBlockOffset_42 = ramBlockOffset_16 + 128; _6 = (long unsigned int) maxMbNum_41; msgBuffIdxBackup_43 = msgBuffIdxBackup_17 - _6; i.2_7 = i_18; i_44 = i.2_7 + 1; : # mb_size_14 = PHI # ramBlockOffset_16 = PHI # msgBuffIdxBackup_17 = PHI # i_18 = PHI # maxMbNum_19 = PHI if (i_18 == 0) goto ; [INV] else goto ; [INV] : # mb_size_15 = PHI # maxMbNum_20 = PHI _8 = (long unsigned int) maxMbNum_20; _9 = msgBuffIdxBackup_17 % _8; _10 = mb_size_15 >> 2; _11 = (long unsigned int) _10; _12 = _9 * _11; mb_index_45 = ramBlockOffset_16 + _12; _13 = mb_index_45 * 4; pAddressRet_46 = RAM_34 + _13; _47 = pAddressRet_46; : : return _47; } FlexCAN_ComputePayloadSize (uint8 dlcValue) { uint8 ret; uint8 D.7403; int _1; uint8 _13; : ret_3 = 8; if (dlcValue_4(D) <= 8) goto ; [INV] else goto ; [INV] : ret_12 = dlcValue_4(D); goto ; [INV] : _1 = (int) dlcValue_4(D); switch (_1) [INV], case 9: [INV], case 10: [INV], case 11: [INV], case 12: [INV], case 13: [INV], case 14: [INV], case 15: [INV]> : : ret_11 = 12; goto ; [INV] : : ret_10 = 16; goto ; [INV] : : ret_9 = 20; goto ; [INV] : : ret_8 = 24; goto ; [INV] : : ret_7 = 32; goto ; [INV] : : ret_6 = 48; goto ; [INV] : : ret_5 = 64; goto ; [INV] : : : # ret_2 = PHI _13 = ret_2; : : return _13; } FlexCAN_ClearRAM (struct FLEXCAN_Type * base) { volatile uint32 * RAM; uint32 RXIMR_size; uint32 RAM_size; uint32 databyte; long unsigned int _1; long unsigned int base.0_2; long unsigned int _3; long unsigned int _4; volatile uint32 * _5; long unsigned int _6; volatile uint32 * _7; : _1 = FlexCAN_GetMaxMbNum (base_13(D)); RAM_size_15 = _1 * 4; RXIMR_size_17 = FlexCAN_GetMaxMbNum (base_13(D)); base.0_2 = (long unsigned int) base_13(D); _3 = base.0_2 + 128; RAM_18 = (volatile uint32 *) _3; databyte_19 = 0; goto ; [INV] : _4 = databyte_8 * 4; _5 = RAM_18 + _4; *_5 ={v} 0; databyte_25 = databyte_8 + 1; : # databyte_8 = PHI if (databyte_8 < RAM_size_15) goto ; [INV] else goto ; [INV] : RAM_20 = &base_13(D)->RXIMR; databyte_21 = 0; goto ; [INV] : _6 = databyte_9 * 4; _7 = RAM_20 + _6; *_7 ={v} 0; databyte_23 = databyte_9 + 1; : # databyte_9 = PHI if (databyte_9 < RXIMR_size_17) goto ; [INV] else goto ; [INV] : return; } FlexCAN_ComputeDLCValue (uint8 payloadSize) { static const uint8 payload_code[65] = "\x00\x01\x02\x03\x04\x05\x06\x07\b\t\t\t\t\n\n\n\n\v\v\v\v\f\f\f\f\r\r\r\r\r\r\r\r\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f"; uint32 ret; uint8 D.7398; int _1; unsigned char _2; uint8 _8; : ret_4 = 255; if (payloadSize_5(D) <= 64) goto ; [INV] else goto ; [INV] : _1 = (int) payloadSize_5(D); _2 = payload_code[_1]; ret_7 = (uint32) _2; : # ret_3 = PHI _8 = (uint8) ret_3; : : return _8; } FlexCAN_SetPNPayloadLowFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload) { unsigned char _1; long unsigned int _2; long unsigned int _3; const uint8 * _4; unsigned char _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; const uint8 * _10; unsigned char _11; long unsigned int _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; const uint8 * _16; unsigned char _17; long unsigned int _18; long unsigned int _19; : _1 = *pPayload_21(D); _2 = (long unsigned int) _1; _3 = _2 << 24; _4 = pPayload_21(D) + 1; _5 = *_4; _6 = (long unsigned int) _5; _7 = _6 << 16; _8 = _7 & 16711680; _9 = _3 | _8; _10 = pPayload_21(D) + 2; _11 = *_10; _12 = (long unsigned int) _11; _13 = _12 << 8; _14 = _13 & 65535; _15 = _9 | _14; _16 = pPayload_21(D) + 3; _17 = *_16; _18 = (long unsigned int) _17; _19 = _15 | _18; pBase_22(D)->PL2_PLMASK_LO ={v} _19; return; } FlexCAN_SetPNPayloadHighFilter2 (struct FLEXCAN_Type * pBase, const uint8 * pPayload) { const uint8 * _1; unsigned char _2; long unsigned int _3; long unsigned int _4; const uint8 * _5; unsigned char _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; const uint8 * _11; unsigned char _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; long unsigned int _16; const uint8 * _17; unsigned char _18; long unsigned int _19; long unsigned int _20; : _1 = pPayload_21(D) + 4; _2 = *_1; _3 = (long unsigned int) _2; _4 = _3 << 24; _5 = pPayload_21(D) + 5; _6 = *_5; _7 = (long unsigned int) _6; _8 = _7 << 16; _9 = _8 & 16711680; _10 = _4 | _9; _11 = pPayload_21(D) + 6; _12 = *_11; _13 = (long unsigned int) _12; _14 = _13 << 8; _15 = _14 & 65535; _16 = _10 | _15; _17 = pPayload_21(D) + 7; _18 = *_17; _19 = (long unsigned int) _18; _20 = _16 | _19; pBase_23(D)->PL2_PLMASK_HI ={v} _20; return; } FlexCAN_SetPNPayloadLowFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload) { unsigned char _1; long unsigned int _2; long unsigned int _3; const uint8 * _4; unsigned char _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; const uint8 * _10; unsigned char _11; long unsigned int _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; const uint8 * _16; unsigned char _17; long unsigned int _18; long unsigned int _19; : _1 = *pPayload_21(D); _2 = (long unsigned int) _1; _3 = _2 << 24; _4 = pPayload_21(D) + 1; _5 = *_4; _6 = (long unsigned int) _5; _7 = _6 << 16; _8 = _7 & 16711680; _9 = _3 | _8; _10 = pPayload_21(D) + 2; _11 = *_10; _12 = (long unsigned int) _11; _13 = _12 << 8; _14 = _13 & 65535; _15 = _9 | _14; _16 = pPayload_21(D) + 3; _17 = *_16; _18 = (long unsigned int) _17; _19 = _15 | _18; pBase_22(D)->PL1_LO ={v} _19; return; } FlexCAN_SetPNPayloadHighFilter1 (struct FLEXCAN_Type * pBase, const uint8 * pPayload) { const uint8 * _1; unsigned char _2; long unsigned int _3; long unsigned int _4; const uint8 * _5; unsigned char _6; long unsigned int _7; long unsigned int _8; long unsigned int _9; long unsigned int _10; const uint8 * _11; unsigned char _12; long unsigned int _13; long unsigned int _14; long unsigned int _15; long unsigned int _16; const uint8 * _17; unsigned char _18; long unsigned int _19; long unsigned int _20; : _1 = pPayload_21(D) + 4; _2 = *_1; _3 = (long unsigned int) _2; _4 = _3 << 24; _5 = pPayload_21(D) + 5; _6 = *_5; _7 = (long unsigned int) _6; _8 = _7 << 16; _9 = _8 & 16711680; _10 = _4 | _9; _11 = pPayload_21(D) + 6; _12 = *_11; _13 = (long unsigned int) _12; _14 = _13 << 8; _15 = _14 & 65535; _16 = _10 | _15; _17 = pPayload_21(D) + 7; _18 = *_17; _19 = (long unsigned int) _18; _20 = _16 | _19; pBase_23(D)->PL1_HI ={v} _20; return; } FlexCAN_SetPNDlcFilter (struct FLEXCAN_Type * pBase, uint8 u8DlcLow, uint8 u8DlcHigh) { uint32 tmp; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; long unsigned int _5; : tmp_8 ={v} pBase_7(D)->FLT_DLC; tmp_9 = tmp_8 & 4293984240; _1 = (long unsigned int) u8DlcHigh_10(D); _2 = _1 & 15; tmp_11 = tmp_9 | _2; _3 = (long unsigned int) u8DlcLow_12(D); _4 = _3 << 16; _5 = _4 & 983040; tmp_13 = tmp_11 | _5; pBase_7(D)->FLT_DLC ={v} tmp_13; return; } FlexCAN_SetPNIdFilter2 (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig) { uint32 u32Tmp; long unsigned int iftmp.27; long unsigned int iftmp.26; _Bool _1; _Bool _2; _Bool _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int iftmp.26_10; long unsigned int iftmp.27_11; long unsigned int iftmp.26_17; long unsigned int iftmp.26_18; long unsigned int iftmp.27_20; long unsigned int iftmp.27_21; : u32Tmp_14 ={v} pBase_13(D)->FLT_ID2_IDMASK; u32Tmp_15 = u32Tmp_14 & 2147483648; _1 = pPnConfig_16(D)->idFilter2.bExtendedId; if (_1 != 0) goto ; [INV] else goto ; [INV] : iftmp.26_18 = 1073741824; goto ; [INV] : iftmp.26_17 = 0; : # iftmp.26_10 = PHI u32Tmp_19 = iftmp.26_10 | u32Tmp_15; _2 = pPnConfig_16(D)->idFilter2.bRemoteFrame; if (_2 != 0) goto ; [INV] else goto ; [INV] : iftmp.27_21 = 536870912; goto ; [INV] : iftmp.27_20 = 0; : # iftmp.27_11 = PHI u32Tmp_22 = iftmp.27_11 | u32Tmp_19; _3 = pPnConfig_16(D)->idFilter1.bExtendedId; if (_3 != 0) goto ; [INV] else goto ; [INV] : _4 = pPnConfig_16(D)->idFilter2.u32Id; _5 = _4 & 536870911; u32Tmp_24 = u32Tmp_22 | _5; goto ; [INV] : _6 = pPnConfig_16(D)->idFilter2.u32Id; _7 = _6 << 18; _8 = _7 & 536870911; u32Tmp_23 = u32Tmp_22 | _8; : # u32Tmp_9 = PHI pBase_13(D)->FLT_ID2_IDMASK ={v} u32Tmp_9; return; } FlexCAN_SetPNIdFilter2Check (struct FLEXCAN_Type * pBase) { long unsigned int _1; long unsigned int _2; : _1 ={v} pBase_4(D)->FLT_ID2_IDMASK; _2 = _1 | 1610612736; pBase_4(D)->FLT_ID2_IDMASK ={v} _2; return; } FlexCAN_SetPNIdFilter1 (struct FLEXCAN_Type * pBase, struct Flexcan_Ip_PnIdFilterType idFilter) { uint32 u32Tmp; long unsigned int iftmp.25; long unsigned int iftmp.24; _Bool _1; _Bool _2; _Bool _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; long unsigned int _7; long unsigned int _8; long unsigned int iftmp.24_10; long unsigned int iftmp.25_11; long unsigned int iftmp.24_16; long unsigned int iftmp.24_17; long unsigned int iftmp.25_19; long unsigned int iftmp.25_20; : u32Tmp_14 ={v} pBase_13(D)->FLT_ID1; u32Tmp_15 = u32Tmp_14 & 2147483648; _1 = idFilter.bExtendedId; if (_1 != 0) goto ; [INV] else goto ; [INV] : iftmp.24_17 = 1073741824; goto ; [INV] : iftmp.24_16 = 0; : # iftmp.24_10 = PHI u32Tmp_18 = iftmp.24_10 | u32Tmp_15; _2 = idFilter.bRemoteFrame; if (_2 != 0) goto ; [INV] else goto ; [INV] : iftmp.25_20 = 536870912; goto ; [INV] : iftmp.25_19 = 0; : # iftmp.25_11 = PHI u32Tmp_21 = iftmp.25_11 | u32Tmp_18; _3 = idFilter.bExtendedId; if (_3 != 0) goto ; [INV] else goto ; [INV] : _4 = idFilter.u32Id; _5 = _4 & 536870911; u32Tmp_23 = u32Tmp_21 | _5; goto ; [INV] : _6 = idFilter.u32Id; _7 = _6 << 18; _8 = _7 & 536870911; u32Tmp_22 = u32Tmp_21 | _8; : # u32Tmp_9 = PHI pBase_13(D)->FLT_ID1 ={v} u32Tmp_9; return; } FlexCAN_SetPNTimeoutValue (struct FLEXCAN_Type * pBase, uint16 u16TimeoutValue) { long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int _4; : _1 ={v} pBase_6(D)->CTRL2_PN; _2 = _1 & 4294901760; _3 = (long unsigned int) u16TimeoutValue_7(D); _4 = _2 | _3; pBase_6(D)->CTRL2_PN ={v} _4; return; } FlexCAN_SetPNFilteringSelection (struct FLEXCAN_Type * pBase, const struct Flexcan_Ip_PnConfigType * pPnConfig) { uint32 u32Tmp; long unsigned int iftmp.23; long unsigned int iftmp.22; _Bool _1; _Bool _2; short unsigned int _3; long unsigned int _4; long unsigned int _5; long unsigned int _6; _7; long unsigned int _8; _9; long unsigned int _10; long unsigned int _11; _12; long unsigned int _13; long unsigned int _14; long unsigned int iftmp.22_15; long unsigned int iftmp.23_16; long unsigned int iftmp.22_22; long unsigned int iftmp.22_23; long unsigned int iftmp.23_25; long unsigned int iftmp.23_26; : u32Tmp_19 ={v} pBase_18(D)->CTRL1_PN; u32Tmp_20 = u32Tmp_19 & 4294705344; _1 = pPnConfig_21(D)->bWakeUpTimeout; if (_1 != 0) goto ; [INV] else goto ; [INV] : iftmp.22_23 = 131072; goto ; [INV] : iftmp.22_22 = 0; : # iftmp.22_15 = PHI u32Tmp_24 = iftmp.22_15 | u32Tmp_20; _2 = pPnConfig_21(D)->bWakeUpMatch; if (_2 != 0) goto ; [INV] else goto ; [INV] : iftmp.23_26 = 65536; goto ; [INV] : iftmp.23_25 = 0; : # iftmp.23_16 = PHI u32Tmp_27 = iftmp.23_16 | u32Tmp_24; _3 = pPnConfig_21(D)->u16NumMatches; _4 = (long unsigned int) _3; _5 = _4 << 8; _6 = _5 & 65535; u32Tmp_28 = u32Tmp_27 | _6; _7 = pPnConfig_21(D)->eFilterComb; _8 = _7 & 3; u32Tmp_29 = u32Tmp_28 | _8; _9 = pPnConfig_21(D)->eIdFilterType; _10 = _9 << 2; _11 = _10 & 12; u32Tmp_30 = u32Tmp_29 | _11; _12 = pPnConfig_21(D)->ePayloadFilterType; _13 = _12 << 4; _14 = _13 & 48; u32Tmp_31 = u32Tmp_30 | _14; pBase_18(D)->CTRL1_PN ={v} u32Tmp_31; return; } FlexCAN_CanBitSampling (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.18; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.18_4; long unsigned int iftmp.18_8; long unsigned int iftmp.18_9; : _1 ={v} base_6(D)->CTRL1; _2 = _1 & 4294967167; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.18_9 = 128; goto ; [INV] : iftmp.18_8 = 0; : # iftmp.18_4 = PHI _3 = iftmp.18_4 | _2; base_6(D)->CTRL1 ={v} _3; return; } FlexCAN_SetEdgeFilter (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.21; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.21_4; long unsigned int iftmp.21_8; long unsigned int iftmp.21_9; : _1 ={v} base_6(D)->CTRL2; _2 = _1 & 4294965247; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.21_9 = 0; goto ; [INV] : iftmp.21_8 = 2048; : # iftmp.21_4 = PHI _3 = iftmp.21_4 | _2; base_6(D)->CTRL2 ={v} _3; return; } FlexCAN_SetBusOffAutorecovery (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.19; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.19_4; long unsigned int iftmp.19_8; long unsigned int iftmp.19_9; : _1 ={v} base_6(D)->CTRL1; _2 = _1 & 4294967231; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.19_9 = 0; goto ; [INV] : iftmp.19_8 = 64; : # iftmp.19_4 = PHI _3 = iftmp.19_4 | _2; base_6(D)->CTRL1 ={v} _3; return; } FlexCAN_SetRemoteReqStore (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.20; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.20_4; long unsigned int iftmp.20_8; long unsigned int iftmp.20_9; : _1 ={v} base_6(D)->CTRL2; _2 = _1 & 4294836223; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.20_9 = 131072; goto ; [INV] : iftmp.20_8 = 0; : # iftmp.20_4 = PHI _3 = iftmp.20_4 | _2; base_6(D)->CTRL2 ={v} _3; return; } FlexCAN_SetProtocolException (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.17; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.17_4; long unsigned int iftmp.17_8; long unsigned int iftmp.17_9; : _1 ={v} base_6(D)->CTRL2; _2 = _1 & 4294950911; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.17_9 = 16384; goto ; [INV] : iftmp.17_8 = 0; : # iftmp.17_4 = PHI _3 = iftmp.17_4 | _2; base_6(D)->CTRL2 ={v} _3; return; } FlexCAN_SetEntireFrameArbitrationFieldComparison (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.16; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.16_4; long unsigned int iftmp.16_8; long unsigned int iftmp.16_9; : _1 ={v} base_6(D)->CTRL2; _2 = _1 & 4294901759; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.16_9 = 65536; goto ; [INV] : iftmp.16_8 = 0; : # iftmp.16_4 = PHI _3 = iftmp.16_4 | _2; base_6(D)->CTRL2 ={v} _3; return; } FlexCAN_SetIsoCan (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.15; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.15_4; long unsigned int iftmp.15_8; long unsigned int iftmp.15_9; : _1 ={v} base_6(D)->CTRL2; _2 = _1 & 4294963199; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.15_9 = 4096; goto ; [INV] : iftmp.15_8 = 0; : # iftmp.15_4 = PHI _3 = iftmp.15_4 | _2; base_6(D)->CTRL2 ={v} _3; return; } FlexCAN_IsFDEnabled (const struct FLEXCAN_Type * base) { boolean D.7487; long unsigned int _1; long unsigned int _2; boolean _5; : _1 ={v} base_4(D)->MCR; _2 = _1 & 2048; _5 = _2 != 0; : : return _5; } FlexCAN_SetSelfReception (struct FLEXCAN_Type * base, boolean enable) { long unsigned int iftmp.11; long unsigned int _1; long unsigned int _2; long unsigned int _3; long unsigned int iftmp.11_4; long unsigned int iftmp.11_8; long unsigned int iftmp.11_9; : _1 ={v} base_6(D)->MCR; _2 = _1 & 4294836223; if (enable_7(D) != 0) goto ; [INV] else goto ; [INV] : iftmp.11_9 = 0; goto ; [INV] : iftmp.11_8 = 131072; : # iftmp.11_4 = PHI _3 = iftmp.11_4 | _2; base_6(D)->MCR ={v} _3; return; } DevAssert (volatile boolean x) { _Bool x.4_1; : x.4_1 ={v} x; if (x.4_1 != 0) goto ; [INV] else goto ; [INV] : goto ; [INV] : return; }