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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R3Point = type { [3 x double] }
%class.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.RNFlags = type { i64 }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #3

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #6

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Mesh17SetVertexPositionEP12R3MeshVertexRK7R3Point(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #7 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh6SmoothEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca %class.R3Point, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca %class.R3Point, align 8
  %24 = alloca %class.R3Point, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %25 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %26 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %25)
  %27 = sext i32 %26 to i64
  %28 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %27, i64 24)
  %29 = extractvalue { i64, i1 } %28, 1
  %30 = extractvalue { i64, i1 } %28, 0
  %31 = select i1 %29, i64 -1, i64 %30
  %32 = call noalias noundef nonnull ptr @_Znam(i64 noundef %31) #10
  %33 = icmp eq i64 %27, 0
  br i1 %33, label %41, label %34

34:                                               ; preds = %2
  %35 = getelementptr inbounds %class.R3Point, ptr %32, i64 %27
  br label %36

36:                                               ; preds = %38, %34
  %37 = phi ptr [ %32, %34 ], [ %39, %38 ]
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %37)
          to label %38 unwind label %47

38:                                               ; preds = %36
  %39 = getelementptr inbounds %class.R3Point, ptr %37, i64 1
  %40 = icmp eq ptr %39, %35
  br i1 %40, label %41, label %36

41:                                               ; preds = %38, %2
  store ptr %32, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %42

42:                                               ; preds = %61, %41
  %43 = load i32, ptr %8, align 4, !tbaa !11
  %44 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %25)
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %51, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %64

47:                                               ; preds = %36
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  call void @_ZdaPvm(ptr noundef %32, i64 noundef %31) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  br label %146

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %52 = load i32, ptr %8, align 4, !tbaa !11
  %53 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %25, i32 noundef %52)
  store ptr %53, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %54)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %class.R3Point, ptr %56, i64 %58
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(24) %55)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %61

61:                                               ; preds = %51
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %8, align 4, !tbaa !11
  br label %42, !llvm.loop !13

64:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %138, %64
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %25)
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %141

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %71 = load i32, ptr %10, align 4, !tbaa !11
  %72 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %25, i32 noundef %71)
  store ptr %72, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  store double 1.000000e+00, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #9
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.R3MeshVertex, ptr %74, i32 0, i32 7
  %76 = load i32, ptr %75, align 8, !tbaa !15
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %class.R3Point, ptr %73, i64 %77
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %78)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = call noundef double @_ZNK6R3Mesh23VertexAverageEdgeLengthEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %79)
  store double %80, ptr %15, align 8, !tbaa !9
  %81 = load double, ptr %15, align 8, !tbaa !9
  %82 = fcmp ogt double %81, 0.000000e+00
  br i1 %82, label %83, label %137

83:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %84

84:                                               ; preds = %131, %83
  %85 = load i32, ptr %16, align 4, !tbaa !11
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %86)
  %88 = icmp slt i32 %85, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %134

90:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = load i32, ptr %16, align 4, !tbaa !11
  %93 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %91, i32 noundef %92)
  store ptr %93, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %94 = load ptr, ptr %17, align 8, !tbaa !5
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %94, ptr noundef %95)
  store ptr %96, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = getelementptr inbounds %class.R3MeshVertex, ptr %98, i32 0, i32 7
  %100 = load i32, ptr %99, align 8, !tbaa !15
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %class.R3Point, ptr %97, i64 %101
  store ptr %102, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  %104 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %103)
  store double %104, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %105 = load double, ptr %20, align 8, !tbaa !9
  %106 = fcmp ogt double %105, 0.000000e+00
  br i1 %106, label %107, label %111

107:                                              ; preds = %90
  %108 = load double, ptr %20, align 8, !tbaa !9
  %109 = load double, ptr %15, align 8, !tbaa !9
  %110 = fdiv double %108, %109
  br label %112

111:                                              ; preds = %90
  br label %112

112:                                              ; preds = %111, %107
  %113 = phi double [ %110, %107 ], [ 1.000000e+00, %111 ]
  store double %113, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %114 = load double, ptr %4, align 8, !tbaa !9
  %115 = load double, ptr %20, align 8, !tbaa !9
  %116 = load double, ptr %20, align 8, !tbaa !9
  %117 = fmul double %115, %116
  %118 = load double, ptr %21, align 8, !tbaa !9
  %119 = fmul double -2.000000e+00, %118
  %120 = load double, ptr %21, align 8, !tbaa !9
  %121 = fmul double %119, %120
  %122 = fdiv double %117, %121
  %123 = call double @exp(double noundef %122) #9
  %124 = fmul double %114, %123
  store double %124, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #9
  %125 = load double, ptr %22, align 8, !tbaa !9
  %126 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %23, double noundef %125, ptr noundef nonnull align 8 dereferenceable(24) %126)
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #9
  %128 = load double, ptr %22, align 8, !tbaa !9
  %129 = load double, ptr %13, align 8, !tbaa !9
  %130 = fadd double %129, %128
  store double %130, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %131

131:                                              ; preds = %112
  %132 = load i32, ptr %16, align 4, !tbaa !11
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %16, align 4, !tbaa !11
  br label %84, !llvm.loop !25

134:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #9
  %135 = load double, ptr %13, align 8, !tbaa !9
  call void @_ZdvRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %14, double noundef %135)
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN6R3Mesh17SetVertexPositionEP12R3MeshVertexRK7R3Point(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef %136, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #9
  br label %137

137:                                              ; preds = %134, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %10, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %10, align 4, !tbaa !11
  br label %65, !llvm.loop !26

141:                                              ; preds = %69
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = icmp eq ptr %142, null
  br i1 %143, label %145, label %144

144:                                              ; preds = %141
  call void @_ZdaPv(ptr noundef %142) #11
  br label %145

145:                                              ; preds = %144, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  ret void

146:                                              ; preds = %47
  %147 = load ptr, ptr %6, align 8
  %148 = load i32, ptr %7, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150
}

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "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 allocsize(0) }
attributes #11 = { 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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 120}
!16 = !{!"_ZTS12R3MeshVertex", !17, i64 8, !19, i64 24, !20, i64 48, !21, i64 72, !22, i64 88, !10, i64 112, !12, i64 120, !23, i64 128, !10, i64 136, !12, i64 144, !6, i64 152}
!17 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !18, i64 0}
!18 = !{!"_ZTS8RNVArray", !6, i64 0, !12, i64 8, !12, i64 12}
!19 = !{!"_ZTS7R3Point", !7, i64 0}
!20 = !{!"_ZTS8R3Vector", !7, i64 0}
!21 = !{!"_ZTS7R2Point", !7, i64 0}
!22 = !{!"_ZTS5RNRgb", !7, i64 0}
!23 = !{!"_ZTS7RNFlags", !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}


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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

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

declare void @_ZdvRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Mesh17SetVertexPositionEP12R3MeshVertexRK7R3Point(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #7 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh6SmoothEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.R3Point, align 8
  %4 = alloca %class.R3Point, align 8
  %5 = alloca %class.R3Point, align 8
  %6 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %7 = sext i32 %6 to i64
  %8 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %7, i64 24)
  %9 = extractvalue { i64, i1 } %8, 1
  %10 = extractvalue { i64, i1 } %8, 0
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #9
  %13 = icmp eq i32 %6, 0
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %2
  %15 = getelementptr inbounds %class.R3Point, ptr %12, i64 %7
  br label %16

16:                                               ; preds = %18, %14
  %17 = phi ptr [ %12, %14 ], [ %19, %18 ]
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %18 unwind label %25

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %17, i64 24
  %20 = icmp eq ptr %19, %15
  br i1 %20, label %.loopexit, label %16

.loopexit:                                        ; preds = %18, %2
  %21 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %.preheader46

.preheader46:                                     ; preds = %.lr.ph, %.loopexit
  %23 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph52, label %._crit_edge53

25:                                               ; preds = %16
  %26 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdaPvm(ptr noundef nonnull %12, i64 noundef %11) #10
  resume { ptr, i32 } %26

.lr.ph:                                           ; preds = %.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.loopexit ]
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  %28 = tail call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %27)
  %29 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %28)
  %30 = getelementptr inbounds %class.R3Point, ptr %12, i64 %indvars.iv
  %31 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %29)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next, %33
  br i1 %34, label %.lr.ph, label %.preheader46, !llvm.loop !5

.lr.ph52:                                         ; preds = %.preheader46, %65
  %.04051 = phi i32 [ %66, %65 ], [ 0, %.preheader46 ]
  %35 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.04051)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #11
  %36 = getelementptr inbounds i8, ptr %35, i64 120
  %37 = load i32, ptr %36, align 8, !tbaa !7
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %class.R3Point, ptr %12, i64 %38
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %39)
  %40 = call noundef double @_ZNK6R3Mesh23VertexAverageEdgeLengthEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %35)
  %41 = fcmp ogt double %40, 0.000000e+00
  br i1 %41, label %.preheader, label %65

.preheader:                                       ; preds = %.lr.ph52
  %42 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %35)
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph50, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph50, %.preheader
  %.041.lcssa = phi double [ 1.000000e+00, %.preheader ], [ %61, %.lr.ph50 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #11
  call void @_ZdvRK7R3Pointd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef %.041.lcssa)
  call void @_ZN6R3Mesh17SetVertexPositionEP12R3MeshVertexRK7R3Point(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %35, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #11
  br label %65

.lr.ph50:                                         ; preds = %.preheader, %.lr.ph50
  %.04149 = phi double [ %61, %.lr.ph50 ], [ 1.000000e+00, %.preheader ]
  %.04248 = phi i32 [ %62, %.lr.ph50 ], [ 0, %.preheader ]
  %44 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %35, i32 noundef %.04248)
  %45 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %44, ptr noundef %35)
  %46 = getelementptr inbounds i8, ptr %45, i64 120
  %47 = load i32, ptr %46, align 8, !tbaa !7
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %class.R3Point, ptr %12, i64 %48
  %50 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %44)
  %51 = fcmp ogt double %50, 0.000000e+00
  %52 = fdiv double %50, %40
  %53 = select i1 %51, double %52, double 1.000000e+00
  %54 = fmul double %50, %50
  %55 = fmul double %53, -2.000000e+00
  %56 = fmul double %53, %55
  %57 = fdiv double %54, %56
  %58 = call double @exp(double noundef %57) #11
  %59 = fmul double %58, %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #11
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %4, double noundef %59, ptr noundef nonnull align 8 dereferenceable(24) %49)
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #11
  %61 = fadd double %.04149, %59
  %62 = add nuw nsw i32 %.04248, 1
  %63 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %35)
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph50, label %._crit_edge, !llvm.loop !22

65:                                               ; preds = %._crit_edge, %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #11
  %66 = add nuw nsw i32 %.04051, 1
  %67 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %.lr.ph52, label %._crit_edge53, !llvm.loop !23

._crit_edge53:                                    ; preds = %65, %.preheader46
  call void @_ZdaPv(ptr noundef nonnull %12) #10
  ret void
}

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }
attributes #11 = { 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"}
!7 = !{!8, !14, i64 120}
!8 = !{!"_ZTS12R3MeshVertex", !9, i64 8, !15, i64 24, !16, i64 48, !17, i64 72, !18, i64 88, !19, i64 112, !14, i64 120, !20, i64 128, !19, i64 136, !14, i64 144, !11, i64 152}
!9 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !10, i64 0}
!10 = !{!"_ZTS8RNVArray", !11, i64 0, !14, i64 8, !14, i64 12}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTS7R3Point", !12, i64 0}
!16 = !{!"_ZTS8R3Vector", !12, i64 0}
!17 = !{!"_ZTS7R2Point", !12, i64 0}
!18 = !{!"_ZTS5RNRgb", !12, i64 0}
!19 = !{!"double", !12, i64 0}
!20 = !{!"_ZTS7RNFlags", !21, i64 0}
!21 = !{!"long", !12, i64 0}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !6}


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