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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { %struct.GridPoint, i32 }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPointReference = type { i32 }
%"class.std::vector.37" = type { %"struct.std::_Vector_base.38" }
%"struct.std::_Vector_base.38" = type { %"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridIndex = type { i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%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 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@__FUNCTION__._ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE = external hidden unnamed_addr constant [27 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 1 %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"class.std::vector.37", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.GridPoint, align 4
  %14 = alloca %struct.GridPointReference, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.vmath::vec3", align 4
  %18 = alloca %struct.GridPointReference, align 4
  %19 = alloca %struct.GridPoint, align 4
  %20 = alloca %"class.vmath::vec3", align 4
  %21 = alloca %struct.GridPointReference, align 4
  %22 = alloca %struct.GridIndex, align 4
  %23 = alloca %"class.vmath::vec3", align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca { i64, i32 }, align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 20, ptr %9) #9
  call void @_ZNSt4pairI9GridPointjEC2IS0_jTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(20) %9)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #9
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #9
  invoke void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %32)
          to label %33 unwind label %47

33:                                               ; preds = %4
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #9
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36)
          to label %37 unwind label %47

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #9
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %13)
          to label %38 unwind label %51

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  invoke void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %39 unwind label %55

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %124, %39
  %41 = load i32, ptr %16, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #9
  %45 = icmp ult i64 %42, %44
  br i1 %45, label %59, label %46

46:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %144

47:                                               ; preds = %33, %4
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %11, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %12, align 4
  br label %186

51:                                               ; preds = %37
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %11, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %12, align 4
  br label %185

55:                                               ; preds = %38
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %11, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %12, align 4
  br label %184

59:                                               ; preds = %40
  %60 = getelementptr inbounds %class.SpatialPointGrid, ptr %30, i32 0, i32 7
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %64, i64 12, i1 false), !tbaa.struct !11
  %65 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %60, ptr noundef %17)
          to label %66 unwind label %87

66:                                               ; preds = %59
  %67 = xor i1 %65, true
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #9
  br i1 %67, label %68, label %95

68:                                               ; preds = %66
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
          to label %70 unwind label %91

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @.str.8)
          to label %72 unwind label %91

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef @.str.2)
          to label %74 unwind label %91

74:                                               ; preds = %72
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @.str.3)
          to label %76 unwind label %91

76:                                               ; preds = %74
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef @.str.4)
          to label %78 unwind label %91

78:                                               ; preds = %76
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef @__FUNCTION__._ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE)
          to label %80 unwind label %91

80:                                               ; preds = %78
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef @.str.5)
          to label %82 unwind label %91

82:                                               ; preds = %80
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %81, i32 noundef 268)
          to label %84 unwind label %91

84:                                               ; preds = %82
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %86 unwind label %91

86:                                               ; preds = %84
  call void @abort() #10
  unreachable

87:                                               ; preds = %59
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %11, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #9
  br label %143

91:                                               ; preds = %121, %119, %84, %82, %80, %78, %76, %74, %72, %70, %68
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %11, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %12, align 4
  br label %143

95:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  %96 = load i32, ptr %16, align 4, !tbaa !9
  invoke void @_ZN18GridPointReferenceC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 noundef %96)
          to label %97 unwind label %127

97:                                               ; preds = %95
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %18, i64 4, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #9
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %101, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %14, i64 4, i1 false), !tbaa.struct !14
  %102 = getelementptr inbounds %struct.GridPointReference, ptr %21, i32 0, i32 0
  %103 = load i32, ptr %102, align 4
  invoke void @_ZN9GridPointC2EN5vmath4vec3E18GridPointReference(ptr noundef nonnull align 4 dereferenceable(16) %19, ptr noundef %20, i32 %103)
          to label %104 unwind label %131

104:                                              ; preds = %97
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %19, i64 16, i1 false), !tbaa.struct !15
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %19) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %107) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %108, i64 12, i1 false), !tbaa.struct !11
  %109 = getelementptr inbounds %class.SpatialPointGrid, ptr %30, i32 0, i32 3
  %110 = load double, ptr %109, align 8, !tbaa !16
  %111 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef %23, double noundef %110)
          to label %112 unwind label %135

112:                                              ; preds = %104
  store { i64, i32 } %111, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %24, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %22, i64 12, i1 false)
  %113 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 0
  %114 = load i64, ptr %113, align 4
  %115 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 1
  %116 = load i32, ptr %115, align 4
  %117 = invoke noundef i32 @_ZN16SpatialPointGrid13_getFlatIndexE9GridIndex(ptr noundef nonnull align 8 dereferenceable(152) %30, i64 %114, i32 %116)
          to label %118 unwind label %135

118:                                              ; preds = %112
  store i32 %117, ptr %15, align 4, !tbaa !9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #9
  call void @llvm.lifetime.start.p0(i64 20, ptr %26) #9
  invoke void @_ZNSt4pairI9GridPointjEC2IRS0_RjTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(20) %26, ptr noundef nonnull align 4 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %119 unwind label %139

119:                                              ; preds = %118
  %120 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt4pairI9GridPointjEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(20) %9, ptr noundef nonnull align 4 dereferenceable(20) %26) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %26) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr %26) #9
  invoke void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(20) %9)
          to label %121 unwind label %91

121:                                              ; preds = %119
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %123 unwind label %91

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %16, align 4, !tbaa !9
  %126 = add i32 %125, 1
  store i32 %126, ptr %16, align 4, !tbaa !9
  br label %40, !llvm.loop !32

127:                                              ; preds = %95
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %11, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %143

131:                                              ; preds = %97
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %11, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  br label %143

135:                                              ; preds = %112, %104
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %11, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #9
  br label %143

139:                                              ; preds = %118
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %11, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 20, ptr %26) #9
  br label %143

143:                                              ; preds = %139, %135, %131, %127, %91, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %183

144:                                              ; preds = %46
  %145 = call ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %146 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  %147 = call ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %148 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %147, ptr %148, align 8
  %149 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8
  %151 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairI9GridPointjESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %150, ptr %152, ptr noundef @_Z22compareByFlatGridIndexSt4pairI9GridPointjES1_)
          to label %153 unwind label %164

153:                                              ; preds = %144
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %155) #9
  invoke void @_ZNSt6vectorI9GridPointSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %154, i64 noundef %156)
          to label %157 unwind label %164

157:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %175, %157
  %159 = load i32, ptr %29, align 4, !tbaa !9
  %160 = zext i32 %159 to i64
  %161 = call noundef i64 @_ZNKSt6vectorISt4pairI9GridPointjESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %162 = icmp ult i64 %160, %161
  br i1 %162, label %168, label %163

163:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %182

164:                                              ; preds = %153, %144
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %11, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %12, align 4
  br label %183

168:                                              ; preds = %158
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load i32, ptr %29, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %171) #9
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 0
  invoke void @_ZNSt6vectorI9GridPointSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %169, ptr noundef nonnull align 4 dereferenceable(16) %173)
          to label %174 unwind label %178

174:                                              ; preds = %168
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %29, align 4, !tbaa !9
  %177 = add i32 %176, 1
  store i32 %177, ptr %29, align 4, !tbaa !9
  br label %158, !llvm.loop !34

178:                                              ; preds = %168
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %11, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %183

182:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %13) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #9
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %9) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr %9) #9
  ret void

183:                                              ; preds = %178, %164, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %184

184:                                              ; preds = %183, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %13) #9
  br label %185

185:                                              ; preds = %184, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #9
  br label %186

186:                                              ; preds = %185, %47
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %9) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr %9) #9
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr %11, align 8
  %189 = load i32, ptr %12, align 4
  %190 = insertvalue { ptr, i32 } poison, ptr %188, 0
  %191 = insertvalue { ptr, i32 } %190, i32 %189, 1
  resume { ptr, i32 } %191
}

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z22compareByFlatGridIndexSt4pairI9GridPointjES1_(ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @abort() #7

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

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

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18GridPointReferenceC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN16SpatialPointGrid13_getFlatIndexE9GridIndex(ptr noundef nonnull align 8 dereferenceable(152), i64, i32) #8 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt4pairI9GridPointjEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(20)) #3 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "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 = { noreturn 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }

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

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { %struct.GridPoint, i32 }
%struct.GridPoint = type { %"class.vmath::vec3", %struct.GridPointReference }
%"class.vmath::vec3" = type { float, float, float }
%struct.GridPointReference = type { i32 }
%"class.std::vector.37" = type { %"struct.std::_Vector_base.38" }
%"struct.std::_Vector_base.38" = type { %"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<GridPoint, unsigned int>, std::allocator<std::pair<GridPoint, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@__FUNCTION__._ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE = external hidden unnamed_addr constant [27 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 1 %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"class.std::vector.37", align 8
  %7 = alloca %struct.GridPoint, align 4
  %8 = alloca %struct.GridPointReference, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %struct.GridPointReference, align 4
  %12 = alloca %struct.GridPoint, align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca %"class.vmath::vec3", align 4
  %15 = alloca %"struct.std::pair", align 4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #9
  call void @_ZNSt4pairI9GridPointjEC2IS0_jTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(20) %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %16 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  invoke void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %16)
          to label %17 unwind label %26

17:                                               ; preds = %4
  %18 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %18)
          to label %19 unwind label %26

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #9
  invoke void @_ZN9GridPointC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %20 unwind label %28

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %21 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %.not = icmp eq i64 %21, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  br label %30

._crit_edge:                                      ; preds = %66, %20
  %24 = call ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %25 = call ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairI9GridPointjESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %24, ptr %25, ptr noundef nonnull @_Z22compareByFlatGridIndexSt4pairI9GridPointjES1_)
          to label %73 unwind label %76

26:                                               ; preds = %17, %4
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %89

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

30:                                               ; preds = %.lr.ph, %66
  %31 = phi i64 [ 0, %.lr.ph ], [ %68, %66 ]
  %.03441 = phi i32 [ 0, %.lr.ph ], [ %67, %66 ]
  %32 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %32, i64 12, i1 false), !tbaa.struct !5
  %33 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %22, ptr noundef nonnull %10)
          to label %34 unwind label %54

34:                                               ; preds = %30
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  br i1 %33, label %56, label %35

35:                                               ; preds = %34
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
          to label %37 unwind label %.loopexit.split-lp

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.8)
          to label %39 unwind label %.loopexit.split-lp

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @.str.2)
          to label %41 unwind label %.loopexit.split-lp

41:                                               ; preds = %39
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @.str.3)
          to label %43 unwind label %.loopexit.split-lp

43:                                               ; preds = %41
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.4)
          to label %45 unwind label %.loopexit.split-lp

45:                                               ; preds = %43
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @__FUNCTION__._ZN16SpatialPointGrid26_sortGridPointsByGridIndexERSt6vectorIN5vmath4vec3ESaIS2_EERS0_I9GridPointSaIS6_EERS0_I18GridPointReferenceSaISA_EE)
          to label %47 unwind label %.loopexit.split-lp

47:                                               ; preds = %45
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @.str.5)
          to label %49 unwind label %.loopexit.split-lp

49:                                               ; preds = %47
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %48, i32 noundef 268)
          to label %51 unwind label %.loopexit.split-lp

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %53 unwind label %.loopexit.split-lp

53:                                               ; preds = %51
  call void @abort() #10
  unreachable

54:                                               ; preds = %30
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  br label %87

.loopexit:                                        ; preds = %62, %65
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %87

.loopexit.split-lp:                               ; preds = %35, %37, %39, %41, %43, %45, %47, %49, %51
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %87

56:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  call void @_ZN18GridPointReferenceC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %.03441)
  %57 = load i32, ptr %11, align 4, !tbaa !10
  store i32 %57, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #9
  %58 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %58, i64 12, i1 false), !tbaa.struct !5
  %.sroa.09.0.copyload = load i32, ptr %8, align 4, !tbaa !10
  call void @_ZN9GridPointC2EN5vmath4vec3E18GridPointReference(ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull %13, i32 %.sroa.09.0.copyload)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %12, i64 16, i1 false), !tbaa.struct !12
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #9
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %59, i64 12, i1 false), !tbaa.struct !5
  %60 = load double, ptr %23, align 8, !tbaa !13
  %61 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef nonnull %14, double noundef %60)
          to label %62 unwind label %71

62:                                               ; preds = %56
  %.fca.0.extract = extractvalue { i64, i32 } %61, 0
  %.fca.1.extract = extractvalue { i64, i32 } %61, 1
  %63 = call noundef i32 @_ZN16SpatialPointGrid13_getFlatIndexE9GridIndex(ptr noundef nonnull align 8 dereferenceable(152) %0, i64 %.fca.0.extract, i32 %.fca.1.extract)
  store i32 %63, ptr %9, align 4, !tbaa !10
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #9
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %15) #9
  call void @_ZNSt4pairI9GridPointjEC2IRS0_RjTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(20) %15, ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %64 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt4pairI9GridPointjEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(20) %5, ptr noundef nonnull align 4 dereferenceable(20) %15) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %15) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %15) #9
  invoke void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(20) %5)
          to label %65 unwind label %.loopexit

65:                                               ; preds = %62
  invoke void @_ZNSt6vectorI18GridPointReferenceSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %66 unwind label %.loopexit

66:                                               ; preds = %65
  %67 = add i32 %.03441, 1
  %68 = zext i32 %67 to i64
  %69 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %70 = icmp ugt i64 %69, %68
  br i1 %70, label %30, label %._crit_edge, !llvm.loop !30

71:                                               ; preds = %56
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #9
  br label %87

73:                                               ; preds = %._crit_edge
  %74 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  invoke void @_ZNSt6vectorI9GridPointSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %74)
          to label %.preheader unwind label %76

.preheader:                                       ; preds = %73
  %75 = call noundef i64 @_ZNKSt6vectorISt4pairI9GridPointjESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %.not45 = icmp eq i64 %75, 0
  br i1 %.not45, label %._crit_edge44, label %.lr.ph43

._crit_edge44:                                    ; preds = %80, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %5) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #9
  ret void

76:                                               ; preds = %73, %._crit_edge
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %87

.lr.ph43:                                         ; preds = %.preheader, %80
  %78 = phi i64 [ %82, %80 ], [ 0, %.preheader ]
  %.042 = phi i32 [ %81, %80 ], [ 0, %.preheader ]
  %79 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %78) #9
  invoke void @_ZNSt6vectorI9GridPointSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(16) %79)
          to label %80 unwind label %85

80:                                               ; preds = %.lr.ph43
  %81 = add i32 %.042, 1
  %82 = zext i32 %81 to i64
  %83 = call noundef i64 @_ZNKSt6vectorISt4pairI9GridPointjESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %84 = icmp ugt i64 %83, %82
  br i1 %84, label %.lr.ph43, label %._crit_edge44, !llvm.loop !32

85:                                               ; preds = %.lr.ph43
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %87

87:                                               ; preds = %.loopexit, %.loopexit.split-lp, %54, %71, %85, %76
  %.pn.pn = phi { ptr, i32 } [ %86, %85 ], [ %77, %76 ], [ %72, %71 ], [ %55, %54 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @_ZN9GridPointD2Ev(ptr noundef nonnull align 4 dereferenceable(16) %7) #9
  br label %88

88:                                               ; preds = %87, %28
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %87 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  br label %89

89:                                               ; preds = %88, %26
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %88 ], [ %27, %26 ]
  call void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt4pairI9GridPointjED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %5) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #9
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; 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 zeroext i1 @_Z22compareByFlatGridIndexSt4pairI9GridPointjES1_(ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #7

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

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

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18GridPointReferenceC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN16SpatialPointGrid13_getFlatIndexE9GridIndex(ptr noundef nonnull align 8 dereferenceable(152), i64, i32) local_unnamed_addr #8 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt4pairI9GridPointjEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairI9GridPointjESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 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 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "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 = { noreturn 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn 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, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !10}
!13 = !{!14, !15, i64 16}
!14 = !{!"_ZTS16SpatialPointGrid", !11, i64 0, !11, i64 4, !11, i64 8, !15, i64 16, !16, i64 24, !21, i64 48, !25, i64 72, !28, i64 112}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSSt6vectorI9GridPointSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI9GridPointSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!"_ZTSSt6vectorIiSaIiEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!25 = !{!"_ZTS7Array3dIN16SpatialPointGrid8CellNodeEE", !11, i64 0, !11, i64 4, !11, i64 8, !20, i64 16, !26, i64 24, !27, i64 28, !11, i64 36}
!26 = !{!"bool", !8, i64 0}
!27 = !{!"_ZTSN16SpatialPointGrid8CellNodeE", !11, i64 0, !11, i64 4}
!28 = !{!"_ZTS4AABB", !29, i64 0, !15, i64 16, !15, i64 24, !15, i64 32}
!29 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


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