anchor.diff:               id_min = 5
             end if
             tmin = tz
  -       else
  +       else if(tz.gt.ty) then
             if(pos_vy) then
                id_min = 4
             else
                id_min = 3
             end if
             tmin = ty
  +       else ! ty == tz
  +          id_min = 15
  +          if(pos_vy) id_min = id_min + 1
  +          if(pos_vz) id_min = id_min + 2
  +          tmin = ty
          end if
  +    else ! tx == tz
  +       if(tx.lt.ty) then
  +          id_min = 11
  +          if(pos_vx) id_min = id_min + 1
  +          if(pos_vz) id_min = id_min + 2
  +       else if(tx.gt.ty) then
  +          if(pos_vy) then
  +             id_min = 4
  +          else
  +             id_min = 3
  +          end if
  +       else
  +          id_min = 19
  +          if(pos_vx) id_min = id_min + 1
  +          if(pos_vy) id_min = id_min + 2
  +          if(pos_vz) id_min = id_min + 4
  +       end if
       end if
   
     end subroutine find_wall
  
positive.code:              id_min = 1
            end if
            tmin = tx
         else
            if(pos_vy) then
               id_min = 4
            else
               id_min = 3
            end if
            tmin = ty
         end if
      else
         if(tz.lt.ty) then
            if(pos_vz) then
               id_min = 6
  
negative.code:     ! in min function or any kind of loop. Each iteraction comprises only
      ! three if statements and two pointer assignements.
  
      ! xmin             = 1
      ! xmax             = 2
      ! ymin             = 3
      ! ymax             = 4
      ! zmin             = 5
      ! zmax             = 6
      ! xmin, ymin       = 7
      ! xmax, ymin       = 8
      ! xmin, ymax       = 9
      ! xmax, ymax       = 10
      ! xmin, zmin       = 11
      ! xmax, zmin       = 12
      ! xmin, zmax       = 13
      ! xmax, zmax       = 14
      ! ymin, zmin       = 15
      ! ymax, zmin       = 16
      ! ymin, zmax       = 17
      ! ymax, zmax       = 18
      ! xmin, ymin, zmin = 19
      ! xmax, ymin, zmin = 20
      ! xmin, ymax, zmin = 21
      ! xmax, ymax, zmin = 22
      ! xmin, ymin, zmax = 23
      ! xmax, ymin, zmax = 24
      ! xmin, ymax, zmax = 25
      ! xmax, ymax, zmax = 26
  
      if(tx.lt.tz) then
         if(tx.lt.ty) then
            if(pos_vx) then
  