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

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

@R3mesh_mark = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@R3null_point = external global %class.R3Point, align 8
@R4identity_matrix = external global %class.R4Matrix, align 8
@.str.45 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

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

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

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

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

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

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

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

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

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

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

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

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK6R3Mesh9TracePathEPK12R3MeshVertexRK8R3VectordP7R3PointPP10R3MeshFaceP18R3MeshIntersectionPi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #4 align 2 {
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %class.R3Vector, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca double, align 8
  %24 = alloca %class.R3Plane, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %class.R3Point, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca double, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca %class.R3Point, align 8
  %41 = alloca %class.R3Vector, align 8
  %42 = alloca %class.R3Vector, align 8
  %43 = alloca double, align 8
  %44 = alloca %class.R3Vector, align 8
  %45 = alloca double, align 8
  %46 = alloca %class.R3Point, align 8
  %47 = alloca %class.R3Point, align 8
  %48 = alloca %class.R3Point, align 8
  %49 = alloca ptr, align 8
  %50 = alloca %class.R3Vector, align 8
  %51 = alloca %class.R3Vector, align 8
  %52 = alloca %class.R4Matrix, align 8
  %53 = alloca %class.R3Vector, align 8
  %54 = alloca %class.R3Vector, align 8
  %55 = alloca %class.R3Plane, align 8
  %56 = alloca ptr, align 8
  %57 = alloca %class.R3Point, align 8
  %58 = alloca double, align 8
  %59 = alloca ptr, align 8
  %60 = alloca %class.R3Vector, align 8
  %61 = alloca double, align 8
  %62 = alloca %class.R3Point, align 8
  %63 = alloca double, align 8
  %64 = alloca %class.R3Point, align 8
  %65 = alloca %class.R3Vector, align 8
  %66 = alloca double, align 8
  %67 = alloca double, align 8
  %68 = alloca %class.R3Point, align 8
  %69 = alloca %class.R3Point, align 8
  %70 = alloca %class.R3Point, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store double %3, ptr %13, align 8, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  %71 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store ptr %71, ptr %18, align 8, !tbaa !5
  %72 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @R3mesh_mark, align 4, !tbaa !11
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %81

76:                                               ; preds = %8
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %77)
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %79, ptr noundef nonnull align 8 dereferenceable(24) %78)
  br label %81

81:                                               ; preds = %76, %8
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr null, ptr %85, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %84, %81
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %91

89:                                               ; preds = %86
  %90 = load ptr, ptr %17, align 8, !tbaa !5
  store i32 0, ptr %90, align 4, !tbaa !11
  br label %91

91:                                               ; preds = %89, %86
  %92 = load double, ptr %13, align 8, !tbaa !9
  %93 = fcmp ole double %92, 0.000000e+00
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  store double 0.000000e+00, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %385

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %96)
  store ptr %97, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %98)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %99)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %100, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %101 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  store double %101, ptr %23, align 8, !tbaa !9
  %102 = load double, ptr %23, align 8, !tbaa !9
  %103 = fcmp oeq double %102, 0.000000e+00
  br i1 %103, label %104, label %105

104:                                              ; preds = %95
  store double 0.000000e+00, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %384

105:                                              ; preds = %95
  %106 = load double, ptr %23, align 8, !tbaa !9
  %107 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %22, double noundef %106)
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #5
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store ptr null, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #5
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) @R3null_point)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %186, %105
  %110 = load i32, ptr %28, align 4, !tbaa !11
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %111)
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 2, ptr %19, align 4
  br label %189

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i32, ptr %28, align 4, !tbaa !11
  %118 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %116, i32 noundef %117)
  store ptr %118, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = load ptr, ptr %29, align 8, !tbaa !5
  %121 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %119, ptr noundef %120, i32 noundef 0)
  store ptr %121, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load ptr, ptr %29, align 8, !tbaa !5
  %124 = call noundef ptr @_ZNK6R3Mesh12FaceOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %122, ptr noundef %123, i32 noundef 0)
  store ptr %124, ptr %31, align 8, !tbaa !5
  %125 = load ptr, ptr %31, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %128, label %127

127:                                              ; preds = %115
  store i32 4, ptr %19, align 4
  br label %183

128:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %129 = load ptr, ptr %31, align 8, !tbaa !5
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = call noundef ptr @_ZNK6R3Mesh14EdgeAcrossFaceEPK10R3MeshFacePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %129, ptr noundef %130)
  store ptr %131, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %132 = load ptr, ptr %29, align 8, !tbaa !5
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %132, ptr noundef %133)
  store ptr %134, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %135 = load ptr, ptr %33, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %135)
  store ptr %136, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %137 = load ptr, ptr %34, align 8, !tbaa !5
  %138 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 8 dereferenceable(24) %137)
  store double %138, ptr %35, align 8, !tbaa !9
  %139 = load double, ptr %35, align 8, !tbaa !9
  %140 = fcmp oeq double %139, 0.000000e+00
  br i1 %140, label %141, label %146

141:                                              ; preds = %128
  %142 = load ptr, ptr %34, align 8, !tbaa !5
  %143 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %142)
  %144 = load ptr, ptr %31, align 8, !tbaa !5
  store ptr %144, ptr %25, align 8, !tbaa !5
  %145 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %145, ptr %26, align 8, !tbaa !5
  store i32 2, ptr %19, align 4
  br label %182

146:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %147 = load ptr, ptr %30, align 8, !tbaa !5
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %147, ptr noundef %148)
  store ptr %149, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %150 = load ptr, ptr %36, align 8, !tbaa !5
  %151 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %150)
  store ptr %151, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %152 = load ptr, ptr %37, align 8, !tbaa !5
  %153 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 8 dereferenceable(24) %152)
  store double %153, ptr %38, align 8, !tbaa !9
  %154 = load double, ptr %38, align 8, !tbaa !9
  %155 = fcmp oeq double %154, 0.000000e+00
  br i1 %155, label %156, label %161

156:                                              ; preds = %146
  %157 = load ptr, ptr %37, align 8, !tbaa !5
  %158 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %157)
  %159 = load ptr, ptr %31, align 8, !tbaa !5
  store ptr %159, ptr %25, align 8, !tbaa !5
  %160 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %160, ptr %26, align 8, !tbaa !5
  store i32 2, ptr %19, align 4
  br label %181

161:                                              ; preds = %146
  %162 = load double, ptr %35, align 8, !tbaa !9
  %163 = fcmp ogt double %162, 0.000000e+00
  br i1 %163, label %164, label %180

164:                                              ; preds = %161
  %165 = load double, ptr %38, align 8, !tbaa !9
  %166 = fcmp olt double %165, 0.000000e+00
  br i1 %166, label %167, label %180

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %168 = load double, ptr %35, align 8, !tbaa !9
  %169 = load double, ptr %35, align 8, !tbaa !9
  %170 = load double, ptr %38, align 8, !tbaa !9
  %171 = fsub double %169, %170
  %172 = fdiv double %168, %171
  store double %172, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %40) #5
  %173 = load ptr, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %41) #5
  %174 = load double, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #5
  %175 = load ptr, ptr %37, align 8, !tbaa !5
  %176 = load ptr, ptr %34, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %42, ptr noundef nonnull align 8 dereferenceable(24) %175, ptr noundef nonnull align 8 dereferenceable(24) %176)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %41, double noundef %174, ptr noundef nonnull align 8 dereferenceable(24) %42)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %40, ptr noundef nonnull align 8 dereferenceable(24) %173, ptr noundef nonnull align 8 dereferenceable(24) %41)
  %177 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #5
  %178 = load ptr, ptr %31, align 8, !tbaa !5
  store ptr %178, ptr %25, align 8, !tbaa !5
  %179 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %179, ptr %26, align 8, !tbaa !5
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  br label %181

180:                                              ; preds = %164, %161
  store i32 0, ptr %19, align 4
  br label %181

181:                                              ; preds = %180, %167, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  br label %182

182:                                              ; preds = %181, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %183

183:                                              ; preds = %182, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %184 = load i32, ptr %19, align 4
  switch i32 %184, label %189 [
    i32 0, label %185
    i32 4, label %186
  ]

185:                                              ; preds = %183
  br label %186

186:                                              ; preds = %185, %183
  %187 = load i32, ptr %28, align 4, !tbaa !11
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %28, align 4, !tbaa !11
  br label %109, !llvm.loop !13

189:                                              ; preds = %183, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %190

190:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #5
  %191 = load ptr, ptr %20, align 8, !tbaa !5
  %192 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %191)
  store double %192, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %44) #5
  %193 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %44, ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %193)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %194 = load ptr, ptr %25, align 8, !tbaa !5
  %195 = icmp ne ptr %194, null
  br i1 %195, label %197, label %196

196:                                              ; preds = %190
  store double 0.000000e+00, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %383

197:                                              ; preds = %190
  %198 = load double, ptr %43, align 8, !tbaa !9
  %199 = load double, ptr %13, align 8, !tbaa !9
  %200 = fcmp oge double %198, %199
  br i1 %200, label %201, label %222

201:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #5
  %202 = load double, ptr %13, align 8, !tbaa !9
  %203 = load double, ptr %43, align 8, !tbaa !9
  %204 = fdiv double %202, %203
  store double %204, ptr %45, align 8, !tbaa !9
  %205 = load ptr, ptr %14, align 8, !tbaa !5
  %206 = icmp ne ptr %205, null
  br i1 %206, label %207, label %214

207:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 24, ptr %46) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %47) #5
  %208 = load double, ptr %45, align 8, !tbaa !9
  %209 = fsub double 1.000000e+00, %208
  %210 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %47, double noundef %209, ptr noundef nonnull align 8 dereferenceable(24) %210)
  call void @llvm.lifetime.start.p0(i64 24, ptr %48) #5
  %211 = load double, ptr %45, align 8, !tbaa !9
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %48, double noundef %211, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %46, ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 8 dereferenceable(24) %48)
  %212 = load ptr, ptr %14, align 8, !tbaa !5
  %213 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %212, ptr noundef nonnull align 8 dereferenceable(24) %46)
  call void @llvm.lifetime.end.p0(i64 24, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #5
  br label %214

214:                                              ; preds = %207, %201
  %215 = load ptr, ptr %15, align 8, !tbaa !5
  %216 = icmp ne ptr %215, null
  br i1 %216, label %217, label %220

217:                                              ; preds = %214
  %218 = load ptr, ptr %25, align 8, !tbaa !5
  %219 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %218, ptr %219, align 8, !tbaa !5
  br label %220

220:                                              ; preds = %217, %214
  %221 = load double, ptr %13, align 8, !tbaa !9
  store double %221, ptr %9, align 8
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #5
  br label %383

222:                                              ; preds = %197
  br label %223

223:                                              ; preds = %382, %222
  br label %224

224:                                              ; preds = %223
  %225 = load ptr, ptr %18, align 8, !tbaa !5
  %226 = load ptr, ptr %26, align 8, !tbaa !5
  %227 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  call void @_ZN6R3Mesh11SetEdgeMarkEP10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %225, ptr noundef %226, i32 noundef %227)
  %228 = load ptr, ptr %18, align 8, !tbaa !5
  %229 = load ptr, ptr %25, align 8, !tbaa !5
  %230 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  call void @_ZN6R3Mesh11SetFaceMarkEP10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %228, ptr noundef %229, i32 noundef %230)
  %231 = load ptr, ptr %16, align 8, !tbaa !5
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %280

233:                                              ; preds = %224
  %234 = load ptr, ptr %17, align 8, !tbaa !5
  %235 = icmp ne ptr %234, null
  br i1 %235, label %236, label %280

236:                                              ; preds = %233
  %237 = load ptr, ptr %16, align 8, !tbaa !5
  %238 = load ptr, ptr %17, align 8, !tbaa !5
  %239 = load i32, ptr %238, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds %struct.R3MeshIntersection, ptr %237, i64 %240
  %242 = getelementptr inbounds %struct.R3MeshIntersection, ptr %241, i32 0, i32 0
  store i32 2, ptr %242, align 8, !tbaa !15
  %243 = load ptr, ptr %16, align 8, !tbaa !5
  %244 = load ptr, ptr %17, align 8, !tbaa !5
  %245 = load i32, ptr %244, align 4, !tbaa !11
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds %struct.R3MeshIntersection, ptr %243, i64 %246
  %248 = getelementptr inbounds %struct.R3MeshIntersection, ptr %247, i32 0, i32 1
  store ptr null, ptr %248, align 8, !tbaa !19
  %249 = load ptr, ptr %26, align 8, !tbaa !5
  %250 = load ptr, ptr %16, align 8, !tbaa !5
  %251 = load ptr, ptr %17, align 8, !tbaa !5
  %252 = load i32, ptr %251, align 4, !tbaa !11
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds %struct.R3MeshIntersection, ptr %250, i64 %253
  %255 = getelementptr inbounds %struct.R3MeshIntersection, ptr %254, i32 0, i32 2
  store ptr %249, ptr %255, align 8, !tbaa !20
  %256 = load ptr, ptr %25, align 8, !tbaa !5
  %257 = load ptr, ptr %16, align 8, !tbaa !5
  %258 = load ptr, ptr %17, align 8, !tbaa !5
  %259 = load i32, ptr %258, align 4, !tbaa !11
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds %struct.R3MeshIntersection, ptr %257, i64 %260
  %262 = getelementptr inbounds %struct.R3MeshIntersection, ptr %261, i32 0, i32 3
  store ptr %256, ptr %262, align 8, !tbaa !21
  %263 = load ptr, ptr %16, align 8, !tbaa !5
  %264 = load ptr, ptr %17, align 8, !tbaa !5
  %265 = load i32, ptr %264, align 4, !tbaa !11
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds %struct.R3MeshIntersection, ptr %263, i64 %266
  %268 = getelementptr inbounds %struct.R3MeshIntersection, ptr %267, i32 0, i32 4
  %269 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %268, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %270 = load double, ptr %43, align 8, !tbaa !9
  %271 = load ptr, ptr %16, align 8, !tbaa !5
  %272 = load ptr, ptr %17, align 8, !tbaa !5
  %273 = load i32, ptr %272, align 4, !tbaa !11
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds %struct.R3MeshIntersection, ptr %271, i64 %274
  %276 = getelementptr inbounds %struct.R3MeshIntersection, ptr %275, i32 0, i32 5
  store double %270, ptr %276, align 8, !tbaa !22
  %277 = load ptr, ptr %17, align 8, !tbaa !5
  %278 = load i32, ptr %277, align 4, !tbaa !11
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %277, align 4, !tbaa !11
  br label %280

280:                                              ; preds = %236, %233, %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #5
  %281 = load ptr, ptr %26, align 8, !tbaa !5
  %282 = load ptr, ptr %25, align 8, !tbaa !5
  %283 = call noundef ptr @_ZNK6R3Mesh14FaceAcrossEdgeEPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %281, ptr noundef %282)
  store ptr %283, ptr %49, align 8, !tbaa !5
  %284 = load ptr, ptr %49, align 8, !tbaa !5
  %285 = icmp ne ptr %284, null
  br i1 %285, label %300, label %286

286:                                              ; preds = %280
  %287 = load ptr, ptr %14, align 8, !tbaa !5
  %288 = icmp ne ptr %287, null
  br i1 %288, label %289, label %292

289:                                              ; preds = %286
  %290 = load ptr, ptr %14, align 8, !tbaa !5
  %291 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %290, ptr noundef nonnull align 8 dereferenceable(24) %27)
  br label %292

292:                                              ; preds = %289, %286
  %293 = load ptr, ptr %15, align 8, !tbaa !5
  %294 = icmp ne ptr %293, null
  br i1 %294, label %295, label %298

295:                                              ; preds = %292
  %296 = load ptr, ptr %25, align 8, !tbaa !5
  %297 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %296, ptr %297, align 8, !tbaa !5
  br label %298

298:                                              ; preds = %295, %292
  %299 = load double, ptr %43, align 8, !tbaa !9
  store double %299, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %380

300:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 24, ptr %50) #5
  %301 = load ptr, ptr %25, align 8, !tbaa !5
  %302 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %301)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(24) %302)
  call void @llvm.lifetime.start.p0(i64 24, ptr %51) #5
  %303 = load ptr, ptr %49, align 8, !tbaa !5
  %304 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %303)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(24) %304)
  call void @llvm.lifetime.start.p0(i64 128, ptr %52) #5
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %52, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %52, ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(24) %51)
  call void @llvm.lifetime.start.p0(i64 24, ptr %53) #5
  call void @_ZmlRK8R4MatrixRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %53, ptr noundef nonnull align 8 dereferenceable(128) %52, ptr noundef nonnull align 8 dereferenceable(24) %44)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  call void @llvm.lifetime.start.p0(i64 24, ptr %54) #5
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %54, ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(24) %53)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  call void @llvm.lifetime.start.p0(i64 32, ptr %55) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %55, ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #5
  %305 = load ptr, ptr %49, align 8, !tbaa !5
  %306 = load ptr, ptr %26, align 8, !tbaa !5
  %307 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %305, ptr noundef %306)
  store ptr %307, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %57) #5
  %308 = load ptr, ptr %56, align 8, !tbaa !5
  %309 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %308)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %309)
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #5
  %310 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %55, ptr noundef nonnull align 8 dereferenceable(24) %57)
  store double %310, ptr %58, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #5
  %311 = load ptr, ptr %49, align 8, !tbaa !5
  %312 = load ptr, ptr %26, align 8, !tbaa !5
  %313 = load double, ptr %58, align 8, !tbaa !9
  %314 = fcmp olt double %313, 0.000000e+00
  %315 = zext i1 %314 to i64
  %316 = select i1 %314, i32 1, i32 0
  %317 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacePK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %311, ptr noundef %312, i32 noundef %316)
  store ptr %317, ptr %59, align 8, !tbaa !5
  %318 = load double, ptr %58, align 8, !tbaa !9
  %319 = fcmp une double %318, 0.000000e+00
  br i1 %319, label %320, label %337

320:                                              ; preds = %300
  call void @llvm.lifetime.start.p0(i64 24, ptr %60) #5
  %321 = load ptr, ptr %59, align 8, !tbaa !5
  call void @_ZNK6R3Mesh10EdgeVectorEPK10R3MeshEdge(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %60, ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %321)
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #5
  %322 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
  %323 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %322, ptr noundef nonnull align 8 dereferenceable(24) %60)
  store double %323, ptr %61, align 8, !tbaa !9
  %324 = load double, ptr %61, align 8, !tbaa !9
  %325 = fcmp une double %324, 0.000000e+00
  br i1 %325, label %326, label %336

326:                                              ; preds = %320
  call void @llvm.lifetime.start.p0(i64 24, ptr %62) #5
  %327 = load ptr, ptr %59, align 8, !tbaa !5
  %328 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %327, i32 noundef 0)
  %329 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %328)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %329)
  call void @llvm.lifetime.start.p0(i64 8, ptr %63) #5
  %330 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %55, ptr noundef nonnull align 8 dereferenceable(24) %62)
  %331 = fneg double %330
  %332 = load double, ptr %61, align 8, !tbaa !9
  %333 = fdiv double %331, %332
  store double %333, ptr %63, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %64) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %65) #5
  %334 = load double, ptr %63, align 8, !tbaa !9
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %65, ptr noundef nonnull align 8 dereferenceable(24) %60, double noundef %334)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %64, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %65)
  %335 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %64)
  call void @llvm.lifetime.end.p0(i64 24, ptr %65) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %64) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %63) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %62) #5
  br label %336

336:                                              ; preds = %326, %320
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %60) #5
  br label %337

337:                                              ; preds = %336, %300
  call void @llvm.lifetime.start.p0(i64 8, ptr %66) #5
  %338 = load double, ptr %43, align 8, !tbaa !9
  %339 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %57)
  %340 = fadd double %338, %339
  store double %340, ptr %66, align 8, !tbaa !9
  %341 = load double, ptr %66, align 8, !tbaa !9
  %342 = load double, ptr %13, align 8, !tbaa !9
  %343 = fcmp oge double %341, %342
  br i1 %343, label %344, label %373

344:                                              ; preds = %337
  %345 = load double, ptr %66, align 8, !tbaa !9
  %346 = load double, ptr %43, align 8, !tbaa !9
  %347 = fcmp ogt double %345, %346
  br i1 %347, label %349, label %348

348:                                              ; preds = %344
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.45, i32 noundef 4052, ptr noundef @.str.2)
  br label %349

349:                                              ; preds = %348, %344
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #5
  %350 = load double, ptr %13, align 8, !tbaa !9
  %351 = load double, ptr %43, align 8, !tbaa !9
  %352 = fsub double %350, %351
  %353 = load double, ptr %66, align 8, !tbaa !9
  %354 = load double, ptr %43, align 8, !tbaa !9
  %355 = fsub double %353, %354
  %356 = fdiv double %352, %355
  store double %356, ptr %67, align 8, !tbaa !9
  %357 = load ptr, ptr %14, align 8, !tbaa !5
  %358 = icmp ne ptr %357, null
  br i1 %358, label %359, label %365

359:                                              ; preds = %349
  call void @llvm.lifetime.start.p0(i64 24, ptr %68) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %69) #5
  %360 = load double, ptr %67, align 8, !tbaa !9
  %361 = fsub double 1.000000e+00, %360
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %69, double noundef %361, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.lifetime.start.p0(i64 24, ptr %70) #5
  %362 = load double, ptr %67, align 8, !tbaa !9
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %70, double noundef %362, ptr noundef nonnull align 8 dereferenceable(24) %57)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %68, ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(24) %70)
  %363 = load ptr, ptr %14, align 8, !tbaa !5
  %364 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %363, ptr noundef nonnull align 8 dereferenceable(24) %68)
  call void @llvm.lifetime.end.p0(i64 24, ptr %70) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %69) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %68) #5
  br label %365

365:                                              ; preds = %359, %349
  %366 = load ptr, ptr %15, align 8, !tbaa !5
  %367 = icmp ne ptr %366, null
  br i1 %367, label %368, label %371

368:                                              ; preds = %365
  %369 = load ptr, ptr %49, align 8, !tbaa !5
  %370 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %369, ptr %370, align 8, !tbaa !5
  br label %371

371:                                              ; preds = %368, %365
  %372 = load double, ptr %13, align 8, !tbaa !9
  store double %372, ptr %9, align 8
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #5
  br label %379

373:                                              ; preds = %337
  %374 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %374, ptr %26, align 8, !tbaa !5
  %375 = load ptr, ptr %49, align 8, !tbaa !5
  store ptr %375, ptr %25, align 8, !tbaa !5
  %376 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %57)
  %377 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(24) %53)
  %378 = load double, ptr %66, align 8, !tbaa !9
  store double %378, ptr %43, align 8, !tbaa !9
  store i32 0, ptr %19, align 4
  br label %379

379:                                              ; preds = %373, %371
  call void @llvm.lifetime.end.p0(i64 8, ptr %66) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %57) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %55) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %51) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %50) #5
  br label %380

380:                                              ; preds = %379, %298
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #5
  %381 = load i32, ptr %19, align 4
  switch i32 %381, label %383 [
    i32 0, label %382
  ]

382:                                              ; preds = %380
  br label %223, !llvm.loop !23

383:                                              ; preds = %380, %220, %196
  call void @llvm.lifetime.end.p0(i64 24, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #5
  br label %384

384:                                              ; preds = %383, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %385

385:                                              ; preds = %384, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %386 = load double, ptr %9, align 8
  ret double %386
}

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

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #0

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

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

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

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

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


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

@R3mesh_mark = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@R3null_point = external global %class.R3Point, align 8
@R4identity_matrix = external global %class.R4Matrix, align 8
@.str.45 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

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

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

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

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

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

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

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

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

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

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

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

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

declare void @_ZplRK7R3PointS1_(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 #0

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK6R3Mesh9TracePathEPK12R3MeshVertexRK8R3VectordP7R3PointPP10R3MeshFaceP18R3MeshIntersectionPi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3, ptr noundef %4, ptr noundef writeonly %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #4 align 2 {
  %9 = alloca %class.R3Vector, align 8
  %10 = alloca %class.R3Vector, align 8
  %11 = alloca %class.R3Plane, align 8
  %12 = alloca %class.R3Point, align 8
  %13 = alloca %class.R3Point, align 8
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Point, align 8
  %18 = alloca %class.R3Point, align 8
  %19 = alloca %class.R3Point, align 8
  %20 = alloca %class.R3Vector, align 8
  %21 = alloca %class.R3Vector, align 8
  %22 = alloca %class.R4Matrix, align 8
  %23 = alloca %class.R3Vector, align 8
  %24 = alloca %class.R3Vector, align 8
  %25 = alloca %class.R3Plane, align 8
  %26 = alloca %class.R3Point, align 8
  %27 = alloca %class.R3Vector, align 8
  %28 = alloca %class.R3Point, align 8
  %29 = alloca %class.R3Point, align 8
  %30 = alloca %class.R3Vector, align 8
  %31 = alloca %class.R3Point, align 8
  %32 = alloca %class.R3Point, align 8
  %33 = alloca %class.R3Point, align 8
  %34 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr @R3mesh_mark, align 4, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %39, label %36

36:                                               ; preds = %8
  %37 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %38 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %37)
  br label %39

39:                                               ; preds = %36, %8
  %.not185 = icmp eq ptr %5, null
  br i1 %.not185, label %41, label %40

40:                                               ; preds = %39
  store ptr null, ptr %5, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %40, %39
  %42 = icmp ne ptr %7, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %41
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %43, %41
  %45 = fcmp ugt double %3, 0.000000e+00
  br i1 %45, label %46, label %160

46:                                               ; preds = %44
  %47 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %48 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %48)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %49 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %50 = fcmp oeq double %49, 0.000000e+00
  br i1 %50, label %159, label %51

51:                                               ; preds = %46
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef %49)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) @R3null_point)
  %53 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %51, %80
  %.0159227 = phi i32 [ %81, %80 ], [ 0, %51 ]
  %55 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, i32 noundef %.0159227)
  %56 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef %55, i32 noundef 0)
  %57 = call noundef ptr @_ZNK6R3Mesh12FaceOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef %55, i32 noundef 0)
  %.not186 = icmp eq ptr %57, null
  br i1 %.not186, label %80, label %58

58:                                               ; preds = %.lr.ph
  %59 = call noundef ptr @_ZNK6R3Mesh14EdgeAcrossFaceEPK10R3MeshFacePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %57, ptr noundef %1)
  %60 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %55, ptr noundef %1)
  %61 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %60)
  %62 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %61)
  %63 = fcmp oeq double %62, 0.000000e+00
  br i1 %63, label %64, label %66

64:                                               ; preds = %58
  %65 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %61)
  br label %.thread

66:                                               ; preds = %58
  %67 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %56, ptr noundef %1)
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %67)
  %69 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %68)
  %70 = fcmp oeq double %69, 0.000000e+00
  br i1 %70, label %71, label %73

71:                                               ; preds = %66
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %68)
  br label %.thread

73:                                               ; preds = %66
  %74 = fcmp ogt double %62, 0.000000e+00
  %75 = fcmp olt double %69, 0.000000e+00
  %or.cond = and i1 %74, %75
  br i1 %or.cond, label %76, label %80

76:                                               ; preds = %73
  %77 = fsub double %62, %69
  %78 = fdiv double %62, %77
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(24) %61)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %14, double noundef %78, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  br label %.thread

80:                                               ; preds = %.lr.ph, %73
  %81 = add nuw nsw i32 %.0159227, 1
  %82 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %.lr.ph, label %.thread, !llvm.loop !11

.thread:                                          ; preds = %80, %51, %76, %71, %64
  %.4155 = phi ptr [ %59, %64 ], [ %59, %71 ], [ %59, %76 ], [ null, %51 ], [ null, %80 ]
  %.4149 = phi ptr [ %57, %64 ], [ %57, %71 ], [ %57, %76 ], [ null, %51 ], [ null, %80 ]
  %84 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not187 = icmp eq ptr %.4149, null
  br i1 %.not187, label %.thread193, label %85

85:                                               ; preds = %.thread
  %86 = fcmp ult double %84, %3
  br i1 %86, label %.preheader, label %88

.preheader:                                       ; preds = %85
  %87 = icmp ne ptr %6, null
  %or.cond3 = and i1 %87, %42
  br label %95

88:                                               ; preds = %85
  br i1 %.not, label %93, label %89

89:                                               ; preds = %88
  %90 = fdiv double %3, %84
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #5
  %91 = fsub double 1.000000e+00, %90
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %18, double noundef %91, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %19, double noundef %90, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #5
  br label %93

93:                                               ; preds = %89, %88
  br i1 %.not185, label %.thread193, label %94

94:                                               ; preds = %93
  store ptr %.4149, ptr %5, align 8, !tbaa !9
  br label %.thread193

95:                                               ; preds = %.preheader, %156
  %.0160 = phi double [ %142, %156 ], [ %84, %.preheader ]
  %.5156 = phi ptr [ %126, %156 ], [ %.4155, %.preheader ]
  %.5150 = phi ptr [ %112, %156 ], [ %.4149, %.preheader ]
  %96 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  call void @_ZN6R3Mesh11SetEdgeMarkEP10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.5156, i32 noundef %96)
  %97 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  call void @_ZN6R3Mesh11SetFaceMarkEP10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %.5150, i32 noundef %97)
  br i1 %or.cond3, label %98, label %111

98:                                               ; preds = %95
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %100
  store i32 2, ptr %101, align 8, !tbaa !13
  %102 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %100, i32 1
  store ptr null, ptr %102, align 8, !tbaa !18
  %103 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %100, i32 2
  store ptr %.5156, ptr %103, align 8, !tbaa !19
  %104 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %100, i32 3
  store ptr %.5150, ptr %104, align 8, !tbaa !20
  %105 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %100, i32 4
  %106 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 8 dereferenceable(24) %12)
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.R3MeshIntersection, ptr %6, i64 %108, i32 5
  store double %.0160, ptr %109, align 8, !tbaa !21
  %110 = add nsw i32 %107, 1
  store i32 %110, ptr %7, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %98, %95
  %112 = call noundef ptr @_ZNK6R3Mesh14FaceAcrossEdgeEPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.5156, ptr noundef nonnull %.5150)
  %.not188 = icmp eq ptr %112, null
  br i1 %.not188, label %113, label %118

113:                                              ; preds = %111
  br i1 %.not, label %116, label %114

114:                                              ; preds = %113
  %115 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %12)
  br label %116

116:                                              ; preds = %114, %113
  br i1 %.not185, label %.thread193, label %117

117:                                              ; preds = %116
  store ptr %.5150, ptr %5, align 8, !tbaa !9
  br label %.thread193

118:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %20) #5
  %119 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %.5150)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %119)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #5
  %120 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %112)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %120)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %22) #5
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %22, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %22, ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #5
  call void @_ZmlRK8R4MatrixRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %23, ptr noundef nonnull align 8 dereferenceable(128) %22, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #5
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %25) #5
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %24)
  %121 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %112, ptr noundef %.5156)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %26) #5
  %122 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %121)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %122)
  %123 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %124 = fcmp olt double %123, 0.000000e+00
  %125 = zext i1 %124 to i32
  %126 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacePK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %112, ptr noundef %.5156, i32 noundef %125)
  %127 = fcmp une double %123, 0.000000e+00
  br i1 %127, label %128, label %140

128:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #5
  call void @_ZNK6R3Mesh10EdgeVectorEPK10R3MeshEdge(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %27, ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %126)
  %129 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %25)
  %130 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %129, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %131 = fcmp une double %130, 0.000000e+00
  br i1 %131, label %132, label %139

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #5
  %133 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %126, i32 noundef 0)
  %134 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %133)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %134)
  %135 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %136 = fneg double %135
  %137 = fdiv double %136, %130
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #5
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %27, double noundef %137)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %29, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %30)
  %138 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #5
  br label %139

139:                                              ; preds = %132, %128
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #5
  br label %140

140:                                              ; preds = %139, %118
  %141 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %142 = fadd double %.0160, %141
  %143 = fcmp ult double %142, %3
  br i1 %143, label %156, label %144

144:                                              ; preds = %140
  %145 = fcmp ogt double %142, %.0160
  br i1 %145, label %147, label %146

146:                                              ; preds = %144
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.45, i32 noundef 4052, ptr noundef nonnull @.str.2)
  br label %147

147:                                              ; preds = %146, %144
  br i1 %.not, label %154, label %148

148:                                              ; preds = %147
  %149 = fsub double %3, %.0160
  %150 = fsub double %142, %.0160
  %151 = fdiv double %149, %150
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %31) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %32) #5
  %152 = fsub double 1.000000e+00, %151
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %32, double noundef %152, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %33) #5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %33, double noundef %151, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %31, ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(24) %33)
  %153 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %33) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %32) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #5
  br label %154

154:                                              ; preds = %148, %147
  br i1 %.not185, label %.thread201, label %155

155:                                              ; preds = %154
  store ptr %112, ptr %5, align 8, !tbaa !9
  br label %.thread201

.thread201:                                       ; preds = %155, %154
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #5
  br label %.thread193

156:                                              ; preds = %140
  %157 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %158 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #5
  br label %95, !llvm.loop !22

.thread193:                                       ; preds = %116, %117, %.thread201, %93, %94, %.thread
  %.3 = phi double [ 0.000000e+00, %.thread ], [ %3, %94 ], [ %3, %93 ], [ %3, %.thread201 ], [ %.0160, %117 ], [ %.0160, %116 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br label %159

159:                                              ; preds = %46, %.thread193
  %.4 = phi double [ %.3, %.thread193 ], [ 0.000000e+00, %46 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %160

160:                                              ; preds = %44, %159
  %.5 = phi double [ %.4, %159 ], [ 0.000000e+00, %44 ]
  ret double %.5
}

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

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #0

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass