-static void quicksort(uint32_t* const start, uint32_t* const stop)\r
-{\r
- uint32_t *it = start + 1, *rit = stop, t;\r
-\r
- if(it > rit)\r
- return;\r
-\r
- while(it < rit)\r
- if(*it <= *start)\r
- ++it;\r
- else if(*rit > *start)\r
- --rit;\r
- else\r
- t = *it, *it = *rit, *rit = t;\r
-\r
- if(*rit >= *start)\r
- --rit;\r
- if(rit != start)\r
- t = *rit, *rit = *start, *start = t;\r
-\r
- quicksort(start, rit - 1);\r
- quicksort(rit + 1, stop);\r
-}\r
-/** binsearch\r
- * Binary search for the first occurence of *stop's MSB in sorted [start,stop]\r
- */\r
-static inline uint32_t* binsearch(uint32_t *start, uint32_t *stop)\r
-{\r
- uint32_t mid, val = *stop & 0xff000000;\r
- while(start != stop)\r
- if(start[mid = (stop - start) >> 1] > val)\r
- stop = &start[mid];\r
- else\r
- start += mid + 1;\r
-\r
- return start;\r
-}\r
-\r