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

; 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"

%struct.GridPointReference = type { i32 }
%"class.std::vector.20" = 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.34" = type { i8 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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.std::_Bit_reference" = type { ptr, i64 }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }
%class.SpatialPointGrid = type { i32, i32, i32, double, %"class.std::vector", %"class.std::vector.0", %class.Array3d, %class.AABB }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 = 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 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIbSaIbEERS1_IS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152), i32, double noundef, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid19_getConnectedPointsE18GridPointReferencedRSt6vectorIN5vmath4vec3ESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.GridPointReference, align 4
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector.20", align 8
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::allocator.34", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector.5", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca %struct.GridPointReference, align 4
  %17 = alloca %struct.GridPoint, align 4
  %18 = alloca %"class.std::vector.5", align 8
  %19 = alloca %struct.GridPointReference, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca %"class.vmath::vec3", align 4
  %24 = alloca %struct.GridPointReference, align 4
  %25 = getelementptr inbounds %struct.GridPointReference, ptr %5, i32 0, i32 0
  store i32 %1, ptr %25, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #6
  %27 = getelementptr inbounds %class.SpatialPointGrid, ptr %26, i32 0, i32 4
  %28 = call noundef i64 @_ZNKSt6vectorI9GridPointSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i8 0, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %28, ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %29 unwind label %58

29:                                               ; preds = %4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %30 unwind label %62

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %31 = getelementptr inbounds %struct.GridPointReference, ptr %5, i32 0, i32 0
  %32 = load i32, ptr %31, align 4, !tbaa !13
  %33 = sext i32 %32 to i64
  %34 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %33)
          to label %35 unwind label %66

35:                                               ; preds = %30
  %36 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %37 = extractvalue { ptr, i64 } %34, 0
  store ptr %37, ptr %36, align 8
  %38 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %39 = extractvalue { ptr, i64 } %34, 1
  store i64 %39, ptr %38, align 8
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext true) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  invoke void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %41 unwind label %70

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %17)
          to label %42 unwind label %74

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  br label %43

43:                                               ; preds = %131, %42
  %44 = call noundef zeroext i1 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %45 = xor i1 %44, true
  br i1 %45, label %46, label %141

46:                                               ; preds = %43
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %47, i64 4, i1 false), !tbaa.struct !16
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %5, i64 4, i1 false), !tbaa.struct !16
  %48 = load double, ptr %7, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.GridPointReference, ptr %19, i32 0, i32 0
  %50 = load i32, ptr %49, align 4
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIbSaIbEERS1_IS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152) %26, i32 %50, double noundef %48, ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %51 unwind label %78

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !17
  br label %52

52:                                               ; preds = %122, %51
  %53 = load i32, ptr %20, align 4, !tbaa !17
  %54 = zext i32 %53 to i64
  %55 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %56 = icmp ult i64 %54, %55
  br i1 %56, label %82, label %57

57:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %126

58:                                               ; preds = %4
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %12, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %13, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %146

62:                                               ; preds = %29
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %13, align 4
  br label %145

66:                                               ; preds = %30
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %12, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %145

70:                                               ; preds = %35
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %12, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %13, align 4
  br label %144

74:                                               ; preds = %41
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %12, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %13, align 4
  br label %143

78:                                               ; preds = %46
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  br label %142

82:                                               ; preds = %52
  %83 = load i32, ptr %20, align 4, !tbaa !17
  %84 = zext i32 %83 to i64
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %84) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %85, i64 4, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %86 = getelementptr inbounds %struct.GridPointReference, ptr %16, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !13
  %88 = sext i32 %87 to i64
  %89 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %88)
          to label %90 unwind label %109

90:                                               ; preds = %82
  %91 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %92 = extractvalue { ptr, i64 } %89, 0
  store ptr %92, ptr %91, align 8
  %93 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %94 = extractvalue { ptr, i64 } %89, 1
  store i64 %94, ptr %93, align 8
  %95 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  %96 = xor i1 %95, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br i1 %96, label %97, label %121

97:                                               ; preds = %90
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %98 unwind label %113

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %99 = getelementptr inbounds %struct.GridPointReference, ptr %16, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !13
  %101 = sext i32 %100 to i64
  %102 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %101)
          to label %103 unwind label %117

103:                                              ; preds = %98
  %104 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %105 = extractvalue { ptr, i64 } %102, 0
  store ptr %105, ptr %104, align 8
  %106 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %107 = extractvalue { ptr, i64 } %102, 1
  store i64 %107, ptr %106, align 8
  %108 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %22, i1 noundef zeroext true) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  br label %121

109:                                              ; preds = %82
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %12, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %125

113:                                              ; preds = %97
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %12, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %13, align 4
  br label %125

117:                                              ; preds = %98
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %12, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  br label %125

121:                                              ; preds = %103, %90
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %20, align 4, !tbaa !17
  %124 = add i32 %123, 1
  store i32 %124, ptr %20, align 4, !tbaa !17
  br label %52, !llvm.loop !18

125:                                              ; preds = %117, %113, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %142

126:                                              ; preds = %57
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %5, i64 4, i1 false), !tbaa.struct !16
  %128 = getelementptr inbounds %struct.GridPointReference, ptr %24, i32 0, i32 0
  %129 = load i32, ptr %128, align 4
  invoke void @_ZN16SpatialPointGrid21getPointFromReferenceE18GridPointReference(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %23, ptr noundef nonnull align 8 dereferenceable(152) %26, i32 %129)
          to label %130 unwind label %132

130:                                              ; preds = %126
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %127, ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %131 unwind label %136

131:                                              ; preds = %130
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #6
  br label %43, !llvm.loop !20

132:                                              ; preds = %126
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %12, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %13, align 4
  br label %140

136:                                              ; preds = %130
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %12, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %13, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #6
  br label %140

140:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #6
  br label %142

141:                                              ; preds = %43
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  ret void

142:                                              ; preds = %140, %125, %78
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %17) #6
  br label %143

143:                                              ; preds = %142, %74
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %144

144:                                              ; preds = %143, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %145

145:                                              ; preds = %144, %66, %62
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  br label %146

146:                                              ; preds = %145, %58
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %12, align 8
  %149 = load i32, ptr %13, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151
}

; 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) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16SpatialPointGrid21getPointFromReferenceE18GridPointReference(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(152), i32) #5 align 2

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

; 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)) #1 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) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS18GridPointReference", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{i64 0, i64 4, !17}
!17 = !{!15, !15, 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"

%struct.GridPointReference = type { i32 }
%"class.std::vector.20" = 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.34" = type { i8 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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.std::_Bit_reference" = type { ptr, i64 }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid19_getConnectedPointsE18GridPointReferencedRSt6vectorIN5vmath4vec3ESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.GridPointReference, align 4
  %6 = alloca %"class.std::vector.20", align 8
  %7 = alloca i8, align 1
  %8 = alloca %"class.std::allocator.34", align 1
  %9 = alloca %"class.std::vector.5", align 8
  %10 = alloca %"struct.std::_Bit_reference", align 8
  %11 = alloca %struct.GridPointReference, align 4
  %12 = alloca %struct.GridPoint, align 4
  %13 = alloca %"class.std::vector.5", align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca %"class.vmath::vec3", align 4
  store i32 %1, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = tail call noundef i64 @_ZNKSt6vectorI9GridPointSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  store i8 0, ptr %7, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #5
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %18, ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %19 unwind label %37

19:                                               ; preds = %4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %20 unwind label %39

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %22)
          to label %24 unwind label %41

24:                                               ; preds = %20
  %25 = extractvalue { ptr, i64 } %23, 0
  store ptr %25, ptr %10, align 8
  %26 = getelementptr inbounds i8, ptr %10, i64 8
  %27 = extractvalue { ptr, i64 } %23, 1
  store i64 %27, ptr %26, align 8
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %10, i1 noundef zeroext true) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  call void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %12)
          to label %29 unwind label %43

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %30 = call noundef zeroext i1 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br i1 %30, label %._crit_edge26, label %.lr.ph25

.lr.ph25:                                         ; preds = %29
  %31 = getelementptr inbounds i8, ptr %14, i64 8
  %32 = getelementptr inbounds i8, ptr %15, i64 8
  br label %33

33:                                               ; preds = %.lr.ph25, %77
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %35 = load i32, ptr %34, align 4, !tbaa !12
  store i32 %35, ptr %5, align 4, !tbaa !12
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %.sroa.03.0.copyload = load i32, ptr %5, align 4, !tbaa !12
  invoke void @_ZN16SpatialPointGrid32queryPointReferencesInsideSphereE18GridPointReferencedRSt6vectorIbSaIbEERS1_IS0_SaIS0_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 %.sroa.03.0.copyload, double noundef %2, ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %.preheader unwind label %45

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

._crit_edge:                                      ; preds = %71, %.preheader
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #5
  %.sroa.0.0.copyload = load i32, ptr %5, align 4, !tbaa !12
  invoke void @_ZN16SpatialPointGrid21getPointFromReferenceE18GridPointReference(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %16, ptr noundef nonnull align 8 dereferenceable(152) %0, i32 %.sroa.0.0.copyload)
          to label %76 unwind label %79

37:                                               ; preds = %4
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  br label %87

39:                                               ; preds = %19
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %86

41:                                               ; preds = %20
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %86

43:                                               ; preds = %24
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %85

45:                                               ; preds = %33
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %84

.lr.ph:                                           ; preds = %.preheader, %71
  %47 = phi i64 [ %73, %71 ], [ 0, %.preheader ]
  %.0823 = phi i32 [ %72, %71 ], [ 0, %.preheader ]
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI18GridPointReferenceSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %47) #5
  %49 = load i32, ptr %48, align 4, !tbaa !12
  store i32 %49, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #5
  %50 = sext i32 %49 to i64
  %51 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %50)
          to label %52 unwind label %65

52:                                               ; preds = %.lr.ph
  %53 = extractvalue { ptr, i64 } %51, 0
  store ptr %53, ptr %14, align 8
  %54 = extractvalue { ptr, i64 } %51, 1
  store i64 %54, ptr %31, align 8
  %55 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #5
  br i1 %55, label %71, label %56

56:                                               ; preds = %52
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %57 unwind label %67

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #5
  %58 = load i32, ptr %11, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %59)
          to label %61 unwind label %69

61:                                               ; preds = %57
  %62 = extractvalue { ptr, i64 } %60, 0
  store ptr %62, ptr %15, align 8
  %63 = extractvalue { ptr, i64 } %60, 1
  store i64 %63, ptr %32, align 8
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext true) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  br label %71

65:                                               ; preds = %.lr.ph
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #5
  br label %84

67:                                               ; preds = %56
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %84

69:                                               ; preds = %57
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  br label %84

71:                                               ; preds = %52, %61
  %72 = add i32 %.0823, 1
  %73 = zext i32 %72 to i64
  %74 = call noundef i64 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %75 = icmp ugt i64 %74, %73
  br i1 %75, label %.lr.ph, label %._crit_edge, !llvm.loop !13

76:                                               ; preds = %._crit_edge
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %77 unwind label %81

77:                                               ; preds = %76
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #5
  %78 = call noundef zeroext i1 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br i1 %78, label %._crit_edge26, label %33, !llvm.loop !15

79:                                               ; preds = %._crit_edge
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %76
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #5
  br label %83

83:                                               ; preds = %81, %79
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #5
  br label %84

._crit_edge26:                                    ; preds = %77, %29
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  ret void

84:                                               ; preds = %65, %67, %69, %83, %45
  %.pn17.pn = phi { ptr, i32 } [ %.pn, %83 ], [ %46, %45 ], [ %70, %69 ], [ %68, %67 ], [ %66, %65 ]
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %12) #5
  br label %85

85:                                               ; preds = %84, %43
  %.pn17.pn.pn = phi { ptr, i32 } [ %.pn17.pn, %84 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %86

86:                                               ; preds = %85, %41, %39
  %.pn17.pn.pn.pn = phi { ptr, i32 } [ %.pn17.pn.pn, %85 ], [ %42, %41 ], [ %40, %39 ]
  call void @_ZNSt6vectorI18GridPointReferenceSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #5
  br label %87

87:                                               ; preds = %86, %37
  %.pn17.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn17.pn.pn.pn, %86 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn17.pn.pn.pn.pn
}

; 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16SpatialPointGrid21getPointFromReferenceE18GridPointReference(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(152), i32) local_unnamed_addr #4 align 2

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

; 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 #1 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 #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorI18GridPointReferenceSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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, !11, i64 0}
!10 = !{!"_ZTS18GridPointReference", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, 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,TailCallElimPass