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

; 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"

%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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK14R3MeshProperty7EntropyEv(ptr noundef nonnull align 8 dereferenceable(1096) %0) #2 align 2 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [50 x double], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 50, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %22 = call noundef double @_ZNK14R3MeshProperty10PercentileEd(ptr noundef nonnull align 8 dereferenceable(1096) %21, double noundef 1.000000e+00)
  store double %22, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %23 = call noundef double @_ZNK14R3MeshProperty10PercentileEd(ptr noundef nonnull align 8 dereferenceable(1096) %21, double noundef 9.900000e+01)
  store double %23, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %24 = load double, ptr %6, align 8, !tbaa !11
  %25 = load double, ptr %5, align 8, !tbaa !11
  %26 = fsub double %24, %25
  store double %26, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %27 = load double, ptr %7, align 8, !tbaa !11
  %28 = fdiv double 5.000000e+01, %27
  store double %28, ptr %8, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.R3MeshProperty, ptr %21, i32 0, i32 2
  %30 = load i32, ptr %29, align 8, !tbaa !13
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %1
  store double 0.000000e+00, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %163

33:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 400, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %42, %33
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 50
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %45

38:                                               ; preds = %34
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %40
  store double 0.000000e+00, ptr %41, align 8, !tbaa !11
  br label %42

42:                                               ; preds = %38
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %12, align 4, !tbaa !9
  br label %34, !llvm.loop !15

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

46:                                               ; preds = %115, %45
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = getelementptr inbounds %struct.R3MeshProperty, ptr %21, i32 0, i32 2
  %49 = load i32, ptr %48, align 8, !tbaa !13
  %50 = icmp slt i32 %47, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %118

52:                                               ; preds = %46
  %53 = getelementptr inbounds %struct.R3MeshProperty, ptr %21, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %54, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !11
  %59 = fcmp oeq double %58, -1.000000e+00
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  br label %115

61:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %62 = load double, ptr %8, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.R3MeshProperty, ptr %21, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %64, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !11
  %69 = load double, ptr %5, align 8, !tbaa !11
  %70 = fsub double %68, %69
  %71 = fmul double %62, %70
  store double %71, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %72 = load double, ptr %14, align 8, !tbaa !11
  %73 = fptosi double %72 to i32
  store i32 %73, ptr %15, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %61
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %76, %61
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = icmp sge i32 %78, 50
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  store i32 49, ptr %15, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %80, %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %82 = load i32, ptr %15, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %16, align 4, !tbaa !9
  %84 = load i32, ptr %16, align 4, !tbaa !9
  %85 = icmp sge i32 %84, 50
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  store i32 49, ptr %16, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %86, %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %88 = load double, ptr %14, align 8, !tbaa !11
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = sitofp i32 %89 to double
  %91 = fsub double %88, %90
  store double %91, ptr %17, align 8, !tbaa !11
  %92 = load double, ptr %17, align 8, !tbaa !11
  %93 = fcmp olt double %92, 0.000000e+00
  br i1 %93, label %94, label %95

94:                                               ; preds = %87
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  br label %95

95:                                               ; preds = %94, %87
  %96 = load double, ptr %17, align 8, !tbaa !11
  %97 = fcmp ogt double %96, 1.000000e+00
  br i1 %97, label %98, label %99

98:                                               ; preds = %95
  store double 1.000000e+00, ptr %17, align 8, !tbaa !11
  br label %99

99:                                               ; preds = %98, %95
  %100 = load double, ptr %17, align 8, !tbaa !11
  %101 = fsub double 1.000000e+00, %100
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !11
  %106 = fadd double %105, %101
  store double %106, ptr %104, align 8, !tbaa !11
  %107 = load double, ptr %17, align 8, !tbaa !11
  %108 = load i32, ptr %16, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !11
  %112 = fadd double %111, %107
  store double %112, ptr %110, align 8, !tbaa !11
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %115

115:                                              ; preds = %99, %60
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %13, align 4, !tbaa !9
  br label %46, !llvm.loop !18

118:                                              ; preds = %51
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = icmp sgt i32 %119, 0
  br i1 %120, label %121, label %138

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %134, %121
  %123 = load i32, ptr %18, align 4, !tbaa !9
  %124 = icmp slt i32 %123, 50
  br i1 %124, label %126, label %125

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

126:                                              ; preds = %122
  %127 = load i32, ptr %10, align 4, !tbaa !9
  %128 = sitofp i32 %127 to double
  %129 = load i32, ptr %18, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %130
  %132 = load double, ptr %131, align 8, !tbaa !11
  %133 = fdiv double %132, %128
  store double %133, ptr %131, align 8, !tbaa !11
  br label %134

134:                                              ; preds = %126
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %18, align 4, !tbaa !9
  br label %122, !llvm.loop !19

137:                                              ; preds = %125
  br label %138

138:                                              ; preds = %137, %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store double 0.000000e+00, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %158, %138
  %140 = load i32, ptr %20, align 4, !tbaa !9
  %141 = icmp slt i32 %140, 50
  br i1 %141, label %143, label %142

142:                                              ; preds = %139
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %161

143:                                              ; preds = %139
  %144 = load i32, ptr %20, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !11
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [50 x double], ptr %11, i64 0, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = call double @log(double noundef %151) #4
  %153 = call double @log(double noundef 2.000000e+00) #4
  %154 = fdiv double %152, %153
  %155 = load double, ptr %19, align 8, !tbaa !11
  %156 = fneg double %147
  %157 = call double @llvm.fmuladd.f64(double %156, double %154, double %155)
  store double %157, ptr %19, align 8, !tbaa !11
  br label %158

158:                                              ; preds = %143
  %159 = load i32, ptr %20, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %20, align 4, !tbaa !9
  br label %139, !llvm.loop !20

161:                                              ; preds = %142
  %162 = load double, ptr %19, align 8, !tbaa !11
  store double %162, ptr %2, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %163

163:                                              ; preds = %161, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %164 = load double, ptr %2, align 8
  ret double %164
}

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

; Function Attrs: nounwind
declare double @log(double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { nounwind }

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

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

; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK14R3MeshProperty7EntropyEv(ptr noundef nonnull align 8 dereferenceable(1096) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca [50 x double], align 16
  %3 = tail call noundef double @_ZNK14R3MeshProperty10PercentileEd(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef 1.000000e+00)
  %4 = tail call noundef double @_ZNK14R3MeshProperty10PercentileEd(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef 9.900000e+01)
  %5 = fsub double %4, %3
  %6 = fdiv double 5.000000e+01, %5
  %7 = getelementptr inbounds i8, ptr %0, i64 1032
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %122, label %.preheader50

.preheader50:                                     ; preds = %1
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %2, i8 0, i64 400, i1 false), !tbaa !12
  %10 = icmp sgt i32 %8, 0
  br i1 %10, label %.lr.ph, label %.loopexit.preheader

.lr.ph:                                           ; preds = %.preheader50
  %11 = getelementptr inbounds i8, ptr %0, i64 1040
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %wide.trip.count = zext nneg i32 %8 to i64
  br label %91

._crit_edge:                                      ; preds = %114
  %13 = icmp sgt i32 %.147, 0
  br i1 %13, label %.preheader, label %.loopexit.preheader

.loopexit.preheader:                              ; preds = %.preheader50, %.preheader, %._crit_edge
  br label %.loopexit

.preheader:                                       ; preds = %._crit_edge
  %14 = uitofp nneg i32 %.147 to double
  %15 = load <2 x double>, ptr %2, align 16, !tbaa !12
  %16 = insertelement <2 x double> poison, double %14, i64 0
  %17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
  %18 = fdiv <2 x double> %15, %17
  store <2 x double> %18, ptr %2, align 16, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = load <2 x double>, ptr %19, align 16, !tbaa !12
  %21 = fdiv <2 x double> %20, %17
  store <2 x double> %21, ptr %19, align 16, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %2, i64 32
  %23 = load <2 x double>, ptr %22, align 16, !tbaa !12
  %24 = fdiv <2 x double> %23, %17
  store <2 x double> %24, ptr %22, align 16, !tbaa !12
  %25 = getelementptr inbounds i8, ptr %2, i64 48
  %26 = load <2 x double>, ptr %25, align 16, !tbaa !12
  %27 = fdiv <2 x double> %26, %17
  store <2 x double> %27, ptr %25, align 16, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %2, i64 64
  %29 = load <2 x double>, ptr %28, align 16, !tbaa !12
  %30 = fdiv <2 x double> %29, %17
  store <2 x double> %30, ptr %28, align 16, !tbaa !12
  %31 = getelementptr inbounds i8, ptr %2, i64 80
  %32 = load <2 x double>, ptr %31, align 16, !tbaa !12
  %33 = fdiv <2 x double> %32, %17
  store <2 x double> %33, ptr %31, align 16, !tbaa !12
  %34 = getelementptr inbounds i8, ptr %2, i64 96
  %35 = load <2 x double>, ptr %34, align 16, !tbaa !12
  %36 = fdiv <2 x double> %35, %17
  store <2 x double> %36, ptr %34, align 16, !tbaa !12
  %37 = getelementptr inbounds i8, ptr %2, i64 112
  %38 = load <2 x double>, ptr %37, align 16, !tbaa !12
  %39 = fdiv <2 x double> %38, %17
  store <2 x double> %39, ptr %37, align 16, !tbaa !12
  %40 = getelementptr inbounds i8, ptr %2, i64 128
  %41 = load <2 x double>, ptr %40, align 16, !tbaa !12
  %42 = fdiv <2 x double> %41, %17
  store <2 x double> %42, ptr %40, align 16, !tbaa !12
  %43 = getelementptr inbounds i8, ptr %2, i64 144
  %44 = load <2 x double>, ptr %43, align 16, !tbaa !12
  %45 = fdiv <2 x double> %44, %17
  store <2 x double> %45, ptr %43, align 16, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %2, i64 160
  %47 = load <2 x double>, ptr %46, align 16, !tbaa !12
  %48 = fdiv <2 x double> %47, %17
  store <2 x double> %48, ptr %46, align 16, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %2, i64 176
  %50 = load <2 x double>, ptr %49, align 16, !tbaa !12
  %51 = fdiv <2 x double> %50, %17
  store <2 x double> %51, ptr %49, align 16, !tbaa !12
  %52 = getelementptr inbounds i8, ptr %2, i64 192
  %53 = load <2 x double>, ptr %52, align 16, !tbaa !12
  %54 = fdiv <2 x double> %53, %17
  store <2 x double> %54, ptr %52, align 16, !tbaa !12
  %55 = getelementptr inbounds i8, ptr %2, i64 208
  %56 = load <2 x double>, ptr %55, align 16, !tbaa !12
  %57 = fdiv <2 x double> %56, %17
  store <2 x double> %57, ptr %55, align 16, !tbaa !12
  %58 = getelementptr inbounds i8, ptr %2, i64 224
  %59 = load <2 x double>, ptr %58, align 16, !tbaa !12
  %60 = fdiv <2 x double> %59, %17
  store <2 x double> %60, ptr %58, align 16, !tbaa !12
  %61 = getelementptr inbounds i8, ptr %2, i64 240
  %62 = load <2 x double>, ptr %61, align 16, !tbaa !12
  %63 = fdiv <2 x double> %62, %17
  store <2 x double> %63, ptr %61, align 16, !tbaa !12
  %64 = getelementptr inbounds i8, ptr %2, i64 256
  %65 = load <2 x double>, ptr %64, align 16, !tbaa !12
  %66 = fdiv <2 x double> %65, %17
  store <2 x double> %66, ptr %64, align 16, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %2, i64 272
  %68 = load <2 x double>, ptr %67, align 16, !tbaa !12
  %69 = fdiv <2 x double> %68, %17
  store <2 x double> %69, ptr %67, align 16, !tbaa !12
  %70 = getelementptr inbounds i8, ptr %2, i64 288
  %71 = load <2 x double>, ptr %70, align 16, !tbaa !12
  %72 = fdiv <2 x double> %71, %17
  store <2 x double> %72, ptr %70, align 16, !tbaa !12
  %73 = getelementptr inbounds i8, ptr %2, i64 304
  %74 = load <2 x double>, ptr %73, align 16, !tbaa !12
  %75 = fdiv <2 x double> %74, %17
  store <2 x double> %75, ptr %73, align 16, !tbaa !12
  %76 = getelementptr inbounds i8, ptr %2, i64 320
  %77 = load <2 x double>, ptr %76, align 16, !tbaa !12
  %78 = fdiv <2 x double> %77, %17
  store <2 x double> %78, ptr %76, align 16, !tbaa !12
  %79 = getelementptr inbounds i8, ptr %2, i64 336
  %80 = load <2 x double>, ptr %79, align 16, !tbaa !12
  %81 = fdiv <2 x double> %80, %17
  store <2 x double> %81, ptr %79, align 16, !tbaa !12
  %82 = getelementptr inbounds i8, ptr %2, i64 352
  %83 = load <2 x double>, ptr %82, align 16, !tbaa !12
  %84 = fdiv <2 x double> %83, %17
  store <2 x double> %84, ptr %82, align 16, !tbaa !12
  %85 = getelementptr inbounds i8, ptr %2, i64 368
  %86 = load <2 x double>, ptr %85, align 16, !tbaa !12
  %87 = fdiv <2 x double> %86, %17
  store <2 x double> %87, ptr %85, align 16, !tbaa !12
  %88 = getelementptr inbounds i8, ptr %2, i64 384
  %89 = load <2 x double>, ptr %88, align 16, !tbaa !12
  %90 = fdiv <2 x double> %89, %17
  store <2 x double> %90, ptr %88, align 16, !tbaa !12
  br label %.loopexit.preheader

91:                                               ; preds = %.lr.ph, %114
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %114 ]
  %.04652 = phi i32 [ 0, %.lr.ph ], [ %.147, %114 ]
  %92 = getelementptr inbounds double, ptr %12, i64 %indvars.iv
  %93 = load double, ptr %92, align 8, !tbaa !12
  %94 = fcmp oeq double %93, -1.000000e+00
  br i1 %94, label %114, label %95

95:                                               ; preds = %91
  %96 = fsub double %93, %3
  %97 = fmul double %6, %96
  %98 = fptosi double %97 to i32
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %98, i32 0)
  %spec.store.select2 = tail call i32 @llvm.umin.i32(i32 %spec.store.select, i32 49)
  %99 = tail call i32 @llvm.umin.i32(i32 %spec.store.select, i32 48)
  %spec.store.select1 = add nuw nsw i32 %99, 1
  %100 = uitofp nneg i32 %spec.store.select2 to double
  %101 = fsub double %97, %100
  %102 = fcmp olt double %101, 0.000000e+00
  %.042 = select i1 %102, double 0.000000e+00, double %101
  %103 = fcmp ogt double %.042, 1.000000e+00
  %.1 = select i1 %103, double 1.000000e+00, double %.042
  %104 = fsub double 1.000000e+00, %.1
  %105 = zext nneg i32 %spec.store.select2 to i64
  %106 = getelementptr inbounds [50 x double], ptr %2, i64 0, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !12
  %108 = fadd double %104, %107
  store double %108, ptr %106, align 8, !tbaa !12
  %109 = zext nneg i32 %spec.store.select1 to i64
  %110 = getelementptr inbounds [50 x double], ptr %2, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !12
  %112 = fadd double %.1, %111
  store double %112, ptr %110, align 8, !tbaa !12
  %113 = add nsw i32 %.04652, 1
  br label %114

114:                                              ; preds = %91, %95
  %.147 = phi i32 [ %.04652, %91 ], [ %113, %95 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %91, !llvm.loop !14

115:                                              ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #6
  br label %122

.loopexit:                                        ; preds = %.loopexit.preheader, %.loopexit
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.loopexit ], [ 0, %.loopexit.preheader ]
  %.04055 = phi double [ %121, %.loopexit ], [ 0.000000e+00, %.loopexit.preheader ]
  %116 = getelementptr inbounds [50 x double], ptr %2, i64 0, i64 %indvars.iv63
  %117 = load double, ptr %116, align 8, !tbaa !12
  %118 = tail call double @log(double noundef %117) #6
  %119 = fdiv double %118, 0x3FE62E42FEFA39EF
  %120 = fneg double %117
  %121 = tail call double @llvm.fmuladd.f64(double %120, double %119, double %.04055)
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next64, 50
  br i1 %exitcond66.not, label %115, label %.loopexit, !llvm.loop !16

122:                                              ; preds = %1, %115
  %.043 = phi double [ %121, %115 ], [ 0.000000e+00, %1 ]
  ret double %.043
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 1032}
!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 = !{!11, !11, i64 0}
!13 = !{!6, !7, i64 1040}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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