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

; 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.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #1

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

29:                                               ; preds = %3
  store double -1.000000e+00, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %136

30:                                               ; preds = %3
  %31 = load double, ptr %7, align 8, !tbaa !9
  %32 = fcmp oeq double %31, 0.000000e+00
  br i1 %32, label %33, label %35

33:                                               ; preds = %30
  %34 = load double, ptr %8, align 8, !tbaa !9
  store double %34, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %136

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %36 = load double, ptr %7, align 8, !tbaa !9
  %37 = fmul double 3.000000e+00, %36
  store double %37, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %38 = load double, ptr %7, align 8, !tbaa !9
  %39 = fmul double -2.000000e+00, %38
  %40 = load double, ptr %7, align 8, !tbaa !9
  %41 = fmul double %39, %40
  store double %41, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %42 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load double, ptr %10, align 8, !tbaa !9
  %46 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %43, ptr noundef %44, double noundef %45, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef null)
          to label %47 unwind label %58

47:                                               ; preds = %35
  store ptr %46, ptr %13, align 8, !tbaa !5
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  call void @_ZdaPv(ptr noundef %48) #9
  br label %51

51:                                               ; preds = %50, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store double 0.000000e+00, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %52

52:                                               ; preds = %120, %51
  %53 = load i32, ptr %18, align 4, !tbaa !14
  %54 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %55 unwind label %62

55:                                               ; preds = %52
  %56 = icmp slt i32 %53, %54
  br i1 %56, label %66, label %57

57:                                               ; preds = %55
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %125

58:                                               ; preds = %35
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %14, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %15, align 4
  br label %135

62:                                               ; preds = %52
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  br label %124

66:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %67 = load i32, ptr %18, align 4, !tbaa !14
  %68 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %67)
          to label %69 unwind label %84

69:                                               ; preds = %66
  store ptr %68, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %70 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = load ptr, ptr %19, align 8, !tbaa !5
  %73 = invoke noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %71, ptr noundef %72)
          to label %74 unwind label %88

74:                                               ; preds = %69
  store i32 %73, ptr %20, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %75 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = load i32, ptr %20, align 4, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds double, ptr %76, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !9
  store double %80, ptr %21, align 8, !tbaa !9
  %81 = load double, ptr %21, align 8, !tbaa !9
  %82 = fcmp oeq double %81, -1.000000e+00
  br i1 %82, label %83, label %92

83:                                               ; preds = %74
  store i32 4, ptr %9, align 4
  br label %117

84:                                               ; preds = %66
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %14, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %15, align 4
  br label %123

88:                                               ; preds = %69
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %123

92:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = load i32, ptr %20, align 4, !tbaa !14
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %93, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !9
  store double %97, ptr %22, align 8, !tbaa !9
  %98 = load double, ptr %22, align 8, !tbaa !9
  %99 = load double, ptr %10, align 8, !tbaa !9
  %100 = fcmp ogt double %98, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %92
  store i32 4, ptr %9, align 4
  br label %116

102:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %103 = load double, ptr %22, align 8, !tbaa !9
  %104 = load double, ptr %22, align 8, !tbaa !9
  %105 = fmul double %103, %104
  %106 = load double, ptr %11, align 8, !tbaa !9
  %107 = fdiv double %105, %106
  %108 = call double @exp(double noundef %107) #8
  store double %108, ptr %23, align 8, !tbaa !9
  %109 = load double, ptr %23, align 8, !tbaa !9
  %110 = load double, ptr %21, align 8, !tbaa !9
  %111 = load double, ptr %16, align 8, !tbaa !9
  %112 = call double @llvm.fmuladd.f64(double %109, double %110, double %111)
  store double %112, ptr %16, align 8, !tbaa !9
  %113 = load double, ptr %23, align 8, !tbaa !9
  %114 = load double, ptr %17, align 8, !tbaa !9
  %115 = fadd double %114, %113
  store double %115, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  store i32 0, ptr %9, align 4
  br label %116

116:                                              ; preds = %102, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %117

117:                                              ; preds = %116, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %118 = load i32, ptr %9, align 4
  switch i32 %118, label %143 [
    i32 0, label %119
    i32 4, label %120
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119, %117
  %121 = load i32, ptr %18, align 4, !tbaa !14
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %18, align 4, !tbaa !14
  br label %52, !llvm.loop !16

123:                                              ; preds = %88, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %124

124:                                              ; preds = %123, %62
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %135

125:                                              ; preds = %57
  %126 = load double, ptr %17, align 8, !tbaa !9
  %127 = fcmp oeq double %126, 0.000000e+00
  br i1 %127, label %128, label %130

128:                                              ; preds = %125
  %129 = load double, ptr %8, align 8, !tbaa !9
  store double %129, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %134

130:                                              ; preds = %125
  %131 = load double, ptr %16, align 8, !tbaa !9
  %132 = load double, ptr %17, align 8, !tbaa !9
  %133 = fdiv double %131, %132
  store double %133, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %134

134:                                              ; preds = %130, %128
  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 %13) #8
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %136

135:                                              ; preds = %124, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  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 %8) #8
  br label %138

136:                                              ; preds = %134, %33, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %137 = load double, ptr %4, align 8
  ret double %137

138:                                              ; preds = %135
  %139 = load ptr, ptr %14, align 8
  %140 = load i32, ptr %15, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142

143:                                              ; preds = %117
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

declare noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

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

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

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

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

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

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

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


; 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.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

; 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK14R3MeshProperty8GaussianEP12R3MeshVertexd(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1, double noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.RNArray, 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 %53, label %7

7:                                                ; preds = %3
  %8 = fcmp oeq double %2, 0.000000e+00
  br i1 %8, label %53, label %9

9:                                                ; preds = %7
  %10 = fmul double %2, 3.000000e+00
  %11 = fmul double %2, -2.000000e+00
  %12 = fmul double %11, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %13, ptr noundef %1, double noundef %10, ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef null)
          to label %15 unwind label %24

15:                                               ; preds = %9
  %16 = icmp eq ptr %14, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %15
  call void @_ZdaPv(ptr noundef nonnull %14) #10
  br label %18

18:                                               ; preds = %17, %15
  %19 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %21 = getelementptr inbounds i8, ptr %0, i64 1040
  br label %26

._crit_edge:                                      ; preds = %48, %18
  %.040.lcssa = phi double [ 0.000000e+00, %18 ], [ %.242, %48 ]
  %.037.lcssa = phi double [ 0.000000e+00, %18 ], [ %.2, %48 ]
  %22 = fcmp oeq double %.040.lcssa, 0.000000e+00
  %23 = fdiv double %.037.lcssa, %.040.lcssa
  %.0 = select i1 %22, double %5, double %23
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  br label %53

24:                                               ; preds = %9
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %52

26:                                               ; preds = %.lr.ph, %48
  %.03753 = phi double [ 0.000000e+00, %.lr.ph ], [ %.2, %48 ]
  %.03952 = phi i32 [ 0, %.lr.ph ], [ %49, %48 ]
  %.04051 = phi double [ 0.000000e+00, %.lr.ph ], [ %.242, %48 ]
  %27 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.03952)
          to label %28 unwind label %36

28:                                               ; preds = %26
  %29 = load ptr, ptr %0, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %27)
  %31 = load ptr, ptr %21, align 8, !tbaa !12
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds double, ptr %31, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !13
  %35 = fcmp oeq double %34, -1.000000e+00
  br i1 %35, label %48, label %38

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %52

38:                                               ; preds = %28
  %39 = getelementptr inbounds double, ptr %14, i64 %32
  %40 = load double, ptr %39, align 8, !tbaa !13
  %41 = fcmp ogt double %40, %10
  br i1 %41, label %48, label %42

42:                                               ; preds = %38
  %43 = fmul double %40, %40
  %44 = fdiv double %43, %12
  %45 = call double @exp(double noundef %44) #9
  %46 = call double @llvm.fmuladd.f64(double %45, double %34, double %.03753)
  %47 = fadd double %.04051, %45
  br label %48

48:                                               ; preds = %42, %38, %28
  %.242 = phi double [ %.04051, %28 ], [ %47, %42 ], [ %.04051, %38 ]
  %.2 = phi double [ %.03753, %28 ], [ %46, %42 ], [ %.03753, %38 ]
  %49 = add nuw nsw i32 %.03952, 1
  %50 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %26, label %._crit_edge, !llvm.loop !14

52:                                               ; preds = %36, %24
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %25, %24 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  resume { ptr, i32 } %.pn

53:                                               ; preds = %7, %3, %._crit_edge
  %.1 = phi double [ %.0, %._crit_edge ], [ -1.000000e+00, %3 ], [ %5, %7 ]
  ret double %.1
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

declare noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { "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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 #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, !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 = !{!6, !7, i64 1040}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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