; 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.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.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 }
%struct.GridPointReference = type { i32 }
%"struct.std::pair" = type { i32, i32 }
%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.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] }>

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 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)) #5

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh25_findDuplicateVertexPairsERSt6vectorIiSaIiEES3_4AABBdRS0_ISt4pairIiiESaIS6_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.vmath::vec3", align 4
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.vmath::vec3", align 4
  %23 = alloca %class.SpatialPointGrid, align 8
  %24 = alloca %"class.std::vector.47", align 8
  %25 = alloca double, align 8
  %26 = alloca %"class.std::vector.47", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.vmath::vec3", align 4
  %30 = alloca %"class.vmath::vec3", align 4
  %31 = alloca %struct.GridPointReference, align 4
  %32 = alloca double, align 8
  %33 = alloca i32, align 4
  %34 = alloca %"class.vmath::vec3", align 4
  %35 = alloca double, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca %"struct.std::pair", align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store double %4, ptr %11, align 8, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store double 6.250000e-02, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %40 = getelementptr inbounds %class.AABB, ptr %3, i32 0, i32 1
  %41 = load double, ptr %40, align 8, !tbaa !11
  %42 = load double, ptr %13, align 8, !tbaa !9
  %43 = fdiv double %41, %42
  %44 = call double @llvm.ceil.f64(double %43)
  %45 = fptosi double %44 to i32
  store i32 %45, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %46 = getelementptr inbounds %class.AABB, ptr %3, i32 0, i32 2
  %47 = load double, ptr %46, align 8, !tbaa !17
  %48 = load double, ptr %13, align 8, !tbaa !9
  %49 = fdiv double %47, %48
  %50 = call double @llvm.ceil.f64(double %49)
  %51 = fptosi double %50 to i32
  store i32 %51, ptr %15, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %52 = getelementptr inbounds %class.AABB, ptr %3, i32 0, i32 3
  %53 = load double, ptr %52, align 8, !tbaa !18
  %54 = load double, ptr %13, align 8, !tbaa !9
  %55 = fdiv double %53, %54
  %56 = call double @llvm.ceil.f64(double %55)
  %57 = fptosi double %56 to i32
  store i32 %57, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #8
  %58 = getelementptr inbounds %class.AABB, ptr %3, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %58, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #8
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #8
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %60)
          to label %61 unwind label %69

61:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !15
  br label %62

62:                                               ; preds = %84, %61
  %63 = load i32, ptr %21, align 4, !tbaa !15
  %64 = zext i32 %63 to i64
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %65) #8
  %67 = icmp ult i64 %64, %66
  br i1 %67, label %73, label %68

68:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %96

69:                                               ; preds = %6
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %19, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %20, align 4
  br label %230

73:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #8
  %74 = getelementptr inbounds %class.TriangleMesh, ptr %39, i32 0, i32 0
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i32, ptr %21, align 4, !tbaa !15
  %77 = zext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77) #8
  %79 = load i32, ptr %78, align 4, !tbaa !15
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %80) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %22, ptr noundef nonnull align 4 dereferenceable(12) %81, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %82 unwind label %87

82:                                               ; preds = %73
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %83 unwind label %91

83:                                               ; preds = %82
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %21, align 4, !tbaa !15
  %86 = add i32 %85, 1
  store i32 %86, ptr %21, align 4, !tbaa !15
  br label %62, !llvm.loop !21

87:                                               ; preds = %73
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %19, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %20, align 4
  br label %95

91:                                               ; preds = %82
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %19, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %20, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #8
  br label %95

95:                                               ; preds = %91, %87
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %230

96:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 152, ptr %23) #8
  %97 = load i32, ptr %14, align 4, !tbaa !15
  %98 = load i32, ptr %15, align 4, !tbaa !15
  %99 = load i32, ptr %16, align 4, !tbaa !15
  %100 = load double, ptr %13, align 8, !tbaa !9
  invoke void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152) %23, i32 noundef %97, i32 noundef %98, i32 noundef %99, double noundef %100)
          to label %101 unwind label %111

101:                                              ; preds = %96
  invoke void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind writable sret(%"class.std::vector.47") align 8 %24, ptr noundef nonnull align 8 dereferenceable(152) %23, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %102 unwind label %115

102:                                              ; preds = %101
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %103 = load double, ptr %11, align 8, !tbaa !9
  store double %103, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !15
  br label %104

104:                                              ; preds = %217, %102
  %105 = load i32, ptr %27, align 4, !tbaa !15
  %106 = zext i32 %105 to i64
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #8
  %109 = icmp ult i64 %106, %108
  br i1 %109, label %119, label %110

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

111:                                              ; preds = %96
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %19, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %20, align 4
  br label %229

115:                                              ; preds = %101
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %19, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %20, align 4
  br label %228

119:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #8
  %120 = getelementptr inbounds %class.TriangleMesh, ptr %39, i32 0, i32 0
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load i32, ptr %27, align 4, !tbaa !15
  %123 = zext i32 %122 to i64
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %123) #8
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %120, i64 noundef %126) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %127, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %128 unwind label %134

128:                                              ; preds = %119
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %29, i64 12, i1 false), !tbaa.struct !19
  %129 = load double, ptr %25, align 8, !tbaa !9
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereEN5vmath4vec3EdRSt6vectorI18GridPointReferenceSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %23, ptr noundef %30, double noundef %129, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %130 unwind label %138

130:                                              ; preds = %128
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %30) #8
  %131 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %132 = icmp eq i64 %131, 0
  br i1 %132, label %133, label %142

133:                                              ; preds = %130
  store i32 7, ptr %28, align 4
  br label %214

134:                                              ; preds = %119
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %19, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %20, align 4
  br label %226

138:                                              ; preds = %128
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %19, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %20, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %30) #8
  br label %225

142:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  invoke void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %143 unwind label %148

143:                                              ; preds = %142
  %144 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %145 = icmp eq i64 %144, 1
  br i1 %145, label %146, label %152

146:                                              ; preds = %143
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 0) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %147, i64 4, i1 false), !tbaa.struct !23
  br label %199

148:                                              ; preds = %142
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %19, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %20, align 4
  br label %224

152:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %153 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  store double %153, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !15
  br label %154

154:                                              ; preds = %194, %152
  %155 = load i32, ptr %33, align 4, !tbaa !15
  %156 = zext i32 %155 to i64
  %157 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %158 = icmp ult i64 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %154
  store i32 8, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %198

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 12, ptr %34) #8
  %161 = getelementptr inbounds %class.TriangleMesh, ptr %39, i32 0, i32 0
  %162 = load i32, ptr %27, align 4, !tbaa !15
  %163 = zext i32 %162 to i64
  %164 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %163) #8
  %165 = getelementptr inbounds %class.TriangleMesh, ptr %39, i32 0, i32 0
  %166 = load i32, ptr %33, align 4, !tbaa !15
  %167 = zext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %167) #8
  %169 = getelementptr inbounds %struct.GridPointReference, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 4, !tbaa !24
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %165, i64 noundef %171) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %34, ptr noundef nonnull align 4 dereferenceable(12) %164, ptr noundef nonnull align 4 dereferenceable(12) %172)
          to label %173 unwind label %185

173:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %174 = invoke noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %34)
          to label %175 unwind label %189

175:                                              ; preds = %173
  %176 = fpext float %174 to double
  store double %176, ptr %35, align 8, !tbaa !9
  %177 = load double, ptr %35, align 8, !tbaa !9
  %178 = load double, ptr %32, align 8, !tbaa !9
  %179 = fcmp olt double %177, %178
  br i1 %179, label %180, label %193

180:                                              ; preds = %175
  %181 = load double, ptr %35, align 8, !tbaa !9
  store double %181, ptr %32, align 8, !tbaa !9
  %182 = load i32, ptr %33, align 4, !tbaa !15
  %183 = zext i32 %182 to i64
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %183) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %184, i64 4, i1 false), !tbaa.struct !23
  br label %193

185:                                              ; preds = %160
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %19, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %20, align 4
  br label %197

189:                                              ; preds = %173
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %19, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %34) #8
  br label %197

193:                                              ; preds = %180, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %34) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #8
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %33, align 4, !tbaa !15
  %196 = add i32 %195, 1
  store i32 %196, ptr %33, align 4, !tbaa !15
  br label %154, !llvm.loop !26

197:                                              ; preds = %189, %185
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %224

198:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %199

199:                                              ; preds = %198, %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load i32, ptr %27, align 4, !tbaa !15
  %202 = zext i32 %201 to i64
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %200, i64 noundef %202) #8
  %204 = load i32, ptr %203, align 4, !tbaa !15
  store i32 %204, ptr %36, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.GridPointReference, ptr %31, i32 0, i32 0
  %207 = load i32, ptr %206, align 4, !tbaa !24
  %208 = sext i32 %207 to i64
  %209 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %205, i64 noundef %208) #8
  %210 = load i32, ptr %209, align 4, !tbaa !15
  store i32 %210, ptr %37, align 4, !tbaa !15
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %38, ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %212 unwind label %220

212:                                              ; preds = %199
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %211, ptr noundef nonnull align 4 dereferenceable(8) %38)
          to label %213 unwind label %220

213:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  store i32 0, ptr %28, align 4
  br label %214

214:                                              ; preds = %213, %133
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  %215 = load i32, ptr %28, align 4
  switch i32 %215, label %236 [
    i32 0, label %216
    i32 7, label %217
  ]

216:                                              ; preds = %214
  br label %217

217:                                              ; preds = %216, %214
  %218 = load i32, ptr %27, align 4, !tbaa !15
  %219 = add i32 %218, 1
  store i32 %219, ptr %27, align 4, !tbaa !15
  br label %104, !llvm.loop !27

220:                                              ; preds = %212, %199
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %19, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %224

224:                                              ; preds = %220, %197, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %225

225:                                              ; preds = %224, %138
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  br label %226

226:                                              ; preds = %225, %134
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %228

227:                                              ; preds = %110
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %23) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr %23) #8
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  ret void

228:                                              ; preds = %226, %115
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %23) #8
  br label %229

229:                                              ; preds = %228, %111
  call void @llvm.lifetime.end.p0(i64 152, ptr %23) #8
  br label %230

230:                                              ; preds = %229, %95, %69
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %19, align 8
  %233 = load i32, ptr %20, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235

236:                                              ; preds = %214
  unreachable
}

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

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)) #5

; 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

; 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)) #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: 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #7

declare void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereEN5vmath4vec3EdRSt6vectorI18GridPointReferenceSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #5

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 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS4AABB", !13, i64 0, !10, i64 16, !10, i64 24, !10, i64 32}
!13 = !{!"_ZTSN5vmath4vec3E", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!12, !10, i64 24}
!18 = !{!12, !10, i64 32}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{i64 0, i64 4, !15}
!24 = !{!25, !16, i64 0}
!25 = !{!"_ZTS18GridPointReference", !16, i64 0}
!26 = distinct !{!26, !22}
!27 = distinct !{!27, !22}


; 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.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.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 }
%struct.GridPointReference = type { i32 }
%"struct.std::pair" = type { i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 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) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 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 #5

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh25_findDuplicateVertexPairsERSt6vectorIiSaIiEES3_4AABBdRS0_ISt4pairIiiESaIS6_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr nocapture noundef readonly %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.vmath::vec3", align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %class.SpatialPointGrid, align 8
  %11 = alloca %"class.std::vector.47", align 8
  %12 = alloca %"class.std::vector.47", align 8
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca %"class.vmath::vec3", align 4
  %15 = alloca %struct.GridPointReference, align 4
  %16 = alloca %"class.vmath::vec3", align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = getelementptr inbounds i8, ptr %3, i64 16
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = fmul double %21, 1.600000e+01
  %23 = tail call double @llvm.ceil.f64(double %22)
  %24 = fptosi double %23 to i32
  %25 = getelementptr inbounds i8, ptr %3, i64 24
  %26 = load double, ptr %25, align 8, !tbaa !12
  %27 = fmul double %26, 1.600000e+01
  %28 = tail call double @llvm.ceil.f64(double %27)
  %29 = fptosi double %28 to i32
  %30 = getelementptr inbounds i8, ptr %3, i64 32
  %31 = load double, ptr %30, align 8, !tbaa !13
  %32 = fmul double %31, 1.600000e+01
  %33 = tail call double @llvm.ceil.f64(double %32)
  %34 = fptosi double %33 to i32
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(12) %3, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  %35 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %35)
          to label %.preheader unwind label %37

.preheader:                                       ; preds = %6
  %36 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %.not = icmp eq i64 %36, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %45, %.preheader
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %10) #8
  invoke void @_ZN16SpatialPointGridC1Eiiid(ptr noundef nonnull align 8 dereferenceable(152) %10, i32 noundef %24, i32 noundef %29, i32 noundef %34, double noundef 6.250000e-02)
          to label %55 unwind label %58

37:                                               ; preds = %6
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %123

.lr.ph:                                           ; preds = %.preheader, %45
  %39 = phi i64 [ %47, %45 ], [ 0, %.preheader ]
  %.04558 = phi i32 [ %46, %45 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %39) #8
  %41 = load i32, ptr %40, align 4, !tbaa !16
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %42) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %44 unwind label %50

44:                                               ; preds = %.lr.ph
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %45 unwind label %52

45:                                               ; preds = %44
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  %46 = add i32 %.04558, 1
  %47 = zext i32 %46 to i64
  %48 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %49 = icmp ugt i64 %48, %47
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !18

50:                                               ; preds = %.lr.ph
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

52:                                               ; preds = %44
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  br label %54

54:                                               ; preds = %52, %50
  %.pn55 = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  br label %123

55:                                               ; preds = %._crit_edge
  invoke void @_ZN16SpatialPointGrid6insertERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.47") align 8 %11, ptr noundef nonnull align 8 dereferenceable(152) %10, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %56 unwind label %60

56:                                               ; preds = %55
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %57 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  %.not67 = icmp eq i64 %57, 0
  br i1 %.not67, label %._crit_edge66, label %.lr.ph65

._crit_edge66:                                    ; preds = %111, %56
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %10) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %10) #8
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  ret void

58:                                               ; preds = %._crit_edge
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %122

60:                                               ; preds = %55
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %121

.lr.ph65:                                         ; preds = %56, %111
  %62 = phi i64 [ %113, %111 ], [ 0, %56 ]
  %.03763 = phi i32 [ %112, %111 ], [ 0, %56 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #8
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %62) #8
  %64 = load i32, ptr %63, align 4, !tbaa !16
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %65) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %66, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %67 unwind label %71

67:                                               ; preds = %.lr.ph65
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %13, i64 12, i1 false), !tbaa.struct !14
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereEN5vmath4vec3EdRSt6vectorI18GridPointReferenceSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %10, ptr noundef nonnull %14, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %68 unwind label %73

68:                                               ; preds = %67
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #8
  %69 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %111, label %75

71:                                               ; preds = %.lr.ph65
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %120

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #8
  br label %119

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  call void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %15)
  %76 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %77 = icmp eq i64 %76, 1
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef 0) #8
  %80 = load i32, ptr %79, align 4, !tbaa !16
  store i32 %80, ptr %15, align 4, !tbaa !16
  br label %.loopexit

81:                                               ; preds = %75
  %82 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  %83 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %.not68 = icmp eq i64 %83, 0
  br i1 %.not68, label %.loopexit, label %.lr.ph62

.lr.ph62:                                         ; preds = %81, %99
  %84 = phi i64 [ %101, %99 ], [ 0, %81 ]
  %.03460 = phi i32 [ %100, %99 ], [ 0, %81 ]
  %.03559 = phi double [ %.136, %99 ], [ %82, %81 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #8
  %85 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %62) #8
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %84) #8
  %87 = load i32, ptr %86, align 4, !tbaa !20
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %88) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %85, ptr noundef nonnull align 4 dereferenceable(12) %89)
          to label %90 unwind label %97

90:                                               ; preds = %.lr.ph62
  %91 = call noundef float @_ZN5vmath8lengthsqERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %16)
  %92 = fpext float %91 to double
  %93 = fcmp ogt double %.03559, %92
  br i1 %93, label %94, label %99

94:                                               ; preds = %90
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %84) #8
  %96 = load i32, ptr %95, align 4, !tbaa !16
  store i32 %96, ptr %15, align 4, !tbaa !16
  br label %99

97:                                               ; preds = %.lr.ph62
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #8
  br label %118

99:                                               ; preds = %94, %90
  %.136 = phi double [ %92, %94 ], [ %.03559, %90 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #8
  %100 = add i32 %.03460, 1
  %101 = zext i32 %100 to i64
  %102 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %103 = icmp ugt i64 %102, %101
  br i1 %103, label %.lr.ph62, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %99, %81, %78
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %62) #8
  %105 = load i32, ptr %104, align 4, !tbaa !16
  store i32 %105, ptr %17, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #8
  %106 = load i32, ptr %15, align 4, !tbaa !20
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %107) #8
  %109 = load i32, ptr %108, align 4, !tbaa !16
  store i32 %109, ptr %18, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %110 unwind label %116

110:                                              ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  br label %111

111:                                              ; preds = %68, %110
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  %112 = add i32 %.03763, 1
  %113 = zext i32 %112 to i64
  %114 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  %115 = icmp ugt i64 %114, %113
  br i1 %115, label %.lr.ph65, label %._crit_edge66, !llvm.loop !23

116:                                              ; preds = %.loopexit
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  br label %118

118:                                              ; preds = %116, %97
  %.pn = phi { ptr, i32 } [ %117, %116 ], [ %98, %97 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  br label %119

119:                                              ; preds = %118, %73
  %.pn.pn = phi { ptr, i32 } [ %.pn, %118 ], [ %74, %73 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  br label %120

120:                                              ; preds = %119, %71
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %119 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  br label %121

121:                                              ; preds = %120, %60
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %120 ], [ %61, %60 ]
  call void @_ZN16SpatialPointGridD1Ev(ptr noundef nonnull align 8 dereferenceable(152) %10) #8
  br label %122

122:                                              ; preds = %121, %58
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %121 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %10) #8
  br label %123

123:                                              ; preds = %122, %54, %37
  %.pn55.pn = phi { ptr, i32 } [ %.pn55, %54 ], [ %.pn.pn.pn.pn.pn, %122 ], [ %38, %37 ]
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  resume { ptr, i32 } %.pn55.pn
}

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

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 #5

; 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

; 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 #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)) 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: 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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #7

declare void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereEN5vmath4vec3EdRSt6vectorI18GridPointReferenceSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5

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 = { mustprogress 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 = { 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 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 16}
!6 = !{!"_ZTS4AABB", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32}
!7 = !{!"_ZTSN5vmath4vec3E", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !11, i64 32}
!14 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15}
!15 = !{!8, !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !9, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !17, i64 0}
!21 = !{!"_ZTS18GridPointReference", !17, i64 0}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}


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