stream_buffer.c.082i.materialize-all-clones 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956
  1. ucStreamBufferGetStreamBufferType (struct StreamBufferDef_t * xStreamBuffer)
  2. {
  3. uint8_t D.6587;
  4. unsigned char _1;
  5. uint8_t _4;
  6. <bb 2> :
  7. _1 = xStreamBuffer_3(D)->ucFlags;
  8. _4 = _1 & 1;
  9. <bb 3> :
  10. <L0>:
  11. return _4;
  12. }
  13. vStreamBufferSetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer, UBaseType_t uxStreamBufferNumber)
  14. {
  15. <bb 2> :
  16. xStreamBuffer_2(D)->uxStreamBufferNumber = uxStreamBufferNumber_3(D);
  17. return;
  18. }
  19. uxStreamBufferGetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer)
  20. {
  21. UBaseType_t D.6585;
  22. UBaseType_t _3;
  23. <bb 2> :
  24. _3 = xStreamBuffer_2(D)->uxStreamBufferNumber;
  25. <bb 3> :
  26. <L0>:
  27. return _3;
  28. }
  29. prvInitialiseNewStreamBuffer (struct StreamBuffer_t * const pxStreamBuffer, uint8_t * const pucBuffer, size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t ucFlags)
  30. {
  31. uint32_t ulNewBASEPRI;
  32. const BaseType_t xWriteValue;
  33. void * _1;
  34. <bb 2> :
  35. xWriteValue_2 = 85;
  36. _1 = memset (pucBuffer_4(D), xWriteValue_2, xBufferSizeBytes_5(D));
  37. if (pucBuffer_4(D) != _1)
  38. goto <bb 3>; [INV]
  39. else
  40. goto <bb 6>; [INV]
  41. <bb 3> :
  42. __asm__ __volatile__(" mov %0, %1
  43. msr basepri, %0
  44. isb
  45. dsb
  46. " : "=r" ulNewBASEPRI_15 : "i" 16 : "memory");
  47. <bb 4> :
  48. <bb 5> :
  49. goto <bb 5>; [INV]
  50. <bb 6> :
  51. memset (pxStreamBuffer_7(D), 0, 36);
  52. pxStreamBuffer_7(D)->pucBuffer = pucBuffer_4(D);
  53. pxStreamBuffer_7(D)->xLength = xBufferSizeBytes_5(D);
  54. pxStreamBuffer_7(D)->xTriggerLevelBytes = xTriggerLevelBytes_11(D);
  55. pxStreamBuffer_7(D)->ucFlags = ucFlags_13(D);
  56. return;
  57. }
  58. prvBytesInBuffer (const struct StreamBuffer_t * const pxStreamBuffer)
  59. {
  60. size_t xCount;
  61. size_t D.6581;
  62. unsigned int D.6577;
  63. unsigned int _1;
  64. unsigned int _2;
  65. unsigned int _3;
  66. unsigned int _4;
  67. unsigned int _9;
  68. size_t _12;
  69. <bb 2> :
  70. _1 = pxStreamBuffer_7(D)->xLength;
  71. _2 ={v} pxStreamBuffer_7(D)->xHead;
  72. xCount_8 = _1 + _2;
  73. _9 ={v} pxStreamBuffer_7(D)->xTail;
  74. xCount_10 = xCount_8 - _9;
  75. _3 = pxStreamBuffer_7(D)->xLength;
  76. if (xCount_10 >= _3)
  77. goto <bb 3>; [INV]
  78. else
  79. goto <bb 4>; [INV]
  80. <bb 3> :
  81. _4 = pxStreamBuffer_7(D)->xLength;
  82. xCount_11 = xCount_10 - _4;
  83. <bb 4> :
  84. # xCount_5 = PHI <xCount_10(2), xCount_11(3)>
  85. _12 = xCount_5;
  86. <bb 5> :
  87. <L3>:
  88. return _12;
  89. }
  90. prvReadBytesFromBuffer (struct StreamBuffer_t * pxStreamBuffer, uint8_t * pucData, size_t xCount, size_t xTail)
  91. {
  92. uint32_t ulNewBASEPRI;
  93. uint32_t ulNewBASEPRI;
  94. uint32_t ulNewBASEPRI;
  95. size_t xFirstLength;
  96. size_t D.6575;
  97. unsigned int _1;
  98. unsigned int _2;
  99. unsigned int _3;
  100. unsigned int _4;
  101. uint8_t * _5;
  102. uint8_t * _6;
  103. uint8_t * _7;
  104. uint8_t * _8;
  105. unsigned int _9;
  106. unsigned int _10;
  107. unsigned int _11;
  108. size_t _24;
  109. <bb 2> :
  110. if (xCount_14(D) == 0)
  111. goto <bb 3>; [INV]
  112. else
  113. goto <bb 6>; [INV]
  114. <bb 3> :
  115. __asm__ __volatile__(" mov %0, %1
  116. msr basepri, %0
  117. isb
  118. dsb
  119. " : "=r" ulNewBASEPRI_25 : "i" 16 : "memory");
  120. <bb 4> :
  121. <bb 5> :
  122. goto <bb 5>; [INV]
  123. <bb 6> :
  124. _1 = pxStreamBuffer_16(D)->xLength;
  125. _2 = _1 - xTail_17(D);
  126. xFirstLength_18 = MIN_EXPR <xCount_14(D), _2>;
  127. if (xFirstLength_18 > xCount_14(D))
  128. goto <bb 7>; [INV]
  129. else
  130. goto <bb 10>; [INV]
  131. <bb 7> :
  132. __asm__ __volatile__(" mov %0, %1
  133. msr basepri, %0
  134. isb
  135. dsb
  136. " : "=r" ulNewBASEPRI_26 : "i" 16 : "memory");
  137. <bb 8> :
  138. <bb 9> :
  139. goto <bb 9>; [INV]
  140. <bb 10> :
  141. _3 = xTail_17(D) + xFirstLength_18;
  142. _4 = pxStreamBuffer_16(D)->xLength;
  143. if (_3 > _4)
  144. goto <bb 11>; [INV]
  145. else
  146. goto <bb 14>; [INV]
  147. <bb 11> :
  148. __asm__ __volatile__(" mov %0, %1
  149. msr basepri, %0
  150. isb
  151. dsb
  152. " : "=r" ulNewBASEPRI_27 : "i" 16 : "memory");
  153. <bb 12> :
  154. <bb 13> :
  155. goto <bb 13>; [INV]
  156. <bb 14> :
  157. _5 = pxStreamBuffer_16(D)->pucBuffer;
  158. _6 = _5 + xTail_17(D);
  159. memcpy (pucData_19(D), _6, xFirstLength_18);
  160. if (xCount_14(D) > xFirstLength_18)
  161. goto <bb 15>; [INV]
  162. else
  163. goto <bb 16>; [INV]
  164. <bb 15> :
  165. _7 = pucData_19(D) + xFirstLength_18;
  166. _8 = pxStreamBuffer_16(D)->pucBuffer;
  167. _9 = xCount_14(D) - xFirstLength_18;
  168. memcpy (_7, _8, _9);
  169. <bb 16> :
  170. xTail_22 = xTail_17(D) + xCount_14(D);
  171. _10 = pxStreamBuffer_16(D)->xLength;
  172. if (xTail_22 >= _10)
  173. goto <bb 17>; [INV]
  174. else
  175. goto <bb 18>; [INV]
  176. <bb 17> :
  177. _11 = pxStreamBuffer_16(D)->xLength;
  178. xTail_23 = xTail_22 - _11;
  179. <bb 18> :
  180. # xTail_12 = PHI <xTail_22(16), xTail_23(17)>
  181. _24 = xTail_12;
  182. <bb 19> :
  183. <L14>:
  184. return _24;
  185. }
  186. prvWriteBytesToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const uint8_t * pucData, size_t xCount, size_t xHead)
  187. {
  188. uint32_t ulNewBASEPRI;
  189. uint32_t ulNewBASEPRI;
  190. uint32_t ulNewBASEPRI;
  191. size_t xFirstLength;
  192. size_t D.6562;
  193. unsigned int _1;
  194. unsigned int _2;
  195. unsigned int _3;
  196. unsigned int _4;
  197. uint8_t * _5;
  198. uint8_t * _6;
  199. unsigned int _7;
  200. unsigned int _8;
  201. uint8_t * _9;
  202. const uint8_t * _10;
  203. unsigned int _11;
  204. unsigned int _12;
  205. unsigned int _13;
  206. size_t _26;
  207. <bb 2> :
  208. if (xCount_16(D) == 0)
  209. goto <bb 3>; [INV]
  210. else
  211. goto <bb 6>; [INV]
  212. <bb 3> :
  213. __asm__ __volatile__(" mov %0, %1
  214. msr basepri, %0
  215. isb
  216. dsb
  217. " : "=r" ulNewBASEPRI_27 : "i" 16 : "memory");
  218. <bb 4> :
  219. <bb 5> :
  220. goto <bb 5>; [INV]
  221. <bb 6> :
  222. _1 = pxStreamBuffer_18(D)->xLength;
  223. _2 = _1 - xHead_19(D);
  224. xFirstLength_20 = MIN_EXPR <xCount_16(D), _2>;
  225. _3 = xHead_19(D) + xFirstLength_20;
  226. _4 = pxStreamBuffer_18(D)->xLength;
  227. if (_3 > _4)
  228. goto <bb 7>; [INV]
  229. else
  230. goto <bb 10>; [INV]
  231. <bb 7> :
  232. __asm__ __volatile__(" mov %0, %1
  233. msr basepri, %0
  234. isb
  235. dsb
  236. " : "=r" ulNewBASEPRI_28 : "i" 16 : "memory");
  237. <bb 8> :
  238. <bb 9> :
  239. goto <bb 9>; [INV]
  240. <bb 10> :
  241. _5 = pxStreamBuffer_18(D)->pucBuffer;
  242. _6 = _5 + xHead_19(D);
  243. memcpy (_6, pucData_21(D), xFirstLength_20);
  244. if (xCount_16(D) > xFirstLength_20)
  245. goto <bb 11>; [INV]
  246. else
  247. goto <bb 16>; [INV]
  248. <bb 11> :
  249. _7 = xCount_16(D) - xFirstLength_20;
  250. _8 = pxStreamBuffer_18(D)->xLength;
  251. if (_7 > _8)
  252. goto <bb 12>; [INV]
  253. else
  254. goto <bb 15>; [INV]
  255. <bb 12> :
  256. __asm__ __volatile__(" mov %0, %1
  257. msr basepri, %0
  258. isb
  259. dsb
  260. " : "=r" ulNewBASEPRI_29 : "i" 16 : "memory");
  261. <bb 13> :
  262. <bb 14> :
  263. goto <bb 14>; [INV]
  264. <bb 15> :
  265. _9 = pxStreamBuffer_18(D)->pucBuffer;
  266. _10 = pucData_21(D) + xFirstLength_20;
  267. _11 = xCount_16(D) - xFirstLength_20;
  268. memcpy (_9, _10, _11);
  269. <bb 16> :
  270. xHead_24 = xHead_19(D) + xCount_16(D);
  271. _12 = pxStreamBuffer_18(D)->xLength;
  272. if (xHead_24 >= _12)
  273. goto <bb 17>; [INV]
  274. else
  275. goto <bb 18>; [INV]
  276. <bb 17> :
  277. _13 = pxStreamBuffer_18(D)->xLength;
  278. xHead_25 = xHead_24 - _13;
  279. <bb 18> :
  280. # xHead_14 = PHI <xHead_24(16), xHead_25(17)>
  281. _26 = xHead_14;
  282. <bb 19> :
  283. <L15>:
  284. return _26;
  285. }
  286. xStreamBufferReceiveCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  287. {
  288. uint32_t ulNewMaskValue;
  289. uint32_t D.6632;
  290. uint32_t ulOriginalBASEPRI;
  291. uint32_t ulNewBASEPRI;
  292. uint32_t D.6631;
  293. uint32_t ulNewBASEPRI;
  294. UBaseType_t uxSavedInterruptStatus;
  295. BaseType_t xReturn;
  296. struct StreamBuffer_t * const pxStreamBuffer;
  297. BaseType_t D.6548;
  298. struct tskTaskControlBlock * _1;
  299. struct tskTaskControlBlock * _2;
  300. BaseType_t _14;
  301. long unsigned int _18;
  302. <bb 2> :
  303. pxStreamBuffer_6 = xStreamBuffer_5(D);
  304. if (pxStreamBuffer_6 == 0B)
  305. goto <bb 3>; [INV]
  306. else
  307. goto <bb 6>; [INV]
  308. <bb 3> :
  309. __asm__ __volatile__(" mov %0, %1
  310. msr basepri, %0
  311. isb
  312. dsb
  313. " : "=r" ulNewBASEPRI_15 : "i" 16 : "memory");
  314. <bb 4> :
  315. <bb 5> :
  316. goto <bb 5>; [INV]
  317. <bb 6> :
  318. __asm__ __volatile__(" mrs %0, basepri
  319. mov %1, %2
  320. msr basepri, %1
  321. isb
  322. dsb
  323. " : "=r" ulOriginalBASEPRI_16, "=r" ulNewBASEPRI_17 : "i" 16 : "memory");
  324. _18 = ulOriginalBASEPRI_16;
  325. <bb 7> :
  326. <L7>:
  327. _21 = _18;
  328. <bb 8> :
  329. uxSavedInterruptStatus_8 = _21;
  330. _1 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
  331. if (_1 != 0B)
  332. goto <bb 9>; [INV]
  333. else
  334. goto <bb 10>; [INV]
  335. <bb 9> :
  336. _2 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
  337. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_10(D));
  338. pxStreamBuffer_6->xTaskWaitingToSend ={v} 0B;
  339. xReturn_13 = 1;
  340. goto <bb 11>; [INV]
  341. <bb 10> :
  342. xReturn_9 = 0;
  343. <bb 11> :
  344. # xReturn_3 = PHI <xReturn_13(9), xReturn_9(10)>
  345. ulNewMaskValue_19 = uxSavedInterruptStatus_8;
  346. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_19 : "memory");
  347. <bb 12> :
  348. _14 = xReturn_3;
  349. <bb 13> :
  350. <L6>:
  351. return _14;
  352. }
  353. xStreamBufferSendCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  354. {
  355. uint32_t ulNewMaskValue;
  356. uint32_t D.6625;
  357. uint32_t ulOriginalBASEPRI;
  358. uint32_t ulNewBASEPRI;
  359. uint32_t D.6624;
  360. uint32_t ulNewBASEPRI;
  361. UBaseType_t uxSavedInterruptStatus;
  362. BaseType_t xReturn;
  363. struct StreamBuffer_t * const pxStreamBuffer;
  364. BaseType_t D.6541;
  365. struct tskTaskControlBlock * _1;
  366. struct tskTaskControlBlock * _2;
  367. BaseType_t _14;
  368. long unsigned int _18;
  369. <bb 2> :
  370. pxStreamBuffer_6 = xStreamBuffer_5(D);
  371. if (pxStreamBuffer_6 == 0B)
  372. goto <bb 3>; [INV]
  373. else
  374. goto <bb 6>; [INV]
  375. <bb 3> :
  376. __asm__ __volatile__(" mov %0, %1
  377. msr basepri, %0
  378. isb
  379. dsb
  380. " : "=r" ulNewBASEPRI_15 : "i" 16 : "memory");
  381. <bb 4> :
  382. <bb 5> :
  383. goto <bb 5>; [INV]
  384. <bb 6> :
  385. __asm__ __volatile__(" mrs %0, basepri
  386. mov %1, %2
  387. msr basepri, %1
  388. isb
  389. dsb
  390. " : "=r" ulOriginalBASEPRI_16, "=r" ulNewBASEPRI_17 : "i" 16 : "memory");
  391. _18 = ulOriginalBASEPRI_16;
  392. <bb 7> :
  393. <L7>:
  394. _21 = _18;
  395. <bb 8> :
  396. uxSavedInterruptStatus_8 = _21;
  397. _1 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
  398. if (_1 != 0B)
  399. goto <bb 9>; [INV]
  400. else
  401. goto <bb 10>; [INV]
  402. <bb 9> :
  403. _2 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
  404. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_10(D));
  405. pxStreamBuffer_6->xTaskWaitingToReceive ={v} 0B;
  406. xReturn_13 = 1;
  407. goto <bb 11>; [INV]
  408. <bb 10> :
  409. xReturn_9 = 0;
  410. <bb 11> :
  411. # xReturn_3 = PHI <xReturn_13(9), xReturn_9(10)>
  412. ulNewMaskValue_19 = uxSavedInterruptStatus_8;
  413. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_19 : "memory");
  414. <bb 12> :
  415. _14 = xReturn_3;
  416. <bb 13> :
  417. <L6>:
  418. return _14;
  419. }
  420. xStreamBufferIsFull (struct StreamBufferDef_t * xStreamBuffer)
  421. {
  422. uint32_t ulNewBASEPRI;
  423. const struct StreamBuffer_t * const pxStreamBuffer;
  424. size_t xBytesToStoreMessageLength;
  425. BaseType_t xReturn;
  426. BaseType_t D.6534;
  427. unsigned char _1;
  428. int _2;
  429. int _3;
  430. unsigned int _4;
  431. BaseType_t _15;
  432. <bb 2> :
  433. pxStreamBuffer_8 = xStreamBuffer_7(D);
  434. if (pxStreamBuffer_8 == 0B)
  435. goto <bb 3>; [INV]
  436. else
  437. goto <bb 6>; [INV]
  438. <bb 3> :
  439. __asm__ __volatile__(" mov %0, %1
  440. msr basepri, %0
  441. isb
  442. dsb
  443. " : "=r" ulNewBASEPRI_16 : "i" 16 : "memory");
  444. <bb 4> :
  445. <bb 5> :
  446. goto <bb 5>; [INV]
  447. <bb 6> :
  448. _1 = pxStreamBuffer_8->ucFlags;
  449. _2 = (int) _1;
  450. _3 = _2 & 1;
  451. if (_3 != 0)
  452. goto <bb 7>; [INV]
  453. else
  454. goto <bb 8>; [INV]
  455. <bb 7> :
  456. xBytesToStoreMessageLength_11 = 4;
  457. goto <bb 9>; [INV]
  458. <bb 8> :
  459. xBytesToStoreMessageLength_10 = 0;
  460. <bb 9> :
  461. # xBytesToStoreMessageLength_6 = PHI <xBytesToStoreMessageLength_11(7), xBytesToStoreMessageLength_10(8)>
  462. _4 = xStreamBufferSpacesAvailable (xStreamBuffer_7(D));
  463. if (xBytesToStoreMessageLength_6 >= _4)
  464. goto <bb 10>; [INV]
  465. else
  466. goto <bb 11>; [INV]
  467. <bb 10> :
  468. xReturn_14 = 1;
  469. goto <bb 12>; [INV]
  470. <bb 11> :
  471. xReturn_13 = 0;
  472. <bb 12> :
  473. # xReturn_5 = PHI <xReturn_14(10), xReturn_13(11)>
  474. _15 = xReturn_5;
  475. <bb 13> :
  476. <L9>:
  477. return _15;
  478. }
  479. xStreamBufferIsEmpty (struct StreamBufferDef_t * xStreamBuffer)
  480. {
  481. uint32_t ulNewBASEPRI;
  482. size_t xTail;
  483. BaseType_t xReturn;
  484. const struct StreamBuffer_t * const pxStreamBuffer;
  485. BaseType_t D.6524;
  486. unsigned int _1;
  487. BaseType_t _9;
  488. <bb 2> :
  489. pxStreamBuffer_4 = xStreamBuffer_3(D);
  490. if (pxStreamBuffer_4 == 0B)
  491. goto <bb 3>; [INV]
  492. else
  493. goto <bb 6>; [INV]
  494. <bb 3> :
  495. __asm__ __volatile__(" mov %0, %1
  496. msr basepri, %0
  497. isb
  498. dsb
  499. " : "=r" ulNewBASEPRI_10 : "i" 16 : "memory");
  500. <bb 4> :
  501. <bb 5> :
  502. goto <bb 5>; [INV]
  503. <bb 6> :
  504. xTail_6 ={v} pxStreamBuffer_4->xTail;
  505. _1 ={v} pxStreamBuffer_4->xHead;
  506. if (xTail_6 == _1)
  507. goto <bb 7>; [INV]
  508. else
  509. goto <bb 8>; [INV]
  510. <bb 7> :
  511. xReturn_8 = 1;
  512. goto <bb 9>; [INV]
  513. <bb 8> :
  514. xReturn_7 = 0;
  515. <bb 9> :
  516. # xReturn_2 = PHI <xReturn_8(7), xReturn_7(8)>
  517. _9 = xReturn_2;
  518. <bb 10> :
  519. <L6>:
  520. return _9;
  521. }
  522. prvReadMessageFromBuffer (struct StreamBuffer_t * pxStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, size_t xBytesAvailable)
  523. {
  524. size_t xNextTail;
  525. size_t xTempNextMessageLength;
  526. size_t xNextMessageLength;
  527. size_t xCount;
  528. size_t D.6516;
  529. unsigned char _1;
  530. int _2;
  531. int _3;
  532. unsigned int _4;
  533. size_t _25;
  534. <bb 2> :
  535. xNextTail_12 ={v} pxStreamBuffer_11(D)->xTail;
  536. _1 = pxStreamBuffer_11(D)->ucFlags;
  537. _2 = (int) _1;
  538. _3 = _2 & 1;
  539. if (_3 != 0)
  540. goto <bb 3>; [INV]
  541. else
  542. goto <bb 5>; [INV]
  543. <bb 3> :
  544. xNextTail_17 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), &xTempNextMessageLength, 4, xNextTail_12);
  545. xNextMessageLength_18 = xTempNextMessageLength;
  546. xBytesAvailable_19 = xBytesAvailable_15(D) + 4294967292;
  547. if (xNextMessageLength_18 > xBufferLengthBytes_13(D))
  548. goto <bb 4>; [INV]
  549. else
  550. goto <bb 6>; [INV]
  551. <bb 4> :
  552. xNextMessageLength_20 = 0;
  553. goto <bb 6>; [INV]
  554. <bb 5> :
  555. xNextMessageLength_14 = xBufferLengthBytes_13(D);
  556. <bb 6> :
  557. # xBytesAvailable_5 = PHI <xBytesAvailable_19(4), xBytesAvailable_15(D)(5), xBytesAvailable_19(3)>
  558. # xNextMessageLength_6 = PHI <xNextMessageLength_20(4), xNextMessageLength_14(5), xNextMessageLength_18(3)>
  559. # xNextTail_7 = PHI <xNextTail_17(4), xNextTail_12(5), xNextTail_17(3)>
  560. xCount_21 = MIN_EXPR <xBytesAvailable_5, xNextMessageLength_6>;
  561. if (xCount_21 != 0)
  562. goto <bb 7>; [INV]
  563. else
  564. goto <bb 8>; [INV]
  565. <bb 7> :
  566. _4 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), pvRxData_22(D), xCount_21, xNextTail_7);
  567. pxStreamBuffer_11(D)->xTail ={v} _4;
  568. <bb 8> :
  569. _25 = xCount_21;
  570. xTempNextMessageLength ={v} {CLOBBER};
  571. <bb 9> :
  572. <L9>:
  573. return _25;
  574. }
  575. xStreamBufferReceiveFromISR (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  576. {
  577. uint32_t ulNewMaskValue;
  578. uint32_t D.6664;
  579. uint32_t ulOriginalBASEPRI;
  580. uint32_t ulNewBASEPRI;
  581. uint32_t D.6663;
  582. uint32_t ulNewBASEPRI;
  583. uint32_t ulNewBASEPRI;
  584. UBaseType_t uxSavedInterruptStatus;
  585. size_t xBytesToStoreMessageLength;
  586. size_t xBytesAvailable;
  587. size_t xReceivedLength;
  588. struct StreamBuffer_t * const pxStreamBuffer;
  589. size_t D.6506;
  590. unsigned char _1;
  591. int _2;
  592. int _3;
  593. struct tskTaskControlBlock * _4;
  594. struct tskTaskControlBlock * _5;
  595. size_t _26;
  596. long unsigned int _31;
  597. <bb 2> :
  598. pxStreamBuffer_11 = xStreamBuffer_10(D);
  599. xReceivedLength_12 = 0;
  600. if (pvRxData_13(D) == 0B)
  601. goto <bb 3>; [INV]
  602. else
  603. goto <bb 6>; [INV]
  604. <bb 3> :
  605. __asm__ __volatile__(" mov %0, %1
  606. msr basepri, %0
  607. isb
  608. dsb
  609. " : "=r" ulNewBASEPRI_27 : "i" 16 : "memory");
  610. <bb 4> :
  611. <bb 5> :
  612. goto <bb 5>; [INV]
  613. <bb 6> :
  614. if (pxStreamBuffer_11 == 0B)
  615. goto <bb 7>; [INV]
  616. else
  617. goto <bb 10>; [INV]
  618. <bb 7> :
  619. __asm__ __volatile__(" mov %0, %1
  620. msr basepri, %0
  621. isb
  622. dsb
  623. " : "=r" ulNewBASEPRI_28 : "i" 16 : "memory");
  624. <bb 8> :
  625. <bb 9> :
  626. goto <bb 9>; [INV]
  627. <bb 10> :
  628. _1 = pxStreamBuffer_11->ucFlags;
  629. _2 = (int) _1;
  630. _3 = _2 & 1;
  631. if (_3 != 0)
  632. goto <bb 11>; [INV]
  633. else
  634. goto <bb 12>; [INV]
  635. <bb 11> :
  636. xBytesToStoreMessageLength_16 = 4;
  637. goto <bb 13>; [INV]
  638. <bb 12> :
  639. xBytesToStoreMessageLength_15 = 0;
  640. <bb 13> :
  641. # xBytesToStoreMessageLength_7 = PHI <xBytesToStoreMessageLength_16(11), xBytesToStoreMessageLength_15(12)>
  642. xBytesAvailable_18 = prvBytesInBuffer (pxStreamBuffer_11);
  643. if (xBytesAvailable_18 > xBytesToStoreMessageLength_7)
  644. goto <bb 14>; [INV]
  645. else
  646. goto <bb 21>; [INV]
  647. <bb 14> :
  648. xReceivedLength_21 = prvReadMessageFromBuffer (pxStreamBuffer_11, pvRxData_13(D), xBufferLengthBytes_19(D), xBytesAvailable_18);
  649. if (xReceivedLength_21 != 0)
  650. goto <bb 15>; [INV]
  651. else
  652. goto <bb 21>; [INV]
  653. <bb 15> :
  654. __asm__ __volatile__(" mrs %0, basepri
  655. mov %1, %2
  656. msr basepri, %1
  657. isb
  658. dsb
  659. " : "=r" ulOriginalBASEPRI_29, "=r" ulNewBASEPRI_30 : "i" 16 : "memory");
  660. _31 = ulOriginalBASEPRI_29;
  661. <bb 16> :
  662. <L18>:
  663. _34 = _31;
  664. <bb 17> :
  665. uxSavedInterruptStatus_22 = _34;
  666. _4 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
  667. if (_4 != 0B)
  668. goto <bb 18>; [INV]
  669. else
  670. goto <bb 19>; [INV]
  671. <bb 18> :
  672. _5 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
  673. xTaskGenericNotifyFromISR (_5, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_23(D));
  674. pxStreamBuffer_11->xTaskWaitingToSend ={v} 0B;
  675. <bb 19> :
  676. ulNewMaskValue_32 = uxSavedInterruptStatus_22;
  677. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_32 : "memory");
  678. <bb 20> :
  679. <bb 21> :
  680. # xReceivedLength_6 = PHI <xReceivedLength_12(13), xReceivedLength_21(20), xReceivedLength_21(14)>
  681. _26 = xReceivedLength_6;
  682. <bb 22> :
  683. <L17>:
  684. return _26;
  685. }
  686. xStreamBufferNextMessageLengthBytes (struct StreamBufferDef_t * xStreamBuffer)
  687. {
  688. uint32_t ulNewBASEPRI;
  689. uint32_t ulNewBASEPRI;
  690. size_t xTempReturn;
  691. size_t xBytesAvailable;
  692. size_t xReturn;
  693. struct StreamBuffer_t * const pxStreamBuffer;
  694. size_t D.6488;
  695. unsigned char _1;
  696. int _2;
  697. int _3;
  698. unsigned int _4;
  699. size_t _16;
  700. <bb 2> :
  701. pxStreamBuffer_8 = xStreamBuffer_7(D);
  702. if (pxStreamBuffer_8 == 0B)
  703. goto <bb 3>; [INV]
  704. else
  705. goto <bb 6>; [INV]
  706. <bb 3> :
  707. __asm__ __volatile__(" mov %0, %1
  708. msr basepri, %0
  709. isb
  710. dsb
  711. " : "=r" ulNewBASEPRI_18 : "i" 16 : "memory");
  712. <bb 4> :
  713. <bb 5> :
  714. goto <bb 5>; [INV]
  715. <bb 6> :
  716. _1 = pxStreamBuffer_8->ucFlags;
  717. _2 = (int) _1;
  718. _3 = _2 & 1;
  719. if (_3 != 0)
  720. goto <bb 7>; [INV]
  721. else
  722. goto <bb 14>; [INV]
  723. <bb 7> :
  724. xBytesAvailable_12 = prvBytesInBuffer (pxStreamBuffer_8);
  725. if (xBytesAvailable_12 > 4)
  726. goto <bb 8>; [INV]
  727. else
  728. goto <bb 9>; [INV]
  729. <bb 8> :
  730. _4 ={v} pxStreamBuffer_8->xTail;
  731. prvReadBytesFromBuffer (pxStreamBuffer_8, &xTempReturn, 4, _4);
  732. xReturn_15 = xTempReturn;
  733. goto <bb 15>; [INV]
  734. <bb 9> :
  735. if (xBytesAvailable_12 != 0)
  736. goto <bb 10>; [INV]
  737. else
  738. goto <bb 13>; [INV]
  739. <bb 10> :
  740. __asm__ __volatile__(" mov %0, %1
  741. msr basepri, %0
  742. isb
  743. dsb
  744. " : "=r" ulNewBASEPRI_19 : "i" 16 : "memory");
  745. <bb 11> :
  746. <bb 12> :
  747. goto <bb 12>; [INV]
  748. <bb 13> :
  749. xReturn_13 = 0;
  750. goto <bb 15>; [INV]
  751. <bb 14> :
  752. xReturn_10 = 0;
  753. <bb 15> :
  754. # xReturn_5 = PHI <xReturn_13(13), xReturn_10(14), xReturn_15(8)>
  755. _16 = xReturn_5;
  756. xTempReturn ={v} {CLOBBER};
  757. <bb 16> :
  758. <L13>:
  759. return _16;
  760. }
  761. xStreamBufferReceive (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
  762. {
  763. uint32_t ulNewBASEPRI;
  764. uint32_t ulNewBASEPRI;
  765. uint32_t ulNewBASEPRI;
  766. size_t xBytesToStoreMessageLength;
  767. size_t xBytesAvailable;
  768. size_t xReceivedLength;
  769. struct StreamBuffer_t * const pxStreamBuffer;
  770. size_t D.6476;
  771. unsigned char _1;
  772. int _2;
  773. int _3;
  774. struct tskTaskControlBlock * _4;
  775. struct tskTaskControlBlock * _5;
  776. struct tskTaskControlBlock * _6;
  777. struct tskTaskControlBlock * _7;
  778. size_t _43;
  779. <bb 2> :
  780. pxStreamBuffer_16 = xStreamBuffer_15(D);
  781. xReceivedLength_17 = 0;
  782. if (pvRxData_18(D) == 0B)
  783. goto <bb 3>; [INV]
  784. else
  785. goto <bb 6>; [INV]
  786. <bb 3> :
  787. __asm__ __volatile__(" mov %0, %1
  788. msr basepri, %0
  789. isb
  790. dsb
  791. " : "=r" ulNewBASEPRI_44 : "i" 16 : "memory");
  792. <bb 4> :
  793. <bb 5> :
  794. goto <bb 5>; [INV]
  795. <bb 6> :
  796. if (pxStreamBuffer_16 == 0B)
  797. goto <bb 7>; [INV]
  798. else
  799. goto <bb 10>; [INV]
  800. <bb 7> :
  801. __asm__ __volatile__(" mov %0, %1
  802. msr basepri, %0
  803. isb
  804. dsb
  805. " : "=r" ulNewBASEPRI_45 : "i" 16 : "memory");
  806. <bb 8> :
  807. <bb 9> :
  808. goto <bb 9>; [INV]
  809. <bb 10> :
  810. _1 = pxStreamBuffer_16->ucFlags;
  811. _2 = (int) _1;
  812. _3 = _2 & 1;
  813. if (_3 != 0)
  814. goto <bb 11>; [INV]
  815. else
  816. goto <bb 12>; [INV]
  817. <bb 11> :
  818. xBytesToStoreMessageLength_21 = 4;
  819. goto <bb 13>; [INV]
  820. <bb 12> :
  821. xBytesToStoreMessageLength_20 = 0;
  822. <bb 13> :
  823. # xBytesToStoreMessageLength_10 = PHI <xBytesToStoreMessageLength_21(11), xBytesToStoreMessageLength_20(12)>
  824. if (xTicksToWait_22(D) != 0)
  825. goto <bb 14>; [INV]
  826. else
  827. goto <bb 22>; [INV]
  828. <bb 14> :
  829. vPortEnterCritical ();
  830. xBytesAvailable_27 = prvBytesInBuffer (pxStreamBuffer_16);
  831. if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
  832. goto <bb 15>; [INV]
  833. else
  834. goto <bb 20>; [INV]
  835. <bb 15> :
  836. xTaskGenericNotifyStateClear (0B, 0);
  837. _4 ={v} pxStreamBuffer_16->xTaskWaitingToReceive;
  838. if (_4 != 0B)
  839. goto <bb 16>; [INV]
  840. else
  841. goto <bb 19>; [INV]
  842. <bb 16> :
  843. __asm__ __volatile__(" mov %0, %1
  844. msr basepri, %0
  845. isb
  846. dsb
  847. " : "=r" ulNewBASEPRI_46 : "i" 16 : "memory");
  848. <bb 17> :
  849. <bb 18> :
  850. goto <bb 18>; [INV]
  851. <bb 19> :
  852. _5 = xTaskGetCurrentTaskHandle ();
  853. pxStreamBuffer_16->xTaskWaitingToReceive ={v} _5;
  854. <bb 20> :
  855. vPortExitCritical ();
  856. if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
  857. goto <bb 21>; [INV]
  858. else
  859. goto <bb 23>; [INV]
  860. <bb 21> :
  861. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait_22(D));
  862. pxStreamBuffer_16->xTaskWaitingToReceive ={v} 0B;
  863. xBytesAvailable_35 = prvBytesInBuffer (pxStreamBuffer_16);
  864. goto <bb 23>; [INV]
  865. <bb 22> :
  866. xBytesAvailable_24 = prvBytesInBuffer (pxStreamBuffer_16);
  867. <bb 23> :
  868. # xBytesAvailable_9 = PHI <xBytesAvailable_35(21), xBytesAvailable_24(22), xBytesAvailable_27(20)>
  869. if (xBytesAvailable_9 > xBytesToStoreMessageLength_10)
  870. goto <bb 24>; [INV]
  871. else
  872. goto <bb 28>; [INV]
  873. <bb 24> :
  874. xReceivedLength_38 = prvReadMessageFromBuffer (pxStreamBuffer_16, pvRxData_18(D), xBufferLengthBytes_36(D), xBytesAvailable_9);
  875. if (xReceivedLength_38 != 0)
  876. goto <bb 25>; [INV]
  877. else
  878. goto <bb 28>; [INV]
  879. <bb 25> :
  880. vTaskSuspendAll ();
  881. _6 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
  882. if (_6 != 0B)
  883. goto <bb 26>; [INV]
  884. else
  885. goto <bb 27>; [INV]
  886. <bb 26> :
  887. _7 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
  888. xTaskGenericNotify (_7, 0, 0, 0, 0B);
  889. pxStreamBuffer_16->xTaskWaitingToSend ={v} 0B;
  890. <bb 27> :
  891. xTaskResumeAll ();
  892. <bb 28> :
  893. # xReceivedLength_8 = PHI <xReceivedLength_17(23), xReceivedLength_38(27), xReceivedLength_38(24)>
  894. _43 = xReceivedLength_8;
  895. <bb 29> :
  896. <L29>:
  897. return _43;
  898. }
  899. prvWriteMessageToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, size_t xSpace, size_t xRequiredSpace)
  900. {
  901. size_t xNextHead;
  902. size_t D.6448;
  903. unsigned char _1;
  904. int _2;
  905. int _3;
  906. unsigned int xDataLengthBytes.2_4;
  907. unsigned int _5;
  908. unsigned int xDataLengthBytes.3_6;
  909. unsigned int xDataLengthBytes.4_7;
  910. unsigned int _8;
  911. size_t _24;
  912. <bb 2> :
  913. xNextHead_14 ={v} pxStreamBuffer_13(D)->xHead;
  914. _1 = pxStreamBuffer_13(D)->ucFlags;
  915. _2 = (int) _1;
  916. _3 = _2 & 1;
  917. if (_3 != 0)
  918. goto <bb 3>; [INV]
  919. else
  920. goto <bb 6>; [INV]
  921. <bb 3> :
  922. if (xSpace_15(D) >= xRequiredSpace_17(D))
  923. goto <bb 4>; [INV]
  924. else
  925. goto <bb 5>; [INV]
  926. <bb 4> :
  927. xNextHead_20 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), &xDataLengthBytes, 4, xNextHead_14);
  928. goto <bb 7>; [INV]
  929. <bb 5> :
  930. xDataLengthBytes = 0;
  931. goto <bb 7>; [INV]
  932. <bb 6> :
  933. xDataLengthBytes.2_4 = xDataLengthBytes;
  934. _5 = MIN_EXPR <xSpace_15(D), xDataLengthBytes.2_4>;
  935. xDataLengthBytes = _5;
  936. <bb 7> :
  937. # xNextHead_9 = PHI <xNextHead_14(5), xNextHead_14(6), xNextHead_20(4)>
  938. xDataLengthBytes.3_6 = xDataLengthBytes;
  939. if (xDataLengthBytes.3_6 != 0)
  940. goto <bb 8>; [INV]
  941. else
  942. goto <bb 9>; [INV]
  943. <bb 8> :
  944. xDataLengthBytes.4_7 = xDataLengthBytes;
  945. _8 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), pvTxData_21(D), xDataLengthBytes.4_7, xNextHead_9);
  946. pxStreamBuffer_13(D)->xHead ={v} _8;
  947. <bb 9> :
  948. _24 = xDataLengthBytes;
  949. <bb 10> :
  950. <L8>:
  951. return _24;
  952. }
  953. xStreamBufferSendFromISR (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  954. {
  955. uint32_t ulNewMaskValue;
  956. uint32_t D.6651;
  957. uint32_t ulOriginalBASEPRI;
  958. uint32_t ulNewBASEPRI;
  959. uint32_t D.6650;
  960. uint32_t ulNewBASEPRI;
  961. uint32_t ulNewBASEPRI;
  962. UBaseType_t uxSavedInterruptStatus;
  963. size_t xRequiredSpace;
  964. size_t xSpace;
  965. size_t xReturn;
  966. struct StreamBuffer_t * const pxStreamBuffer;
  967. size_t D.6436;
  968. unsigned char _1;
  969. int _2;
  970. int _3;
  971. unsigned int _4;
  972. unsigned int _5;
  973. struct tskTaskControlBlock * _6;
  974. struct tskTaskControlBlock * _7;
  975. size_t _27;
  976. long unsigned int _32;
  977. <bb 2> :
  978. pxStreamBuffer_12 = xStreamBuffer_11(D);
  979. xRequiredSpace_14 = xDataLengthBytes_13(D);
  980. if (pvTxData_15(D) == 0B)
  981. goto <bb 3>; [INV]
  982. else
  983. goto <bb 6>; [INV]
  984. <bb 3> :
  985. __asm__ __volatile__(" mov %0, %1
  986. msr basepri, %0
  987. isb
  988. dsb
  989. " : "=r" ulNewBASEPRI_28 : "i" 16 : "memory");
  990. <bb 4> :
  991. <bb 5> :
  992. goto <bb 5>; [INV]
  993. <bb 6> :
  994. if (pxStreamBuffer_12 == 0B)
  995. goto <bb 7>; [INV]
  996. else
  997. goto <bb 10>; [INV]
  998. <bb 7> :
  999. __asm__ __volatile__(" mov %0, %1
  1000. msr basepri, %0
  1001. isb
  1002. dsb
  1003. " : "=r" ulNewBASEPRI_29 : "i" 16 : "memory");
  1004. <bb 8> :
  1005. <bb 9> :
  1006. goto <bb 9>; [INV]
  1007. <bb 10> :
  1008. _1 = pxStreamBuffer_12->ucFlags;
  1009. _2 = (int) _1;
  1010. _3 = _2 & 1;
  1011. if (_3 != 0)
  1012. goto <bb 11>; [INV]
  1013. else
  1014. goto <bb 12>; [INV]
  1015. <bb 11> :
  1016. xRequiredSpace_17 = xRequiredSpace_14 + 4;
  1017. <bb 12> :
  1018. # xRequiredSpace_8 = PHI <xRequiredSpace_14(10), xRequiredSpace_17(11)>
  1019. xSpace_19 = xStreamBufferSpacesAvailable (pxStreamBuffer_12);
  1020. xReturn_21 = prvWriteMessageToBuffer (pxStreamBuffer_12, pvTxData_15(D), xDataLengthBytes_13(D), xSpace_19, xRequiredSpace_8);
  1021. if (xReturn_21 != 0)
  1022. goto <bb 13>; [INV]
  1023. else
  1024. goto <bb 20>; [INV]
  1025. <bb 13> :
  1026. _4 = prvBytesInBuffer (pxStreamBuffer_12);
  1027. _5 = pxStreamBuffer_12->xTriggerLevelBytes;
  1028. if (_4 >= _5)
  1029. goto <bb 14>; [INV]
  1030. else
  1031. goto <bb 20>; [INV]
  1032. <bb 14> :
  1033. __asm__ __volatile__(" mrs %0, basepri
  1034. mov %1, %2
  1035. msr basepri, %1
  1036. isb
  1037. dsb
  1038. " : "=r" ulOriginalBASEPRI_30, "=r" ulNewBASEPRI_31 : "i" 16 : "memory");
  1039. _32 = ulOriginalBASEPRI_30;
  1040. <bb 15> :
  1041. <L18>:
  1042. _35 = _32;
  1043. <bb 16> :
  1044. uxSavedInterruptStatus_23 = _35;
  1045. _6 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
  1046. if (_6 != 0B)
  1047. goto <bb 17>; [INV]
  1048. else
  1049. goto <bb 18>; [INV]
  1050. <bb 17> :
  1051. _7 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
  1052. xTaskGenericNotifyFromISR (_7, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_24(D));
  1053. pxStreamBuffer_12->xTaskWaitingToReceive ={v} 0B;
  1054. <bb 18> :
  1055. ulNewMaskValue_33 = uxSavedInterruptStatus_23;
  1056. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_33 : "memory");
  1057. <bb 19> :
  1058. <bb 20> :
  1059. _27 = xReturn_21;
  1060. <bb 21> :
  1061. <L17>:
  1062. return _27;
  1063. }
  1064. xStreamBufferSend (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
  1065. {
  1066. uint32_t ulNewBASEPRI;
  1067. uint32_t ulNewBASEPRI;
  1068. uint32_t ulNewBASEPRI;
  1069. uint32_t ulNewBASEPRI;
  1070. size_t xMaxReportedSpace;
  1071. struct TimeOut_t xTimeOut;
  1072. size_t xRequiredSpace;
  1073. size_t xSpace;
  1074. size_t xReturn;
  1075. struct StreamBuffer_t * const pxStreamBuffer;
  1076. size_t D.6418;
  1077. unsigned int _1;
  1078. unsigned char _2;
  1079. int _3;
  1080. int _4;
  1081. long unsigned int xTicksToWait.0_5;
  1082. struct tskTaskControlBlock * _6;
  1083. struct tskTaskControlBlock * _7;
  1084. long unsigned int xTicksToWait.1_8;
  1085. long int _9;
  1086. unsigned int _10;
  1087. unsigned int _11;
  1088. struct tskTaskControlBlock * _12;
  1089. struct tskTaskControlBlock * _13;
  1090. size_t _57;
  1091. <bb 2> :
  1092. pxStreamBuffer_25 = xStreamBuffer_24(D);
  1093. xSpace_26 = 0;
  1094. xRequiredSpace_28 = xDataLengthBytes_27(D);
  1095. xMaxReportedSpace_29 = 0;
  1096. if (pvTxData_30(D) == 0B)
  1097. goto <bb 3>; [INV]
  1098. else
  1099. goto <bb 6>; [INV]
  1100. <bb 3> :
  1101. __asm__ __volatile__(" mov %0, %1
  1102. msr basepri, %0
  1103. isb
  1104. dsb
  1105. " : "=r" ulNewBASEPRI_59 : "i" 16 : "memory");
  1106. <bb 4> :
  1107. <bb 5> :
  1108. goto <bb 5>; [INV]
  1109. <bb 6> :
  1110. if (pxStreamBuffer_25 == 0B)
  1111. goto <bb 7>; [INV]
  1112. else
  1113. goto <bb 10>; [INV]
  1114. <bb 7> :
  1115. __asm__ __volatile__(" mov %0, %1
  1116. msr basepri, %0
  1117. isb
  1118. dsb
  1119. " : "=r" ulNewBASEPRI_60 : "i" 16 : "memory");
  1120. <bb 8> :
  1121. <bb 9> :
  1122. goto <bb 9>; [INV]
  1123. <bb 10> :
  1124. _1 = pxStreamBuffer_25->xLength;
  1125. xMaxReportedSpace_32 = _1 + 4294967295;
  1126. _2 = pxStreamBuffer_25->ucFlags;
  1127. _3 = (int) _2;
  1128. _4 = _3 & 1;
  1129. if (_4 != 0)
  1130. goto <bb 11>; [INV]
  1131. else
  1132. goto <bb 17>; [INV]
  1133. <bb 11> :
  1134. xRequiredSpace_34 = xRequiredSpace_28 + 4;
  1135. if (xRequiredSpace_34 <= xDataLengthBytes_27(D))
  1136. goto <bb 12>; [INV]
  1137. else
  1138. goto <bb 15>; [INV]
  1139. <bb 12> :
  1140. __asm__ __volatile__(" mov %0, %1
  1141. msr basepri, %0
  1142. isb
  1143. dsb
  1144. " : "=r" ulNewBASEPRI_61 : "i" 16 : "memory");
  1145. <bb 13> :
  1146. <bb 14> :
  1147. goto <bb 14>; [INV]
  1148. <bb 15> :
  1149. if (xRequiredSpace_34 > xMaxReportedSpace_32)
  1150. goto <bb 16>; [INV]
  1151. else
  1152. goto <bb 19>; [INV]
  1153. <bb 16> :
  1154. xTicksToWait = 0;
  1155. goto <bb 19>; [INV]
  1156. <bb 17> :
  1157. if (xRequiredSpace_28 > xMaxReportedSpace_32)
  1158. goto <bb 18>; [INV]
  1159. else
  1160. goto <bb 19>; [INV]
  1161. <bb 18> :
  1162. xRequiredSpace_33 = xMaxReportedSpace_32;
  1163. <bb 19> :
  1164. # xRequiredSpace_16 = PHI <xRequiredSpace_34(16), xRequiredSpace_28(17), xRequiredSpace_33(18), xRequiredSpace_34(15)>
  1165. xTicksToWait.0_5 = xTicksToWait;
  1166. if (xTicksToWait.0_5 != 0)
  1167. goto <bb 20>; [INV]
  1168. else
  1169. goto <bb 30>; [INV]
  1170. <bb 20> :
  1171. vTaskSetTimeOutState (&xTimeOut);
  1172. <bb 21> :
  1173. vPortEnterCritical ();
  1174. xSpace_39 = xStreamBufferSpacesAvailable (pxStreamBuffer_25);
  1175. if (xSpace_39 < xRequiredSpace_16)
  1176. goto <bb 22>; [INV]
  1177. else
  1178. goto <bb 27>; [INV]
  1179. <bb 22> :
  1180. xTaskGenericNotifyStateClear (0B, 0);
  1181. _6 ={v} pxStreamBuffer_25->xTaskWaitingToSend;
  1182. if (_6 != 0B)
  1183. goto <bb 23>; [INV]
  1184. else
  1185. goto <bb 26>; [INV]
  1186. <bb 23> :
  1187. __asm__ __volatile__(" mov %0, %1
  1188. msr basepri, %0
  1189. isb
  1190. dsb
  1191. " : "=r" ulNewBASEPRI_62 : "i" 16 : "memory");
  1192. <bb 24> :
  1193. <bb 25> :
  1194. goto <bb 25>; [INV]
  1195. <bb 26> :
  1196. _7 = xTaskGetCurrentTaskHandle ();
  1197. pxStreamBuffer_25->xTaskWaitingToSend ={v} _7;
  1198. goto <bb 28>; [INV]
  1199. <bb 27> :
  1200. vPortExitCritical ();
  1201. goto <bb 29>; [INV]
  1202. <bb 28> :
  1203. vPortExitCritical ();
  1204. xTicksToWait.1_8 = xTicksToWait;
  1205. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait.1_8);
  1206. pxStreamBuffer_25->xTaskWaitingToSend ={v} 0B;
  1207. _9 = xTaskCheckForTimeOut (&xTimeOut, &xTicksToWait);
  1208. if (_9 == 0)
  1209. goto <bb 21>; [INV]
  1210. else
  1211. goto <bb 29>; [INV]
  1212. <bb 29> :
  1213. <bb 30> :
  1214. # xSpace_14 = PHI <xSpace_26(19), xSpace_39(29)>
  1215. if (xSpace_14 == 0)
  1216. goto <bb 31>; [INV]
  1217. else
  1218. goto <bb 32>; [INV]
  1219. <bb 31> :
  1220. xSpace_49 = xStreamBufferSpacesAvailable (pxStreamBuffer_25);
  1221. <bb 32> :
  1222. # xSpace_15 = PHI <xSpace_14(30), xSpace_49(31)>
  1223. xReturn_51 = prvWriteMessageToBuffer (pxStreamBuffer_25, pvTxData_30(D), xDataLengthBytes_27(D), xSpace_15, xRequiredSpace_16);
  1224. if (xReturn_51 != 0)
  1225. goto <bb 33>; [INV]
  1226. else
  1227. goto <bb 37>; [INV]
  1228. <bb 33> :
  1229. _10 = prvBytesInBuffer (pxStreamBuffer_25);
  1230. _11 = pxStreamBuffer_25->xTriggerLevelBytes;
  1231. if (_10 >= _11)
  1232. goto <bb 34>; [INV]
  1233. else
  1234. goto <bb 37>; [INV]
  1235. <bb 34> :
  1236. vTaskSuspendAll ();
  1237. _12 ={v} pxStreamBuffer_25->xTaskWaitingToReceive;
  1238. if (_12 != 0B)
  1239. goto <bb 35>; [INV]
  1240. else
  1241. goto <bb 36>; [INV]
  1242. <bb 35> :
  1243. _13 ={v} pxStreamBuffer_25->xTaskWaitingToReceive;
  1244. xTaskGenericNotify (_13, 0, 0, 0, 0B);
  1245. pxStreamBuffer_25->xTaskWaitingToReceive ={v} 0B;
  1246. <bb 36> :
  1247. xTaskResumeAll ();
  1248. <bb 37> :
  1249. _57 = xReturn_51;
  1250. xTimeOut ={v} {CLOBBER};
  1251. <bb 38> :
  1252. <L41>:
  1253. return _57;
  1254. }
  1255. xStreamBufferBytesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  1256. {
  1257. uint32_t ulNewBASEPRI;
  1258. size_t xReturn;
  1259. const struct StreamBuffer_t * const pxStreamBuffer;
  1260. size_t D.6382;
  1261. size_t _6;
  1262. <bb 2> :
  1263. pxStreamBuffer_2 = xStreamBuffer_1(D);
  1264. if (pxStreamBuffer_2 == 0B)
  1265. goto <bb 3>; [INV]
  1266. else
  1267. goto <bb 6>; [INV]
  1268. <bb 3> :
  1269. __asm__ __volatile__(" mov %0, %1
  1270. msr basepri, %0
  1271. isb
  1272. dsb
  1273. " : "=r" ulNewBASEPRI_7 : "i" 16 : "memory");
  1274. <bb 4> :
  1275. <bb 5> :
  1276. goto <bb 5>; [INV]
  1277. <bb 6> :
  1278. xReturn_5 = prvBytesInBuffer (pxStreamBuffer_2);
  1279. _6 = xReturn_5;
  1280. <bb 7> :
  1281. <L3>:
  1282. return _6;
  1283. }
  1284. xStreamBufferSpacesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  1285. {
  1286. uint32_t ulNewBASEPRI;
  1287. size_t xOriginalTail;
  1288. size_t xSpace;
  1289. const struct StreamBuffer_t * const pxStreamBuffer;
  1290. size_t D.6378;
  1291. unsigned int D.6374;
  1292. unsigned int _1;
  1293. unsigned int _2;
  1294. unsigned int _3;
  1295. unsigned int _4;
  1296. unsigned int _5;
  1297. unsigned int _12;
  1298. size_t _16;
  1299. <bb 2> :
  1300. pxStreamBuffer_8 = xStreamBuffer_7(D);
  1301. if (pxStreamBuffer_8 == 0B)
  1302. goto <bb 3>; [INV]
  1303. else
  1304. goto <bb 6>; [INV]
  1305. <bb 3> :
  1306. __asm__ __volatile__(" mov %0, %1
  1307. msr basepri, %0
  1308. isb
  1309. dsb
  1310. " : "=r" ulNewBASEPRI_17 : "i" 16 : "memory");
  1311. <bb 4> :
  1312. <bb 5> :
  1313. goto <bb 5>; [INV]
  1314. <bb 6> :
  1315. xOriginalTail_10 ={v} pxStreamBuffer_8->xTail;
  1316. _1 = pxStreamBuffer_8->xLength;
  1317. _2 ={v} pxStreamBuffer_8->xTail;
  1318. xSpace_11 = _1 + _2;
  1319. _12 ={v} pxStreamBuffer_8->xHead;
  1320. xSpace_13 = xSpace_11 - _12;
  1321. _3 ={v} pxStreamBuffer_8->xTail;
  1322. if (xOriginalTail_10 != _3)
  1323. goto <bb 6>; [INV]
  1324. else
  1325. goto <bb 7>; [INV]
  1326. <bb 7> :
  1327. xSpace_14 = xSpace_13 + 4294967295;
  1328. _4 = pxStreamBuffer_8->xLength;
  1329. if (xSpace_14 >= _4)
  1330. goto <bb 8>; [INV]
  1331. else
  1332. goto <bb 9>; [INV]
  1333. <bb 8> :
  1334. _5 = pxStreamBuffer_8->xLength;
  1335. xSpace_15 = xSpace_14 - _5;
  1336. <bb 9> :
  1337. # xSpace_6 = PHI <xSpace_14(7), xSpace_15(8)>
  1338. _16 = xSpace_6;
  1339. <bb 10> :
  1340. <L8>:
  1341. return _16;
  1342. }
  1343. xStreamBufferSetTriggerLevel (struct StreamBufferDef_t * xStreamBuffer, size_t xTriggerLevel)
  1344. {
  1345. uint32_t ulNewBASEPRI;
  1346. BaseType_t xReturn;
  1347. struct StreamBuffer_t * const pxStreamBuffer;
  1348. BaseType_t D.6370;
  1349. unsigned int _1;
  1350. BaseType_t _13;
  1351. <bb 2> :
  1352. pxStreamBuffer_6 = xStreamBuffer_5(D);
  1353. if (pxStreamBuffer_6 == 0B)
  1354. goto <bb 3>; [INV]
  1355. else
  1356. goto <bb 6>; [INV]
  1357. <bb 3> :
  1358. __asm__ __volatile__(" mov %0, %1
  1359. msr basepri, %0
  1360. isb
  1361. dsb
  1362. " : "=r" ulNewBASEPRI_14 : "i" 16 : "memory");
  1363. <bb 4> :
  1364. <bb 5> :
  1365. goto <bb 5>; [INV]
  1366. <bb 6> :
  1367. if (xTriggerLevel_7(D) == 0)
  1368. goto <bb 7>; [INV]
  1369. else
  1370. goto <bb 8>; [INV]
  1371. <bb 7> :
  1372. xTriggerLevel_8 = 1;
  1373. <bb 8> :
  1374. # xTriggerLevel_2 = PHI <xTriggerLevel_7(D)(6), xTriggerLevel_8(7)>
  1375. _1 = pxStreamBuffer_6->xLength;
  1376. if (xTriggerLevel_2 < _1)
  1377. goto <bb 9>; [INV]
  1378. else
  1379. goto <bb 10>; [INV]
  1380. <bb 9> :
  1381. pxStreamBuffer_6->xTriggerLevelBytes = xTriggerLevel_2;
  1382. xReturn_12 = 1;
  1383. goto <bb 11>; [INV]
  1384. <bb 10> :
  1385. xReturn_10 = 0;
  1386. <bb 11> :
  1387. # xReturn_3 = PHI <xReturn_12(9), xReturn_10(10)>
  1388. _13 = xReturn_3;
  1389. <bb 12> :
  1390. <L8>:
  1391. return _13;
  1392. }
  1393. xStreamBufferReset (struct StreamBufferDef_t * xStreamBuffer)
  1394. {
  1395. uint32_t ulNewBASEPRI;
  1396. UBaseType_t uxStreamBufferNumber;
  1397. BaseType_t xReturn;
  1398. struct StreamBuffer_t * const pxStreamBuffer;
  1399. BaseType_t D.6361;
  1400. struct tskTaskControlBlock * _1;
  1401. struct tskTaskControlBlock * _2;
  1402. uint8_t * _3;
  1403. unsigned int _4;
  1404. unsigned int _5;
  1405. unsigned char _6;
  1406. BaseType_t _19;
  1407. <bb 2> :
  1408. pxStreamBuffer_10 = xStreamBuffer_9(D);
  1409. xReturn_11 = 0;
  1410. if (pxStreamBuffer_10 == 0B)
  1411. goto <bb 3>; [INV]
  1412. else
  1413. goto <bb 6>; [INV]
  1414. <bb 3> :
  1415. __asm__ __volatile__(" mov %0, %1
  1416. msr basepri, %0
  1417. isb
  1418. dsb
  1419. " : "=r" ulNewBASEPRI_20 : "i" 16 : "memory");
  1420. <bb 4> :
  1421. <bb 5> :
  1422. goto <bb 5>; [INV]
  1423. <bb 6> :
  1424. uxStreamBufferNumber_13 = pxStreamBuffer_10->uxStreamBufferNumber;
  1425. vPortEnterCritical ();
  1426. _1 ={v} pxStreamBuffer_10->xTaskWaitingToReceive;
  1427. if (_1 == 0B)
  1428. goto <bb 7>; [INV]
  1429. else
  1430. goto <bb 9>; [INV]
  1431. <bb 7> :
  1432. _2 ={v} pxStreamBuffer_10->xTaskWaitingToSend;
  1433. if (_2 == 0B)
  1434. goto <bb 8>; [INV]
  1435. else
  1436. goto <bb 9>; [INV]
  1437. <bb 8> :
  1438. _3 = pxStreamBuffer_10->pucBuffer;
  1439. _4 = pxStreamBuffer_10->xLength;
  1440. _5 = pxStreamBuffer_10->xTriggerLevelBytes;
  1441. _6 = pxStreamBuffer_10->ucFlags;
  1442. prvInitialiseNewStreamBuffer (pxStreamBuffer_10, _3, _4, _5, _6);
  1443. xReturn_16 = 1;
  1444. pxStreamBuffer_10->uxStreamBufferNumber = uxStreamBufferNumber_13;
  1445. <bb 9> :
  1446. # xReturn_7 = PHI <xReturn_11(6), xReturn_11(7), xReturn_16(8)>
  1447. vPortExitCritical ();
  1448. _19 = xReturn_7;
  1449. <bb 10> :
  1450. <L7>:
  1451. return _19;
  1452. }
  1453. vStreamBufferDelete (struct StreamBufferDef_t * xStreamBuffer)
  1454. {
  1455. uint32_t ulNewBASEPRI;
  1456. struct StreamBuffer_t * pxStreamBuffer;
  1457. unsigned char _1;
  1458. int _2;
  1459. int _3;
  1460. <bb 2> :
  1461. pxStreamBuffer_6 = xStreamBuffer_5(D);
  1462. if (pxStreamBuffer_6 == 0B)
  1463. goto <bb 3>; [INV]
  1464. else
  1465. goto <bb 6>; [INV]
  1466. <bb 3> :
  1467. __asm__ __volatile__(" mov %0, %1
  1468. msr basepri, %0
  1469. isb
  1470. dsb
  1471. " : "=r" ulNewBASEPRI_10 : "i" 16 : "memory");
  1472. <bb 4> :
  1473. <bb 5> :
  1474. goto <bb 5>; [INV]
  1475. <bb 6> :
  1476. _1 = pxStreamBuffer_6->ucFlags;
  1477. _2 = (int) _1;
  1478. _3 = _2 & 2;
  1479. if (_3 == 0)
  1480. goto <bb 7>; [INV]
  1481. else
  1482. goto <bb 8>; [INV]
  1483. <bb 7> :
  1484. vPortFree (pxStreamBuffer_6);
  1485. goto <bb 9>; [INV]
  1486. <bb 8> :
  1487. memset (pxStreamBuffer_6, 0, 36);
  1488. <bb 9> :
  1489. return;
  1490. }
  1491. xStreamBufferGenericCreate (size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer)
  1492. {
  1493. uint32_t ulNewBASEPRI;
  1494. uint32_t ulNewBASEPRI;
  1495. uint32_t ulNewBASEPRI;
  1496. uint8_t ucFlags;
  1497. uint8_t * pucAllocatedMemory;
  1498. struct StreamBufferDef_t * D.6348;
  1499. unsigned int _1;
  1500. uint8_t * _2;
  1501. struct StreamBufferDef_t * _21;
  1502. <bb 2> :
  1503. if (xIsMessageBuffer_9(D) == 1)
  1504. goto <bb 3>; [INV]
  1505. else
  1506. goto <bb 7>; [INV]
  1507. <bb 3> :
  1508. ucFlags_13 = 1;
  1509. if (xBufferSizeBytes_11(D) <= 4)
  1510. goto <bb 4>; [INV]
  1511. else
  1512. goto <bb 11>; [INV]
  1513. <bb 4> :
  1514. __asm__ __volatile__(" mov %0, %1
  1515. msr basepri, %0
  1516. isb
  1517. dsb
  1518. " : "=r" ulNewBASEPRI_22 : "i" 16 : "memory");
  1519. <bb 5> :
  1520. <bb 6> :
  1521. goto <bb 6>; [INV]
  1522. <bb 7> :
  1523. ucFlags_10 = 0;
  1524. if (xBufferSizeBytes_11(D) == 0)
  1525. goto <bb 8>; [INV]
  1526. else
  1527. goto <bb 11>; [INV]
  1528. <bb 8> :
  1529. __asm__ __volatile__(" mov %0, %1
  1530. msr basepri, %0
  1531. isb
  1532. dsb
  1533. " : "=r" ulNewBASEPRI_23 : "i" 16 : "memory");
  1534. <bb 9> :
  1535. <bb 10> :
  1536. goto <bb 10>; [INV]
  1537. <bb 11> :
  1538. # ucFlags_6 = PHI <ucFlags_13(3), ucFlags_10(7)>
  1539. if (xTriggerLevelBytes_14(D) > xBufferSizeBytes_11(D))
  1540. goto <bb 12>; [INV]
  1541. else
  1542. goto <bb 15>; [INV]
  1543. <bb 12> :
  1544. __asm__ __volatile__(" mov %0, %1
  1545. msr basepri, %0
  1546. isb
  1547. dsb
  1548. " : "=r" ulNewBASEPRI_24 : "i" 16 : "memory");
  1549. <bb 13> :
  1550. <bb 14> :
  1551. goto <bb 14>; [INV]
  1552. <bb 15> :
  1553. if (xTriggerLevelBytes_14(D) == 0)
  1554. goto <bb 16>; [INV]
  1555. else
  1556. goto <bb 17>; [INV]
  1557. <bb 16> :
  1558. xTriggerLevelBytes_15 = 1;
  1559. <bb 17> :
  1560. # xTriggerLevelBytes_4 = PHI <xTriggerLevelBytes_14(D)(15), xTriggerLevelBytes_15(16)>
  1561. if (xBufferSizeBytes_11(D) <= 4294967258)
  1562. goto <bb 18>; [INV]
  1563. else
  1564. goto <bb 19>; [INV]
  1565. <bb 18> :
  1566. xBufferSizeBytes_17 = xBufferSizeBytes_11(D) + 1;
  1567. _1 = xBufferSizeBytes_17 + 36;
  1568. pucAllocatedMemory_19 = pvPortMalloc (_1);
  1569. goto <bb 20>; [INV]
  1570. <bb 19> :
  1571. pucAllocatedMemory_16 = 0B;
  1572. <bb 20> :
  1573. # xBufferSizeBytes_3 = PHI <xBufferSizeBytes_17(18), xBufferSizeBytes_11(D)(19)>
  1574. # pucAllocatedMemory_5 = PHI <pucAllocatedMemory_19(18), pucAllocatedMemory_16(19)>
  1575. if (pucAllocatedMemory_5 != 0B)
  1576. goto <bb 21>; [INV]
  1577. else
  1578. goto <bb 22>; [INV]
  1579. <bb 21> :
  1580. _2 = pucAllocatedMemory_5 + 36;
  1581. prvInitialiseNewStreamBuffer (pucAllocatedMemory_5, _2, xBufferSizeBytes_3, xTriggerLevelBytes_4, ucFlags_6);
  1582. <bb 22> :
  1583. _21 = pucAllocatedMemory_5;
  1584. <bb 23> :
  1585. <L20>:
  1586. return _21;
  1587. }