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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

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

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

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

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

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

; 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 ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #6 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) #6 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) #4 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)) #3

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #7

declare noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local 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 %8) #5 align 2 personality ptr @__gxx_personality_v0 {
  %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 double, 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 %struct.R3MeshIntersection, align 8
  %46 = alloca %class.R3Vector, align 8
  %47 = alloca double, align 8
  %48 = alloca %class.R3Vector, align 8
  %49 = alloca double, align 8
  %50 = alloca double, align 8
  %51 = alloca double, align 8
  %52 = alloca %class.R3Point, align 8
  %53 = alloca %class.R3Vector, align 8
  %54 = alloca double, align 8
  %55 = alloca %class.R3Vector, align 8
  %56 = alloca double, align 8
  %57 = alloca %class.R3Vector, align 8
  %58 = alloca double, align 8
  %59 = alloca double, align 8
  %60 = alloca double, align 8
  %61 = alloca %class.R3Point, align 8
  %62 = alloca %class.R3Vector, align 8
  %63 = alloca double, align 8
  %64 = alloca %class.R3Vector, align 8
  %65 = alloca double, align 8
  %66 = alloca %class.R3Vector, align 8
  %67 = alloca double, align 8
  %68 = alloca double, align 8
  %69 = alloca double, align 8
  %70 = alloca %class.R3Point, align 8
  %71 = alloca %class.R3Vector, align 8
  %72 = alloca double, align 8
  %73 = alloca ptr, align 8
  %74 = alloca i32, align 4
  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 double %5, ptr %15, align 8, !tbaa !9
  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
  %75 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %76 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %18, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %77, ptr noundef %78)
  store ptr %79, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %80 = load ptr, ptr %19, align 8, !tbaa !5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %80, ptr noundef nonnull align 8 dereferenceable(24) %81)
  store double %82, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %83 = load double, ptr %20, align 8, !tbaa !9
  %84 = load double, ptr %20, align 8, !tbaa !9
  %85 = fmul double %83, %84
  store double %85, ptr %21, align 8, !tbaa !9
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = load double, ptr %15, align 8, !tbaa !9
  %88 = fcmp oge double %86, %87
  br i1 %88, label %89, label %90

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

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

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

102:                                              ; preds = %90
  %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 %75, 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 %561

116:                                              ; preds = %105
  br label %117

117:                                              ; preds = %116, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %118 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %122 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %126 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %130 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %134 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %138 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %142 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #8
  %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) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #8
  %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) #8
  %151 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %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) #8
  %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) #8
  %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) #8
  %159 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %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) #8
  %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) #8
  %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) #8
  %167 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, 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) #8
  %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) #8
  %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
  call void @llvm.lifetime.start.p0(i64 64, ptr %45) #8
  call void @_ZN18R3MeshIntersectionC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %45)
  %173 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 0, ptr %173, align 8, !tbaa !14
  %174 = load double, ptr %36, align 8, !tbaa !9
  %175 = fcmp oge double %174, 0.000000e+00
  br i1 %175, label %176, label %198

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

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

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

186:                                              ; preds = %182
  %187 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 3, ptr %187, align 8, !tbaa !14
  %188 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr null, ptr %188, align 8, !tbaa !18
  %189 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr null, ptr %189, align 8, !tbaa !19
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %190, ptr %191, align 8, !tbaa !20
  %192 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, 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 = call double @sqrt(double noundef %194) #8
  %196 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %195, ptr %196, align 8, !tbaa !21
  br label %197

197:                                              ; preds = %186, %182
  br label %547

198:                                              ; preds = %179, %176, %117
  %199 = load double, ptr %36, align 8, !tbaa !9
  %200 = fcmp olt double %199, 0.000000e+00
  br i1 %200, label %201, label %314

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

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

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

221:                                              ; preds = %214
  %222 = load double, ptr %50, align 8, !tbaa !9
  %223 = load double, ptr %15, align 8, !tbaa !9
  %224 = fcmp olt double %222, %223
  br i1 %224, label %225, label %245

225:                                              ; preds = %221
  %226 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %226, align 8, !tbaa !14
  %227 = load ptr, ptr %24, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %227, ptr %228, align 8, !tbaa !18
  %229 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !11
  %231 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %232 = load ptr, ptr %231, align 8, !tbaa !18
  %233 = load ptr, ptr %18, align 8, !tbaa !5
  %234 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %230, ptr noundef %232, ptr noundef %233, i32 noundef 0)
  %235 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %234, ptr %235, align 8, !tbaa !19
  %236 = load ptr, ptr %18, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %236, ptr %237, align 8, !tbaa !20
  %238 = load ptr, ptr %27, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %240 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %239, ptr noundef nonnull align 8 dereferenceable(24) %238)
  %241 = load double, ptr %50, align 8, !tbaa !9
  %242 = call double @sqrt(double noundef %241) #8
  %243 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %242, ptr %243, align 8, !tbaa !21
  %244 = load double, ptr %50, align 8, !tbaa !9
  store double %244, ptr %15, align 8, !tbaa !9
  br label %245

245:                                              ; preds = %225, %221, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  br label %312

246:                                              ; preds = %207
  %247 = load double, ptr %49, align 8, !tbaa !9
  %248 = load double, ptr %47, align 8, !tbaa !9
  %249 = fcmp oge double %247, %248
  br i1 %249, label %250, label %282

250:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #8
  %251 = load ptr, ptr %11, align 8, !tbaa !5
  %252 = load ptr, ptr %28, align 8, !tbaa !5
  %253 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %251, ptr noundef nonnull align 8 dereferenceable(24) %252)
  store double %253, ptr %51, align 8, !tbaa !9
  %254 = load double, ptr %51, align 8, !tbaa !9
  %255 = load double, ptr %14, align 8, !tbaa !9
  %256 = fcmp oge double %254, %255
  br i1 %256, label %257, label %281

257:                                              ; preds = %250
  %258 = load double, ptr %51, align 8, !tbaa !9
  %259 = load double, ptr %15, align 8, !tbaa !9
  %260 = fcmp olt double %258, %259
  br i1 %260, label %261, label %281

261:                                              ; preds = %257
  %262 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %262, align 8, !tbaa !14
  %263 = load ptr, ptr %25, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %263, ptr %264, align 8, !tbaa !18
  %265 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %266 = load ptr, ptr %265, align 8, !tbaa !11
  %267 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %268 = load ptr, ptr %267, align 8, !tbaa !18
  %269 = load ptr, ptr %18, align 8, !tbaa !5
  %270 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %266, ptr noundef %268, ptr noundef %269, i32 noundef 0)
  %271 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %270, ptr %271, align 8, !tbaa !19
  %272 = load ptr, ptr %18, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %272, ptr %273, align 8, !tbaa !20
  %274 = load ptr, ptr %28, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %276 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %275, ptr noundef nonnull align 8 dereferenceable(24) %274)
  %277 = load double, ptr %51, align 8, !tbaa !9
  %278 = call double @sqrt(double noundef %277) #8
  %279 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %278, ptr %279, align 8, !tbaa !21
  %280 = load double, ptr %51, align 8, !tbaa !9
  store double %280, ptr %15, align 8, !tbaa !9
  br label %281

281:                                              ; preds = %261, %257, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #8
  br label %311

282:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 24, ptr %52) #8
  %283 = load ptr, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %53) #8
  %284 = load double, ptr %49, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %53, double noundef %284, ptr noundef nonnull align 8 dereferenceable(24) %46)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %52, ptr noundef nonnull align 8 dereferenceable(24) %283, ptr noundef nonnull align 8 dereferenceable(24) %53)
  call void @llvm.lifetime.end.p0(i64 24, ptr %53) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #8
  %285 = load ptr, ptr %11, align 8, !tbaa !5
  %286 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %285, ptr noundef nonnull align 8 dereferenceable(24) %52)
  store double %286, ptr %54, align 8, !tbaa !9
  %287 = load double, ptr %54, align 8, !tbaa !9
  %288 = load double, ptr %14, align 8, !tbaa !9
  %289 = fcmp oge double %287, %288
  br i1 %289, label %290, label %310

290:                                              ; preds = %282
  %291 = load double, ptr %54, align 8, !tbaa !9
  %292 = load double, ptr %15, align 8, !tbaa !9
  %293 = fcmp olt double %291, %292
  br i1 %293, label %294, label %310

294:                                              ; preds = %290
  %295 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 2, ptr %295, align 8, !tbaa !14
  %296 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr null, ptr %296, align 8, !tbaa !18
  %297 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %298 = load ptr, ptr %297, align 8, !tbaa !11
  %299 = load ptr, ptr %18, align 8, !tbaa !5
  %300 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %298, ptr noundef %299, i32 noundef 0)
  %301 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %300, ptr %301, align 8, !tbaa !19
  %302 = load ptr, ptr %18, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %302, ptr %303, align 8, !tbaa !20
  %304 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %305 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %304, ptr noundef nonnull align 8 dereferenceable(24) %52)
  %306 = load double, ptr %54, align 8, !tbaa !9
  %307 = call double @sqrt(double noundef %306) #8
  %308 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %307, ptr %308, align 8, !tbaa !21
  %309 = load double, ptr %54, align 8, !tbaa !9
  store double %309, ptr %15, align 8, !tbaa !9
  br label %310

310:                                              ; preds = %294, %290, %282
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %52) #8
  br label %311

311:                                              ; preds = %310, %281
  br label %312

312:                                              ; preds = %311, %245
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %48) #8
  br label %313

313:                                              ; preds = %312, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #8
  br label %314

314:                                              ; preds = %313, %198
  %315 = load double, ptr %40, align 8, !tbaa !9
  %316 = fcmp olt double %315, 0.000000e+00
  br i1 %316, label %317, label %430

317:                                              ; preds = %314
  call void @llvm.lifetime.start.p0(i64 24, ptr %55) #8
  %318 = load ptr, ptr %29, align 8, !tbaa !5
  %319 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %55, ptr noundef nonnull align 8 dereferenceable(24) %318, ptr noundef nonnull align 8 dereferenceable(24) %319)
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #8
  %320 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  store double %320, ptr %56, align 8, !tbaa !9
  %321 = load double, ptr %56, align 8, !tbaa !9
  %322 = fcmp ogt double %321, 0.000000e+00
  br i1 %322, label %323, label %429

323:                                              ; preds = %317
  %324 = load double, ptr %56, align 8, !tbaa !9
  %325 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %55, double noundef %324)
  call void @llvm.lifetime.start.p0(i64 24, ptr %57) #8
  %326 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %57, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %326)
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #8
  %327 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %57)
  store double %327, ptr %58, align 8, !tbaa !9
  %328 = load double, ptr %58, align 8, !tbaa !9
  %329 = fcmp ole double %328, 0.000000e+00
  br i1 %329, label %330, label %362

330:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #8
  %331 = load ptr, ptr %11, align 8, !tbaa !5
  %332 = load ptr, ptr %28, align 8, !tbaa !5
  %333 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %331, ptr noundef nonnull align 8 dereferenceable(24) %332)
  store double %333, ptr %59, align 8, !tbaa !9
  %334 = load double, ptr %59, align 8, !tbaa !9
  %335 = load double, ptr %14, align 8, !tbaa !9
  %336 = fcmp oge double %334, %335
  br i1 %336, label %337, label %361

337:                                              ; preds = %330
  %338 = load double, ptr %59, align 8, !tbaa !9
  %339 = load double, ptr %15, align 8, !tbaa !9
  %340 = fcmp olt double %338, %339
  br i1 %340, label %341, label %361

341:                                              ; preds = %337
  %342 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %342, align 8, !tbaa !14
  %343 = load ptr, ptr %25, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %343, ptr %344, align 8, !tbaa !18
  %345 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %346 = load ptr, ptr %345, align 8, !tbaa !11
  %347 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %348 = load ptr, ptr %347, align 8, !tbaa !18
  %349 = load ptr, ptr %18, align 8, !tbaa !5
  %350 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %346, ptr noundef %348, ptr noundef %349, i32 noundef 0)
  %351 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %350, ptr %351, align 8, !tbaa !19
  %352 = load ptr, ptr %18, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %352, ptr %353, align 8, !tbaa !20
  %354 = load ptr, ptr %28, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %356 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %355, ptr noundef nonnull align 8 dereferenceable(24) %354)
  %357 = load double, ptr %59, align 8, !tbaa !9
  %358 = call double @sqrt(double noundef %357) #8
  %359 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %358, ptr %359, align 8, !tbaa !21
  %360 = load double, ptr %59, align 8, !tbaa !9
  store double %360, ptr %15, align 8, !tbaa !9
  br label %361

361:                                              ; preds = %341, %337, %330
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #8
  br label %428

362:                                              ; preds = %323
  %363 = load double, ptr %58, align 8, !tbaa !9
  %364 = load double, ptr %56, align 8, !tbaa !9
  %365 = fcmp oge double %363, %364
  br i1 %365, label %366, label %398

366:                                              ; preds = %362
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #8
  %367 = load ptr, ptr %11, align 8, !tbaa !5
  %368 = load ptr, ptr %29, align 8, !tbaa !5
  %369 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %367, ptr noundef nonnull align 8 dereferenceable(24) %368)
  store double %369, ptr %60, align 8, !tbaa !9
  %370 = load double, ptr %60, align 8, !tbaa !9
  %371 = load double, ptr %14, align 8, !tbaa !9
  %372 = fcmp oge double %370, %371
  br i1 %372, label %373, label %397

373:                                              ; preds = %366
  %374 = load double, ptr %60, align 8, !tbaa !9
  %375 = load double, ptr %15, align 8, !tbaa !9
  %376 = fcmp olt double %374, %375
  br i1 %376, label %377, label %397

377:                                              ; preds = %373
  %378 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %378, align 8, !tbaa !14
  %379 = load ptr, ptr %26, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %379, ptr %380, align 8, !tbaa !18
  %381 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %382 = load ptr, ptr %381, align 8, !tbaa !11
  %383 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %384 = load ptr, ptr %383, align 8, !tbaa !18
  %385 = load ptr, ptr %18, align 8, !tbaa !5
  %386 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %382, ptr noundef %384, ptr noundef %385, i32 noundef 0)
  %387 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %386, ptr %387, align 8, !tbaa !19
  %388 = load ptr, ptr %18, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %388, ptr %389, align 8, !tbaa !20
  %390 = load ptr, ptr %29, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, 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) %390)
  %393 = load double, ptr %60, align 8, !tbaa !9
  %394 = call double @sqrt(double noundef %393) #8
  %395 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %394, ptr %395, align 8, !tbaa !21
  %396 = load double, ptr %60, align 8, !tbaa !9
  store double %396, ptr %15, align 8, !tbaa !9
  br label %397

397:                                              ; preds = %377, %373, %366
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #8
  br label %427

398:                                              ; preds = %362
  call void @llvm.lifetime.start.p0(i64 24, ptr %61) #8
  %399 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %62) #8
  %400 = load double, ptr %58, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %62, double noundef %400, ptr noundef nonnull align 8 dereferenceable(24) %55)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %61, ptr noundef nonnull align 8 dereferenceable(24) %399, ptr noundef nonnull align 8 dereferenceable(24) %62)
  call void @llvm.lifetime.end.p0(i64 24, ptr %62) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %63) #8
  %401 = load ptr, ptr %11, align 8, !tbaa !5
  %402 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %401, ptr noundef nonnull align 8 dereferenceable(24) %61)
  store double %402, ptr %63, align 8, !tbaa !9
  %403 = load double, ptr %63, align 8, !tbaa !9
  %404 = load double, ptr %14, align 8, !tbaa !9
  %405 = fcmp oge double %403, %404
  br i1 %405, label %406, label %426

406:                                              ; preds = %398
  %407 = load double, ptr %63, align 8, !tbaa !9
  %408 = load double, ptr %15, align 8, !tbaa !9
  %409 = fcmp olt double %407, %408
  br i1 %409, label %410, label %426

410:                                              ; preds = %406
  %411 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 2, ptr %411, align 8, !tbaa !14
  %412 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr null, ptr %412, align 8, !tbaa !18
  %413 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %414 = load ptr, ptr %413, align 8, !tbaa !11
  %415 = load ptr, ptr %18, align 8, !tbaa !5
  %416 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %414, ptr noundef %415, i32 noundef 1)
  %417 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %416, ptr %417, align 8, !tbaa !19
  %418 = load ptr, ptr %18, align 8, !tbaa !5
  %419 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %418, ptr %419, align 8, !tbaa !20
  %420 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %421 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %420, ptr noundef nonnull align 8 dereferenceable(24) %61)
  %422 = load double, ptr %63, align 8, !tbaa !9
  %423 = call double @sqrt(double noundef %422) #8
  %424 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %423, ptr %424, align 8, !tbaa !21
  %425 = load double, ptr %63, align 8, !tbaa !9
  store double %425, ptr %15, align 8, !tbaa !9
  br label %426

426:                                              ; preds = %410, %406, %398
  call void @llvm.lifetime.end.p0(i64 8, ptr %63) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %61) #8
  br label %427

427:                                              ; preds = %426, %397
  br label %428

428:                                              ; preds = %427, %361
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %57) #8
  br label %429

429:                                              ; preds = %428, %317
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %55) #8
  br label %430

430:                                              ; preds = %429, %314
  %431 = load double, ptr %44, align 8, !tbaa !9
  %432 = fcmp olt double %431, 0.000000e+00
  br i1 %432, label %433, label %546

433:                                              ; preds = %430
  call void @llvm.lifetime.start.p0(i64 24, ptr %64) #8
  %434 = load ptr, ptr %27, align 8, !tbaa !5
  %435 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %64, ptr noundef nonnull align 8 dereferenceable(24) %434, ptr noundef nonnull align 8 dereferenceable(24) %435)
  call void @llvm.lifetime.start.p0(i64 8, ptr %65) #8
  %436 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %64)
  store double %436, ptr %65, align 8, !tbaa !9
  %437 = load double, ptr %65, align 8, !tbaa !9
  %438 = fcmp ogt double %437, 0.000000e+00
  br i1 %438, label %439, label %545

439:                                              ; preds = %433
  %440 = load double, ptr %65, align 8, !tbaa !9
  %441 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %64, double noundef %440)
  call void @llvm.lifetime.start.p0(i64 24, ptr %66) #8
  %442 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %66, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %442)
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #8
  %443 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 8 dereferenceable(24) %66)
  store double %443, ptr %67, align 8, !tbaa !9
  %444 = load double, ptr %67, align 8, !tbaa !9
  %445 = fcmp ole double %444, 0.000000e+00
  br i1 %445, label %446, label %478

446:                                              ; preds = %439
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #8
  %447 = load ptr, ptr %11, align 8, !tbaa !5
  %448 = load ptr, ptr %29, align 8, !tbaa !5
  %449 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %447, ptr noundef nonnull align 8 dereferenceable(24) %448)
  store double %449, ptr %68, align 8, !tbaa !9
  %450 = load double, ptr %68, align 8, !tbaa !9
  %451 = load double, ptr %14, align 8, !tbaa !9
  %452 = fcmp oge double %450, %451
  br i1 %452, label %453, label %477

453:                                              ; preds = %446
  %454 = load double, ptr %68, align 8, !tbaa !9
  %455 = load double, ptr %15, align 8, !tbaa !9
  %456 = fcmp olt double %454, %455
  br i1 %456, label %457, label %477

457:                                              ; preds = %453
  %458 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %458, align 8, !tbaa !14
  %459 = load ptr, ptr %26, align 8, !tbaa !5
  %460 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %459, ptr %460, align 8, !tbaa !18
  %461 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %462 = load ptr, ptr %461, align 8, !tbaa !11
  %463 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %464 = load ptr, ptr %463, align 8, !tbaa !18
  %465 = load ptr, ptr %18, align 8, !tbaa !5
  %466 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %462, ptr noundef %464, ptr noundef %465, i32 noundef 0)
  %467 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %466, ptr %467, align 8, !tbaa !19
  %468 = load ptr, ptr %18, align 8, !tbaa !5
  %469 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %468, ptr %469, align 8, !tbaa !20
  %470 = load ptr, ptr %29, align 8, !tbaa !5
  %471 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %472 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %471, ptr noundef nonnull align 8 dereferenceable(24) %470)
  %473 = load double, ptr %68, align 8, !tbaa !9
  %474 = call double @sqrt(double noundef %473) #8
  %475 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %474, ptr %475, align 8, !tbaa !21
  %476 = load double, ptr %68, align 8, !tbaa !9
  store double %476, ptr %15, align 8, !tbaa !9
  br label %477

477:                                              ; preds = %457, %453, %446
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  br label %544

478:                                              ; preds = %439
  %479 = load double, ptr %67, align 8, !tbaa !9
  %480 = load double, ptr %65, align 8, !tbaa !9
  %481 = fcmp oge double %479, %480
  br i1 %481, label %482, label %514

482:                                              ; preds = %478
  call void @llvm.lifetime.start.p0(i64 8, ptr %69) #8
  %483 = load ptr, ptr %11, align 8, !tbaa !5
  %484 = load ptr, ptr %27, align 8, !tbaa !5
  %485 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %483, ptr noundef nonnull align 8 dereferenceable(24) %484)
  store double %485, ptr %69, align 8, !tbaa !9
  %486 = load double, ptr %69, align 8, !tbaa !9
  %487 = load double, ptr %14, align 8, !tbaa !9
  %488 = fcmp oge double %486, %487
  br i1 %488, label %489, label %513

489:                                              ; preds = %482
  %490 = load double, ptr %69, align 8, !tbaa !9
  %491 = load double, ptr %15, align 8, !tbaa !9
  %492 = fcmp olt double %490, %491
  br i1 %492, label %493, label %513

493:                                              ; preds = %489
  %494 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 1, ptr %494, align 8, !tbaa !14
  %495 = load ptr, ptr %24, align 8, !tbaa !5
  %496 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr %495, ptr %496, align 8, !tbaa !18
  %497 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %498 = load ptr, ptr %497, align 8, !tbaa !11
  %499 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  %500 = load ptr, ptr %499, align 8, !tbaa !18
  %501 = load ptr, ptr %18, align 8, !tbaa !5
  %502 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %498, ptr noundef %500, ptr noundef %501, i32 noundef 0)
  %503 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %502, ptr %503, align 8, !tbaa !19
  %504 = load ptr, ptr %18, align 8, !tbaa !5
  %505 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %504, ptr %505, align 8, !tbaa !20
  %506 = load ptr, ptr %27, align 8, !tbaa !5
  %507 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %508 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %507, ptr noundef nonnull align 8 dereferenceable(24) %506)
  %509 = load double, ptr %69, align 8, !tbaa !9
  %510 = call double @sqrt(double noundef %509) #8
  %511 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %510, ptr %511, align 8, !tbaa !21
  %512 = load double, ptr %69, align 8, !tbaa !9
  store double %512, ptr %15, align 8, !tbaa !9
  br label %513

513:                                              ; preds = %493, %489, %482
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #8
  br label %543

514:                                              ; preds = %478
  call void @llvm.lifetime.start.p0(i64 24, ptr %70) #8
  %515 = load ptr, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %71) #8
  %516 = load double, ptr %67, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %71, double noundef %516, ptr noundef nonnull align 8 dereferenceable(24) %64)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %70, ptr noundef nonnull align 8 dereferenceable(24) %515, ptr noundef nonnull align 8 dereferenceable(24) %71)
  call void @llvm.lifetime.end.p0(i64 24, ptr %71) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #8
  %517 = load ptr, ptr %11, align 8, !tbaa !5
  %518 = call noundef double @_ZNK16R3MeshSearchTree15DistanceSquaredERK7R3PointS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %517, ptr noundef nonnull align 8 dereferenceable(24) %70)
  store double %518, ptr %72, align 8, !tbaa !9
  %519 = load double, ptr %72, align 8, !tbaa !9
  %520 = load double, ptr %14, align 8, !tbaa !9
  %521 = fcmp oge double %519, %520
  br i1 %521, label %522, label %542

522:                                              ; preds = %514
  %523 = load double, ptr %72, align 8, !tbaa !9
  %524 = load double, ptr %15, align 8, !tbaa !9
  %525 = fcmp olt double %523, %524
  br i1 %525, label %526, label %542

526:                                              ; preds = %522
  %527 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  store i32 2, ptr %527, align 8, !tbaa !14
  %528 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 1
  store ptr null, ptr %528, align 8, !tbaa !18
  %529 = getelementptr inbounds %class.R3MeshSearchTree, ptr %75, i32 0, i32 0
  %530 = load ptr, ptr %529, align 8, !tbaa !11
  %531 = load ptr, ptr %18, align 8, !tbaa !5
  %532 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %530, ptr noundef %531, i32 noundef 2)
  %533 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 2
  store ptr %532, ptr %533, align 8, !tbaa !19
  %534 = load ptr, ptr %18, align 8, !tbaa !5
  %535 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 3
  store ptr %534, ptr %535, align 8, !tbaa !20
  %536 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 4
  %537 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %536, ptr noundef nonnull align 8 dereferenceable(24) %70)
  %538 = load double, ptr %72, align 8, !tbaa !9
  %539 = call double @sqrt(double noundef %538) #8
  %540 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 5
  store double %539, ptr %540, align 8, !tbaa !21
  %541 = load double, ptr %72, align 8, !tbaa !9
  store double %541, ptr %15, align 8, !tbaa !9
  br label %542

542:                                              ; preds = %526, %522, %514
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %70) #8
  br label %543

543:                                              ; preds = %542, %513
  br label %544

544:                                              ; preds = %543, %477
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %66) #8
  br label %545

545:                                              ; preds = %544, %433
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %64) #8
  br label %546

546:                                              ; preds = %545, %430
  br label %547

547:                                              ; preds = %546, %197
  %548 = getelementptr inbounds %struct.R3MeshIntersection, ptr %45, i32 0, i32 0
  %549 = load i32, ptr %548, align 8, !tbaa !14
  %550 = icmp ne i32 %549, 0
  br i1 %550, label %551, label %560

551:                                              ; preds = %547
  %552 = load ptr, ptr %13, align 8, !tbaa !5
  %553 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #9
  invoke void @_ZN18R3MeshIntersectionC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64) %553, ptr noundef nonnull align 8 dereferenceable(64) %45)
          to label %554 unwind label %556

554:                                              ; preds = %551
  %555 = call noundef ptr @_ZN7RNArrayIP18R3MeshIntersectionE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %552, ptr noundef %553)
  br label %560

556:                                              ; preds = %551
  %557 = landingpad { ptr, i32 }
          cleanup
  %558 = extractvalue { ptr, i32 } %557, 0
  store ptr %558, ptr %73, align 8
  %559 = extractvalue { ptr, i32 } %557, 1
  store i32 %559, ptr %74, align 4
  call void @_ZdlPvm(ptr noundef %553, i64 noundef 64) #10
  call void @llvm.lifetime.end.p0(i64 64, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %565

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

561:                                              ; preds = %560, %115, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %562

562:                                              ; preds = %561, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %563 = load i32, ptr %22, align 4
  switch i32 %563, label %570 [
    i32 0, label %564
    i32 1, label %564
  ]

564:                                              ; preds = %562, %562
  ret void

565:                                              ; preds = %556
  %566 = load ptr, ptr %73, align 8
  %567 = load i32, ptr %74, align 4
  %568 = insertvalue { ptr, i32 } poison, ptr %566, 0
  %569 = insertvalue { ptr, i32 } %568, i32 %567, 1
  resume { ptr, i32 } %569

570:                                              ; preds = %562
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN18R3MeshIntersectionC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

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


; 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 }
%struct.R3MeshIntersection = type { i32, ptr, ptr, ptr, %class.R3Point, double }

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

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

; 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 ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) local_unnamed_addr #6 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 #6 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 #4 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 #3

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #7

declare noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local 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 readonly %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %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 %struct.R3MeshIntersection, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca %class.R3Vector, align 8
  %24 = alloca %class.R3Point, align 8
  %25 = alloca %class.R3Vector, align 8
  %26 = alloca %class.R3Vector, align 8
  %27 = alloca %class.R3Vector, align 8
  %28 = alloca %class.R3Point, align 8
  %29 = alloca %class.R3Vector, align 8
  %30 = alloca %class.R3Vector, align 8
  %31 = alloca %class.R3Vector, align 8
  %32 = alloca %class.R3Point, align 8
  %33 = alloca %class.R3Vector, align 8
  %34 = load ptr, ptr %0, align 8, !tbaa !5
  %35 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6R3Mesh9FacePlaneEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %34, ptr noundef %8)
  %36 = tail call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %35, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %37 = fmul double %36, %36
  %38 = fcmp ult double %37, %5
  br i1 %38, label %39, label %260

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 = 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 %5)
  %43 = fcmp ult double %42, %5
  br i1 %43, label %44, label %260

44:                                               ; preds = %39
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %48, label %45

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

48:                                               ; preds = %45, %44
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %49, ptr noundef %8, i32 noundef 0)
  %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 1)
  %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 2)
  %55 = load ptr, ptr %0, align 8, !tbaa !5
  %56 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %55, ptr noundef %50)
  %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 @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %61, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #10
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %11, double noundef %36, ptr noundef nonnull align 8 dereferenceable(24) %62)
  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) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %56)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #10
  %63 = load ptr, ptr %0, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %63, 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) %64, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #10
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %65 = 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) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %15, 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) %15)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #10
  %66 = load ptr, ptr %0, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %66, 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) %67, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #10
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %68 = 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) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %60)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #10
  %69 = load ptr, ptr %0, align 8, !tbaa !5
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %69, 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) %70, ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #10
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %71 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %21) #10
  call void @_ZN18R3MeshIntersectionC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %21)
  store i32 0, ptr %21, align 8, !tbaa !11
  %72 = fcmp oge double %65, 0.000000e+00
  %73 = fcmp oge double %68, 0.000000e+00
  %or.cond = and i1 %72, %73
  %74 = fcmp oge double %71, 0.000000e+00
  %or.cond3 = and i1 %or.cond, %74
  br i1 %or.cond3, label %75, label %83

75:                                               ; preds = %48
  %76 = fcmp ult double %37, %4
  br i1 %76, label %251, label %77

77:                                               ; preds = %75
  store i32 3, ptr %21, align 8, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %21, i64 8
  %79 = getelementptr inbounds i8, ptr %21, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %78, i8 0, i64 16, i1 false)
  store ptr %8, ptr %79, align 8, !tbaa !16
  %80 = getelementptr inbounds i8, ptr %21, i64 32
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %sqrt = call double @llvm.sqrt.f64(double %37)
  %82 = getelementptr inbounds i8, ptr %21, i64 56
  store double %sqrt, ptr %82, align 8, !tbaa !17
  br label %251

83:                                               ; preds = %48
  %84 = fcmp olt double %65, 0.000000e+00
  br i1 %84, label %85, label %139

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

88:                                               ; preds = %85
  %89 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %22, double noundef %86)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %23, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %56)
  %90 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %23)
  %91 = fcmp ugt double %90, 0.000000e+00
  br i1 %91, label %106, 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) %56)
  %94 = fcmp oge double %93, %4
  %95 = fcmp olt double %93, %5
  %or.cond205 = and i1 %94, %95
  br i1 %or.cond205, label %96, label %137

96:                                               ; preds = %92
  store i32 1, ptr %21, align 8, !tbaa !11
  %97 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %50, ptr %97, align 8, !tbaa !18
  %98 = load ptr, ptr %0, align 8, !tbaa !5
  %99 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %98, ptr noundef %50, ptr noundef %8, i32 noundef 0)
  %100 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %99, ptr %100, align 8, !tbaa !19
  %101 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %101, align 8, !tbaa !16
  %102 = getelementptr inbounds i8, ptr %21, i64 32
  %103 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 8 dereferenceable(24) %56)
  %104 = call double @sqrt(double noundef %93) #10
  %105 = getelementptr inbounds i8, ptr %21, i64 56
  store double %104, ptr %105, align 8, !tbaa !17
  br label %137

106:                                              ; preds = %88
  %107 = fcmp ult double %90, %86
  br i1 %107, label %122, label %108

108:                                              ; preds = %106
  %109 = 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)
  %110 = fcmp oge double %109, %4
  %111 = fcmp olt double %109, %5
  %or.cond206 = and i1 %110, %111
  br i1 %or.cond206, label %112, label %137

112:                                              ; preds = %108
  store i32 1, ptr %21, align 8, !tbaa !11
  %113 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %52, ptr %113, align 8, !tbaa !18
  %114 = load ptr, ptr %0, align 8, !tbaa !5
  %115 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %114, ptr noundef %52, ptr noundef %8, i32 noundef 0)
  %116 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %115, ptr %116, align 8, !tbaa !19
  %117 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %117, align 8, !tbaa !16
  %118 = getelementptr inbounds i8, ptr %21, i64 32
  %119 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %118, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %120 = call double @sqrt(double noundef %109) #10
  %121 = getelementptr inbounds i8, ptr %21, i64 56
  store double %120, ptr %121, align 8, !tbaa !17
  br label %137

122:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %25) #10
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %25, double noundef %90, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #10
  %123 = 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) %24)
  %124 = fcmp oge double %123, %4
  %125 = fcmp olt double %123, %5
  %or.cond207 = and i1 %124, %125
  br i1 %or.cond207, label %126, label %136

126:                                              ; preds = %122
  store i32 2, ptr %21, align 8, !tbaa !11
  %127 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr null, ptr %127, align 8, !tbaa !18
  %128 = load ptr, ptr %0, align 8, !tbaa !5
  %129 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %128, ptr noundef %8, i32 noundef 0)
  %130 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %129, ptr %130, align 8, !tbaa !19
  %131 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %131, align 8, !tbaa !16
  %132 = getelementptr inbounds i8, ptr %21, i64 32
  %133 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %132, ptr noundef nonnull align 8 dereferenceable(24) %24)
  %134 = call double @sqrt(double noundef %123) #10
  %135 = getelementptr inbounds i8, ptr %21, i64 56
  store double %134, ptr %135, align 8, !tbaa !17
  br label %136

136:                                              ; preds = %126, %122
  %.2 = phi double [ %123, %126 ], [ %5, %122 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #10
  br label %137

137:                                              ; preds = %108, %112, %92, %96, %136
  %.3 = phi double [ %.2, %136 ], [ %93, %96 ], [ %5, %92 ], [ %109, %112 ], [ %5, %108 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #10
  br label %138

138:                                              ; preds = %137, %85
  %.4 = phi double [ %.3, %137 ], [ %5, %85 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #10
  br label %139

139:                                              ; preds = %138, %83
  %.5 = phi double [ %.4, %138 ], [ %5, %83 ]
  %140 = fcmp olt double %68, 0.000000e+00
  br i1 %140, label %141, label %195

141:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %26) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %26, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %142 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %143 = fcmp ogt double %142, 0.000000e+00
  br i1 %143, label %144, label %194

144:                                              ; preds = %141
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %26, double noundef %142)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %146 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %147 = fcmp ugt double %146, 0.000000e+00
  br i1 %147, label %162, label %148

148:                                              ; preds = %144
  %149 = 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)
  %150 = fcmp oge double %149, %4
  %151 = fcmp olt double %149, %.5
  %or.cond208 = and i1 %150, %151
  br i1 %or.cond208, label %152, label %193

152:                                              ; preds = %148
  store i32 1, ptr %21, align 8, !tbaa !11
  %153 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %52, ptr %153, align 8, !tbaa !18
  %154 = load ptr, ptr %0, align 8, !tbaa !5
  %155 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %154, ptr noundef %52, ptr noundef %8, i32 noundef 0)
  %156 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %155, ptr %156, align 8, !tbaa !19
  %157 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %157, align 8, !tbaa !16
  %158 = getelementptr inbounds i8, ptr %21, i64 32
  %159 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %158, ptr noundef nonnull align 8 dereferenceable(24) %58)
  %160 = call double @sqrt(double noundef %149) #10
  %161 = getelementptr inbounds i8, ptr %21, i64 56
  store double %160, ptr %161, align 8, !tbaa !17
  br label %193

162:                                              ; preds = %144
  %163 = fcmp ult double %146, %142
  br i1 %163, label %178, label %164

164:                                              ; preds = %162
  %165 = 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)
  %166 = fcmp oge double %165, %4
  %167 = fcmp olt double %165, %.5
  %or.cond209 = and i1 %166, %167
  br i1 %or.cond209, label %168, label %193

168:                                              ; preds = %164
  store i32 1, ptr %21, align 8, !tbaa !11
  %169 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %54, ptr %169, align 8, !tbaa !18
  %170 = load ptr, ptr %0, align 8, !tbaa !5
  %171 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %170, ptr noundef %54, ptr noundef %8, i32 noundef 0)
  %172 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %171, ptr %172, align 8, !tbaa !19
  %173 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %173, align 8, !tbaa !16
  %174 = getelementptr inbounds i8, ptr %21, i64 32
  %175 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %174, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %176 = call double @sqrt(double noundef %165) #10
  %177 = getelementptr inbounds i8, ptr %21, i64 56
  store double %176, ptr %177, align 8, !tbaa !17
  br label %193

178:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #10
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %29, double noundef %146, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %28, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #10
  %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) %28)
  %180 = fcmp oge double %179, %4
  %181 = fcmp olt double %179, %.5
  %or.cond210 = and i1 %180, %181
  br i1 %or.cond210, label %182, label %192

182:                                              ; preds = %178
  store i32 2, ptr %21, align 8, !tbaa !11
  %183 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr null, ptr %183, align 8, !tbaa !18
  %184 = load ptr, ptr %0, align 8, !tbaa !5
  %185 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %184, ptr noundef %8, i32 noundef 1)
  %186 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %185, ptr %186, align 8, !tbaa !19
  %187 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %187, align 8, !tbaa !16
  %188 = getelementptr inbounds i8, ptr %21, i64 32
  %189 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %188, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %190 = call double @sqrt(double noundef %179) #10
  %191 = getelementptr inbounds i8, ptr %21, i64 56
  store double %190, ptr %191, align 8, !tbaa !17
  br label %192

192:                                              ; preds = %182, %178
  %.8 = phi double [ %179, %182 ], [ %.5, %178 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #10
  br label %193

193:                                              ; preds = %164, %168, %148, %152, %192
  %.9 = phi double [ %.8, %192 ], [ %149, %152 ], [ %.5, %148 ], [ %165, %168 ], [ %.5, %164 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #10
  br label %194

194:                                              ; preds = %193, %141
  %.10 = phi double [ %.9, %193 ], [ %.5, %141 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #10
  br label %195

195:                                              ; preds = %194, %139
  %.11 = phi double [ %.10, %194 ], [ %.5, %139 ]
  %196 = fcmp olt double %71, 0.000000e+00
  br i1 %196, label %197, label %251

197:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %198 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %199 = fcmp ogt double %198, 0.000000e+00
  br i1 %199, label %200, label %250

200:                                              ; preds = %197
  %201 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %30, double noundef %198)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %31) #10
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %31, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %202 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %203 = fcmp ugt double %202, 0.000000e+00
  br i1 %203, label %218, label %204

204:                                              ; preds = %200
  %205 = 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)
  %206 = fcmp oge double %205, %4
  %207 = fcmp olt double %205, %.11
  %or.cond211 = select i1 %206, i1 %207, i1 false
  br i1 %or.cond211, label %208, label %249

208:                                              ; preds = %204
  store i32 1, ptr %21, align 8, !tbaa !11
  %209 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %54, ptr %209, align 8, !tbaa !18
  %210 = load ptr, ptr %0, align 8, !tbaa !5
  %211 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %210, ptr noundef %54, ptr noundef %8, i32 noundef 0)
  %212 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %211, ptr %212, align 8, !tbaa !19
  %213 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %213, align 8, !tbaa !16
  %214 = getelementptr inbounds i8, ptr %21, i64 32
  %215 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %214, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %216 = call double @sqrt(double noundef %205) #10
  %217 = getelementptr inbounds i8, ptr %21, i64 56
  store double %216, ptr %217, align 8, !tbaa !17
  br label %249

218:                                              ; preds = %200
  %219 = fcmp ult double %202, %198
  br i1 %219, label %234, label %220

220:                                              ; preds = %218
  %221 = 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) %56)
  %222 = fcmp oge double %221, %4
  %223 = fcmp olt double %221, %.11
  %or.cond212 = select i1 %222, i1 %223, i1 false
  br i1 %or.cond212, label %224, label %249

224:                                              ; preds = %220
  store i32 1, ptr %21, align 8, !tbaa !11
  %225 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %50, ptr %225, align 8, !tbaa !18
  %226 = load ptr, ptr %0, align 8, !tbaa !5
  %227 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %226, ptr noundef %50, ptr noundef %8, i32 noundef 0)
  %228 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %227, ptr %228, align 8, !tbaa !19
  %229 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %229, align 8, !tbaa !16
  %230 = getelementptr inbounds i8, ptr %21, i64 32
  %231 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %230, ptr noundef nonnull align 8 dereferenceable(24) %56)
  %232 = call double @sqrt(double noundef %221) #10
  %233 = getelementptr inbounds i8, ptr %21, i64 56
  store double %232, ptr %233, align 8, !tbaa !17
  br label %249

234:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %32) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %33) #10
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %33, double noundef %202, ptr noundef nonnull align 8 dereferenceable(24) %30)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %32, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %33) #10
  %235 = 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) %32)
  %236 = fcmp oge double %235, %4
  %237 = fcmp olt double %235, %.11
  %or.cond213 = select i1 %236, i1 %237, i1 false
  br i1 %or.cond213, label %238, label %248

238:                                              ; preds = %234
  store i32 2, ptr %21, align 8, !tbaa !11
  %239 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr null, ptr %239, align 8, !tbaa !18
  %240 = load ptr, ptr %0, align 8, !tbaa !5
  %241 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %240, ptr noundef %8, i32 noundef 2)
  %242 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr %241, ptr %242, align 8, !tbaa !19
  %243 = getelementptr inbounds i8, ptr %21, i64 24
  store ptr %8, ptr %243, align 8, !tbaa !16
  %244 = getelementptr inbounds i8, ptr %21, i64 32
  %245 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %244, ptr noundef nonnull align 8 dereferenceable(24) %32)
  %246 = call double @sqrt(double noundef %235) #10
  %247 = getelementptr inbounds i8, ptr %21, i64 56
  store double %246, ptr %247, align 8, !tbaa !17
  br label %248

248:                                              ; preds = %238, %234
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %32) #10
  br label %249

249:                                              ; preds = %220, %224, %204, %208, %248
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #10
  br label %250

250:                                              ; preds = %249, %197
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #10
  br label %251

251:                                              ; preds = %195, %250, %75, %77
  %252 = load i32, ptr %21, align 8, !tbaa !11
  %.not204 = icmp eq i32 %252, 0
  br i1 %.not204, label %259, label %253

253:                                              ; preds = %251
  %254 = call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #11
  invoke void @_ZN18R3MeshIntersectionC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64) %254, ptr noundef nonnull align 8 dereferenceable(64) %21)
          to label %255 unwind label %257

255:                                              ; preds = %253
  %256 = call noundef ptr @_ZN7RNArrayIP18R3MeshIntersectionE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull %254)
  br label %259

257:                                              ; preds = %253
  %258 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %254, i64 noundef 64) #12
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %21) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #10
  resume { ptr, i32 } %258

259:                                              ; preds = %255, %251
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %21) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #10
  br label %260

260:                                              ; preds = %259, %39, %45, %9
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN18R3MeshIntersectionC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9

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


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