; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (trianglemesh)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.vmath::vec3" = type { float, float, float }
%class.SpatialPointGrid = type { i32, i32, i32, double, %"class.std::vector.41", %"class.std::vector.15", %class.Array3d.46, %class.AABB }
%"class.std::vector.41" = type { %"struct.std::_Vector_base.42" }
%"struct.std::_Vector_base.42" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d.46 = type { i32, i32, i32, ptr, i8, %"struct.SpatialPointGrid::CellNode", i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.std::vector.47" = type { %"struct.std::_Vector_base.48" }
%"struct.std::_Vector_base.48" = type { %"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.27" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.31" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%struct.GridPointReference = type { i32 }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator.52" = type { ptr }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z26sortVertexPairByFirstIndexRKSt4pairIiiES2_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh25_findDuplicateVertexPairsEiiidRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) #5 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %class.SpatialPointGrid, align 8
  %14 = alloca %"class.std::vector.47", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::vector.27", align 8
  %18 = alloca i8, align 1
  %19 = alloca %"class.std::allocator.31", align 1
  %20 = alloca double, align 8
  %21 = alloca %"class.std::vector.47", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %struct.GridPointReference, align 4
  %26 = alloca %struct.GridPointReference, align 4
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca %"class.vmath::vec3", align 4
  %30 = alloca double, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca %"struct.std::pair", align 4
  %34 = alloca %"struct.std::_Bit_reference", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator.52", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator.52", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !11
  store ptr %5, ptr %12, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 152, ptr %13) #8
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load double, ptr %11, align 8, !tbaa !11
  call void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152) %13, i32 noundef %38, i32 noundef %39, i32 noundef %40, double noundef %41)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #8
  %42 = getelementptr inbounds %class.TriangleMesh, ptr %37, i32 0, i32 0
  invoke void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind writable sret(%"class.std::vector.47") align 8 %14, ptr noundef nonnull align 8 dereferenceable(152) %13, ptr noundef nonnull align 8 dereferenceable(24) %42)
          to label %43 unwind label %54

43:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #8
  %44 = getelementptr inbounds %class.TriangleMesh, ptr %37, i32 0, i32 0
  %45 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #8
  store i8 0, ptr %18, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #8
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %17, i64 noundef %45, ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %46 unwind label %58

46:                                               ; preds = %43
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store double 1.000000e-05, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %174, %46
  %48 = load i32, ptr %22, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds %class.TriangleMesh, ptr %37, i32 0, i32 0
  %51 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #8
  %52 = icmp ult i64 %49, %51
  br i1 %52, label %62, label %53

53:                                               ; preds = %47
  store i32 2, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %188

54:                                               ; preds = %6
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %15, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %16, align 4
  br label %206

58:                                               ; preds = %43
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %15, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %16, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #8
  br label %205

62:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  %63 = load i32, ptr %22, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %17, i64 noundef %64)
          to label %66 unwind label %73

66:                                               ; preds = %62
  %67 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %68 = extractvalue { ptr, i64 } %65, 0
  store ptr %68, ptr %67, align 8
  %69 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %70 = extractvalue { ptr, i64 } %65, 1
  store i64 %70, ptr %69, align 8
  %71 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  br i1 %71, label %72, label %77

72:                                               ; preds = %66
  br label %174

73:                                               ; preds = %62
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %15, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  br label %187

77:                                               ; preds = %66
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  %78 = load i32, ptr %22, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %79) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %80, i64 4, i1 false), !tbaa.struct !15
  %81 = load double, ptr %20, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.GridPointReference, ptr %25, i32 0, i32 0
  %83 = load i32, ptr %82, align 4
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152) %13, i32 %83, double noundef %81, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %84 unwind label %88

84:                                               ; preds = %77
  %85 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  %86 = icmp eq i64 %85, 0
  br i1 %86, label %87, label %92

87:                                               ; preds = %84
  br label %174

88:                                               ; preds = %77
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %15, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %16, align 4
  br label %187

92:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  invoke void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %93 unwind label %98

93:                                               ; preds = %92
  %94 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  %95 = icmp eq i64 %94, 1
  br i1 %95, label %96, label %102

96:                                               ; preds = %93
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 0) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %97, i64 4, i1 false), !tbaa.struct !15
  br label %149

98:                                               ; preds = %92
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %15, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %16, align 4
  br label %186

102:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %103 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  store double %103, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %144, %102
  %105 = load i32, ptr %28, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  %108 = icmp ult i64 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  store i32 5, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %148

110:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #8
  %111 = getelementptr inbounds %class.TriangleMesh, ptr %37, i32 0, i32 0
  %112 = load i32, ptr %22, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113) #8
  %115 = getelementptr inbounds %class.TriangleMesh, ptr %37, i32 0, i32 0
  %116 = load i32, ptr %28, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %117) #8
  %119 = getelementptr inbounds %struct.GridPointReference, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !16
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %121) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %114, ptr noundef nonnull align 4 dereferenceable(12) %122)
          to label %123 unwind label %135

123:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %124 = invoke noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %29)
          to label %125 unwind label %139

125:                                              ; preds = %123
  %126 = fpext float %124 to double
  store double %126, ptr %30, align 8, !tbaa !11
  %127 = load double, ptr %30, align 8, !tbaa !11
  %128 = load double, ptr %27, align 8, !tbaa !11
  %129 = fcmp olt double %127, %128
  br i1 %129, label %130, label %143

130:                                              ; preds = %125
  %131 = load double, ptr %30, align 8, !tbaa !11
  store double %131, ptr %27, align 8, !tbaa !11
  %132 = load i32, ptr %28, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %133) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %134, i64 4, i1 false), !tbaa.struct !15
  br label %143

135:                                              ; preds = %110
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %15, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %16, align 4
  br label %147

139:                                              ; preds = %123
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %15, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  br label %147

143:                                              ; preds = %130, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %28, align 4, !tbaa !9
  %146 = add i32 %145, 1
  store i32 %146, ptr %28, align 4, !tbaa !9
  br label %104, !llvm.loop !18

147:                                              ; preds = %139, %135
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %186

148:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %149

149:                                              ; preds = %148, %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %150 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %150, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %151 = getelementptr inbounds %struct.GridPointReference, ptr %26, i32 0, i32 0
  %152 = load i32, ptr %151, align 4, !tbaa !16
  store i32 %152, ptr %32, align 4, !tbaa !9
  %153 = load i32, ptr %32, align 4, !tbaa !9
  %154 = load i32, ptr %31, align 4, !tbaa !9
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %160

156:                                              ; preds = %149
  %157 = getelementptr inbounds %struct.GridPointReference, ptr %26, i32 0, i32 0
  %158 = load i32, ptr %157, align 4, !tbaa !16
  store i32 %158, ptr %31, align 4, !tbaa !9
  %159 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %159, ptr %32, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %156, %149
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %162 unwind label %177

162:                                              ; preds = %160
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %161, ptr noundef nonnull align 4 dereferenceable(8) %33)
          to label %163 unwind label %177

163:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #8
  %164 = getelementptr inbounds %struct.GridPointReference, ptr %26, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !16
  %166 = sext i32 %165 to i64
  %167 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %17, i64 noundef %166)
          to label %168 unwind label %181

168:                                              ; preds = %163
  %169 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 0
  %170 = extractvalue { ptr, i64 } %167, 0
  store ptr %170, ptr %169, align 8
  %171 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 1
  %172 = extractvalue { ptr, i64 } %167, 1
  store i64 %172, ptr %171, align 8
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %34, i1 noundef zeroext true) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %174

174:                                              ; preds = %168, %87, %72
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = add i32 %175, 1
  store i32 %176, ptr %22, align 4, !tbaa !9
  br label %47, !llvm.loop !20

177:                                              ; preds = %162, %160
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %15, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %185

181:                                              ; preds = %163
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %15, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #8
  br label %185

185:                                              ; preds = %181, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %186

186:                                              ; preds = %185, %147, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %187

187:                                              ; preds = %186, %88, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %204

188:                                              ; preds = %53
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  %190 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %189) #8
  %191 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.52", ptr %35, i32 0, i32 0
  store ptr %190, ptr %191, align 8
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  %193 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %192) #8
  %194 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.52", ptr %36, i32 0, i32 0
  store ptr %193, ptr %194, align 8
  %195 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.52", ptr %35, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8
  %197 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.52", ptr %36, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEPFbRKS3_SA_EEvT_SD_T0_(ptr %196, ptr %198, ptr noundef @_Z26sortVertexPairByFirstIndexRKSt4pairIiiES2_)
          to label %199 unwind label %200

199:                                              ; preds = %188
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %13) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr %13) #8
  ret void

200:                                              ; preds = %188
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %15, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %16, align 4
  br label %204

204:                                              ; preds = %200, %187
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #8
  br label %205

205:                                              ; preds = %204, %58
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #8
  br label %206

206:                                              ; preds = %205, %54
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %13) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr %13) #8
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %15, align 8
  %209 = load i32, ptr %16, align 4
  %210 = insertvalue { ptr, i32 } poison, ptr %208, 0
  %211 = insertvalue { ptr, i32 } %210, i32 %209, 1
  resume { ptr, i32 } %211
}

declare void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef, i32 noundef, i32 noundef, double noundef) unnamed_addr #4

declare void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind writable sret(%"class.std::vector.47") align 8, ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

declare void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152), i32, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12)) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEPFbRKS3_SA_EEvT_SD_T0_(ptr, ptr, ptr noundef) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i64 0, i64 4, !9}
!16 = !{!17, !10, i64 0}
!17 = !{!"_ZTS18GridPointReference", !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.vmath::vec3" = type { float, float, float }
%class.SpatialPointGrid = type { i32, i32, i32, double, %"class.std::vector.41", %"class.std::vector.15", %class.Array3d.46, %class.AABB }
%"class.std::vector.41" = type { %"struct.std::_Vector_base.42" }
%"struct.std::_Vector_base.42" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d.46 = type { i32, i32, i32, ptr, i8, %"struct.SpatialPointGrid::CellNode", i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.std::vector.47" = type { %"struct.std::_Vector_base.48" }
%"struct.std::_Vector_base.48" = type { %"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPointReference, std::allocator<GridPointReference>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.27" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.31" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%struct.GridPointReference = type { i32 }
%"struct.std::pair" = type { i32, i32 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z26sortVertexPairByFirstIndexRKSt4pairIiiES2_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh25_findDuplicateVertexPairsEiiidRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.SpatialPointGrid, align 8
  %8 = alloca %"class.std::vector.47", align 8
  %9 = alloca %"class.std::vector.27", align 8
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::allocator.31", align 1
  %12 = alloca %"class.std::vector.47", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = alloca %struct.GridPointReference, align 4
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %7) #7
  call void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152) %7, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  invoke void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.47") align 8 %8, ptr noundef nonnull align 8 dereferenceable(152) %7, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %20 unwind label %28

20:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #7
  %21 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  store i8 0, ptr %10, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %22 unwind label %30

22:                                               ; preds = %20
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %23 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph49

.lr.ph49:                                         ; preds = %22
  %24 = getelementptr inbounds i8, ptr %13, i64 8
  %25 = getelementptr inbounds i8, ptr %19, i64 8
  br label %32

._crit_edge:                                      ; preds = %89, %22
  %26 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %27 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEPFbRKS3_SA_EEvT_SD_T0_(ptr %26, ptr %27, ptr noundef nonnull @_Z26sortVertexPairByFirstIndexRKSt4pairIiiES2_)
          to label %100 unwind label %101

28:                                               ; preds = %6
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %105

30:                                               ; preds = %20
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  br label %104

32:                                               ; preds = %.lr.ph49, %89
  %33 = phi i64 [ 0, %.lr.ph49 ], [ %91, %89 ]
  %.03247 = phi i32 [ 0, %.lr.ph49 ], [ %90, %89 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %34 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %33)
          to label %35 unwind label %39

35:                                               ; preds = %32
  %36 = extractvalue { ptr, i64 } %34, 0
  store ptr %36, ptr %13, align 8
  %37 = extractvalue { ptr, i64 } %34, 1
  store i64 %37, ptr %24, align 8
  %38 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  br i1 %38, label %89, label %41

39:                                               ; preds = %32
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  br label %103

41:                                               ; preds = %35
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %33) #7
  %.sroa.07.0.copyload = load i32, ptr %42, align 4, !tbaa !9
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152) %7, i32 %.sroa.07.0.copyload, double noundef 1.000000e-05, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %43 unwind label %46

43:                                               ; preds = %41
  %44 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %89, label %48

46:                                               ; preds = %41
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %103

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %14)
  %49 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %50 = icmp eq i64 %49, 1
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef 0) #7
  %53 = load i32, ptr %52, align 4, !tbaa !9
  store i32 %53, ptr %14, align 4, !tbaa !9
  br label %.loopexit

54:                                               ; preds = %48
  %55 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #7
  %56 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %.not50 = icmp eq i64 %56, 0
  br i1 %.not50, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %54, %72
  %57 = phi i64 [ %74, %72 ], [ 0, %54 ]
  %.03346 = phi i32 [ %73, %72 ], [ 0, %54 ]
  %.03445 = phi double [ %.135, %72 ], [ %55, %54 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #7
  %58 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %33) #7
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %57) #7
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %61) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %58, ptr noundef nonnull align 4 dereferenceable(12) %62)
          to label %63 unwind label %70

63:                                               ; preds = %.lr.ph
  %64 = call noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %15)
  %65 = fpext float %64 to double
  %66 = fcmp ogt double %.03445, %65
  br i1 %66, label %67, label %72

67:                                               ; preds = %63
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %57) #7
  %69 = load i32, ptr %68, align 4, !tbaa !9
  store i32 %69, ptr %14, align 4, !tbaa !9
  br label %72

70:                                               ; preds = %.lr.ph
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  br label %99

72:                                               ; preds = %67, %63
  %.135 = phi double [ %65, %67 ], [ %.03445, %63 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  %73 = add i32 %.03346, 1
  %74 = zext i32 %73 to i64
  %75 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %76 = icmp ugt i64 %75, %74
  br i1 %76, label %.lr.ph, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %72, %54, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 %.03247, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #7
  %77 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %77, ptr %17, align 4, !tbaa !9
  %78 = icmp slt i32 %77, %.03247
  br i1 %78, label %79, label %80

79:                                               ; preds = %.loopexit
  store i32 %77, ptr %16, align 4, !tbaa !9
  store i32 %.03247, ptr %17, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %79, %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %81 unwind label %94

81:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #7
  %82 = load i32, ptr %14, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %83)
          to label %85 unwind label %96

85:                                               ; preds = %81
  %86 = extractvalue { ptr, i64 } %84, 0
  store ptr %86, ptr %19, align 8
  %87 = extractvalue { ptr, i64 } %84, 1
  store i64 %87, ptr %25, align 8
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %19, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %89

89:                                               ; preds = %43, %35, %85
  %90 = add i32 %.03247, 1
  %91 = zext i32 %90 to i64
  %92 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %93 = icmp ugt i64 %92, %91
  br i1 %93, label %32, label %._crit_edge, !llvm.loop !15

94:                                               ; preds = %80
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  br label %98

96:                                               ; preds = %81
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  br label %98

98:                                               ; preds = %96, %94
  %.pn = phi { ptr, i32 } [ %97, %96 ], [ %95, %94 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  br label %99

99:                                               ; preds = %98, %70
  %.pn.pn = phi { ptr, i32 } [ %.pn, %98 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %103

100:                                              ; preds = %._crit_edge
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %7) #7
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %7) #7
  ret void

101:                                              ; preds = %._crit_edge
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %103

103:                                              ; preds = %39, %46, %99, %101
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %102, %101 ], [ %.pn.pn, %99 ], [ %47, %46 ], [ %40, %39 ]
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  br label %104

104:                                              ; preds = %103, %30
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %103 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %105

105:                                              ; preds = %104, %28
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %104 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %7) #7
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

declare void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef, i32 noundef, i32 noundef, double noundef) unnamed_addr #3

declare void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind writable sret(%"class.std::vector.47") align 8, ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

declare void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152), i32, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE8infinityEv() local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEPFbRKS3_SA_EEvT_SD_T0_(ptr, ptr, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS18GridPointReference", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass