; 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.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3MeshSearchTree = type { ptr, ptr, i32, i32 }
%struct.R3MeshIntersection = type { i32, ptr, ptr, ptr, %class.R3Point, double }

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

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

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16R3MeshSearchTree11FindClosestERK7R3PointRK8R3VectorR18R3MeshIntersectiondRdPFiS2_S5_P6R3MeshP10R3MeshFacePvESD_SC_(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(64) %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #2 align 2 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca %class.R3Point, align 8
  %32 = alloca %class.R3Vector, align 8
  %33 = alloca %class.R3Vector, align 8
  %34 = alloca %class.R3Vector, align 8
  %35 = alloca %class.R3Plane, align 8
  %36 = alloca double, align 8
  %37 = alloca %class.R3Vector, align 8
  %38 = alloca %class.R3Vector, align 8
  %39 = alloca %class.R3Plane, align 8
  %40 = alloca double, align 8
  %41 = alloca %class.R3Vector, align 8
  %42 = alloca %class.R3Vector, align 8
  %43 = alloca %class.R3Plane, align 8
  %44 = alloca double, align 8
  %45 = alloca %class.R3Vector, align 8
  %46 = alloca double, align 8
  %47 = alloca %class.R3Vector, align 8
  %48 = alloca double, align 8
  %49 = alloca double, align 8
  %50 = alloca double, align 8
  %51 = alloca %class.R3Point, align 8
  %52 = alloca %class.R3Vector, align 8
  %53 = alloca double, align 8
  %54 = alloca %class.R3Vector, align 8
  %55 = alloca double, align 8
  %56 = alloca %class.R3Vector, align 8
  %57 = alloca double, align 8
  %58 = alloca double, align 8
  %59 = alloca double, align 8
  %60 = alloca %class.R3Point, align 8
  %61 = alloca %class.R3Vector, align 8
  %62 = alloca double, align 8
  %63 = alloca %class.R3Vector, align 8
  %64 = alloca double, align 8
  %65 = alloca %class.R3Vector, align 8
  %66 = alloca double, align 8
  %67 = alloca double, align 8
  %68 = alloca double, align 8
  %69 = alloca %class.R3Point, align 8
  %70 = alloca %class.R3Vector, align 8
  %71 = alloca double, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store double %4, ptr %14, align 8, !tbaa !9
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  %72 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %73 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = load ptr, ptr %18, align 8, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %74, ptr noundef %75)
  store ptr %76, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %77 = load ptr, ptr %19, align 8, !tbaa !5
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %77, ptr noundef nonnull align 8 dereferenceable(24) %78)
  store double %79, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %80 = load double, ptr %20, align 8, !tbaa !9
  %81 = load double, ptr %20, align 8, !tbaa !9
  %82 = fmul double %80, %81
  store double %82, ptr %21, align 8, !tbaa !9
  %83 = load double, ptr %21, align 8, !tbaa !9
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = fcmp oge double %83, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %9
  store i32 1, ptr %22, align 4
  br label %503

88:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %91, ptr noundef %92)
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = load double, ptr %94, align 8, !tbaa !9
  %96 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 8 dereferenceable(56) %93, double noundef %95)
  store double %96, ptr %23, align 8, !tbaa !9
  %97 = load double, ptr %23, align 8, !tbaa !9
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fcmp oge double %97, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %88
  store i32 1, ptr %22, align 4
  br label %502

102:                                              ; preds = %88
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %117

105:                                              ; preds = %102
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = load ptr, ptr %18, align 8, !tbaa !5
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = call noundef i32 %106(ptr noundef nonnull align 8 dereferenceable(24) %107, ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef %110, ptr noundef %111, ptr noundef %112)
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %116, label %115

115:                                              ; preds = %105
  store i32 1, ptr %22, align 4
  br label %502

116:                                              ; preds = %105
  br label %117

117:                                              ; preds = %116, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %118 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %119, ptr noundef %120, i32 noundef 0)
  store ptr %121, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %122 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !11
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %123, ptr noundef %124, i32 noundef 1)
  store ptr %125, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %126 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !11
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %127, ptr noundef %128, i32 noundef 2)
  store ptr %129, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %130 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = load ptr, ptr %24, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %131, ptr noundef %132)
  store ptr %133, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %134 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !11
  %136 = load ptr, ptr %25, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %135, ptr noundef %136)
  store ptr %137, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %138 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = load ptr, ptr %26, align 8, !tbaa !5
  %141 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %139, ptr noundef %140)
  store ptr %141, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %142 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = load ptr, ptr %18, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %143, ptr noundef %144)
  store ptr %145, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #5
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #5
  %147 = load double, ptr %20, align 8, !tbaa !9
  %148 = load ptr, ptr %30, align 8, !tbaa !5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %32, double noundef %147, ptr noundef nonnull align 8 dereferenceable(24) %148)
  call void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %31, ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 8 dereferenceable(24) %32)
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #5
  %149 = load ptr, ptr %28, align 8, !tbaa !5
  %150 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %33, ptr noundef nonnull align 8 dereferenceable(24) %149, ptr noundef nonnull align 8 dereferenceable(24) %150)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #5
  %151 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !11
  %153 = load ptr, ptr %18, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %152, ptr noundef %153)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %34, ptr noundef nonnull align 8 dereferenceable(24) %154, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.start.p0(i64 32, ptr %35) #5
  %155 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %35, ptr noundef nonnull align 8 dereferenceable(24) %155, ptr noundef nonnull align 8 dereferenceable(24) %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %156 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %35, ptr noundef nonnull align 8 dereferenceable(24) %31)
  store double %156, ptr %36, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #5
  %157 = load ptr, ptr %29, align 8, !tbaa !5
  %158 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %37, ptr noundef nonnull align 8 dereferenceable(24) %157, ptr noundef nonnull align 8 dereferenceable(24) %158)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #5
  %159 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !11
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  %162 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %160, ptr noundef %161)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %38, ptr noundef nonnull align 8 dereferenceable(24) %162, ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 32, ptr %39) #5
  %163 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull align 8 dereferenceable(24) %163, ptr noundef nonnull align 8 dereferenceable(24) %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  %164 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull align 8 dereferenceable(24) %31)
  store double %164, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %41) #5
  %165 = load ptr, ptr %27, align 8, !tbaa !5
  %166 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %41, ptr noundef nonnull align 8 dereferenceable(24) %165, ptr noundef nonnull align 8 dereferenceable(24) %166)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #5
  %167 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !11
  %169 = load ptr, ptr %18, align 8, !tbaa !5
  %170 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %168, ptr noundef %169)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %42, ptr noundef nonnull align 8 dereferenceable(24) %170, ptr noundef nonnull align 8 dereferenceable(24) %41)
  call void @llvm.lifetime.start.p0(i64 32, ptr %43) #5
  %171 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %43, ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 8 dereferenceable(24) %42)
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #5
  %172 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %43, ptr noundef nonnull align 8 dereferenceable(24) %31)
  store double %172, ptr %44, align 8, !tbaa !9
  %173 = load double, ptr %36, align 8, !tbaa !9
  %174 = fcmp oge double %173, 0.000000e+00
  br i1 %174, label %175, label %197

175:                                              ; preds = %117
  %176 = load double, ptr %40, align 8, !tbaa !9
  %177 = fcmp oge double %176, 0.000000e+00
  br i1 %177, label %178, label %197

178:                                              ; preds = %175
  %179 = load double, ptr %44, align 8, !tbaa !9
  %180 = fcmp oge double %179, 0.000000e+00
  br i1 %180, label %181, label %197

181:                                              ; preds = %178
  %182 = load double, ptr %21, align 8, !tbaa !9
  %183 = load double, ptr %14, align 8, !tbaa !9
  %184 = fcmp oge double %182, %183
  br i1 %184, label %185, label %196

185:                                              ; preds = %181
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.R3MeshIntersection, ptr %186, i32 0, i32 0
  store i32 3, ptr %187, align 8, !tbaa !14
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = load ptr, ptr %13, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.R3MeshIntersection, ptr %189, i32 0, i32 3
  store ptr %188, ptr %190, align 8, !tbaa !18
  %191 = load ptr, ptr %13, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.R3MeshIntersection, ptr %191, i32 0, i32 4
  %193 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %192, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %194 = load double, ptr %21, align 8, !tbaa !9
  %195 = load ptr, ptr %15, align 8, !tbaa !5
  store double %194, ptr %195, align 8, !tbaa !9
  br label %196

196:                                              ; preds = %185, %181
  br label %501

197:                                              ; preds = %178, %175, %117
  %198 = load double, ptr %36, align 8, !tbaa !9
  %199 = fcmp olt double %198, 0.000000e+00
  br i1 %199, label %200, label %298

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 24, ptr %45) #5
  %201 = load ptr, ptr %28, align 8, !tbaa !5
  %202 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %45, ptr noundef nonnull align 8 dereferenceable(24) %201, ptr noundef nonnull align 8 dereferenceable(24) %202)
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #5
  %203 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %45)
  store double %203, ptr %46, align 8, !tbaa !9
  %204 = load double, ptr %46, align 8, !tbaa !9
  %205 = fcmp ogt double %204, 0.000000e+00
  br i1 %205, label %206, label %297

206:                                              ; preds = %200
  %207 = load double, ptr %46, align 8, !tbaa !9
  %208 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %45, double noundef %207)
  call void @llvm.lifetime.start.p0(i64 24, ptr %47) #5
  %209 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %47, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %209)
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #5
  %210 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(24) %47)
  store double %210, ptr %48, align 8, !tbaa !9
  %211 = load double, ptr %48, align 8, !tbaa !9
  %212 = fcmp ole double %211, 0.000000e+00
  br i1 %212, label %213, label %238

213:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #5
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = load ptr, ptr %27, align 8, !tbaa !5
  %216 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %214, ptr noundef nonnull align 8 dereferenceable(24) %215)
  store double %216, ptr %49, align 8, !tbaa !9
  %217 = load double, ptr %49, align 8, !tbaa !9
  %218 = load double, ptr %14, align 8, !tbaa !9
  %219 = fcmp oge double %217, %218
  br i1 %219, label %220, label %237

220:                                              ; preds = %213
  %221 = load double, ptr %49, align 8, !tbaa !9
  %222 = load ptr, ptr %15, align 8, !tbaa !5
  %223 = load double, ptr %222, align 8, !tbaa !9
  %224 = fcmp olt double %221, %223
  br i1 %224, label %225, label %237

225:                                              ; preds = %220
  %226 = load ptr, ptr %13, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.R3MeshIntersection, ptr %226, i32 0, i32 0
  store i32 1, ptr %227, align 8, !tbaa !14
  %228 = load ptr, ptr %24, align 8, !tbaa !5
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.R3MeshIntersection, ptr %229, i32 0, i32 1
  store ptr %228, ptr %230, align 8, !tbaa !19
  %231 = load ptr, ptr %27, align 8, !tbaa !5
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.R3MeshIntersection, ptr %232, i32 0, i32 4
  %234 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %233, ptr noundef nonnull align 8 dereferenceable(24) %231)
  %235 = load double, ptr %49, align 8, !tbaa !9
  %236 = load ptr, ptr %15, align 8, !tbaa !5
  store double %235, ptr %236, align 8, !tbaa !9
  br label %237

237:                                              ; preds = %225, %220, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #5
  br label %296

238:                                              ; preds = %206
  %239 = load double, ptr %48, align 8, !tbaa !9
  %240 = load double, ptr %46, align 8, !tbaa !9
  %241 = fcmp oge double %239, %240
  br i1 %241, label %242, label %267

242:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #5
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  %244 = load ptr, ptr %28, align 8, !tbaa !5
  %245 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %243, ptr noundef nonnull align 8 dereferenceable(24) %244)
  store double %245, ptr %50, align 8, !tbaa !9
  %246 = load double, ptr %50, align 8, !tbaa !9
  %247 = load double, ptr %14, align 8, !tbaa !9
  %248 = fcmp oge double %246, %247
  br i1 %248, label %249, label %266

249:                                              ; preds = %242
  %250 = load double, ptr %50, align 8, !tbaa !9
  %251 = load ptr, ptr %15, align 8, !tbaa !5
  %252 = load double, ptr %251, align 8, !tbaa !9
  %253 = fcmp olt double %250, %252
  br i1 %253, label %254, label %266

254:                                              ; preds = %249
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.R3MeshIntersection, ptr %255, i32 0, i32 0
  store i32 1, ptr %256, align 8, !tbaa !14
  %257 = load ptr, ptr %25, align 8, !tbaa !5
  %258 = load ptr, ptr %13, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.R3MeshIntersection, ptr %258, i32 0, i32 1
  store ptr %257, ptr %259, align 8, !tbaa !19
  %260 = load ptr, ptr %28, align 8, !tbaa !5
  %261 = load ptr, ptr %13, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.R3MeshIntersection, ptr %261, i32 0, i32 4
  %263 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %262, ptr noundef nonnull align 8 dereferenceable(24) %260)
  %264 = load double, ptr %50, align 8, !tbaa !9
  %265 = load ptr, ptr %15, align 8, !tbaa !5
  store double %264, ptr %265, align 8, !tbaa !9
  br label %266

266:                                              ; preds = %254, %249, %242
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #5
  br label %295

267:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 24, ptr %51) #5
  %268 = load ptr, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %52) #5
  %269 = load double, ptr %48, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %52, double noundef %269, ptr noundef nonnull align 8 dereferenceable(24) %45)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %51, ptr noundef nonnull align 8 dereferenceable(24) %268, ptr noundef nonnull align 8 dereferenceable(24) %52)
  call void @llvm.lifetime.end.p0(i64 24, ptr %52) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #5
  %270 = load ptr, ptr %11, align 8, !tbaa !5
  %271 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %270, ptr noundef nonnull align 8 dereferenceable(24) %51)
  store double %271, ptr %53, align 8, !tbaa !9
  %272 = load double, ptr %53, align 8, !tbaa !9
  %273 = load double, ptr %14, align 8, !tbaa !9
  %274 = fcmp oge double %272, %273
  br i1 %274, label %275, label %294

275:                                              ; preds = %267
  %276 = load double, ptr %53, align 8, !tbaa !9
  %277 = load ptr, ptr %15, align 8, !tbaa !5
  %278 = load double, ptr %277, align 8, !tbaa !9
  %279 = fcmp olt double %276, %278
  br i1 %279, label %280, label %294

280:                                              ; preds = %275
  %281 = load ptr, ptr %13, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.R3MeshIntersection, ptr %281, i32 0, i32 0
  store i32 2, ptr %282, align 8, !tbaa !14
  %283 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %284 = load ptr, ptr %283, align 8, !tbaa !11
  %285 = load ptr, ptr %18, align 8, !tbaa !5
  %286 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %284, ptr noundef %285, i32 noundef 0)
  %287 = load ptr, ptr %13, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.R3MeshIntersection, ptr %287, i32 0, i32 2
  store ptr %286, ptr %288, align 8, !tbaa !20
  %289 = load ptr, ptr %13, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.R3MeshIntersection, ptr %289, i32 0, i32 4
  %291 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %290, ptr noundef nonnull align 8 dereferenceable(24) %51)
  %292 = load double, ptr %53, align 8, !tbaa !9
  %293 = load ptr, ptr %15, align 8, !tbaa !5
  store double %292, ptr %293, align 8, !tbaa !9
  br label %294

294:                                              ; preds = %280, %275, %267
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %51) #5
  br label %295

295:                                              ; preds = %294, %266
  br label %296

296:                                              ; preds = %295, %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %47) #5
  br label %297

297:                                              ; preds = %296, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %45) #5
  br label %298

298:                                              ; preds = %297, %197
  %299 = load double, ptr %40, align 8, !tbaa !9
  %300 = fcmp olt double %299, 0.000000e+00
  br i1 %300, label %301, label %399

301:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 24, ptr %54) #5
  %302 = load ptr, ptr %29, align 8, !tbaa !5
  %303 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %54, ptr noundef nonnull align 8 dereferenceable(24) %302, ptr noundef nonnull align 8 dereferenceable(24) %303)
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #5
  %304 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  store double %304, ptr %55, align 8, !tbaa !9
  %305 = load double, ptr %55, align 8, !tbaa !9
  %306 = fcmp ogt double %305, 0.000000e+00
  br i1 %306, label %307, label %398

307:                                              ; preds = %301
  %308 = load double, ptr %55, align 8, !tbaa !9
  %309 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %54, double noundef %308)
  call void @llvm.lifetime.start.p0(i64 24, ptr %56) #5
  %310 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %56, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %310)
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #5
  %311 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(24) %56)
  store double %311, ptr %57, align 8, !tbaa !9
  %312 = load double, ptr %57, align 8, !tbaa !9
  %313 = fcmp ole double %312, 0.000000e+00
  br i1 %313, label %314, label %339

314:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #5
  %315 = load ptr, ptr %11, align 8, !tbaa !5
  %316 = load ptr, ptr %28, align 8, !tbaa !5
  %317 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %315, ptr noundef nonnull align 8 dereferenceable(24) %316)
  store double %317, ptr %58, align 8, !tbaa !9
  %318 = load double, ptr %58, align 8, !tbaa !9
  %319 = load double, ptr %14, align 8, !tbaa !9
  %320 = fcmp oge double %318, %319
  br i1 %320, label %321, label %338

321:                                              ; preds = %314
  %322 = load double, ptr %58, align 8, !tbaa !9
  %323 = load ptr, ptr %15, align 8, !tbaa !5
  %324 = load double, ptr %323, align 8, !tbaa !9
  %325 = fcmp olt double %322, %324
  br i1 %325, label %326, label %338

326:                                              ; preds = %321
  %327 = load ptr, ptr %13, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.R3MeshIntersection, ptr %327, i32 0, i32 0
  store i32 1, ptr %328, align 8, !tbaa !14
  %329 = load ptr, ptr %25, align 8, !tbaa !5
  %330 = load ptr, ptr %13, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.R3MeshIntersection, ptr %330, i32 0, i32 1
  store ptr %329, ptr %331, align 8, !tbaa !19
  %332 = load ptr, ptr %28, align 8, !tbaa !5
  %333 = load ptr, ptr %13, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.R3MeshIntersection, ptr %333, i32 0, i32 4
  %335 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %334, ptr noundef nonnull align 8 dereferenceable(24) %332)
  %336 = load double, ptr %58, align 8, !tbaa !9
  %337 = load ptr, ptr %15, align 8, !tbaa !5
  store double %336, ptr %337, align 8, !tbaa !9
  br label %338

338:                                              ; preds = %326, %321, %314
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #5
  br label %397

339:                                              ; preds = %307
  %340 = load double, ptr %57, align 8, !tbaa !9
  %341 = load double, ptr %55, align 8, !tbaa !9
  %342 = fcmp oge double %340, %341
  br i1 %342, label %343, label %368

343:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #5
  %344 = load ptr, ptr %11, align 8, !tbaa !5
  %345 = load ptr, ptr %29, align 8, !tbaa !5
  %346 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %344, ptr noundef nonnull align 8 dereferenceable(24) %345)
  store double %346, ptr %59, align 8, !tbaa !9
  %347 = load double, ptr %59, align 8, !tbaa !9
  %348 = load double, ptr %14, align 8, !tbaa !9
  %349 = fcmp oge double %347, %348
  br i1 %349, label %350, label %367

350:                                              ; preds = %343
  %351 = load double, ptr %59, align 8, !tbaa !9
  %352 = load ptr, ptr %15, align 8, !tbaa !5
  %353 = load double, ptr %352, align 8, !tbaa !9
  %354 = fcmp olt double %351, %353
  br i1 %354, label %355, label %367

355:                                              ; preds = %350
  %356 = load ptr, ptr %13, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.R3MeshIntersection, ptr %356, i32 0, i32 0
  store i32 1, ptr %357, align 8, !tbaa !14
  %358 = load ptr, ptr %26, align 8, !tbaa !5
  %359 = load ptr, ptr %13, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct.R3MeshIntersection, ptr %359, i32 0, i32 1
  store ptr %358, ptr %360, align 8, !tbaa !19
  %361 = load ptr, ptr %29, align 8, !tbaa !5
  %362 = load ptr, ptr %13, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.R3MeshIntersection, ptr %362, i32 0, i32 4
  %364 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %363, ptr noundef nonnull align 8 dereferenceable(24) %361)
  %365 = load double, ptr %59, align 8, !tbaa !9
  %366 = load ptr, ptr %15, align 8, !tbaa !5
  store double %365, ptr %366, align 8, !tbaa !9
  br label %367

367:                                              ; preds = %355, %350, %343
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #5
  br label %396

368:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 24, ptr %60) #5
  %369 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %61) #5
  %370 = load double, ptr %57, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %61, double noundef %370, ptr noundef nonnull align 8 dereferenceable(24) %54)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %60, ptr noundef nonnull align 8 dereferenceable(24) %369, ptr noundef nonnull align 8 dereferenceable(24) %61)
  call void @llvm.lifetime.end.p0(i64 24, ptr %61) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #5
  %371 = load ptr, ptr %11, align 8, !tbaa !5
  %372 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %371, ptr noundef nonnull align 8 dereferenceable(24) %60)
  store double %372, ptr %62, align 8, !tbaa !9
  %373 = load double, ptr %62, align 8, !tbaa !9
  %374 = load double, ptr %14, align 8, !tbaa !9
  %375 = fcmp oge double %373, %374
  br i1 %375, label %376, label %395

376:                                              ; preds = %368
  %377 = load double, ptr %62, align 8, !tbaa !9
  %378 = load ptr, ptr %15, align 8, !tbaa !5
  %379 = load double, ptr %378, align 8, !tbaa !9
  %380 = fcmp olt double %377, %379
  br i1 %380, label %381, label %395

381:                                              ; preds = %376
  %382 = load ptr, ptr %13, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.R3MeshIntersection, ptr %382, i32 0, i32 0
  store i32 2, ptr %383, align 8, !tbaa !14
  %384 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %385 = load ptr, ptr %384, align 8, !tbaa !11
  %386 = load ptr, ptr %18, align 8, !tbaa !5
  %387 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %385, ptr noundef %386, i32 noundef 1)
  %388 = load ptr, ptr %13, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.R3MeshIntersection, ptr %388, i32 0, i32 2
  store ptr %387, ptr %389, align 8, !tbaa !20
  %390 = load ptr, ptr %13, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.R3MeshIntersection, ptr %390, i32 0, i32 4
  %392 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %391, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %393 = load double, ptr %62, align 8, !tbaa !9
  %394 = load ptr, ptr %15, align 8, !tbaa !5
  store double %393, ptr %394, align 8, !tbaa !9
  br label %395

395:                                              ; preds = %381, %376, %368
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %60) #5
  br label %396

396:                                              ; preds = %395, %367
  br label %397

397:                                              ; preds = %396, %338
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %56) #5
  br label %398

398:                                              ; preds = %397, %301
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %54) #5
  br label %399

399:                                              ; preds = %398, %298
  %400 = load double, ptr %44, align 8, !tbaa !9
  %401 = fcmp olt double %400, 0.000000e+00
  br i1 %401, label %402, label %500

402:                                              ; preds = %399
  call void @llvm.lifetime.start.p0(i64 24, ptr %63) #5
  %403 = load ptr, ptr %27, align 8, !tbaa !5
  %404 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %63, ptr noundef nonnull align 8 dereferenceable(24) %403, ptr noundef nonnull align 8 dereferenceable(24) %404)
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #5
  %405 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %63)
  store double %405, ptr %64, align 8, !tbaa !9
  %406 = load double, ptr %64, align 8, !tbaa !9
  %407 = fcmp ogt double %406, 0.000000e+00
  br i1 %407, label %408, label %499

408:                                              ; preds = %402
  %409 = load double, ptr %64, align 8, !tbaa !9
  %410 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %63, double noundef %409)
  call void @llvm.lifetime.start.p0(i64 24, ptr %65) #5
  %411 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %65, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %411)
  call void @llvm.lifetime.start.p0(i64 8, ptr %66) #5
  %412 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 8 dereferenceable(24) %65)
  store double %412, ptr %66, align 8, !tbaa !9
  %413 = load double, ptr %66, align 8, !tbaa !9
  %414 = fcmp ole double %413, 0.000000e+00
  br i1 %414, label %415, label %440

415:                                              ; preds = %408
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #5
  %416 = load ptr, ptr %11, align 8, !tbaa !5
  %417 = load ptr, ptr %29, align 8, !tbaa !5
  %418 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %416, ptr noundef nonnull align 8 dereferenceable(24) %417)
  store double %418, ptr %67, align 8, !tbaa !9
  %419 = load double, ptr %67, align 8, !tbaa !9
  %420 = load double, ptr %14, align 8, !tbaa !9
  %421 = fcmp oge double %419, %420
  br i1 %421, label %422, label %439

422:                                              ; preds = %415
  %423 = load double, ptr %67, align 8, !tbaa !9
  %424 = load ptr, ptr %15, align 8, !tbaa !5
  %425 = load double, ptr %424, align 8, !tbaa !9
  %426 = fcmp olt double %423, %425
  br i1 %426, label %427, label %439

427:                                              ; preds = %422
  %428 = load ptr, ptr %13, align 8, !tbaa !5
  %429 = getelementptr inbounds %struct.R3MeshIntersection, ptr %428, i32 0, i32 0
  store i32 1, ptr %429, align 8, !tbaa !14
  %430 = load ptr, ptr %26, align 8, !tbaa !5
  %431 = load ptr, ptr %13, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.R3MeshIntersection, ptr %431, i32 0, i32 1
  store ptr %430, ptr %432, align 8, !tbaa !19
  %433 = load ptr, ptr %29, align 8, !tbaa !5
  %434 = load ptr, ptr %13, align 8, !tbaa !5
  %435 = getelementptr inbounds %struct.R3MeshIntersection, ptr %434, i32 0, i32 4
  %436 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %435, ptr noundef nonnull align 8 dereferenceable(24) %433)
  %437 = load double, ptr %67, align 8, !tbaa !9
  %438 = load ptr, ptr %15, align 8, !tbaa !5
  store double %437, ptr %438, align 8, !tbaa !9
  br label %439

439:                                              ; preds = %427, %422, %415
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #5
  br label %498

440:                                              ; preds = %408
  %441 = load double, ptr %66, align 8, !tbaa !9
  %442 = load double, ptr %64, align 8, !tbaa !9
  %443 = fcmp oge double %441, %442
  br i1 %443, label %444, label %469

444:                                              ; preds = %440
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #5
  %445 = load ptr, ptr %11, align 8, !tbaa !5
  %446 = load ptr, ptr %27, align 8, !tbaa !5
  %447 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %445, ptr noundef nonnull align 8 dereferenceable(24) %446)
  store double %447, ptr %68, align 8, !tbaa !9
  %448 = load double, ptr %68, align 8, !tbaa !9
  %449 = load double, ptr %14, align 8, !tbaa !9
  %450 = fcmp oge double %448, %449
  br i1 %450, label %451, label %468

451:                                              ; preds = %444
  %452 = load double, ptr %68, align 8, !tbaa !9
  %453 = load ptr, ptr %15, align 8, !tbaa !5
  %454 = load double, ptr %453, align 8, !tbaa !9
  %455 = fcmp olt double %452, %454
  br i1 %455, label %456, label %468

456:                                              ; preds = %451
  %457 = load ptr, ptr %13, align 8, !tbaa !5
  %458 = getelementptr inbounds %struct.R3MeshIntersection, ptr %457, i32 0, i32 0
  store i32 1, ptr %458, align 8, !tbaa !14
  %459 = load ptr, ptr %24, align 8, !tbaa !5
  %460 = load ptr, ptr %13, align 8, !tbaa !5
  %461 = getelementptr inbounds %struct.R3MeshIntersection, ptr %460, i32 0, i32 1
  store ptr %459, ptr %461, align 8, !tbaa !19
  %462 = load ptr, ptr %27, align 8, !tbaa !5
  %463 = load ptr, ptr %13, align 8, !tbaa !5
  %464 = getelementptr inbounds %struct.R3MeshIntersection, ptr %463, i32 0, i32 4
  %465 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %464, ptr noundef nonnull align 8 dereferenceable(24) %462)
  %466 = load double, ptr %68, align 8, !tbaa !9
  %467 = load ptr, ptr %15, align 8, !tbaa !5
  store double %466, ptr %467, align 8, !tbaa !9
  br label %468

468:                                              ; preds = %456, %451, %444
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #5
  br label %497

469:                                              ; preds = %440
  call void @llvm.lifetime.start.p0(i64 24, ptr %69) #5
  %470 = load ptr, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %70) #5
  %471 = load double, ptr %66, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %70, double noundef %471, ptr noundef nonnull align 8 dereferenceable(24) %63)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %69, ptr noundef nonnull align 8 dereferenceable(24) %470, ptr noundef nonnull align 8 dereferenceable(24) %70)
  call void @llvm.lifetime.end.p0(i64 24, ptr %70) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %71) #5
  %472 = load ptr, ptr %11, align 8, !tbaa !5
  %473 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %472, ptr noundef nonnull align 8 dereferenceable(24) %69)
  store double %473, ptr %71, align 8, !tbaa !9
  %474 = load double, ptr %71, align 8, !tbaa !9
  %475 = load double, ptr %14, align 8, !tbaa !9
  %476 = fcmp oge double %474, %475
  br i1 %476, label %477, label %496

477:                                              ; preds = %469
  %478 = load double, ptr %71, align 8, !tbaa !9
  %479 = load ptr, ptr %15, align 8, !tbaa !5
  %480 = load double, ptr %479, align 8, !tbaa !9
  %481 = fcmp olt double %478, %480
  br i1 %481, label %482, label %496

482:                                              ; preds = %477
  %483 = load ptr, ptr %13, align 8, !tbaa !5
  %484 = getelementptr inbounds %struct.R3MeshIntersection, ptr %483, i32 0, i32 0
  store i32 2, ptr %484, align 8, !tbaa !14
  %485 = getelementptr inbounds %class.R3MeshSearchTree, ptr %72, i32 0, i32 0
  %486 = load ptr, ptr %485, align 8, !tbaa !11
  %487 = load ptr, ptr %18, align 8, !tbaa !5
  %488 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %486, ptr noundef %487, i32 noundef 2)
  %489 = load ptr, ptr %13, align 8, !tbaa !5
  %490 = getelementptr inbounds %struct.R3MeshIntersection, ptr %489, i32 0, i32 2
  store ptr %488, ptr %490, align 8, !tbaa !20
  %491 = load ptr, ptr %13, align 8, !tbaa !5
  %492 = getelementptr inbounds %struct.R3MeshIntersection, ptr %491, i32 0, i32 4
  %493 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %492, ptr noundef nonnull align 8 dereferenceable(24) %69)
  %494 = load double, ptr %71, align 8, !tbaa !9
  %495 = load ptr, ptr %15, align 8, !tbaa !5
  store double %494, ptr %495, align 8, !tbaa !9
  br label %496

496:                                              ; preds = %482, %477, %469
  call void @llvm.lifetime.end.p0(i64 8, ptr %71) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %69) #5
  br label %497

497:                                              ; preds = %496, %468
  br label %498

498:                                              ; preds = %497, %439
  call void @llvm.lifetime.end.p0(i64 8, ptr %66) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %65) #5
  br label %499

499:                                              ; preds = %498, %402
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %63) #5
  br label %500

500:                                              ; preds = %499, %399
  br label %501

501:                                              ; preds = %500, %196
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  store i32 0, ptr %22, align 4
  br label %502

502:                                              ; preds = %501, %115, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %503

503:                                              ; preds = %502, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %504 = load i32, ptr %22, align 4
  switch i32 %504, label %506 [
    i32 0, label %505
    i32 1, label %505
  ]

505:                                              ; preds = %503, %503
  ret void

506:                                              ; preds = %503
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #3 align 2

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #4 align 2

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

declare void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

declare noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) #1

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

declare void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !6, i64 0}
!12 = !{!"_ZTS16R3MeshSearchTree", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTS18R3MeshIntersection", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !10, i64 56}
!16 = !{!"_ZTS10R3MeshType", !7, i64 0}
!17 = !{!"_ZTS7R3Point", !7, i64 0}
!18 = !{!15, !6, i64 24}
!19 = !{!15, !6, i64 8}
!20 = !{!15, !6, i64 16}


; 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.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }

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

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

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16R3MeshSearchTree11FindClosestERK7R3PointRK8R3VectorR18R3MeshIntersectiondRdPFiS2_S5_P6R3MeshP10R3MeshFacePvESD_SC_(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(64) %3, double noundef %4, ptr nocapture noundef nonnull align 8 dereferenceable(8) %5, ptr noundef readonly %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #2 align 2 {
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Vector, align 8
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = alloca %class.R3Plane, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Plane, align 8
  %18 = alloca %class.R3Vector, align 8
  %19 = alloca %class.R3Vector, align 8
  %20 = alloca %class.R3Plane, align 8
  %21 = alloca %class.R3Vector, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca %class.R3Point, align 8
  %24 = alloca %class.R3Vector, align 8
  %25 = alloca %class.R3Vector, align 8
  %26 = alloca %class.R3Vector, align 8
  %27 = alloca %class.R3Point, align 8
  %28 = alloca %class.R3Vector, align 8
  %29 = alloca %class.R3Vector, align 8
  %30 = alloca %class.R3Vector, align 8
  %31 = alloca %class.R3Point, align 8
  %32 = alloca %class.R3Vector, align 8
  %33 = load ptr, ptr %0, align 8, !tbaa !5
  %34 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %8)
  %35 = tail call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %36 = fmul double %35, %35
  %37 = load double, ptr %5, align 8, !tbaa !11
  %38 = fcmp ult double %36, %37
  br i1 %38, label %39, label %213

39:                                               ; preds = %9
  %40 = load ptr, ptr %0, align 8, !tbaa !5
  %41 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %40, ptr noundef %8)
  %42 = load double, ptr %5, align 8, !tbaa !11
  %43 = 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) %41, double noundef %42)
  %44 = load double, ptr %5, align 8, !tbaa !11
  %45 = fcmp ult double %43, %44
  br i1 %45, label %46, label %213

46:                                               ; preds = %39
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %50, label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %0, align 8, !tbaa !5
  %49 = tail call noundef i32 %6(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %48, ptr noundef %8, ptr noundef %7)
  %.not215 = icmp eq i32 %49, 0
  br i1 %.not215, label %213, label %50

50:                                               ; preds = %47, %46
  %51 = load ptr, ptr %0, align 8, !tbaa !5
  %52 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %51, ptr noundef %8, i32 noundef 0)
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %53, ptr noundef %8, i32 noundef 1)
  %55 = load ptr, ptr %0, align 8, !tbaa !5
  %56 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %55, ptr noundef %8, i32 noundef 2)
  %57 = load ptr, ptr %0, align 8, !tbaa !5
  %58 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %57, ptr noundef %52)
  %59 = load ptr, ptr %0, align 8, !tbaa !5
  %60 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %59, ptr noundef %54)
  %61 = load ptr, ptr %0, align 8, !tbaa !5
  %62 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %61, ptr noundef %56)
  %63 = load ptr, ptr %0, align 8, !tbaa !5
  %64 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %63, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %11, double noundef %35, ptr noundef nonnull align 8 dereferenceable(24) %64)
  call void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %58)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  %65 = load ptr, ptr %0, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %65, ptr noundef %8)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %67 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %60)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  %68 = load ptr, ptr %0, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %68, ptr noundef %8)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %70 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %62)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #5
  %71 = load ptr, ptr %0, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %8)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %73 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %74 = fcmp oge double %67, 0.000000e+00
  %75 = fcmp oge double %70, 0.000000e+00
  %or.cond = and i1 %74, %75
  %76 = fcmp oge double %73, 0.000000e+00
  %or.cond3 = and i1 %or.cond, %76
  br i1 %or.cond3, label %77, label %83

77:                                               ; preds = %50
  %78 = fcmp ult double %36, %4
  br i1 %78, label %212, label %79

79:                                               ; preds = %77
  store i32 3, ptr %3, align 8, !tbaa !13
  %80 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %8, ptr %80, align 8, !tbaa !17
  %81 = getelementptr inbounds i8, ptr %3, i64 32
  %82 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 8 dereferenceable(24) %10)
  store double %36, ptr %5, align 8, !tbaa !11
  br label %212

83:                                               ; preds = %50
  %84 = fcmp olt double %67, 0.000000e+00
  br i1 %84, label %85, label %126

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %86 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %87 = fcmp ogt double %86, 0.000000e+00
  br i1 %87, label %88, label %125

88:                                               ; preds = %85
  %89 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %21, double noundef %86)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %22) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %90 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %22)
  %91 = fcmp ugt double %90, 0.000000e+00
  br i1 %91, label %101, label %92

92:                                               ; preds = %88
  %93 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %94 = fcmp oge double %93, %4
  %95 = load double, ptr %5, align 8
  %96 = fcmp olt double %93, %95
  %or.cond217 = select i1 %94, i1 %96, i1 false
  br i1 %or.cond217, label %97, label %124

97:                                               ; preds = %92
  store i32 1, ptr %3, align 8, !tbaa !13
  %98 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %52, ptr %98, align 8, !tbaa !18
  %99 = getelementptr inbounds i8, ptr %3, i64 32
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 8 dereferenceable(24) %58)
  store double %93, ptr %5, align 8, !tbaa !11
  br label %124

101:                                              ; preds = %88
  %102 = fcmp ult double %90, %86
  br i1 %102, label %112, label %103

103:                                              ; preds = %101
  %104 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %105 = fcmp oge double %104, %4
  %106 = load double, ptr %5, align 8
  %107 = fcmp olt double %104, %106
  %or.cond219 = select i1 %105, i1 %107, i1 false
  br i1 %or.cond219, label %108, label %124

108:                                              ; preds = %103
  store i32 1, ptr %3, align 8, !tbaa !13
  %109 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %54, ptr %109, align 8, !tbaa !18
  %110 = getelementptr inbounds i8, ptr %3, i64 32
  %111 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef nonnull align 8 dereferenceable(24) %60)
  store double %104, ptr %5, align 8, !tbaa !11
  br label %124

112:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %24, double noundef %90, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %23, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #5
  %113 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %23)
  %114 = fcmp oge double %113, %4
  %115 = load double, ptr %5, align 8
  %116 = fcmp olt double %113, %115
  %or.cond221 = select i1 %114, i1 %116, i1 false
  br i1 %or.cond221, label %117, label %123

117:                                              ; preds = %112
  store i32 2, ptr %3, align 8, !tbaa !13
  %118 = load ptr, ptr %0, align 8, !tbaa !5
  %119 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %118, ptr noundef %8, i32 noundef 0)
  %120 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %119, ptr %120, align 8, !tbaa !19
  %121 = getelementptr inbounds i8, ptr %3, i64 32
  %122 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %121, ptr noundef nonnull align 8 dereferenceable(24) %23)
  store double %113, ptr %5, align 8, !tbaa !11
  br label %123

123:                                              ; preds = %117, %112
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #5
  br label %124

124:                                              ; preds = %103, %108, %92, %97, %123
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #5
  br label %125

125:                                              ; preds = %124, %85
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  br label %126

126:                                              ; preds = %125, %83
  %127 = fcmp olt double %70, 0.000000e+00
  br i1 %127, label %128, label %169

128:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %25) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %25, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %129 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %25)
  %130 = fcmp ogt double %129, 0.000000e+00
  br i1 %130, label %131, label %168

131:                                              ; preds = %128
  %132 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %25, double noundef %129)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %26) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %26, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %133 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %134 = fcmp ugt double %133, 0.000000e+00
  br i1 %134, label %144, label %135

135:                                              ; preds = %131
  %136 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %137 = fcmp oge double %136, %4
  %138 = load double, ptr %5, align 8
  %139 = fcmp olt double %136, %138
  %or.cond223 = select i1 %137, i1 %139, i1 false
  br i1 %or.cond223, label %140, label %167

140:                                              ; preds = %135
  store i32 1, ptr %3, align 8, !tbaa !13
  %141 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %54, ptr %141, align 8, !tbaa !18
  %142 = getelementptr inbounds i8, ptr %3, i64 32
  %143 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %142, ptr noundef nonnull align 8 dereferenceable(24) %60)
  store double %136, ptr %5, align 8, !tbaa !11
  br label %167

144:                                              ; preds = %131
  %145 = fcmp ult double %133, %129
  br i1 %145, label %155, label %146

146:                                              ; preds = %144
  %147 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %62)
  %148 = fcmp oge double %147, %4
  %149 = load double, ptr %5, align 8
  %150 = fcmp olt double %147, %149
  %or.cond225 = select i1 %148, i1 %150, i1 false
  br i1 %or.cond225, label %151, label %167

151:                                              ; preds = %146
  store i32 1, ptr %3, align 8, !tbaa !13
  %152 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %56, ptr %152, align 8, !tbaa !18
  %153 = getelementptr inbounds i8, ptr %3, i64 32
  %154 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %153, ptr noundef nonnull align 8 dereferenceable(24) %62)
  store double %147, ptr %5, align 8, !tbaa !11
  br label %167

155:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %28, double noundef %133, ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #5
  %156 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %157 = fcmp oge double %156, %4
  %158 = load double, ptr %5, align 8
  %159 = fcmp olt double %156, %158
  %or.cond227 = select i1 %157, i1 %159, i1 false
  br i1 %or.cond227, label %160, label %166

160:                                              ; preds = %155
  store i32 2, ptr %3, align 8, !tbaa !13
  %161 = load ptr, ptr %0, align 8, !tbaa !5
  %162 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %161, ptr noundef %8, i32 noundef 1)
  %163 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %162, ptr %163, align 8, !tbaa !19
  %164 = getelementptr inbounds i8, ptr %3, i64 32
  %165 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %164, ptr noundef nonnull align 8 dereferenceable(24) %27)
  store double %156, ptr %5, align 8, !tbaa !11
  br label %166

166:                                              ; preds = %160, %155
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #5
  br label %167

167:                                              ; preds = %146, %151, %135, %140, %166
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #5
  br label %168

168:                                              ; preds = %167, %128
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #5
  br label %169

169:                                              ; preds = %168, %126
  %170 = fcmp olt double %73, 0.000000e+00
  br i1 %170, label %171, label %212

171:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %29, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %62)
  %172 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
  %173 = fcmp ogt double %172, 0.000000e+00
  br i1 %173, label %174, label %211

174:                                              ; preds = %171
  %175 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %29, double noundef %172)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %62)
  %176 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %30)
  %177 = fcmp ugt double %176, 0.000000e+00
  br i1 %177, label %187, label %178

178:                                              ; preds = %174
  %179 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %62)
  %180 = fcmp oge double %179, %4
  %181 = load double, ptr %5, align 8
  %182 = fcmp olt double %179, %181
  %or.cond229 = select i1 %180, i1 %182, i1 false
  br i1 %or.cond229, label %183, label %210

183:                                              ; preds = %178
  store i32 1, ptr %3, align 8, !tbaa !13
  %184 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %56, ptr %184, align 8, !tbaa !18
  %185 = getelementptr inbounds i8, ptr %3, i64 32
  %186 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %185, ptr noundef nonnull align 8 dereferenceable(24) %62)
  store double %179, ptr %5, align 8, !tbaa !11
  br label %210

187:                                              ; preds = %174
  %188 = fcmp ult double %176, %172
  br i1 %188, label %198, label %189

189:                                              ; preds = %187
  %190 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %191 = fcmp oge double %190, %4
  %192 = load double, ptr %5, align 8
  %193 = fcmp olt double %190, %192
  %or.cond231 = select i1 %191, i1 %193, i1 false
  br i1 %or.cond231, label %194, label %210

194:                                              ; preds = %189
  store i32 1, ptr %3, align 8, !tbaa !13
  %195 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %52, ptr %195, align 8, !tbaa !18
  %196 = getelementptr inbounds i8, ptr %3, i64 32
  %197 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %196, ptr noundef nonnull align 8 dereferenceable(24) %58)
  store double %190, ptr %5, align 8, !tbaa !11
  br label %210

198:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %31) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %32) #5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %32, double noundef %176, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %31, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %32)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %32) #5
  %199 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %200 = fcmp oge double %199, %4
  %201 = load double, ptr %5, align 8
  %202 = fcmp olt double %199, %201
  %or.cond233 = select i1 %200, i1 %202, i1 false
  br i1 %or.cond233, label %203, label %209

203:                                              ; preds = %198
  store i32 2, ptr %3, align 8, !tbaa !13
  %204 = load ptr, ptr %0, align 8, !tbaa !5
  %205 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %204, ptr noundef %8, i32 noundef 2)
  %206 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %205, ptr %206, align 8, !tbaa !19
  %207 = getelementptr inbounds i8, ptr %3, i64 32
  %208 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %207, ptr noundef nonnull align 8 dereferenceable(24) %31)
  store double %199, ptr %5, align 8, !tbaa !11
  br label %209

209:                                              ; preds = %203, %198
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #5
  br label %210

210:                                              ; preds = %189, %194, %178, %183, %209
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #5
  br label %211

211:                                              ; preds = %210, %171
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #5
  br label %212

212:                                              ; preds = %169, %211, %77, %79
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  br label %213

213:                                              ; preds = %212, %39, %47, %9
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #3 align 2

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

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

declare void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #1

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

declare void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"_ZTS16R3MeshSearchTree", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS18R3MeshIntersection", !15, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !16, i64 32, !12, i64 56}
!15 = !{!"_ZTS10R3MeshType", !8, i64 0}
!16 = !{!"_ZTS7R3Point", !8, i64 0}
!17 = !{!14, !7, i64 24}
!18 = !{!14, !7, i64 8}
!19 = !{!14, !7, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass