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

; 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] }

@R3null_vector = external global %class.R3Vector, align 8

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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)) #2

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

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

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

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

declare noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R3Mesh21VertexLaplacianVectorEPK12R3MeshVertex(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %class.R3Vector, align 8
  %19 = alloca %class.R3Vector, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %25)
  store ptr %26, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %91, %3
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %29)
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %94

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %34, i32 noundef %35)
  store ptr %36, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %37, ptr noundef %38)
  store ptr %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %40)
  store ptr %41, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 0.000000e+00, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %83, %33
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = icmp slt i32 %43, 2
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %86

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load i32, ptr %14, align 4, !tbaa !9
  %49 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %47, i32 noundef %48)
  store ptr %49, ptr %15, align 8, !tbaa !5
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i32 7, ptr %9, align 4
  br label %80

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %54, ptr noundef %55)
  store ptr %56, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %57)
  store ptr %58, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(24) %60)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(24) %62)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %63 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
  store double %63, ptr %20, align 8, !tbaa !11
  %64 = load double, ptr %20, align 8, !tbaa !11
  %65 = fcmp oeq double %64, 0.000000e+00
  br i1 %65, label %66, label %67

66:                                               ; preds = %53
  store i32 7, ptr %9, align 4
  br label %79

67:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %68 = load double, ptr %20, align 8, !tbaa !11
  %69 = call double @tan(double noundef %68) #6
  store double %69, ptr %21, align 8, !tbaa !11
  %70 = load double, ptr %21, align 8, !tbaa !11
  %71 = fcmp oeq double %70, 0.000000e+00
  br i1 %71, label %72, label %73

72:                                               ; preds = %67
  store i32 7, ptr %9, align 4
  br label %78

73:                                               ; preds = %67
  %74 = load double, ptr %21, align 8, !tbaa !11
  %75 = fdiv double 1.000000e+00, %74
  %76 = load double, ptr %13, align 8, !tbaa !11
  %77 = fadd double %76, %75
  store double %77, ptr %13, align 8, !tbaa !11
  store i32 0, ptr %9, align 4
  br label %78

78:                                               ; preds = %73, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %79

79:                                               ; preds = %78, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %80

80:                                               ; preds = %79, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %81 = load i32, ptr %9, align 4
  switch i32 %81, label %99 [
    i32 0, label %82
    i32 7, label %83
  ]

82:                                               ; preds = %80
  br label %83

83:                                               ; preds = %82, %80
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %14, align 4, !tbaa !9
  br label %42, !llvm.loop !13

86:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  %87 = load double, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %23, ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 8 dereferenceable(24) %89)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %22, double noundef %87, ptr noundef nonnull align 8 dereferenceable(24) %23)
  %90 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectorpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %91

91:                                               ; preds = %86
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %8, align 4, !tbaa !9
  br label %27, !llvm.loop !15

94:                                               ; preds = %32
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call noundef double @_ZNK6R3Mesh10VertexAreaEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %95)
  %97 = fmul double 4.000000e+00, %96
  %98 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %97)
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void

99:                                               ; preds = %80
  unreachable
}

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

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

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

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

; Function Attrs: nounwind
declare double @tan(double noundef) #5

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectorpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !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.R3Vector = type { [3 x double] }

@R3null_vector = external global %class.R3Vector, align 8

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #4 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 #4 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 #4 align 2

declare noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R3Mesh21VertexLaplacianVectorEPK12R3MeshVertex(ptr dead_on_unwind noalias nonnull writable sret(%class.R3Vector) align 8 %0, ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2) local_unnamed_addr #3 align 2 {
  %4 = alloca %class.R3Vector, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.R3Vector, align 8
  tail call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  %8 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2)
  %9 = tail call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2)
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %42, %3
  %11 = call noundef double @_ZNK6R3Mesh10VertexAreaEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2)
  %12 = fmul double %11, 4.000000e+00
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectordVEd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %12)
  ret void

.lr.ph:                                           ; preds = %3, %42
  %.037 = phi i32 [ %44, %42 ], [ 0, %3 ]
  %14 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2, i32 noundef %.037)
  %15 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %14, ptr noundef %2)
  %16 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %15)
  %17 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %14, i32 noundef 0)
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %29, label %18

18:                                               ; preds = %.lr.ph
  %19 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef nonnull %17, ptr noundef %14)
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %21 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %22 = fcmp oeq double %21, 0.000000e+00
  br i1 %22, label %28, label %23

23:                                               ; preds = %18
  %24 = call double @tan(double noundef %21) #6
  %25 = fcmp oeq double %24, 0.000000e+00
  %26 = fdiv double 1.000000e+00, %24
  %27 = fadd double %26, 0.000000e+00
  %.1 = select i1 %25, double 0.000000e+00, double %27
  br label %28

28:                                               ; preds = %18, %23
  %.2 = phi double [ %.1, %23 ], [ 0.000000e+00, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %29

29:                                               ; preds = %.lr.ph, %28
  %.3 = phi double [ %.2, %28 ], [ 0.000000e+00, %.lr.ph ]
  %30 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %14, i32 noundef 1)
  %.not.1 = icmp eq ptr %30, null
  br i1 %.not.1, label %42, label %31

31:                                               ; preds = %29
  %32 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef nonnull %30, ptr noundef %14)
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %32)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %34 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %35 = fcmp oeq double %34, 0.000000e+00
  br i1 %35, label %41, label %36

36:                                               ; preds = %31
  %37 = call double @tan(double noundef %34) #6
  %38 = fcmp oeq double %37, 0.000000e+00
  %39 = fdiv double 1.000000e+00, %37
  %40 = fadd double %.3, %39
  %.1.1 = select i1 %38, double %.3, double %40
  br label %41

41:                                               ; preds = %36, %31
  %.2.1 = phi double [ %.1.1, %36 ], [ %.3, %31 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %42

42:                                               ; preds = %41, %29
  %.3.1 = phi double [ %.2.1, %41 ], [ %.3, %29 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %6, double noundef %.3.1, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectorpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %44 = add nuw nsw i32 %.037, 1
  %45 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %1, ptr noundef %2)
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectorpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass