Quadsort is a branchless stable adaptive mergesort faster than quicksort.
Generic algorithms and data structures for Lazarus/Free Pascal