protected static function partition(array &$src, array &$dst, int $lo, int $hi, callable $comp): void
    {
        if ($hi <= $lo + static::SORT_CUTOFF) {
            static::insertionSort($dst, $lo, $hi, $comp);

            return;
        }

        $mid = (int) ($lo + ($hi - $lo) / 2);
        static::partition($dst, $src, $lo, $mid, $comp);
        static::partition($dst, $src, $mid + 1, $hi, $comp);

        if (!static::lt($src[$mid + 1], $src[$mid], $comp)) {
            for ($i = $lo; $i <= $hi; $i++) {
                $dst[$i] = $src[$i];
            }

            return;
        }

        static::merge($src, $dst, $lo, $mid, $hi, $comp);
    }