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

; 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.R3Vector = type { [3 x double] }
%struct.R3MeshBoundaryVertexData = type { ptr, ptr, ptr, ptr, ptr, 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
@RN_TWO_PI = external constant double, align 8
@.str.36 = external hidden unnamed_addr constant [10 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

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

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

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

declare noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(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 @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh8FillHoleEP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) #7 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, 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 ptr, align 8
  %20 = alloca %class.R3Vector, align 8
  %21 = alloca %class.R3Vector, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca double, align 8
  %24 = alloca double, 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 ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca %class.R3Vector, align 8
  %38 = alloca %class.R3Vector, align 8
  %39 = alloca %class.R3Vector, align 8
  %40 = alloca double, align 8
  %41 = alloca double, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %47 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %48)
  store ptr %49, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %365

53:                                               ; preds = %2
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call noundef ptr @_ZNK6R3Mesh14FaceAcrossEdgeEPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %54, ptr noundef %55)
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  store i32 1, ptr %6, align 4
  br label %365

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgePK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %60, ptr noundef %61, i32 noundef 0)
  store ptr %62, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr @R3mesh_mark, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @R3mesh_mark, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %65, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %66, ptr %11, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %237, %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %68 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #9
  call void @llvm.memset.p0.i64(ptr align 16 %68, i8 0, i64 48, i1 false)
  store ptr %68, ptr %12, align 8, !tbaa !5
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %70, i32 0, i32 0
  store ptr %69, ptr %71, align 8, !tbaa !11
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %73, i32 0, i32 1
  store ptr %72, ptr %74, align 8, !tbaa !14
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %75, i32 0, i32 2
  store ptr null, ptr %76, align 8, !tbaa !15
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %77, i32 0, i32 3
  store ptr null, ptr %78, align 8, !tbaa !16
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %79, i32 0, i32 4
  store ptr null, ptr %80, align 8, !tbaa !17
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %81, i32 0, i32 5
  store double 0.000000e+00, ptr %82, align 8, !tbaa !18
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load i32, ptr @R3mesh_mark, align 4, !tbaa !9
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %83, i32 noundef %84)
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %89, label %87

87:                                               ; preds = %67
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %88, ptr %8, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %87, %67
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %96

92:                                               ; preds = %89
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %94, i32 0, i32 3
  store ptr %93, ptr %95, align 8, !tbaa !16
  br label %96

96:                                               ; preds = %92, %89
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %98, i32 0, i32 2
  store ptr %97, ptr %99, align 8, !tbaa !15
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %100, ptr %9, align 8, !tbaa !5
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %152

105:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  store ptr %110, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !14
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !11
  %117 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %113, ptr noundef %116)
  store ptr %117, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %118)
  store ptr %119, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %120)
  store ptr %121, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %122)
  store ptr %123, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %124)
  store ptr %125, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %126)
  store ptr %127, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #8
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 8 dereferenceable(24) %129)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #8
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %130, ptr noundef nonnull align 8 dereferenceable(24) %131)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #8
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %132 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  store double %132, ptr %23, align 8, !tbaa !19
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !11
  %136 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %135)
  %137 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %136)
  %138 = fcmp ogt double %137, 0.000000e+00
  br i1 %138, label %139, label %143

139:                                              ; preds = %105
  %140 = load double, ptr @RN_TWO_PI, align 8, !tbaa !19
  %141 = load double, ptr %23, align 8, !tbaa !19
  %142 = fsub double %140, %141
  store double %142, ptr %23, align 8, !tbaa !19
  br label %143

143:                                              ; preds = %139, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %144 = load ptr, ptr %18, align 8, !tbaa !5
  %145 = load ptr, ptr %19, align 8, !tbaa !5
  %146 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %144, ptr noundef nonnull align 8 dereferenceable(24) %145)
  store double %146, ptr %24, align 8, !tbaa !19
  %147 = load double, ptr %23, align 8, !tbaa !19
  %148 = load double, ptr %24, align 8, !tbaa !19
  %149 = fadd double %147, %148
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %150, i32 0, i32 5
  store double %149, ptr %151, align 8, !tbaa !18
  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 24, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %152

152:                                              ; preds = %143, %96
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %153, ptr noundef %154)
  store ptr %155, ptr %11, align 8, !tbaa !5
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  %157 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %156)
  %158 = load i32, ptr @R3mesh_mark, align 4, !tbaa !9
  %159 = icmp eq i32 %157, %158
  br i1 %159, label %160, label %199

160:                                              ; preds = %152
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = icmp ne ptr %161, %162
  br i1 %163, label %164, label %198

164:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %165, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !15
  store ptr %167, ptr %25, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %174, %164
  %169 = load ptr, ptr %25, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = icmp ne ptr %171, %172
  br i1 %173, label %174, label %178

174:                                              ; preds = %168
  %175 = load ptr, ptr %25, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %175, i32 0, i32 2
  %177 = load ptr, ptr %176, align 8, !tbaa !15
  store ptr %177, ptr %25, align 8, !tbaa !5
  br label %168, !llvm.loop !20

178:                                              ; preds = %168
  %179 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %179, ptr %8, align 8, !tbaa !5
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !15
  store ptr %182, ptr %25, align 8, !tbaa !5
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %183, i32 0, i32 2
  store ptr null, ptr %184, align 8, !tbaa !15
  br label %185

185:                                              ; preds = %195, %178
  %186 = load ptr, ptr %25, align 8, !tbaa !5
  %187 = icmp ne ptr %186, null
  br i1 %187, label %188, label %197

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %189 = load ptr, ptr %25, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %189, i32 0, i32 2
  %191 = load ptr, ptr %190, align 8, !tbaa !15
  store ptr %191, ptr %26, align 8, !tbaa !5
  %192 = load ptr, ptr %25, align 8, !tbaa !5
  %193 = icmp eq ptr %192, null
  br i1 %193, label %195, label %194

194:                                              ; preds = %188
  call void @_ZdlPvm(ptr noundef %192, i64 noundef 48) #10
  br label %195

195:                                              ; preds = %194, %188
  %196 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %196, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %185, !llvm.loop !22

197:                                              ; preds = %185
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %234

198:                                              ; preds = %160
  br label %199

199:                                              ; preds = %198, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %200, ptr %27, align 8, !tbaa !5
  br label %201

201:                                              ; preds = %231, %199
  %202 = load ptr, ptr %27, align 8, !tbaa !5
  %203 = icmp ne ptr %202, null
  br i1 %203, label %204, label %232

204:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = load ptr, ptr %27, align 8, !tbaa !5
  %207 = call noundef ptr @_ZNK6R3Mesh12FaceOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %205, ptr noundef %206, i32 noundef 0)
  store ptr %207, ptr %28, align 8, !tbaa !5
  %208 = load ptr, ptr %28, align 8, !tbaa !5
  %209 = icmp ne ptr %208, null
  br i1 %209, label %217, label %210

210:                                              ; preds = %204
  %211 = load ptr, ptr %27, align 8, !tbaa !5
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = icmp ne ptr %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.36, i32 noundef 2726, ptr noundef @.str.2)
  br label %215

215:                                              ; preds = %214, %210
  %216 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %216, ptr %10, align 8, !tbaa !5
  store i32 9, ptr %6, align 4
  br label %229

217:                                              ; preds = %204
  %218 = load ptr, ptr %28, align 8, !tbaa !5
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  %220 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacePK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %218, ptr noundef %219, i32 noundef 1)
  store ptr %220, ptr %27, align 8, !tbaa !5
  %221 = load ptr, ptr %27, align 8, !tbaa !5
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %227

223:                                              ; preds = %217
  %224 = load ptr, ptr %27, align 8, !tbaa !5
  %225 = load ptr, ptr %10, align 8, !tbaa !5
  %226 = icmp eq ptr %224, %225
  br i1 %226, label %227, label %228

227:                                              ; preds = %223, %217
  store i32 1, ptr %6, align 4
  br label %229

228:                                              ; preds = %223
  store i32 0, ptr %6, align 4
  br label %229

229:                                              ; preds = %228, %227, %215
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %230 = load i32, ptr %6, align 4
  switch i32 %230, label %233 [
    i32 0, label %231
    i32 9, label %232
  ]

231:                                              ; preds = %229
  br label %201, !llvm.loop !23

232:                                              ; preds = %229, %201
  store i32 0, ptr %6, align 4
  br label %233

233:                                              ; preds = %232, %229
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %234

234:                                              ; preds = %233, %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %235 = load i32, ptr %6, align 4
  switch i32 %235, label %364 [
    i32 0, label %236
    i32 2, label %241
  ]

236:                                              ; preds = %234
  br label %237

237:                                              ; preds = %236
  %238 = load ptr, ptr %11, align 8, !tbaa !5
  %239 = load ptr, ptr %7, align 8, !tbaa !5
  %240 = icmp ne ptr %238, %239
  br i1 %240, label %67, label %241, !llvm.loop !24

241:                                              ; preds = %237, %234
  %242 = load ptr, ptr %8, align 8, !tbaa !5
  %243 = icmp ne ptr %242, null
  br i1 %243, label %244, label %303

244:                                              ; preds = %241
  %245 = load ptr, ptr %9, align 8, !tbaa !5
  %246 = icmp ne ptr %245, null
  br i1 %246, label %247, label %303

247:                                              ; preds = %244
  %248 = load ptr, ptr %9, align 8, !tbaa !5
  %249 = load ptr, ptr %8, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %249, i32 0, i32 2
  store ptr %248, ptr %250, align 8, !tbaa !15
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %252, i32 0, i32 3
  store ptr %251, ptr %253, align 8, !tbaa !16
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = icmp ne ptr %254, null
  br i1 %255, label %256, label %302

256:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %257 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %257, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %258 = load ptr, ptr %29, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %258, i32 0, i32 2
  %260 = load ptr, ptr %259, align 8, !tbaa !15
  %261 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !11
  store ptr %262, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %263 = load ptr, ptr %29, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %263, i32 0, i32 3
  %265 = load ptr, ptr %264, align 8, !tbaa !16
  %266 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %265, i32 0, i32 0
  %267 = load ptr, ptr %266, align 8, !tbaa !11
  store ptr %267, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %268 = load ptr, ptr %11, align 8, !tbaa !5
  %269 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %268)
  store ptr %269, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %270 = load ptr, ptr %30, align 8, !tbaa !5
  %271 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %270)
  store ptr %271, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %272 = load ptr, ptr %31, align 8, !tbaa !5
  %273 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %272)
  store ptr %273, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %274 = load ptr, ptr %30, align 8, !tbaa !5
  %275 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %274)
  store ptr %275, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %276 = load ptr, ptr %31, align 8, !tbaa !5
  %277 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %276)
  store ptr %277, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #8
  %278 = load ptr, ptr %33, align 8, !tbaa !5
  %279 = load ptr, ptr %32, 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) %278, ptr noundef nonnull align 8 dereferenceable(24) %279)
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #8
  %280 = load ptr, ptr %34, align 8, !tbaa !5
  %281 = load ptr, ptr %32, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %38, ptr noundef nonnull align 8 dereferenceable(24) %280, ptr noundef nonnull align 8 dereferenceable(24) %281)
  call void @llvm.lifetime.start.p0(i64 24, ptr %39) #8
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %39, ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %282 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %38)
  store double %282, ptr %40, align 8, !tbaa !19
  %283 = load ptr, ptr %29, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %283, i32 0, i32 0
  %285 = load ptr, ptr %284, align 8, !tbaa !11
  %286 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %285)
  %287 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(24) %286)
  %288 = fcmp ogt double %287, 0.000000e+00
  br i1 %288, label %289, label %293

289:                                              ; preds = %256
  %290 = load double, ptr @RN_TWO_PI, align 8, !tbaa !19
  %291 = load double, ptr %40, align 8, !tbaa !19
  %292 = fsub double %290, %291
  store double %292, ptr %40, align 8, !tbaa !19
  br label %293

293:                                              ; preds = %289, %256
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %294 = load ptr, ptr %35, align 8, !tbaa !5
  %295 = load ptr, ptr %36, align 8, !tbaa !5
  %296 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %294, ptr noundef nonnull align 8 dereferenceable(24) %295)
  store double %296, ptr %41, align 8, !tbaa !19
  %297 = load double, ptr %40, align 8, !tbaa !19
  %298 = load double, ptr %41, align 8, !tbaa !19
  %299 = fadd double %297, %298
  %300 = load ptr, ptr %29, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %300, i32 0, i32 5
  store double %299, ptr %301, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 24, 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 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %302

302:                                              ; preds = %293, %247
  br label %303

303:                                              ; preds = %302, %244, %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %304 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %304, ptr %42, align 8, !tbaa !5
  br label %305

305:                                              ; preds = %358, %303
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %306 = load ptr, ptr %42, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %306, i32 0, i32 0
  %308 = load ptr, ptr %307, align 8, !tbaa !11
  store ptr %308, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  store i32 0, ptr %44, align 4, !tbaa !9
  br label %309

309:                                              ; preds = %351, %305
  %310 = load i32, ptr %44, align 4, !tbaa !9
  %311 = load ptr, ptr %43, align 8, !tbaa !5
  %312 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %311)
  %313 = icmp slt i32 %310, %312
  br i1 %313, label %315, label %314

314:                                              ; preds = %309
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  br label %354

315:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %316 = load ptr, ptr %43, align 8, !tbaa !5
  %317 = load i32, ptr %44, align 4, !tbaa !9
  %318 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %316, i32 noundef %317)
  store ptr %318, ptr %45, align 8, !tbaa !5
  %319 = load ptr, ptr %45, align 8, !tbaa !5
  %320 = load ptr, ptr %42, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %320, i32 0, i32 1
  %322 = load ptr, ptr %321, align 8, !tbaa !14
  %323 = icmp eq ptr %319, %322
  br i1 %323, label %324, label %325

324:                                              ; preds = %315
  store i32 14, ptr %6, align 4
  br label %348

325:                                              ; preds = %315
  %326 = load ptr, ptr %45, align 8, !tbaa !5
  %327 = load ptr, ptr %42, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %327, i32 0, i32 2
  %329 = load ptr, ptr %328, align 8, !tbaa !15
  %330 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %329, i32 0, i32 1
  %331 = load ptr, ptr %330, align 8, !tbaa !14
  %332 = icmp eq ptr %326, %331
  br i1 %332, label %333, label %334

333:                                              ; preds = %325
  store i32 14, ptr %6, align 4
  br label %348

334:                                              ; preds = %325
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %335 = load ptr, ptr %45, align 8, !tbaa !5
  %336 = load ptr, ptr %43, align 8, !tbaa !5
  %337 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %335, ptr noundef %336)
  store ptr %337, ptr %46, align 8, !tbaa !5
  %338 = load ptr, ptr %46, align 8, !tbaa !5
  %339 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %338)
  %340 = icmp ne i32 %339, 0
  br i1 %340, label %341, label %347

341:                                              ; preds = %334
  %342 = load ptr, ptr %45, align 8, !tbaa !5
  %343 = load ptr, ptr %47, align 8, !tbaa !25
  %344 = getelementptr inbounds ptr, ptr %343, i64 25
  %345 = load ptr, ptr %344, align 8
  %346 = call noundef ptr %345(ptr noundef nonnull align 8 dereferenceable(272) %47, ptr noundef %342)
  br label %347

347:                                              ; preds = %341, %334
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  store i32 0, ptr %6, align 4
  br label %348

348:                                              ; preds = %347, %333, %324
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  %349 = load i32, ptr %6, align 4
  switch i32 %349, label %368 [
    i32 0, label %350
    i32 14, label %351
  ]

350:                                              ; preds = %348
  br label %351

351:                                              ; preds = %350, %348
  %352 = load i32, ptr %44, align 4, !tbaa !9
  %353 = add nsw i32 %352, 1
  store i32 %353, ptr %44, align 4, !tbaa !9
  br label %309, !llvm.loop !27

354:                                              ; preds = %314
  %355 = load ptr, ptr %42, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.R3MeshBoundaryVertexData, ptr %355, i32 0, i32 3
  %357 = load ptr, ptr %356, align 8, !tbaa !16
  store ptr %357, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  br label %358

358:                                              ; preds = %354
  %359 = load ptr, ptr %42, align 8, !tbaa !5
  %360 = load ptr, ptr %8, align 8, !tbaa !5
  %361 = icmp ne ptr %359, %360
  br i1 %361, label %305, label %362, !llvm.loop !28

362:                                              ; preds = %358
  %363 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZL16FillHoleBoundaryP6R3MeshP24R3MeshBoundaryVertexData(ptr noundef %47, ptr noundef %363)
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  store i32 0, ptr %6, align 4
  br label %364

364:                                              ; preds = %362, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %365

365:                                              ; preds = %364, %58, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  %366 = load i32, ptr %6, align 4
  switch i32 %366, label %368 [
    i32 0, label %367
    i32 1, label %367
  ]

367:                                              ; preds = %365, %365
  ret void

368:                                              ; preds = %365, %348
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL16FillHoleBoundaryP6R3MeshP24R3MeshBoundaryVertexData(ptr noundef, ptr noundef) #7

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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS24R3MeshBoundaryVertexData", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 16}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !6, i64 32}
!18 = !{!12, !13, i64 40}
!19 = !{!13, !13, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}


; 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.R3Vector = type { [3 x 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
@RN_TWO_PI = external local_unnamed_addr constant double, align 8
@.str.36 = external hidden unnamed_addr constant [10 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

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

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

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

declare noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(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 @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(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 i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh8FillHoleEP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) local_unnamed_addr #7 align 2 {
  %3 = alloca %class.R3Vector, align 8
  %4 = alloca %class.R3Vector, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = tail call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %.thread178, label %10

10:                                               ; preds = %2
  %11 = tail call noundef ptr @_ZNK6R3Mesh14FaceAcrossEdgeEPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef nonnull %9)
  %.not147 = icmp eq ptr %11, null
  br i1 %.not147, label %12, label %.thread178

12:                                               ; preds = %10
  %13 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgePK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef nonnull %9, i32 noundef 0)
  %14 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @R3mesh_mark, align 4, !tbaa !5
  %16 = load double, ptr @RN_TWO_PI, align 8
  br label %17

17:                                               ; preds = %.loopexit183, %12
  %.0134 = phi ptr [ %13, %12 ], [ %43, %.loopexit183 ]
  %.0130 = phi ptr [ %1, %12 ], [ %.5.ph, %.loopexit183 ]
  %.0128 = phi ptr [ null, %12 ], [ %18, %.loopexit183 ]
  %.0124 = phi ptr [ null, %12 ], [ %spec.select, %.loopexit183 ]
  %18 = call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #8
  store ptr %.0134, ptr %18, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %.0130, ptr %19, align 8, !tbaa !13
  %20 = getelementptr inbounds i8, ptr %18, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %20, i8 0, i64 32, i1 false)
  %21 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.0134, i32 noundef %21)
  %.not148 = icmp eq ptr %.0124, null
  %spec.select = select i1 %.not148, ptr %18, ptr %.0124
  %.not149 = icmp eq ptr %.0128, null
  br i1 %.not149, label %.critedge, label %22

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %18, i64 40
  %24 = getelementptr inbounds i8, ptr %.0128, i64 24
  store ptr %18, ptr %24, align 8, !tbaa !14
  store ptr %.0128, ptr %20, align 8, !tbaa !15
  %25 = load ptr, ptr %.0128, align 8, !tbaa !9
  %26 = load ptr, ptr %19, align 8, !tbaa !13
  %27 = load ptr, ptr %18, align 8, !tbaa !9
  %28 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %26, ptr noundef %27)
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.0134)
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %25)
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %28)
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %25)
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #9
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #9
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %34 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %35 = load ptr, ptr %18, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %35)
  %37 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %36)
  %38 = fcmp ogt double %37, 0.000000e+00
  %39 = fsub double %16, %34
  %.0135 = select i1 %38, double %39, double %34
  %40 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(24) %33)
  %41 = fadd double %40, %.0135
  store double %41, ptr %23, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  br label %42

.critedge:                                        ; preds = %17
  store ptr null, ptr %20, align 8, !tbaa !15
  br label %42

42:                                               ; preds = %.critedge, %22
  %43 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.0130, ptr noundef %.0134)
  %44 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %43)
  %45 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %46 = icmp ne i32 %44, %45
  %.not150 = icmp eq ptr %43, %13
  %or.cond = or i1 %.not150, %46
  br i1 %or.cond, label %.preheader182, label %.preheader

.preheader:                                       ; preds = %42, %.preheader
  %.0136.in = phi ptr [ %48, %.preheader ], [ %20, %42 ]
  %.0136 = load ptr, ptr %.0136.in, align 8, !tbaa !15
  %47 = load ptr, ptr %.0136, align 8, !tbaa !9
  %.not155 = icmp eq ptr %47, %43
  %48 = getelementptr inbounds i8, ptr %.0136, i64 16
  br i1 %.not155, label %49, label %.preheader, !llvm.loop !17

49:                                               ; preds = %.preheader
  %50 = load ptr, ptr %48, align 8, !tbaa !15
  store ptr null, ptr %48, align 8, !tbaa !15
  %.not156202 = icmp eq ptr %50, null
  br i1 %.not156202, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %49, %.lr.ph
  %.1137203 = phi ptr [ %52, %.lr.ph ], [ %50, %49 ]
  %51 = getelementptr inbounds i8, ptr %.1137203, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  call void @_ZdlPvm(ptr noundef nonnull %.1137203, i64 noundef 48) #10
  %.not156 = icmp eq ptr %52, null
  br i1 %.not156, label %.loopexit, label %.lr.ph, !llvm.loop !19

.preheader182:                                    ; preds = %42, %57
  %.0138 = phi ptr [ %58, %57 ], [ %.0130, %42 ]
  %.not151 = icmp eq ptr %.0138, null
  br i1 %.not151, label %.loopexit183, label %53

53:                                               ; preds = %.preheader182
  %54 = call noundef ptr @_ZNK6R3Mesh12FaceOnVertexEPK12R3MeshVertexPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %43, ptr noundef nonnull %.0138, i32 noundef 0)
  %.not152 = icmp eq ptr %54, null
  br i1 %.not152, label %55, label %57

55:                                               ; preds = %53
  %.not153 = icmp eq ptr %.0138, %.0130
  br i1 %.not153, label %56, label %.loopexit183

56:                                               ; preds = %55
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.36, i32 noundef 2726, ptr noundef nonnull @.str.2)
  br label %.loopexit183

57:                                               ; preds = %53
  %58 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacePK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %54, ptr noundef %43, i32 noundef 1)
  %.not154 = icmp eq ptr %58, null
  %59 = icmp eq ptr %58, %.0130
  %or.cond160 = select i1 %.not154, i1 true, i1 %59
  br i1 %or.cond160, label %.thread178, label %.preheader182

.loopexit183:                                     ; preds = %.preheader182, %56, %55
  %.5.ph = phi ptr [ %.0138, %55 ], [ %.0138, %56 ], [ %.0130, %.preheader182 ]
  br i1 %.not150, label %.loopexit, label %17, !llvm.loop !20

.loopexit:                                        ; preds = %.loopexit183, %.lr.ph, %49
  %.2126176 = phi ptr [ %.0136, %49 ], [ %.0136, %.lr.ph ], [ %spec.select, %.loopexit183 ]
  %60 = getelementptr inbounds i8, ptr %18, i64 24
  %61 = getelementptr inbounds i8, ptr %.2126176, i64 16
  store ptr %18, ptr %61, align 8, !tbaa !15
  store ptr %.2126176, ptr %60, align 8, !tbaa !14
  %62 = load ptr, ptr %18, align 8, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %.2126176, i64 24
  %64 = load ptr, ptr %63, align 8, !tbaa !14
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %43)
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %62)
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %65)
  %69 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %62)
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %65)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %66)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #9
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(24) %66)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %71 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %72 = load ptr, ptr %.2126176, align 8, !tbaa !9
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %72)
  %74 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %73)
  %75 = fcmp ogt double %74, 0.000000e+00
  %76 = fsub double %16, %71
  %.0133 = select i1 %75, double %76, double %71
  %77 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(24) %70)
  %78 = fadd double %77, %.0133
  %79 = getelementptr inbounds i8, ptr %.2126176, i64 40
  store double %78, ptr %79, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  br label %80

80:                                               ; preds = %._crit_edge, %.loopexit
  %.0129 = phi ptr [ %.2126176, %.loopexit ], [ %87, %._crit_edge ]
  %81 = load ptr, ptr %.0129, align 8, !tbaa !9
  %82 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %81)
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph205, label %._crit_edge

.lr.ph205:                                        ; preds = %80
  %84 = getelementptr inbounds i8, ptr %.0129, i64 8
  %85 = getelementptr inbounds i8, ptr %.0129, i64 16
  br label %88

._crit_edge:                                      ; preds = %105, %80
  %86 = getelementptr inbounds i8, ptr %.0129, i64 24
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  %.not158 = icmp eq ptr %87, %.2126176
  br i1 %.not158, label %109, label %80, !llvm.loop !21

88:                                               ; preds = %.lr.ph205, %105
  %.0127204 = phi i32 [ 0, %.lr.ph205 ], [ %106, %105 ]
  %89 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %81, i32 noundef %.0127204)
  %90 = load ptr, ptr %84, align 8, !tbaa !13
  %91 = icmp eq ptr %89, %90
  br i1 %91, label %105, label %92

92:                                               ; preds = %88
  %93 = load ptr, ptr %85, align 8, !tbaa !15
  %94 = getelementptr inbounds i8, ptr %93, i64 8
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = icmp eq ptr %89, %95
  br i1 %96, label %105, label %97

97:                                               ; preds = %92
  %98 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %89, ptr noundef %81)
  %99 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %98)
  %.not159 = icmp eq i32 %99, 0
  br i1 %.not159, label %105, label %100

100:                                              ; preds = %97
  %101 = load ptr, ptr %0, align 8, !tbaa !22
  %102 = getelementptr inbounds i8, ptr %101, i64 200
  %103 = load ptr, ptr %102, align 8
  %104 = call noundef ptr %103(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %89)
  br label %105

105:                                              ; preds = %97, %100, %92, %88
  %106 = add nuw nsw i32 %.0127204, 1
  %107 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %81)
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %88, label %._crit_edge, !llvm.loop !24

109:                                              ; preds = %._crit_edge
  call void @_ZL16FillHoleBoundaryP6R3MeshP24R3MeshBoundaryVertexData(ptr noundef nonnull %0, ptr noundef nonnull %.2126176)
  br label %.thread178

.thread178:                                       ; preds = %57, %109, %10, %2
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL16FillHoleBoundaryP6R3MeshP24R3MeshBoundaryVertexData(ptr noundef, ptr noundef) local_unnamed_addr #7

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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS24R3MeshBoundaryVertexData", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !12, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !11, i64 24}
!15 = !{!10, !11, i64 16}
!16 = !{!10, !12, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !8, i64 0}
!24 = distinct !{!24, !18}


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