anchor.diff:         polygon(:, 1) = uniques(:, 1)
          return
       end if
  -
  -    call sort_in_place(num_uniques, uniques)
   
       ! First create a "lower" convex hull
       num_lower = 0
  
positive.code: 
    end subroutine min_index
  
    subroutine sort_in_place(num_points, points)
  
      ! NOTE: This is a helper for ``convex_hull``. This does a simple quadratic
      !       sort (i.e. it is suboptimal) because it expects the number of
      !       points to be small.
  
      integer(c_int), intent(in) :: num_points
      real(c_double), intent(inout) :: points(2, num_points)
      ! Variables outside of signature.
      integer(c_int) :: i, match
      real(c_double) :: swap(2)
  
      do i = 1, num_points - 1
         call min_index(num_points + 1 - i, points(:, i:), match)
         ! Shift ``match`` based on the slice ``points(:, i:)``.
         match = match + i - 1
         if (match /= i) then
            swap = points(:, i)
            points(:, i) = points(:, match)
            points(:, match) = swap
         end if
      end do
  
    end subroutine sort_in_place
  
negative.code:     real(c_double) :: uniques(2, num_points)
      integer(c_int) :: num_lower, num_upper
      real(c_double) :: lower(2, num_points), upper(2, num_points)
      integer(c_int) :: i
      real(c_double) :: result_
  
      uniques = points
      call sort_in_place(num_points, uniques, num_uniques)
  
      ! In the "boring" case that we have fewer than 2 points, return.
      if (num_uniques == 0) then
  