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

; 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.R3MeshProperty = type { ptr, [1024 x i8], i32, ptr, double, double, double, double, double, double }

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK14R3MeshProperty9LaplacianEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %class.R3Vector, align 8
  %23 = alloca %class.R3Vector, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %29, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %28, ptr noundef %30)
  store double %31, ptr %7, align 8, !tbaa !9
  %32 = load double, ptr %7, align 8, !tbaa !9
  %33 = fcmp oeq double %32, -1.000000e+00
  br i1 %33, label %34, label %35

34:                                               ; preds = %2
  store double -1.000000e+00, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %146

35:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %36 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %37, ptr noundef %38)
  store ptr %39, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store double 0.000000e+00, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %40

40:                                               ; preds = %130, %35
  %41 = load i32, ptr %12, align 4, !tbaa !14
  %42 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %43, ptr noundef %44)
  %46 = icmp slt i32 %41, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %40
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %133

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %49 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i32, ptr %12, align 4, !tbaa !14
  %53 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %50, ptr noundef %51, i32 noundef %52)
  store ptr %53, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %54 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %55, ptr noundef %56, ptr noundef %57)
  store ptr %58, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = call noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %28, ptr noundef %59)
  store double %60, ptr %15, align 8, !tbaa !9
  %61 = load double, ptr %15, align 8, !tbaa !9
  %62 = fcmp oeq double %61, -1.000000e+00
  br i1 %62, label %63, label %64

63:                                               ; preds = %48
  store i32 4, ptr %8, align 4
  br label %127

64:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %65 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %66, ptr noundef %67)
  store ptr %68, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %69

69:                                               ; preds = %116, %64
  %70 = load i32, ptr %18, align 4, !tbaa !14
  %71 = icmp slt i32 %70, 2
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %119

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %74 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !11
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load i32, ptr %18, align 4, !tbaa !14
  %78 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %75, ptr noundef %76, i32 noundef %77)
  store ptr %78, ptr %19, align 8, !tbaa !5
  %79 = load ptr, ptr %19, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %82, label %81

81:                                               ; preds = %73
  store i32 7, ptr %8, align 4
  br label %113

82:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %83 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = load ptr, ptr %19, align 8, !tbaa !5
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %84, ptr noundef %85, ptr noundef %86)
  store ptr %87, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %88 = getelementptr inbounds %struct.R3MeshProperty, ptr %28, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = load ptr, ptr %20, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %89, ptr noundef %90)
  store ptr %91, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %93)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %21, 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) %94, ptr noundef nonnull align 8 dereferenceable(24) %95)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %96 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %23)
  store double %96, ptr %24, align 8, !tbaa !9
  %97 = load double, ptr %24, align 8, !tbaa !9
  %98 = fcmp oeq double %97, 0.000000e+00
  br i1 %98, label %99, label %100

99:                                               ; preds = %82
  store i32 7, ptr %8, align 4
  br label %112

100:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %101 = load double, ptr %24, align 8, !tbaa !9
  %102 = call double @tan(double noundef %101) #7
  store double %102, ptr %25, align 8, !tbaa !9
  %103 = load double, ptr %25, align 8, !tbaa !9
  %104 = fcmp oeq double %103, 0.000000e+00
  br i1 %104, label %105, label %106

105:                                              ; preds = %100
  store i32 7, ptr %8, align 4
  br label %111

106:                                              ; preds = %100
  %107 = load double, ptr %25, align 8, !tbaa !9
  %108 = fdiv double 1.000000e+00, %107
  %109 = load double, ptr %17, align 8, !tbaa !9
  %110 = fadd double %109, %108
  store double %110, ptr %17, align 8, !tbaa !9
  store i32 0, ptr %8, align 4
  br label %111

111:                                              ; preds = %106, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %112

112:                                              ; preds = %111, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %113

113:                                              ; preds = %112, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  %114 = load i32, ptr %8, align 4
  switch i32 %114, label %148 [
    i32 0, label %115
    i32 7, label %116
  ]

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115, %113
  %117 = load i32, ptr %18, align 4, !tbaa !14
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %18, align 4, !tbaa !14
  br label %69, !llvm.loop !15

119:                                              ; preds = %72
  %120 = load double, ptr %17, align 8, !tbaa !9
  %121 = load double, ptr %15, align 8, !tbaa !9
  %122 = load double, ptr %10, align 8, !tbaa !9
  %123 = call double @llvm.fmuladd.f64(double %120, double %121, double %122)
  store double %123, ptr %10, align 8, !tbaa !9
  %124 = load double, ptr %17, align 8, !tbaa !9
  %125 = load double, ptr %11, align 8, !tbaa !9
  %126 = fadd double %125, %124
  store double %126, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  store i32 0, ptr %8, align 4
  br label %127

127:                                              ; preds = %119, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %128 = load i32, ptr %8, align 4
  switch i32 %128, label %148 [
    i32 0, label %129
    i32 4, label %130
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129, %127
  %131 = load i32, ptr %12, align 4, !tbaa !14
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %12, align 4, !tbaa !14
  br label %40, !llvm.loop !17

133:                                              ; preds = %47
  %134 = load double, ptr %11, align 8, !tbaa !9
  %135 = fcmp oeq double %134, 0.000000e+00
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  store double 0.000000e+00, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %145

137:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %138 = load double, ptr %10, align 8, !tbaa !9
  %139 = load double, ptr %11, align 8, !tbaa !9
  %140 = fdiv double %138, %139
  store double %140, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %141 = load double, ptr %7, align 8, !tbaa !9
  %142 = load double, ptr %26, align 8, !tbaa !9
  %143 = fsub double %141, %142
  store double %143, ptr %27, align 8, !tbaa !9
  %144 = load double, ptr %27, align 8, !tbaa !9
  store double %144, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %145

145:                                              ; preds = %137, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %146

146:                                              ; preds = %145, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %147 = load double, ptr %3, align 8
  ret double %147

148:                                              ; preds = %127, %113
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind 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) #1 align 2

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS14R3MeshProperty", !6, i64 0, !7, i64 8, !13, i64 1032, !6, i64 1040, !10, i64 1048, !10, i64 1056, !10, i64 1064, !10, i64 1072, !10, i64 1080, !10, i64 1088}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R3Vector = type { [3 x double] }

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK14R3MeshProperty9LaplacianEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %class.R3Vector, align 8
  %4 = alloca %class.R3Vector, align 8
  %5 = tail call noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1)
  %6 = fcmp oeq double %5, -1.000000e+00
  br i1 %6, label %64, label %7

7:                                                ; preds = %2
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %8, ptr noundef %1)
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %11 = tail call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %10, ptr noundef %1)
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %59, %7
  %.045.lcssa = phi double [ 0.000000e+00, %7 ], [ %.146, %59 ]
  %.043.lcssa = phi double [ 0.000000e+00, %7 ], [ %.144, %59 ]
  %13 = fcmp oeq double %.045.lcssa, 0.000000e+00
  %14 = fdiv double %.043.lcssa, %.045.lcssa
  %15 = fsub double %5, %14
  %.0 = select i1 %13, double 0.000000e+00, double %15
  br label %64

.lr.ph:                                           ; preds = %7, %59
  %.04360 = phi double [ %.144, %59 ], [ 0.000000e+00, %7 ]
  %.04559 = phi double [ %.146, %59 ], [ 0.000000e+00, %7 ]
  %.04758 = phi i32 [ %60, %59 ], [ 0, %7 ]
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %16, ptr noundef %1, i32 noundef %.04758)
  %18 = load ptr, ptr %0, align 8, !tbaa !5
  %19 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %17, ptr noundef %1)
  %20 = call noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %19)
  %21 = fcmp oeq double %20, -1.000000e+00
  br i1 %21, label %59, label %22

22:                                               ; preds = %.lr.ph
  %23 = load ptr, ptr %0, align 8, !tbaa !5
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %23, ptr noundef %19)
  %25 = load ptr, ptr %0, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %17, i32 noundef 0)
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %40, label %27

27:                                               ; preds = %22
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef nonnull %26, ptr noundef %17)
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %32 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %33 = fcmp oeq double %32, 0.000000e+00
  br i1 %33, label %39, label %34

34:                                               ; preds = %27
  %35 = call double @tan(double noundef %32) #7
  %36 = fcmp oeq double %35, 0.000000e+00
  %37 = fdiv double 1.000000e+00, %35
  %38 = fadd double %37, 0.000000e+00
  %.149 = select i1 %36, double 0.000000e+00, double %38
  br label %39

39:                                               ; preds = %27, %34
  %.2 = phi double [ %.149, %34 ], [ 0.000000e+00, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %40

40:                                               ; preds = %22, %39
  %.3 = phi double [ %.2, %39 ], [ 0.000000e+00, %22 ]
  %41 = load ptr, ptr %0, align 8, !tbaa !5
  %42 = call noundef ptr @_ZNK6R3Mesh10FaceOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %41, ptr noundef %17, i32 noundef 1)
  %.not.1 = icmp eq ptr %42, null
  br i1 %.not.1, label %56, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %0, align 8, !tbaa !5
  %45 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossFaceEPK10R3MeshFacePK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %44, ptr noundef nonnull %42, ptr noundef %17)
  %46 = load ptr, ptr %0, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %46, ptr noundef %45)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %48 = call noundef double @_Z15R3InteriorAngleRK8R3VectorS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %49 = fcmp oeq double %48, 0.000000e+00
  br i1 %49, label %55, label %50

50:                                               ; preds = %43
  %51 = call double @tan(double noundef %48) #7
  %52 = fcmp oeq double %51, 0.000000e+00
  %53 = fdiv double 1.000000e+00, %51
  %54 = fadd double %.3, %53
  %.149.1 = select i1 %52, double %.3, double %54
  br label %55

55:                                               ; preds = %50, %43
  %.2.1 = phi double [ %.149.1, %50 ], [ %.3, %43 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %56

56:                                               ; preds = %55, %40
  %.3.1 = phi double [ %.2.1, %55 ], [ %.3, %40 ]
  %57 = call double @llvm.fmuladd.f64(double %.3.1, double %20, double %.04360)
  %58 = fadd double %.04559, %.3.1
  br label %59

59:                                               ; preds = %.lr.ph, %56
  %.146 = phi double [ %58, %56 ], [ %.04559, %.lr.ph ]
  %.144 = phi double [ %57, %56 ], [ %.04360, %.lr.ph ]
  %60 = add nuw nsw i32 %.04758, 1
  %61 = load ptr, ptr %0, align 8, !tbaa !5
  %62 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %61, ptr noundef %1)
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %.lr.ph, label %._crit_edge, !llvm.loop !12

64:                                               ; preds = %2, %._crit_edge
  %.1 = phi double [ %.0, %._crit_edge ], [ -1.000000e+00, %2 ]
  ret double %.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 #4 align 2

; Function Attrs: inlinehint mustprogress nounwind 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 #1 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 #1 align 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 #4 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 #1 align 2

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS14R3MeshProperty", !7, i64 0, !8, i64 8, !10, i64 1032, !7, i64 1040, !11, i64 1048, !11, i64 1056, !11, i64 1064, !11, i64 1072, !11, i64 1080, !11, i64 1088}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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