; 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.GridIndex = type { i32, i32, i32 }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%struct.GridPointReference = type { i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }
%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 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid24_queryPointsInsideSphereEN5vmath4vec3EdiRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, double noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.GridIndex, align 4
  %12 = alloca %struct.GridIndex, align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca %struct.GridPoint, align 4
  %20 = alloca %"struct.SpatialPointGrid::CellNode", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.SpatialPointGrid::CellNode", align 4
  %26 = alloca %"struct.SpatialPointGrid::CellNode", align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !13
  %30 = load double, ptr %8, align 8, !tbaa !9
  %31 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 3
  %32 = load double, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !31
  %35 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !32
  %37 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 2
  %38 = load i32, ptr %37, align 8, !tbaa !33
  invoke void @_ZN6Grid3d18getGridIndexBoundsEN5vmath4vec3EddiiiP9GridIndexS3_(ptr noundef %13, double noundef %30, double noundef %32, i32 noundef %34, i32 noundef %36, i32 noundef %38, ptr noundef %11, ptr noundef %12)
          to label %39 unwind label %53

39:                                               ; preds = %5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %40 = load double, ptr %8, align 8, !tbaa !9
  %41 = load double, ptr %8, align 8, !tbaa !9
  %42 = fmul double %40, %41
  store double %42, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %19)
          to label %43 unwind label %57

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  invoke void @_ZN16SpatialPointGrid8CellNodeC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %44 unwind label %61

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %45 = getelementptr inbounds %struct.GridIndex, ptr %11, i32 0, i32 2
  %46 = load i32, ptr %45, align 4, !tbaa !34
  store i32 %46, ptr %21, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %167, %44
  %48 = load i32, ptr %21, align 4, !tbaa !11
  %49 = getelementptr inbounds %struct.GridIndex, ptr %12, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !34
  %51 = icmp sle i32 %48, %50
  br i1 %51, label %65, label %52

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

53:                                               ; preds = %5
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %14, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %15, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  br label %173

57:                                               ; preds = %39
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %14, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %15, align 4
  br label %172

61:                                               ; preds = %43
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %14, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %15, align 4
  br label %171

65:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %66 = getelementptr inbounds %struct.GridIndex, ptr %11, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !36
  store i32 %67, ptr %23, align 4, !tbaa !11
  br label %68

68:                                               ; preds = %163, %65
  %69 = load i32, ptr %23, align 4, !tbaa !11
  %70 = getelementptr inbounds %struct.GridIndex, ptr %12, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !36
  %72 = icmp sle i32 %69, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %68
  store i32 5, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %166

74:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %75 = getelementptr inbounds %struct.GridIndex, ptr %11, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !37
  store i32 %76, ptr %24, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %158, %74
  %78 = load i32, ptr %24, align 4, !tbaa !11
  %79 = getelementptr inbounds %struct.GridIndex, ptr %12, i32 0, i32 0
  %80 = load i32, ptr %79, align 4, !tbaa !37
  %81 = icmp sle i32 %78, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  store i32 8, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %162

83:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %84 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 6
  %85 = load i32, ptr %24, align 4, !tbaa !11
  %86 = load i32, ptr %23, align 4, !tbaa !11
  %87 = load i32, ptr %21, align 4, !tbaa !11
  %88 = invoke i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %84, i32 noundef %85, i32 noundef %86, i32 noundef %87)
          to label %89 unwind label %111

89:                                               ; preds = %83
  store i64 %88, ptr %25, align 4
  %90 = getelementptr inbounds %"struct.SpatialPointGrid::CellNode", ptr %25, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !38
  %92 = icmp sgt i32 %91, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br i1 %92, label %93, label %157

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %94 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 6
  %95 = load i32, ptr %24, align 4, !tbaa !11
  %96 = load i32, ptr %23, align 4, !tbaa !11
  %97 = load i32, ptr %21, align 4, !tbaa !11
  %98 = invoke i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %94, i32 noundef %95, i32 noundef %96, i32 noundef %97)
          to label %99 unwind label %115

99:                                               ; preds = %93
  store i64 %98, ptr %26, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %26, i64 8, i1 false), !tbaa.struct !39
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %100 = getelementptr inbounds %"struct.SpatialPointGrid::CellNode", ptr %20, i32 0, i32 0
  %101 = load i32, ptr %100, align 4, !tbaa !40
  store i32 %101, ptr %27, align 4, !tbaa !11
  br label %102

102:                                              ; preds = %152, %99
  %103 = load i32, ptr %27, align 4, !tbaa !11
  %104 = getelementptr inbounds %"struct.SpatialPointGrid::CellNode", ptr %20, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !40
  %106 = getelementptr inbounds %"struct.SpatialPointGrid::CellNode", ptr %20, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !38
  %108 = add nsw i32 %105, %107
  %109 = icmp slt i32 %103, %108
  br i1 %109, label %119, label %110

110:                                              ; preds = %102
  store i32 11, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %156

111:                                              ; preds = %83
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %14, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %161

115:                                              ; preds = %93
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %14, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %161

119:                                              ; preds = %102
  %120 = getelementptr inbounds %class.SpatialPointGrid, ptr %29, i32 0, i32 4
  %121 = load i32, ptr %27, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %120, i64 noundef %122) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %123, i64 16, i1 false), !tbaa.struct !41
  %124 = getelementptr inbounds %struct.GridPoint, ptr %19, i32 0, i32 1
  %125 = getelementptr inbounds %struct.GridPointReference, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 4, !tbaa !42
  %127 = load i32, ptr %9, align 4, !tbaa !11
  %128 = icmp ne i32 %126, %127
  br i1 %128, label %129, label %151

129:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #8
  %130 = getelementptr inbounds %struct.GridPoint, ptr %19, i32 0, i32 0
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %28, ptr noundef nonnull align 4 dereferenceable(12) %130, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %131 unwind label %142

131:                                              ; preds = %129
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %28, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #8
  %132 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %18, ptr noundef nonnull align 4 dereferenceable(12) %18)
          to label %133 unwind label %146

133:                                              ; preds = %131
  %134 = fpext float %132 to double
  store double %134, ptr %17, align 8, !tbaa !9
  %135 = load double, ptr %17, align 8, !tbaa !9
  %136 = load double, ptr %16, align 8, !tbaa !9
  %137 = fcmp olt double %135, %136
  br i1 %137, label %138, label %150

138:                                              ; preds = %133
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.GridPoint, ptr %19, i32 0, i32 0
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %139, ptr noundef nonnull align 4 dereferenceable(12) %140)
          to label %141 unwind label %146

141:                                              ; preds = %138
  br label %150

142:                                              ; preds = %129
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %14, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #8
  br label %155

146:                                              ; preds = %138, %131
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %14, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %15, align 4
  br label %155

150:                                              ; preds = %141, %133
  br label %151

151:                                              ; preds = %150, %119
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %27, align 4, !tbaa !11
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %27, align 4, !tbaa !11
  br label %102, !llvm.loop !45

155:                                              ; preds = %146, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %161

156:                                              ; preds = %110
  br label %157

157:                                              ; preds = %156, %89
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %24, align 4, !tbaa !11
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %24, align 4, !tbaa !11
  br label %77, !llvm.loop !47

161:                                              ; preds = %155, %115, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %171

162:                                              ; preds = %82
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %23, align 4, !tbaa !11
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %23, align 4, !tbaa !11
  br label %68, !llvm.loop !48

166:                                              ; preds = %73
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %21, align 4, !tbaa !11
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %21, align 4, !tbaa !11
  br label %47, !llvm.loop !49

170:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #8
  ret void

171:                                              ; preds = %161, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %19) #8
  br label %172

172:                                              ; preds = %171, %57
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %173

173:                                              ; preds = %172, %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #8
  br label %174

174:                                              ; preds = %173
  %175 = load ptr, ptr %14, align 8
  %176 = load i32, ptr %15, align 4
  %177 = insertvalue { ptr, i32 } poison, ptr %175, 0
  %178 = insertvalue { ptr, i32 } %177, i32 %176, 1
  resume { ptr, i32 } %178
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 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 i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) #4 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !10, i64 16}
!17 = !{!"_ZTS16SpatialPointGrid", !12, i64 0, !12, i64 4, !12, i64 8, !10, i64 16, !18, i64 24, !22, i64 48, !26, i64 72, !29, i64 112}
!18 = !{!"_ZTSSt6vectorI9GridPointSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI9GridPointSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt6vectorIiSaIiEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTS7Array3dIN16SpatialPointGrid8CellNodeEE", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !27, i64 24, !28, i64 28, !12, i64 36}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSN16SpatialPointGrid8CellNodeE", !12, i64 0, !12, i64 4}
!29 = !{!"_ZTS4AABB", !30, i64 0, !10, i64 16, !10, i64 24, !10, i64 32}
!30 = !{!"_ZTSN5vmath4vec3E", !15, i64 0, !15, i64 4, !15, i64 8}
!31 = !{!17, !12, i64 0}
!32 = !{!17, !12, i64 4}
!33 = !{!17, !12, i64 8}
!34 = !{!35, !12, i64 8}
!35 = !{!"_ZTS9GridIndex", !12, i64 0, !12, i64 4, !12, i64 8}
!36 = !{!35, !12, i64 4}
!37 = !{!35, !12, i64 0}
!38 = !{!28, !12, i64 4}
!39 = !{i64 0, i64 4, !11, i64 4, i64 4, !11}
!40 = !{!28, !12, i64 0}
!41 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 12, i64 4, !11}
!42 = !{!43, !12, i64 12}
!43 = !{!"_ZTS9GridPoint", !30, i64 0, !44, i64 12}
!44 = !{!"_ZTS18GridPointReference", !12, i64 0}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = distinct !{!47, !46}
!48 = distinct !{!48, !46}
!49 = distinct !{!49, !46}


; 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.GridIndex = type { i32, i32, i32 }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%struct.GridPointReference = type { i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid24_queryPointsInsideSphereEN5vmath4vec3EdiRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1, double noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.GridIndex, align 4
  %7 = alloca %struct.GridIndex, align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %struct.GridPoint, align 4
  %11 = alloca %"struct.SpatialPointGrid::CellNode", align 8
  %12 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %1, i64 12, i1 false), !tbaa.struct !5
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !10
  %15 = load i32, ptr %0, align 8, !tbaa !28
  %16 = getelementptr inbounds i8, ptr %0, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !29
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !30
  invoke void @_ZN6Grid3d18getGridIndexBoundsEN5vmath4vec3EddiiiP9GridIndexS3_(ptr noundef nonnull %8, double noundef %2, double noundef %14, i32 noundef %15, i32 noundef %17, i32 noundef %19, ptr noundef nonnull %6, ptr noundef nonnull %7)
          to label %20 unwind label %36

20:                                               ; preds = %5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  %21 = fmul double %2, %2
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %22 unwind label %38

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZN16SpatialPointGrid8CellNodeC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %23 = getelementptr inbounds i8, ptr %6, i64 8
  %24 = load i32, ptr %23, align 4, !tbaa !31
  %25 = getelementptr inbounds i8, ptr %7, i64 8
  %26 = load i32, ptr %25, align 4, !tbaa !31
  %.not49 = icmp sgt i32 %24, %26
  br i1 %.not49, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %22
  %27 = getelementptr inbounds i8, ptr %6, i64 4
  %28 = getelementptr inbounds i8, ptr %7, i64 4
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %30 = getelementptr inbounds i8, ptr %11, i64 4
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = getelementptr inbounds i8, ptr %10, i64 12
  %33 = load i32, ptr %27, align 4, !tbaa !33
  %34 = load i32, ptr %28, align 4, !tbaa !33
  %35 = icmp sgt i32 %33, %34
  br i1 %35, label %._crit_edge54, label %.lr.ph53.split

._crit_edge54:                                    ; preds = %._crit_edge48, %.lr.ph53, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  ret void

36:                                               ; preds = %5
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  br label %93

38:                                               ; preds = %20
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %92

.lr.ph53.split:                                   ; preds = %.lr.ph53, %._crit_edge48
  %40 = phi i32 [ %47, %._crit_edge48 ], [ %26, %.lr.ph53 ]
  %41 = phi i32 [ %48, %._crit_edge48 ], [ %34, %.lr.ph53 ]
  %42 = phi i32 [ %49, %._crit_edge48 ], [ %34, %.lr.ph53 ]
  %.03050 = phi i32 [ %50, %._crit_edge48 ], [ %24, %.lr.ph53 ]
  %43 = load i32, ptr %27, align 4, !tbaa !33
  %.not3344 = icmp sgt i32 %43, %42
  br i1 %.not3344, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph53.split
  %44 = load i32, ptr %6, align 4, !tbaa !34
  %45 = load i32, ptr %7, align 4, !tbaa !34
  %46 = icmp sgt i32 %44, %45
  br i1 %46, label %._crit_edge48, label %.lr.ph47.split

._crit_edge48.loopexit55:                         ; preds = %._crit_edge
  %.pre58 = load i32, ptr %25, align 4, !tbaa !31
  br label %._crit_edge48

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge48.loopexit55, %.lr.ph53.split
  %47 = phi i32 [ %.pre58, %._crit_edge48.loopexit55 ], [ %40, %.lr.ph53.split ], [ %40, %.lr.ph47 ]
  %48 = phi i32 [ %54, %._crit_edge48.loopexit55 ], [ %41, %.lr.ph53.split ], [ %41, %.lr.ph47 ]
  %49 = phi i32 [ %54, %._crit_edge48.loopexit55 ], [ %42, %.lr.ph53.split ], [ %42, %.lr.ph47 ]
  %50 = add nsw i32 %.03050, 1
  %.not.not = icmp slt i32 %.03050, %47
  br i1 %.not.not, label %.lr.ph53.split, label %._crit_edge54, !llvm.loop !35

.lr.ph47.split:                                   ; preds = %.lr.ph47, %._crit_edge
  %51 = phi i32 [ %54, %._crit_edge ], [ %41, %.lr.ph47 ]
  %52 = phi i32 [ %55, %._crit_edge ], [ %45, %.lr.ph47 ]
  %.03245 = phi i32 [ %56, %._crit_edge ], [ %43, %.lr.ph47 ]
  %53 = load i32, ptr %6, align 4, !tbaa !34
  %.not3441 = icmp sgt i32 %53, %52
  br i1 %.not3441, label %._crit_edge, label %.lr.ph43

._crit_edge.loopexit:                             ; preds = %.loopexit
  %.pre = load i32, ptr %28, align 4, !tbaa !33
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph47.split
  %54 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %51, %.lr.ph47.split ]
  %55 = phi i32 [ %90, %._crit_edge.loopexit ], [ %52, %.lr.ph47.split ]
  %56 = add nsw i32 %.03245, 1
  %.not33.not = icmp slt i32 %.03245, %54
  br i1 %.not33.not, label %.lr.ph47.split, label %._crit_edge48.loopexit55, !llvm.loop !38

.lr.ph43:                                         ; preds = %.lr.ph47.split, %.loopexit
  %.03142 = phi i32 [ %89, %.loopexit ], [ %53, %.lr.ph47.split ]
  %57 = invoke i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %29, i32 noundef %.03142, i32 noundef %.03245, i32 noundef %.03050)
          to label %58 unwind label %67

58:                                               ; preds = %.lr.ph43
  %.sroa.4.0.extract.shift = lshr i64 %57, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %59 = icmp sgt i32 %.sroa.4.0.extract.trunc, 0
  br i1 %59, label %60, label %.loopexit

60:                                               ; preds = %58
  %61 = invoke i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %29, i32 noundef %.03142, i32 noundef %.03245, i32 noundef %.03050)
          to label %62 unwind label %69

62:                                               ; preds = %60
  store i64 %61, ptr %11, align 8
  %63 = lshr i64 %61, 32
  %64 = trunc nuw i64 %63 to i32
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %62
  %sext = shl i64 %61, 32
  %66 = ashr exact i64 %sext, 32
  br label %.lr.ph

67:                                               ; preds = %.lr.ph43
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %91

69:                                               ; preds = %60
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %91

.lr.ph:                                           ; preds = %.lr.ph.preheader, %83
  %indvars.iv = phi i64 [ %66, %.lr.ph.preheader ], [ %indvars.iv.next, %83 ]
  %71 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI9GridPointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %indvars.iv) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %71, i64 16, i1 false), !tbaa.struct !39
  %72 = load i32, ptr %32, align 4, !tbaa !41
  %.not35 = icmp eq i32 %72, %3
  br i1 %.not35, label %83, label %73

73:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %74 unwind label %79

74:                                               ; preds = %73
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %12, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  %75 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %76 = fpext float %75 to double
  %77 = fcmp ogt double %21, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %74
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %83 unwind label %81

79:                                               ; preds = %73
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %91

81:                                               ; preds = %78
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %91

83:                                               ; preds = %.lr.ph, %78, %74
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %84 = load i32, ptr %11, align 8, !tbaa !44
  %85 = load i32, ptr %30, align 4, !tbaa !45
  %86 = add nsw i32 %85, %84
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next, %87
  br i1 %88, label %.lr.ph, label %.loopexit, !llvm.loop !46

.loopexit:                                        ; preds = %83, %62, %58
  %89 = add nsw i32 %.03142, 1
  %90 = load i32, ptr %7, align 4, !tbaa !34
  %.not34.not = icmp slt i32 %.03142, %90
  br i1 %.not34.not, label %.lr.ph43, label %._crit_edge.loopexit, !llvm.loop !47

91:                                               ; preds = %79, %81, %69, %67
  %.pn.pn = phi { ptr, i32 } [ %70, %69 ], [ %68, %67 ], [ %82, %81 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10) #8
  br label %92

92:                                               ; preds = %91, %38
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %91 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  br label %93

93:                                               ; preds = %92, %36
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %92 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 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 i64 @_ZN7Array3dIN16SpatialPointGrid8CellNodeEEclEiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d18getGridIndexBoundsEN5vmath4vec3EddiiiP9GridIndexS3_(ptr noundef, double noundef, double noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !13, i64 16}
!11 = !{!"_ZTS16SpatialPointGrid", !12, i64 0, !12, i64 4, !12, i64 8, !13, i64 16, !14, i64 24, !19, i64 48, !23, i64 72, !26, i64 112}
!12 = !{!"int", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTSSt6vectorI9GridPointSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseI9GridPointSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!23 = !{!"_ZTS7Array3dIN16SpatialPointGrid8CellNodeEE", !12, i64 0, !12, i64 4, !12, i64 8, !18, i64 16, !24, i64 24, !25, i64 28, !12, i64 36}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTSN16SpatialPointGrid8CellNodeE", !12, i64 0, !12, i64 4}
!26 = !{!"_ZTS4AABB", !27, i64 0, !13, i64 16, !13, i64 24, !13, i64 32}
!27 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!28 = !{!11, !12, i64 0}
!29 = !{!11, !12, i64 4}
!30 = !{!11, !12, i64 8}
!31 = !{!32, !12, i64 8}
!32 = !{!"_ZTS9GridIndex", !12, i64 0, !12, i64 4, !12, i64 8}
!33 = !{!32, !12, i64 4}
!34 = !{!32, !12, i64 0}
!35 = distinct !{!35, !36, !37}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!"llvm.loop.unswitch.partial.disable"}
!38 = distinct !{!38, !36, !37}
!39 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !40}
!40 = !{!12, !12, i64 0}
!41 = !{!42, !12, i64 12}
!42 = !{!"_ZTS9GridPoint", !27, i64 0, !43, i64 12}
!43 = !{!"_ZTS18GridPointReference", !12, i64 0}
!44 = !{!25, !12, i64 0}
!45 = !{!25, !12, i64 4}
!46 = distinct !{!46, !36}
!47 = distinct !{!47, !36}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass