heap_4.c.080i.single-use 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. vPortGetHeapStats (struct HeapStats_t * pxHeapStats)
  2. {
  3. size_t xMinSize;
  4. size_t xMaxSize;
  5. size_t xBlocks;
  6. struct BlockLink_t * pxBlock;
  7. unsigned int _1;
  8. unsigned int _2;
  9. struct BlockLink_t * pxEnd.32_3;
  10. unsigned int xFreeBytesRemaining.33_4;
  11. unsigned int xNumberOfSuccessfulAllocations.34_5;
  12. unsigned int xNumberOfSuccessfulFrees.35_6;
  13. unsigned int xMinimumEverFreeBytesRemaining.36_7;
  14. <bb 2> :
  15. xBlocks_17 = 0;
  16. xMaxSize_18 = 0;
  17. xMinSize_19 = 4294967295;
  18. vTaskSuspendAll ();
  19. pxBlock_22 = xStart.pxNextFreeBlock;
  20. if (pxBlock_22 != 0B)
  21. goto <bb 3>; [INV]
  22. else
  23. goto <bb 8>; [INV]
  24. <bb 3> :
  25. # pxBlock_8 = PHI <pxBlock_22(2), pxBlock_26(7)>
  26. # xBlocks_9 = PHI <xBlocks_17(2), xBlocks_23(7)>
  27. # xMaxSize_11 = PHI <xMaxSize_18(2), xMaxSize_12(7)>
  28. # xMinSize_14 = PHI <xMinSize_19(2), xMinSize_15(7)>
  29. xBlocks_23 = xBlocks_9 + 1;
  30. _1 = pxBlock_8->xBlockSize;
  31. if (xMaxSize_11 < _1)
  32. goto <bb 4>; [INV]
  33. else
  34. goto <bb 5>; [INV]
  35. <bb 4> :
  36. xMaxSize_24 = pxBlock_8->xBlockSize;
  37. <bb 5> :
  38. # xMaxSize_12 = PHI <xMaxSize_11(3), xMaxSize_24(4)>
  39. _2 = pxBlock_8->xBlockSize;
  40. if (xMinSize_14 > _2)
  41. goto <bb 6>; [INV]
  42. else
  43. goto <bb 7>; [INV]
  44. <bb 6> :
  45. xMinSize_25 = pxBlock_8->xBlockSize;
  46. <bb 7> :
  47. # xMinSize_15 = PHI <xMinSize_14(5), xMinSize_25(6)>
  48. pxBlock_26 = pxBlock_8->pxNextFreeBlock;
  49. pxEnd.32_3 = pxEnd;
  50. if (pxBlock_26 != pxEnd.32_3)
  51. goto <bb 3>; [INV]
  52. else
  53. goto <bb 8>; [INV]
  54. <bb 8> :
  55. # xBlocks_10 = PHI <xBlocks_17(2), xBlocks_23(7)>
  56. # xMaxSize_13 = PHI <xMaxSize_18(2), xMaxSize_12(7)>
  57. # xMinSize_16 = PHI <xMinSize_19(2), xMinSize_15(7)>
  58. xTaskResumeAll ();
  59. pxHeapStats_28(D)->xSizeOfLargestFreeBlockInBytes = xMaxSize_13;
  60. pxHeapStats_28(D)->xSizeOfSmallestFreeBlockInBytes = xMinSize_16;
  61. pxHeapStats_28(D)->xNumberOfFreeBlocks = xBlocks_10;
  62. vPortEnterCritical ();
  63. xFreeBytesRemaining.33_4 = xFreeBytesRemaining;
  64. pxHeapStats_28(D)->xAvailableHeapSpaceInBytes = xFreeBytesRemaining.33_4;
  65. xNumberOfSuccessfulAllocations.34_5 = xNumberOfSuccessfulAllocations;
  66. pxHeapStats_28(D)->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations.34_5;
  67. xNumberOfSuccessfulFrees.35_6 = xNumberOfSuccessfulFrees;
  68. pxHeapStats_28(D)->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees.35_6;
  69. xMinimumEverFreeBytesRemaining.36_7 = xMinimumEverFreeBytesRemaining;
  70. pxHeapStats_28(D)->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining.36_7;
  71. vPortExitCritical ();
  72. return;
  73. }
  74. prvInsertBlockIntoFreeList (struct BlockLink_t * pxBlockToInsert)
  75. {
  76. uint8_t * puc;
  77. struct BlockLink_t * pxIterator;
  78. struct A_BLOCK_LINK * _1;
  79. unsigned int _2;
  80. uint8_t * _3;
  81. unsigned int _4;
  82. unsigned int _5;
  83. unsigned int _6;
  84. unsigned int _7;
  85. uint8_t * _8;
  86. struct A_BLOCK_LINK * _9;
  87. struct A_BLOCK_LINK * _10;
  88. struct BlockLink_t * pxEnd.30_11;
  89. unsigned int _12;
  90. struct A_BLOCK_LINK * _13;
  91. unsigned int _14;
  92. unsigned int _15;
  93. struct A_BLOCK_LINK * _16;
  94. struct A_BLOCK_LINK * _17;
  95. struct BlockLink_t * pxEnd.31_18;
  96. struct A_BLOCK_LINK * _19;
  97. <bb 2> :
  98. pxIterator_25 = &xStart;
  99. goto <bb 4>; [INV]
  100. <bb 3> :
  101. pxIterator_37 = pxIterator_21->pxNextFreeBlock;
  102. <bb 4> :
  103. # pxIterator_21 = PHI <pxIterator_25(2), pxIterator_37(3)>
  104. _1 = pxIterator_21->pxNextFreeBlock;
  105. if (pxBlockToInsert_27(D) > _1)
  106. goto <bb 3>; [INV]
  107. else
  108. goto <bb 5>; [INV]
  109. <bb 5> :
  110. puc_28 = pxIterator_21;
  111. _2 = pxIterator_21->xBlockSize;
  112. _3 = puc_28 + _2;
  113. if (pxBlockToInsert_27(D) == _3)
  114. goto <bb 6>; [INV]
  115. else
  116. goto <bb 7>; [INV]
  117. <bb 6> :
  118. _4 = pxIterator_21->xBlockSize;
  119. _5 = pxBlockToInsert_27(D)->xBlockSize;
  120. _6 = _4 + _5;
  121. pxIterator_21->xBlockSize = _6;
  122. pxBlockToInsert_30 = pxIterator_21;
  123. <bb 7> :
  124. # pxBlockToInsert_20 = PHI <pxBlockToInsert_27(D)(5), pxBlockToInsert_30(6)>
  125. puc_31 = pxBlockToInsert_20;
  126. _7 = pxBlockToInsert_20->xBlockSize;
  127. _8 = puc_31 + _7;
  128. _9 = pxIterator_21->pxNextFreeBlock;
  129. if (_8 == _9)
  130. goto <bb 8>; [INV]
  131. else
  132. goto <bb 11>; [INV]
  133. <bb 8> :
  134. _10 = pxIterator_21->pxNextFreeBlock;
  135. pxEnd.30_11 = pxEnd;
  136. if (_10 != pxEnd.30_11)
  137. goto <bb 9>; [INV]
  138. else
  139. goto <bb 10>; [INV]
  140. <bb 9> :
  141. _12 = pxBlockToInsert_20->xBlockSize;
  142. _13 = pxIterator_21->pxNextFreeBlock;
  143. _14 = _13->xBlockSize;
  144. _15 = _12 + _14;
  145. pxBlockToInsert_20->xBlockSize = _15;
  146. _16 = pxIterator_21->pxNextFreeBlock;
  147. _17 = _16->pxNextFreeBlock;
  148. pxBlockToInsert_20->pxNextFreeBlock = _17;
  149. goto <bb 12>; [INV]
  150. <bb 10> :
  151. pxEnd.31_18 = pxEnd;
  152. pxBlockToInsert_20->pxNextFreeBlock = pxEnd.31_18;
  153. goto <bb 12>; [INV]
  154. <bb 11> :
  155. _19 = pxIterator_21->pxNextFreeBlock;
  156. pxBlockToInsert_20->pxNextFreeBlock = _19;
  157. <bb 12> :
  158. if (pxIterator_21 != pxBlockToInsert_20)
  159. goto <bb 13>; [INV]
  160. else
  161. goto <bb 14>; [INV]
  162. <bb 13> :
  163. pxIterator_21->pxNextFreeBlock = pxBlockToInsert_20;
  164. <bb 14> :
  165. return;
  166. }
  167. prvHeapInit ()
  168. {
  169. size_t xTotalHeapSize;
  170. size_t uxAddress;
  171. uint8_t * pucAlignedHeap;
  172. struct BlockLink_t * pxFirstFreeBlock;
  173. unsigned int _1;
  174. unsigned int _2;
  175. unsigned int ucHeap.22_3;
  176. unsigned int pucAlignedHeap.23_4;
  177. unsigned int xHeapStructSize.24_5;
  178. struct BlockLink_t * uxAddress.25_6;
  179. struct BlockLink_t * pxEnd.26_7;
  180. struct BlockLink_t * pxEnd.27_8;
  181. unsigned int pxFirstFreeBlock.28_9;
  182. unsigned int _10;
  183. struct BlockLink_t * pxEnd.29_11;
  184. unsigned int _12;
  185. unsigned int _13;
  186. <bb 2> :
  187. xTotalHeapSize_16 = 8192;
  188. uxAddress_17 = (size_t) &ucHeap;
  189. _1 = uxAddress_17 & 7;
  190. if (_1 != 0)
  191. goto <bb 3>; [INV]
  192. else
  193. goto <bb 4>; [INV]
  194. <bb 3> :
  195. uxAddress_18 = uxAddress_17 + 7;
  196. uxAddress_19 = uxAddress_18 & 4294967288;
  197. _2 = xTotalHeapSize_16 - uxAddress_19;
  198. ucHeap.22_3 = (unsigned int) &ucHeap;
  199. xTotalHeapSize_20 = _2 + ucHeap.22_3;
  200. <bb 4> :
  201. # uxAddress_14 = PHI <uxAddress_17(2), uxAddress_19(3)>
  202. # xTotalHeapSize_15 = PHI <xTotalHeapSize_16(2), xTotalHeapSize_20(3)>
  203. pucAlignedHeap_21 = (uint8_t *) uxAddress_14;
  204. xStart.pxNextFreeBlock = pucAlignedHeap_21;
  205. xStart.xBlockSize = 0;
  206. pucAlignedHeap.23_4 = (unsigned int) pucAlignedHeap_21;
  207. uxAddress_25 = xTotalHeapSize_15 + pucAlignedHeap.23_4;
  208. xHeapStructSize.24_5 = 8;
  209. uxAddress_26 = uxAddress_25 - xHeapStructSize.24_5;
  210. uxAddress_27 = uxAddress_26 & 4294967288;
  211. uxAddress.25_6 = (struct BlockLink_t *) uxAddress_27;
  212. pxEnd = uxAddress.25_6;
  213. pxEnd.26_7 = pxEnd;
  214. pxEnd.26_7->xBlockSize = 0;
  215. pxEnd.27_8 = pxEnd;
  216. pxEnd.27_8->pxNextFreeBlock = 0B;
  217. pxFirstFreeBlock_31 = pucAlignedHeap_21;
  218. pxFirstFreeBlock.28_9 = (unsigned int) pxFirstFreeBlock_31;
  219. _10 = uxAddress_27 - pxFirstFreeBlock.28_9;
  220. pxFirstFreeBlock_31->xBlockSize = _10;
  221. pxEnd.29_11 = pxEnd;
  222. pxFirstFreeBlock_31->pxNextFreeBlock = pxEnd.29_11;
  223. _12 = pxFirstFreeBlock_31->xBlockSize;
  224. xMinimumEverFreeBytesRemaining = _12;
  225. _13 = pxFirstFreeBlock_31->xBlockSize;
  226. xFreeBytesRemaining = _13;
  227. xBlockAllocatedBit = 2147483648;
  228. return;
  229. }
  230. vPortInitialiseBlocks ()
  231. {
  232. <bb 2> :
  233. return;
  234. }
  235. xPortGetMinimumEverFreeHeapSize ()
  236. {
  237. size_t D.6339;
  238. size_t _2;
  239. <bb 2> :
  240. _2 = xMinimumEverFreeBytesRemaining;
  241. <bb 3> :
  242. <L0>:
  243. return _2;
  244. }
  245. xPortGetFreeHeapSize ()
  246. {
  247. size_t D.6337;
  248. size_t _2;
  249. <bb 2> :
  250. _2 = xFreeBytesRemaining;
  251. <bb 3> :
  252. <L0>:
  253. return _2;
  254. }
  255. vPortFree (void * pv)
  256. {
  257. uint32_t ulNewBASEPRI;
  258. uint32_t ulNewBASEPRI;
  259. struct BlockLink_t * pxLink;
  260. uint8_t * puc;
  261. unsigned int xHeapStructSize.16_1;
  262. sizetype _2;
  263. unsigned int _3;
  264. unsigned int xBlockAllocatedBit.17_4;
  265. unsigned int _5;
  266. struct A_BLOCK_LINK * _6;
  267. unsigned int _7;
  268. unsigned int xBlockAllocatedBit.18_8;
  269. unsigned int _9;
  270. struct A_BLOCK_LINK * _10;
  271. unsigned int _11;
  272. unsigned int xBlockAllocatedBit.19_12;
  273. unsigned int _13;
  274. unsigned int _14;
  275. unsigned int _15;
  276. unsigned int xFreeBytesRemaining.20_16;
  277. unsigned int _17;
  278. unsigned int xNumberOfSuccessfulFrees.21_18;
  279. unsigned int _19;
  280. <bb 2> :
  281. puc_22 = pv_21(D);
  282. if (pv_21(D) != 0B)
  283. goto <bb 3>; [INV]
  284. else
  285. goto <bb 14>; [INV]
  286. <bb 3> :
  287. xHeapStructSize.16_1 = 8;
  288. _2 = -xHeapStructSize.16_1;
  289. puc_24 = puc_22 + _2;
  290. pxLink_25 = puc_24;
  291. _3 = pxLink_25->xBlockSize;
  292. xBlockAllocatedBit.17_4 = xBlockAllocatedBit;
  293. _5 = _3 & xBlockAllocatedBit.17_4;
  294. if (_5 == 0)
  295. goto <bb 4>; [INV]
  296. else
  297. goto <bb 7>; [INV]
  298. <bb 4> :
  299. __asm__ __volatile__(" mov %0, %1
  300. msr basepri, %0
  301. isb
  302. dsb
  303. " : "=r" ulNewBASEPRI_32 : "i" 16 : "memory");
  304. <bb 5> :
  305. <bb 6> :
  306. goto <bb 6>; [INV]
  307. <bb 7> :
  308. _6 = pxLink_25->pxNextFreeBlock;
  309. if (_6 != 0B)
  310. goto <bb 8>; [INV]
  311. else
  312. goto <bb 11>; [INV]
  313. <bb 8> :
  314. __asm__ __volatile__(" mov %0, %1
  315. msr basepri, %0
  316. isb
  317. dsb
  318. " : "=r" ulNewBASEPRI_33 : "i" 16 : "memory");
  319. <bb 9> :
  320. <bb 10> :
  321. goto <bb 10>; [INV]
  322. <bb 11> :
  323. _7 = pxLink_25->xBlockSize;
  324. xBlockAllocatedBit.18_8 = xBlockAllocatedBit;
  325. _9 = _7 & xBlockAllocatedBit.18_8;
  326. if (_9 != 0)
  327. goto <bb 12>; [INV]
  328. else
  329. goto <bb 14>; [INV]
  330. <bb 12> :
  331. _10 = pxLink_25->pxNextFreeBlock;
  332. if (_10 == 0B)
  333. goto <bb 13>; [INV]
  334. else
  335. goto <bb 14>; [INV]
  336. <bb 13> :
  337. _11 = pxLink_25->xBlockSize;
  338. xBlockAllocatedBit.19_12 = xBlockAllocatedBit;
  339. _13 = ~xBlockAllocatedBit.19_12;
  340. _14 = _11 & _13;
  341. pxLink_25->xBlockSize = _14;
  342. vTaskSuspendAll ();
  343. _15 = pxLink_25->xBlockSize;
  344. xFreeBytesRemaining.20_16 = xFreeBytesRemaining;
  345. _17 = _15 + xFreeBytesRemaining.20_16;
  346. xFreeBytesRemaining = _17;
  347. prvInsertBlockIntoFreeList (pxLink_25);
  348. xNumberOfSuccessfulFrees.21_18 = xNumberOfSuccessfulFrees;
  349. _19 = xNumberOfSuccessfulFrees.21_18 + 1;
  350. xNumberOfSuccessfulFrees = _19;
  351. xTaskResumeAll ();
  352. <bb 14> :
  353. return;
  354. }
  355. pvPortMalloc (size_t xWantedSize)
  356. {
  357. uint32_t ulNewBASEPRI;
  358. uint32_t ulNewBASEPRI;
  359. uint32_t ulNewBASEPRI;
  360. void * pvReturn;
  361. struct BlockLink_t * pxNewBlockLink;
  362. struct BlockLink_t * pxPreviousBlock;
  363. struct BlockLink_t * pxBlock;
  364. void * D.6323;
  365. struct BlockLink_t * pxEnd.0_1;
  366. unsigned int xBlockAllocatedBit.1_2;
  367. unsigned int _3;
  368. unsigned int xHeapStructSize.2_4;
  369. unsigned int _5;
  370. unsigned int xHeapStructSize.3_6;
  371. unsigned int _7;
  372. unsigned int _8;
  373. unsigned int _9;
  374. unsigned int _10;
  375. unsigned int _11;
  376. unsigned int xFreeBytesRemaining.4_12;
  377. unsigned int _13;
  378. struct A_BLOCK_LINK * _14;
  379. struct BlockLink_t * pxEnd.5_15;
  380. struct A_BLOCK_LINK * _16;
  381. unsigned int xHeapStructSize.6_17;
  382. struct A_BLOCK_LINK * _18;
  383. unsigned int _19;
  384. unsigned int _20;
  385. unsigned int xHeapStructSize.7_21;
  386. unsigned int _22;
  387. unsigned int pxNewBlockLink.8_23;
  388. unsigned int _24;
  389. unsigned int _25;
  390. unsigned int _26;
  391. unsigned int xFreeBytesRemaining.9_27;
  392. unsigned int _28;
  393. unsigned int _29;
  394. unsigned int xFreeBytesRemaining.10_30;
  395. unsigned int xMinimumEverFreeBytesRemaining.11_31;
  396. unsigned int xFreeBytesRemaining.12_32;
  397. unsigned int _33;
  398. unsigned int xBlockAllocatedBit.13_34;
  399. unsigned int _35;
  400. unsigned int xNumberOfSuccessfulAllocations.14_36;
  401. unsigned int _37;
  402. unsigned int pvReturn.15_38;
  403. unsigned int _39;
  404. void * _74;
  405. <bb 2> :
  406. pvReturn_49 = 0B;
  407. vTaskSuspendAll ();
  408. pxEnd.0_1 = pxEnd;
  409. if (pxEnd.0_1 == 0B)
  410. goto <bb 3>; [INV]
  411. else
  412. goto <bb 4>; [INV]
  413. <bb 3> :
  414. prvHeapInit ();
  415. <bb 4> :
  416. xBlockAllocatedBit.1_2 = xBlockAllocatedBit;
  417. _3 = xWantedSize_53(D) & xBlockAllocatedBit.1_2;
  418. if (_3 == 0)
  419. goto <bb 5>; [INV]
  420. else
  421. goto <bb 32>; [INV]
  422. <bb 5> :
  423. if (xWantedSize_53(D) != 0)
  424. goto <bb 6>; [INV]
  425. else
  426. goto <bb 15>; [INV]
  427. <bb 6> :
  428. xHeapStructSize.2_4 = 8;
  429. _5 = xWantedSize_53(D) + xHeapStructSize.2_4;
  430. if (xWantedSize_53(D) < _5)
  431. goto <bb 7>; [INV]
  432. else
  433. goto <bb 15>; [INV]
  434. <bb 7> :
  435. xHeapStructSize.3_6 = 8;
  436. xWantedSize_54 = xWantedSize_53(D) + xHeapStructSize.3_6;
  437. _7 = xWantedSize_54 & 7;
  438. if (_7 != 0)
  439. goto <bb 8>; [INV]
  440. else
  441. goto <bb 14>; [INV]
  442. <bb 8> :
  443. _8 = xWantedSize_54 & 4294967288;
  444. _9 = _8 + 8;
  445. if (xWantedSize_54 < _9)
  446. goto <bb 9>; [INV]
  447. else
  448. goto <bb 13>; [INV]
  449. <bb 9> :
  450. _10 = xWantedSize_54 & 4294967288;
  451. xWantedSize_56 = _10 + 8;
  452. _11 = xWantedSize_56 & 7;
  453. if (_11 != 0)
  454. goto <bb 10>; [INV]
  455. else
  456. goto <bb 14>; [INV]
  457. <bb 10> :
  458. __asm__ __volatile__(" mov %0, %1
  459. msr basepri, %0
  460. isb
  461. dsb
  462. " : "=r" ulNewBASEPRI_75 : "i" 16 : "memory");
  463. <bb 11> :
  464. <bb 12> :
  465. goto <bb 12>; [INV]
  466. <bb 13> :
  467. xWantedSize_55 = 0;
  468. <bb 14> :
  469. # xWantedSize_40 = PHI <xWantedSize_54(7), xWantedSize_55(13), xWantedSize_56(9)>
  470. goto <bb 16>; [INV]
  471. <bb 15> :
  472. xWantedSize_57 = 0;
  473. <bb 16> :
  474. # xWantedSize_41 = PHI <xWantedSize_40(14), xWantedSize_57(15)>
  475. if (xWantedSize_41 != 0)
  476. goto <bb 17>; [INV]
  477. else
  478. goto <bb 32>; [INV]
  479. <bb 17> :
  480. xFreeBytesRemaining.4_12 = xFreeBytesRemaining;
  481. if (xWantedSize_41 <= xFreeBytesRemaining.4_12)
  482. goto <bb 18>; [INV]
  483. else
  484. goto <bb 32>; [INV]
  485. <bb 18> :
  486. pxPreviousBlock_58 = &xStart;
  487. pxBlock_59 = xStart.pxNextFreeBlock;
  488. goto <bb 20>; [INV]
  489. <bb 19> :
  490. pxPreviousBlock_60 = pxBlock_42;
  491. pxBlock_61 = pxBlock_42->pxNextFreeBlock;
  492. <bb 20> :
  493. # pxBlock_42 = PHI <pxBlock_59(18), pxBlock_61(19)>
  494. # pxPreviousBlock_43 = PHI <pxPreviousBlock_58(18), pxPreviousBlock_60(19)>
  495. _13 = pxBlock_42->xBlockSize;
  496. if (xWantedSize_41 > _13)
  497. goto <bb 21>; [INV]
  498. else
  499. goto <bb 22>; [INV]
  500. <bb 21> :
  501. _14 = pxBlock_42->pxNextFreeBlock;
  502. if (_14 != 0B)
  503. goto <bb 19>; [INV]
  504. else
  505. goto <bb 22>; [INV]
  506. <bb 22> :
  507. pxEnd.5_15 = pxEnd;
  508. if (pxBlock_42 != pxEnd.5_15)
  509. goto <bb 23>; [INV]
  510. else
  511. goto <bb 32>; [INV]
  512. <bb 23> :
  513. _16 = pxPreviousBlock_43->pxNextFreeBlock;
  514. xHeapStructSize.6_17 = 8;
  515. pvReturn_62 = _16 + xHeapStructSize.6_17;
  516. _18 = pxBlock_42->pxNextFreeBlock;
  517. pxPreviousBlock_43->pxNextFreeBlock = _18;
  518. _19 = pxBlock_42->xBlockSize;
  519. _20 = _19 - xWantedSize_41;
  520. xHeapStructSize.7_21 = 8;
  521. _22 = xHeapStructSize.7_21 << 1;
  522. if (_20 > _22)
  523. goto <bb 24>; [INV]
  524. else
  525. goto <bb 29>; [INV]
  526. <bb 24> :
  527. pxNewBlockLink_64 = pxBlock_42 + xWantedSize_41;
  528. pxNewBlockLink.8_23 = (unsigned int) pxNewBlockLink_64;
  529. _24 = pxNewBlockLink.8_23 & 7;
  530. if (_24 != 0)
  531. goto <bb 25>; [INV]
  532. else
  533. goto <bb 28>; [INV]
  534. <bb 25> :
  535. __asm__ __volatile__(" mov %0, %1
  536. msr basepri, %0
  537. isb
  538. dsb
  539. " : "=r" ulNewBASEPRI_76 : "i" 16 : "memory");
  540. <bb 26> :
  541. <bb 27> :
  542. goto <bb 27>; [INV]
  543. <bb 28> :
  544. _25 = pxBlock_42->xBlockSize;
  545. _26 = _25 - xWantedSize_41;
  546. pxNewBlockLink_64->xBlockSize = _26;
  547. pxBlock_42->xBlockSize = xWantedSize_41;
  548. prvInsertBlockIntoFreeList (pxNewBlockLink_64);
  549. <bb 29> :
  550. xFreeBytesRemaining.9_27 = xFreeBytesRemaining;
  551. _28 = pxBlock_42->xBlockSize;
  552. _29 = xFreeBytesRemaining.9_27 - _28;
  553. xFreeBytesRemaining = _29;
  554. xFreeBytesRemaining.10_30 = xFreeBytesRemaining;
  555. xMinimumEverFreeBytesRemaining.11_31 = xMinimumEverFreeBytesRemaining;
  556. if (xFreeBytesRemaining.10_30 < xMinimumEverFreeBytesRemaining.11_31)
  557. goto <bb 30>; [INV]
  558. else
  559. goto <bb 31>; [INV]
  560. <bb 30> :
  561. xFreeBytesRemaining.12_32 = xFreeBytesRemaining;
  562. xMinimumEverFreeBytesRemaining = xFreeBytesRemaining.12_32;
  563. <bb 31> :
  564. _33 = pxBlock_42->xBlockSize;
  565. xBlockAllocatedBit.13_34 = xBlockAllocatedBit;
  566. _35 = _33 | xBlockAllocatedBit.13_34;
  567. pxBlock_42->xBlockSize = _35;
  568. pxBlock_42->pxNextFreeBlock = 0B;
  569. xNumberOfSuccessfulAllocations.14_36 = xNumberOfSuccessfulAllocations;
  570. _37 = xNumberOfSuccessfulAllocations.14_36 + 1;
  571. xNumberOfSuccessfulAllocations = _37;
  572. <bb 32> :
  573. # pvReturn_44 = PHI <pvReturn_49(4), pvReturn_49(17), pvReturn_49(16), pvReturn_49(22), pvReturn_62(31)>
  574. xTaskResumeAll ();
  575. pvReturn.15_38 = (unsigned int) pvReturn_44;
  576. _39 = pvReturn.15_38 & 7;
  577. if (_39 != 0)
  578. goto <bb 33>; [INV]
  579. else
  580. goto <bb 36>; [INV]
  581. <bb 33> :
  582. __asm__ __volatile__(" mov %0, %1
  583. msr basepri, %0
  584. isb
  585. dsb
  586. " : "=r" ulNewBASEPRI_77 : "i" 16 : "memory");
  587. <bb 34> :
  588. <bb 35> :
  589. goto <bb 35>; [INV]
  590. <bb 36> :
  591. _74 = pvReturn_44;
  592. <bb 37> :
  593. <L43>:
  594. return _74;
  595. }