; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes (R3MeshSearchTree)

; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.R3MeshSearchTreeNode = type { ptr, [2 x ptr], double, i32, %class.RNArray, %class.RNArray }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3MeshSearchTreeFace = type { ptr, double, i32, i32 }
%class.R3MeshSearchTree = type { ptr, ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1

declare i32 @__gxx_personality_v0(...)

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56), double noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef nonnull align 8 dereferenceable(56) %9) #5 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca double, align 8
  %26 = alloca %class.R3Box, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca %class.R3Box, align 8
  %30 = alloca %class.R3Box, align 8
  %31 = alloca %class.R3Box, align 8
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store double %4, ptr %15, align 8, !tbaa !9
  store double %5, ptr %16, align 8, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  %34 = load ptr, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = load ptr, ptr %20, align 8, !tbaa !5
  %37 = load double, ptr %16, align 8, !tbaa !9
  %38 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 8 dereferenceable(56) %36, double noundef %37)
  store double %38, ptr %21, align 8, !tbaa !9
  %39 = load double, ptr %21, align 8, !tbaa !9
  %40 = load double, ptr %16, align 8, !tbaa !9
  %41 = fcmp oge double %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %10
  store i32 1, ptr %22, align 4
  br label %300

43:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %44

44:                                               ; preds = %82, %43
  %45 = load i32, ptr %23, align 4, !tbaa !11
  %46 = load ptr, ptr %19, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %46, i32 0, i32 4
  %48 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %47)
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  store i32 2, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %85

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %52 = load ptr, ptr %19, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %52, i32 0, i32 4
  %54 = load i32, ptr %23, align 4, !tbaa !11
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %53, i32 noundef %54)
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  store ptr %56, ptr %24, align 8, !tbaa !5
  %57 = load ptr, ptr %24, align 8, !tbaa !5
  %58 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %57, i32 0, i32 3
  %59 = load i32, ptr %58, align 4, !tbaa !13
  %60 = getelementptr inbounds %class.R3MeshSearchTree, ptr %34, i32 0, i32 3
  %61 = load i32, ptr %60, align 4, !tbaa !15
  %62 = icmp eq i32 %59, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %51
  store i32 4, ptr %22, align 4
  br label %79

64:                                               ; preds = %51
  %65 = getelementptr inbounds %class.R3MeshSearchTree, ptr %34, i32 0, i32 3
  %66 = load i32, ptr %65, align 4, !tbaa !15
  %67 = load ptr, ptr %24, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %67, i32 0, i32 3
  store i32 %66, ptr %68, align 4, !tbaa !13
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = load double, ptr %16, align 8, !tbaa !9
  %74 = load ptr, ptr %17, align 8, !tbaa !5
  %75 = load ptr, ptr %18, align 8, !tbaa !5
  %76 = load ptr, ptr %24, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  call void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_SE_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 8 dereferenceable(16) %71, double noundef %72, double noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %78)
  store i32 0, ptr %22, align 4
  br label %79

79:                                               ; preds = %64, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  %80 = load i32, ptr %22, align 4
  switch i32 %80, label %308 [
    i32 0, label %81
    i32 4, label %82
  ]

81:                                               ; preds = %79
  br label %82

82:                                               ; preds = %81, %79
  %83 = load i32, ptr %23, align 4, !tbaa !11
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %23, align 4, !tbaa !11
  br label %44, !llvm.loop !18

85:                                               ; preds = %50
  %86 = load ptr, ptr %19, align 8, !tbaa !5
  %87 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %86, i32 0, i32 1
  %88 = getelementptr inbounds [2 x ptr], ptr %87, i64 0, i64 0
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %256

91:                                               ; preds = %85
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds [2 x ptr], ptr %93, i64 0, i64 1
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %98, label %97

97:                                               ; preds = %91
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 877, ptr noundef @.str.2)
  br label %98

98:                                               ; preds = %97, %91
  %99 = load ptr, ptr %19, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %99, i32 0, i32 5
  %101 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %100)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %98
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.8, i32 noundef 878, ptr noundef @.str.2)
  br label %104

104:                                              ; preds = %103, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load ptr, ptr %19, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %106, i32 0, i32 3
  %108 = load i32, ptr %107, align 8, !tbaa !20
  %109 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %105, i32 noundef %108)
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %110, i32 0, i32 2
  %112 = load double, ptr %111, align 8, !tbaa !24
  %113 = fsub double %109, %112
  store double %113, ptr %25, align 8, !tbaa !9
  %114 = load double, ptr %25, align 8, !tbaa !9
  %115 = fcmp ole double %114, 0.000000e+00
  br i1 %115, label %116, label %185

116:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 56, ptr %26) #6
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %26, ptr noundef nonnull align 8 dereferenceable(56) %117)
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %118, i32 0, i32 2
  %120 = load double, ptr %119, align 8, !tbaa !24
  %121 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %26, i32 noundef 1)
          to label %122 unwind label %170

122:                                              ; preds = %116
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %123, i32 0, i32 3
  %125 = load i32, ptr %124, align 8, !tbaa !20
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %121, i32 noundef %125)
          to label %127 unwind label %170

127:                                              ; preds = %122
  store double %120, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = load double, ptr %15, align 8, !tbaa !9
  %132 = load double, ptr %16, align 8, !tbaa !9
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds [2 x ptr], ptr %136, i64 0, i64 0
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 8 dereferenceable(24) %129, ptr noundef nonnull align 8 dereferenceable(16) %130, double noundef %131, double noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %138, ptr noundef nonnull align 8 dereferenceable(56) %26)
          to label %139 unwind label %170

139:                                              ; preds = %127
  %140 = load double, ptr %25, align 8, !tbaa !9
  %141 = load double, ptr %25, align 8, !tbaa !9
  %142 = fmul double %140, %141
  %143 = load double, ptr %16, align 8, !tbaa !9
  %144 = fcmp olt double %142, %143
  br i1 %144, label %145, label %183

145:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 56, ptr %29) #6
  %146 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %29, ptr noundef nonnull align 8 dereferenceable(56) %146)
          to label %147 unwind label %174

147:                                              ; preds = %145
  %148 = load ptr, ptr %19, align 8, !tbaa !5
  %149 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %148, i32 0, i32 2
  %150 = load double, ptr %149, align 8, !tbaa !24
  %151 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %29, i32 noundef 0)
          to label %152 unwind label %178

152:                                              ; preds = %147
  %153 = load ptr, ptr %19, align 8, !tbaa !5
  %154 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %153, i32 0, i32 3
  %155 = load i32, ptr %154, align 8, !tbaa !20
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %151, i32 noundef %155)
          to label %157 unwind label %178

157:                                              ; preds = %152
  store double %150, ptr %156, align 8, !tbaa !9
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = load double, ptr %15, align 8, !tbaa !9
  %162 = load double, ptr %16, align 8, !tbaa !9
  %163 = load ptr, ptr %17, align 8, !tbaa !5
  %164 = load ptr, ptr %18, align 8, !tbaa !5
  %165 = load ptr, ptr %19, align 8, !tbaa !5
  %166 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %165, i32 0, i32 1
  %167 = getelementptr inbounds [2 x ptr], ptr %166, i64 0, i64 1
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %158, ptr noundef nonnull align 8 dereferenceable(24) %159, ptr noundef nonnull align 8 dereferenceable(16) %160, double noundef %161, double noundef %162, ptr noundef %163, ptr noundef %164, ptr noundef %168, ptr noundef nonnull align 8 dereferenceable(56) %29)
          to label %169 unwind label %178

169:                                              ; preds = %157
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %29) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %29) #6
  br label %183

170:                                              ; preds = %127, %122, %116
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %27, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %28, align 4
  br label %184

174:                                              ; preds = %145
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %27, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %28, align 4
  br label %182

178:                                              ; preds = %157, %152, %147
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %27, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %28, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %29) #6
  br label %182

182:                                              ; preds = %178, %174
  call void @llvm.lifetime.end.p0(i64 56, ptr %29) #6
  br label %184

183:                                              ; preds = %169, %139
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %26) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %26) #6
  br label %254

184:                                              ; preds = %182, %170
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %26) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %26) #6
  br label %255

185:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 56, ptr %30) #6
  %186 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 8 dereferenceable(56) %186)
  %187 = load ptr, ptr %19, align 8, !tbaa !5
  %188 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %187, i32 0, i32 2
  %189 = load double, ptr %188, align 8, !tbaa !24
  %190 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %30, i32 noundef 0)
          to label %191 unwind label %239

191:                                              ; preds = %185
  %192 = load ptr, ptr %19, align 8, !tbaa !5
  %193 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %192, i32 0, i32 3
  %194 = load i32, ptr %193, align 8, !tbaa !20
  %195 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %190, i32 noundef %194)
          to label %196 unwind label %239

196:                                              ; preds = %191
  store double %189, ptr %195, align 8, !tbaa !9
  %197 = load ptr, ptr %12, align 8, !tbaa !5
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = load ptr, ptr %14, align 8, !tbaa !5
  %200 = load double, ptr %15, align 8, !tbaa !9
  %201 = load double, ptr %16, align 8, !tbaa !9
  %202 = load ptr, ptr %17, align 8, !tbaa !5
  %203 = load ptr, ptr %18, align 8, !tbaa !5
  %204 = load ptr, ptr %19, align 8, !tbaa !5
  %205 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %204, i32 0, i32 1
  %206 = getelementptr inbounds [2 x ptr], ptr %205, i64 0, i64 1
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %197, ptr noundef nonnull align 8 dereferenceable(24) %198, ptr noundef nonnull align 8 dereferenceable(16) %199, double noundef %200, double noundef %201, ptr noundef %202, ptr noundef %203, ptr noundef %207, ptr noundef nonnull align 8 dereferenceable(56) %30)
          to label %208 unwind label %239

208:                                              ; preds = %196
  %209 = load double, ptr %25, align 8, !tbaa !9
  %210 = load double, ptr %25, align 8, !tbaa !9
  %211 = fmul double %209, %210
  %212 = load double, ptr %16, align 8, !tbaa !9
  %213 = fcmp olt double %211, %212
  br i1 %213, label %214, label %252

214:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 56, ptr %31) #6
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %31, ptr noundef nonnull align 8 dereferenceable(56) %215)
          to label %216 unwind label %243

216:                                              ; preds = %214
  %217 = load ptr, ptr %19, align 8, !tbaa !5
  %218 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %217, i32 0, i32 2
  %219 = load double, ptr %218, align 8, !tbaa !24
  %220 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %31, i32 noundef 1)
          to label %221 unwind label %247

221:                                              ; preds = %216
  %222 = load ptr, ptr %19, align 8, !tbaa !5
  %223 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %222, i32 0, i32 3
  %224 = load i32, ptr %223, align 8, !tbaa !20
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %220, i32 noundef %224)
          to label %226 unwind label %247

226:                                              ; preds = %221
  store double %219, ptr %225, align 8, !tbaa !9
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = load ptr, ptr %13, align 8, !tbaa !5
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = load double, ptr %15, align 8, !tbaa !9
  %231 = load double, ptr %16, align 8, !tbaa !9
  %232 = load ptr, ptr %17, align 8, !tbaa !5
  %233 = load ptr, ptr %18, align 8, !tbaa !5
  %234 = load ptr, ptr %19, align 8, !tbaa !5
  %235 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %234, i32 0, i32 1
  %236 = getelementptr inbounds [2 x ptr], ptr %235, i64 0, i64 0
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %227, ptr noundef nonnull align 8 dereferenceable(24) %228, ptr noundef nonnull align 8 dereferenceable(16) %229, double noundef %230, double noundef %231, ptr noundef %232, ptr noundef %233, ptr noundef %237, ptr noundef nonnull align 8 dereferenceable(56) %31)
          to label %238 unwind label %247

238:                                              ; preds = %226
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %31) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %31) #6
  br label %252

239:                                              ; preds = %196, %191, %185
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %27, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %28, align 4
  br label %253

243:                                              ; preds = %214
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %27, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %28, align 4
  br label %251

247:                                              ; preds = %226, %221, %216
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %27, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %28, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %31) #6
  br label %251

251:                                              ; preds = %247, %243
  call void @llvm.lifetime.end.p0(i64 56, ptr %31) #6
  br label %253

252:                                              ; preds = %238, %208
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %30) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %30) #6
  br label %254

253:                                              ; preds = %251, %239
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %30) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %30) #6
  br label %255

254:                                              ; preds = %252, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %299

255:                                              ; preds = %253, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %303

256:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 0, ptr %32, align 4, !tbaa !11
  br label %257

257:                                              ; preds = %295, %256
  %258 = load i32, ptr %32, align 4, !tbaa !11
  %259 = load ptr, ptr %19, align 8, !tbaa !5
  %260 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %259, i32 0, i32 5
  %261 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %260)
  %262 = icmp slt i32 %258, %261
  br i1 %262, label %264, label %263

263:                                              ; preds = %257
  store i32 5, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %298

264:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %265 = load ptr, ptr %19, align 8, !tbaa !5
  %266 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %265, i32 0, i32 5
  %267 = load i32, ptr %32, align 4, !tbaa !11
  %268 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %266, i32 noundef %267)
  %269 = load ptr, ptr %268, align 8, !tbaa !5
  store ptr %269, ptr %33, align 8, !tbaa !5
  %270 = load ptr, ptr %33, align 8, !tbaa !5
  %271 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %270, i32 0, i32 3
  %272 = load i32, ptr %271, align 4, !tbaa !13
  %273 = getelementptr inbounds %class.R3MeshSearchTree, ptr %34, i32 0, i32 3
  %274 = load i32, ptr %273, align 4, !tbaa !15
  %275 = icmp eq i32 %272, %274
  br i1 %275, label %276, label %277

276:                                              ; preds = %264
  store i32 7, ptr %22, align 4
  br label %292

277:                                              ; preds = %264
  %278 = getelementptr inbounds %class.R3MeshSearchTree, ptr %34, i32 0, i32 3
  %279 = load i32, ptr %278, align 4, !tbaa !15
  %280 = load ptr, ptr %33, align 8, !tbaa !5
  %281 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %280, i32 0, i32 3
  store i32 %279, ptr %281, align 4, !tbaa !13
  %282 = load ptr, ptr %12, align 8, !tbaa !5
  %283 = load ptr, ptr %13, align 8, !tbaa !5
  %284 = load ptr, ptr %14, align 8, !tbaa !5
  %285 = load double, ptr %15, align 8, !tbaa !9
  %286 = load double, ptr %16, align 8, !tbaa !9
  %287 = load ptr, ptr %17, align 8, !tbaa !5
  %288 = load ptr, ptr %18, align 8, !tbaa !5
  %289 = load ptr, ptr %33, align 8, !tbaa !5
  %290 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %289, i32 0, i32 0
  %291 = load ptr, ptr %290, align 8, !tbaa !17
  call void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_SE_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %282, ptr noundef nonnull align 8 dereferenceable(24) %283, ptr noundef nonnull align 8 dereferenceable(16) %284, double noundef %285, double noundef %286, ptr noundef %287, ptr noundef %288, ptr noundef %291)
  store i32 0, ptr %22, align 4
  br label %292

292:                                              ; preds = %277, %276
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  %293 = load i32, ptr %22, align 4
  switch i32 %293, label %308 [
    i32 0, label %294
    i32 7, label %295
  ]

294:                                              ; preds = %292
  br label %295

295:                                              ; preds = %294, %292
  %296 = load i32, ptr %32, align 4, !tbaa !11
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %32, align 4, !tbaa !11
  br label %257, !llvm.loop !25

298:                                              ; preds = %263
  br label %299

299:                                              ; preds = %298, %254
  store i32 0, ptr %22, align 4
  br label %300

300:                                              ; preds = %299, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %301 = load i32, ptr %22, align 4
  switch i32 %301, label %308 [
    i32 0, label %302
    i32 1, label %302
  ]

302:                                              ; preds = %300, %300
  ret void

303:                                              ; preds = %255
  %304 = load ptr, ptr %27, align 8
  %305 = load i32, ptr %28, align 4
  %306 = insertvalue { ptr, i32 } poison, ptr %304, 0
  %307 = insertvalue { ptr, i32 } %306, i32 %305, 1
  resume { ptr, i32 } %307

308:                                              ; preds = %300, %292, %79
  unreachable
}

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

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

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


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

%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1

declare i32 @__gxx_personality_v0(...)

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56), double noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef nonnull align 8 dereferenceable(56) %9) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %class.R3Box, align 8
  %12 = alloca %class.R3Box, align 8
  %13 = alloca %class.R3Box, align 8
  %14 = alloca %class.R3Box, align 8
  %15 = tail call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(56) %9, double noundef %5)
  %16 = fcmp ult double %15, %5
  br i1 %16, label %.preheader114, label %.loopexit

.preheader114:                                    ; preds = %10
  %17 = getelementptr inbounds i8, ptr %8, i64 40
  %18 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader114
  %20 = getelementptr inbounds i8, ptr %0, i64 20
  br label %27

._crit_edge:                                      ; preds = %36, %.preheader114
  %21 = getelementptr inbounds i8, ptr %8, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.preheader, label %40

.preheader:                                       ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %8, i64 56
  %24 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph117, label %.loopexit

.lr.ph117:                                        ; preds = %.preheader
  %26 = getelementptr inbounds i8, ptr %0, i64 20
  br label %113

27:                                               ; preds = %.lr.ph, %36
  %.0100115 = phi i32 [ 0, %.lr.ph ], [ %37, %36 ]
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %17, i32 noundef %.0100115)
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 20
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = load i32, ptr %20, align 4, !tbaa !13
  %33 = icmp eq i32 %31, %32
  br i1 %33, label %36, label %34

34:                                               ; preds = %27
  store i32 %32, ptr %30, align 4, !tbaa !9
  %35 = load ptr, ptr %29, align 8, !tbaa !15
  tail call void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_SE_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %35)
  br label %36

36:                                               ; preds = %27, %34
  %37 = add nuw nsw i32 %.0100115, 1
  %38 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %27, label %._crit_edge, !llvm.loop !16

40:                                               ; preds = %._crit_edge
  %41 = getelementptr inbounds i8, ptr %8, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %.not106 = icmp eq ptr %42, null
  br i1 %.not106, label %43, label %44

43:                                               ; preds = %40
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 877, ptr noundef nonnull @.str.2)
  br label %44

44:                                               ; preds = %43, %40
  %45 = getelementptr inbounds i8, ptr %8, i64 56
  %46 = tail call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %.not107 = icmp eq i32 %46, 0
  br i1 %.not107, label %47, label %48

47:                                               ; preds = %44
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.8, i32 noundef 878, ptr noundef nonnull @.str.2)
  br label %48

48:                                               ; preds = %47, %44
  %49 = getelementptr inbounds i8, ptr %8, i64 32
  %50 = load i32, ptr %49, align 8, !tbaa !18
  %51 = tail call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %50)
  %52 = getelementptr inbounds i8, ptr %8, i64 24
  %53 = load double, ptr %52, align 8, !tbaa !22
  %54 = fsub double %51, %53
  %55 = fcmp ugt double %54, 0.000000e+00
  br i1 %55, label %84, label %56

56:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #6
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 8 dereferenceable(56) %9)
  %57 = load double, ptr %52, align 8, !tbaa !22
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef 1)
  %59 = load i32, ptr %49, align 8, !tbaa !18
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %58, i32 noundef %59)
          to label %61 unwind label %75

61:                                               ; preds = %56
  store double %57, ptr %60, align 8, !tbaa !23
  %62 = load ptr, ptr %21, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %62, ptr noundef nonnull align 8 dereferenceable(56) %11)
          to label %63 unwind label %75

63:                                               ; preds = %61
  %64 = fmul double %54, %54
  %65 = fcmp olt double %64, %5
  br i1 %65, label %66, label %82

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #6
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %67 unwind label %77

67:                                               ; preds = %66
  %68 = load double, ptr %52, align 8, !tbaa !22
  %69 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef 0)
  %70 = load i32, ptr %49, align 8, !tbaa !18
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %69, i32 noundef %70)
          to label %72 unwind label %79

72:                                               ; preds = %67
  store double %68, ptr %71, align 8, !tbaa !23
  %73 = load ptr, ptr %41, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %73, ptr noundef nonnull align 8 dereferenceable(56) %12)
          to label %74 unwind label %79

74:                                               ; preds = %72
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #6
  br label %82

75:                                               ; preds = %61, %56
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %83

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

79:                                               ; preds = %72, %67
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  br label %81

81:                                               ; preds = %79, %77
  %.pn110 = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #6
  br label %83

82:                                               ; preds = %74, %63
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #6
  br label %.loopexit

83:                                               ; preds = %81, %75
  %.pn110.pn = phi { ptr, i32 } [ %.pn110, %81 ], [ %76, %75 ]
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #6
  br label %112

84:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %13) #6
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %13, ptr noundef nonnull align 8 dereferenceable(56) %9)
  %85 = load double, ptr %52, align 8, !tbaa !22
  %86 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %13, i32 noundef 0)
  %87 = load i32, ptr %49, align 8, !tbaa !18
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %86, i32 noundef %87)
          to label %89 unwind label %103

89:                                               ; preds = %84
  store double %85, ptr %88, align 8, !tbaa !23
  %90 = load ptr, ptr %41, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %90, ptr noundef nonnull align 8 dereferenceable(56) %13)
          to label %91 unwind label %103

91:                                               ; preds = %89
  %92 = fmul double %54, %54
  %93 = fcmp olt double %92, %5
  br i1 %93, label %94, label %110

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %14) #6
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %14, ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %95 unwind label %105

95:                                               ; preds = %94
  %96 = load double, ptr %52, align 8, !tbaa !22
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %14, i32 noundef 1)
  %98 = load i32, ptr %49, align 8, !tbaa !18
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %97, i32 noundef %98)
          to label %100 unwind label %107

100:                                              ; preds = %95
  store double %96, ptr %99, align 8, !tbaa !23
  %101 = load ptr, ptr %21, align 8, !tbaa !5
  invoke void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_P20R3MeshSearchTreeNodeRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %101, ptr noundef nonnull align 8 dereferenceable(56) %14)
          to label %102 unwind label %107

102:                                              ; preds = %100
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %14) #6
  br label %110

103:                                              ; preds = %89, %84
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %111

105:                                              ; preds = %94
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %109

107:                                              ; preds = %100, %95
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  br label %109

109:                                              ; preds = %107, %105
  %.pn = phi { ptr, i32 } [ %108, %107 ], [ %106, %105 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %14) #6
  br label %111

110:                                              ; preds = %102, %91
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %13) #6
  br label %.loopexit

111:                                              ; preds = %109, %103
  %.pn.pn = phi { ptr, i32 } [ %.pn, %109 ], [ %104, %103 ]
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %13) #6
  br label %112

112:                                              ; preds = %111, %83
  %.pn110.pn.pn = phi { ptr, i32 } [ %.pn110.pn, %83 ], [ %.pn.pn, %111 ]
  resume { ptr, i32 } %.pn110.pn.pn

113:                                              ; preds = %.lr.ph117, %122
  %.0116 = phi i32 [ 0, %.lr.ph117 ], [ %123, %122 ]
  %114 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef %.0116)
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 20
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = load i32, ptr %26, align 4, !tbaa !13
  %119 = icmp eq i32 %117, %118
  br i1 %119, label %122, label %120

120:                                              ; preds = %113
  store i32 %118, ptr %116, align 4, !tbaa !9
  %121 = load ptr, ptr %115, align 8, !tbaa !15
  tail call void @_ZNK16R3MeshSearchTree7FindAllERK7R3PointRK8R3VectorR7RNArrayIP18R3MeshIntersectionEddPFiS2_S5_P6R3MeshP10R3MeshFacePvESF_SE_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %121)
  br label %122

122:                                              ; preds = %113, %120
  %123 = add nuw nsw i32 %.0116, 1
  %124 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %113, label %.loopexit, !llvm.loop !24

.loopexit:                                        ; preds = %122, %.preheader, %110, %82, %10
  ret void
}

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

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

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


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