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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6 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) #7

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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: mustprogress uwtable
define dso_local void @_ZN14R3MeshProperty4BlurEd(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.RNArray, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %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 %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %24 = load ptr, ptr %3, align 8
  %25 = load double, ptr %4, align 8, !tbaa !9
  %26 = fcmp oeq double %25, 0.000000e+00
  br i1 %26, label %27, label %28

27:                                               ; preds = %2
  br label %207

28:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #10
  %29 = load double, ptr %4, align 8, !tbaa !9
  %30 = fmul double 3.000000e+00, %29
  store double %30, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %31 = load double, ptr %4, align 8, !tbaa !9
  %32 = fmul double -2.000000e+00, %31
  %33 = load double, ptr %4, align 8, !tbaa !9
  %34 = fmul double %32, %33
  store double %34, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %35 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %36)
  %38 = sext i32 %37 to i64
  %39 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %38, i64 8)
  %40 = extractvalue { i64, i1 } %39, 1
  %41 = extractvalue { i64, i1 } %39, 0
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = call noalias noundef nonnull ptr @_Znam(i64 noundef %42) #11
  store ptr %43, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %44

44:                                               ; preds = %62, %28
  %45 = load i32, ptr %8, align 4, !tbaa !14
  %46 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %47)
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %65

51:                                               ; preds = %44
  %52 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = load i32, ptr %8, align 4, !tbaa !14
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds double, ptr %53, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !14
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  store double %57, ptr %61, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %51
  %63 = load i32, ptr %8, align 4, !tbaa !14
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !14
  br label %44, !llvm.loop !16

65:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #10
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %66

66:                                               ; preds = %195, %65
  %67 = load i32, ptr %10, align 4, !tbaa !14
  %68 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = invoke noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %69)
          to label %71 unwind label %74

71:                                               ; preds = %66
  %72 = icmp slt i32 %67, %70
  br i1 %72, label %78, label %73

73:                                               ; preds = %71
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  br label %201

74:                                               ; preds = %66
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %11, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %12, align 4
  br label %200

78:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %79 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = load i32, ptr %10, align 4, !tbaa !14
  %82 = invoke noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %80, i32 noundef %81)
          to label %83 unwind label %92

83:                                               ; preds = %78
  store ptr %82, ptr %14, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = load i32, ptr %10, align 4, !tbaa !14
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = fcmp oeq double %89, -1.000000e+00
  br i1 %90, label %91, label %96

91:                                               ; preds = %83
  store i32 7, ptr %13, align 4
  br label %192

92:                                               ; preds = %78
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %11, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %12, align 4
  br label %199

96:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %97 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = load double, ptr %5, align 8, !tbaa !9
  %101 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %98, ptr noundef %99, double noundef %100, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef null)
          to label %102 unwind label %109

102:                                              ; preds = %96
  store ptr %101, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  store double 0.000000e+00, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #10
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %103

103:                                              ; preds = %170, %102
  %104 = load i32, ptr %18, align 4, !tbaa !14
  %105 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %106 unwind label %113

106:                                              ; preds = %103
  %107 = icmp slt i32 %104, %105
  br i1 %107, label %117, label %108

108:                                              ; preds = %106
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  br label %175

109:                                              ; preds = %96
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %11, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %12, align 4
  br label %198

113:                                              ; preds = %103
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %11, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %12, align 4
  br label %174

117:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  %118 = load i32, ptr %18, align 4, !tbaa !14
  %119 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %118)
          to label %120 unwind label %134

120:                                              ; preds = %117
  store ptr %119, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %121 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = invoke noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %122, ptr noundef %123)
          to label %125 unwind label %138

125:                                              ; preds = %120
  store i32 %124, ptr %20, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load i32, ptr %20, align 4, !tbaa !14
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !9
  store double %130, ptr %21, align 8, !tbaa !9
  %131 = load double, ptr %21, align 8, !tbaa !9
  %132 = fcmp oeq double %131, -1.000000e+00
  br i1 %132, label %133, label %142

133:                                              ; preds = %125
  store i32 10, ptr %13, align 4
  br label %167

134:                                              ; preds = %117
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  br label %173

138:                                              ; preds = %120
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %11, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  br label %173

142:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load i32, ptr %20, align 4, !tbaa !14
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %143, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !9
  store double %147, ptr %22, align 8, !tbaa !9
  %148 = load double, ptr %22, align 8, !tbaa !9
  %149 = load double, ptr %5, align 8, !tbaa !9
  %150 = fcmp ogt double %148, %149
  br i1 %150, label %151, label %152

151:                                              ; preds = %142
  store i32 10, ptr %13, align 4
  br label %166

152:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %153 = load double, ptr %22, align 8, !tbaa !9
  %154 = load double, ptr %22, align 8, !tbaa !9
  %155 = fmul double %153, %154
  %156 = load double, ptr %6, align 8, !tbaa !9
  %157 = fdiv double %155, %156
  %158 = call double @exp(double noundef %157) #10
  store double %158, ptr %23, align 8, !tbaa !9
  %159 = load double, ptr %23, align 8, !tbaa !9
  %160 = load double, ptr %21, align 8, !tbaa !9
  %161 = load double, ptr %16, align 8, !tbaa !9
  %162 = call double @llvm.fmuladd.f64(double %159, double %160, double %161)
  store double %162, ptr %16, align 8, !tbaa !9
  %163 = load double, ptr %23, align 8, !tbaa !9
  %164 = load double, ptr %17, align 8, !tbaa !9
  %165 = fadd double %164, %163
  store double %165, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  store i32 0, ptr %13, align 4
  br label %166

166:                                              ; preds = %152, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %167

167:                                              ; preds = %166, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  %168 = load i32, ptr %13, align 4
  switch i32 %168, label %218 [
    i32 0, label %169
    i32 10, label %170
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %167
  %171 = load i32, ptr %18, align 4, !tbaa !14
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %18, align 4, !tbaa !14
  br label %103, !llvm.loop !18

173:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %174

174:                                              ; preds = %173, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br label %198

175:                                              ; preds = %108
  %176 = load double, ptr %17, align 8, !tbaa !9
  %177 = fcmp ogt double %176, 0.000000e+00
  br i1 %177, label %178, label %187

178:                                              ; preds = %175
  %179 = load double, ptr %16, align 8, !tbaa !9
  %180 = load double, ptr %17, align 8, !tbaa !9
  %181 = fdiv double %179, %180
  %182 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !15
  %184 = load i32, ptr %10, align 4, !tbaa !14
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %183, i64 %185
  store double %181, ptr %186, align 8, !tbaa !9
  br label %187

187:                                              ; preds = %178, %175
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = icmp eq ptr %188, null
  br i1 %189, label %191, label %190

190:                                              ; preds = %187
  call void @_ZdaPv(ptr noundef %188) #12
  br label %191

191:                                              ; preds = %190, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  store i32 0, ptr %13, align 4
  br label %192

192:                                              ; preds = %191, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  %193 = load i32, ptr %13, align 4
  switch i32 %193, label %218 [
    i32 0, label %194
    i32 7, label %195
  ]

194:                                              ; preds = %192
  br label %195

195:                                              ; preds = %194, %192
  %196 = load i32, ptr %10, align 4, !tbaa !14
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %10, align 4, !tbaa !14
  br label %66, !llvm.loop !19

198:                                              ; preds = %174, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  br label %199

199:                                              ; preds = %198, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  br label %200

200:                                              ; preds = %199, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  br label %212

201:                                              ; preds = %73
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = icmp eq ptr %202, null
  br i1 %203, label %205, label %204

204:                                              ; preds = %201
  call void @_ZdaPv(ptr noundef %202) #12
  br label %205

205:                                              ; preds = %204, %201
  invoke void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096) %24)
          to label %206 unwind label %208

206:                                              ; preds = %205
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  br label %207

207:                                              ; preds = %206, %27
  ret void

208:                                              ; preds = %205
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %11, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %12, align 4
  br label %212

212:                                              ; preds = %208, %200
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  br label %213

213:                                              ; preds = %212
  %214 = load ptr, ptr %11, align 8
  %215 = load i32, ptr %12, align 4
  %216 = insertvalue { ptr, i32 } poison, ptr %214, 0
  %217 = insertvalue { ptr, i32 } %216, i32 %215, 1
  resume { ptr, i32 } %217

218:                                              ; preds = %192, %167
  unreachable
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #6 = { 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 #7 = { "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 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { 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"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 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 #6

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

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

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

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

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

; 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: mustprogress uwtable
define dso_local void @_ZN14R3MeshProperty4BlurEd(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNArray, align 8
  %4 = fcmp oeq double %1, 0.000000e+00
  br i1 %4, label %90, label %5

5:                                                ; preds = %2
  %6 = fmul double %1, 3.000000e+00
  %7 = fmul double %1, -2.000000e+00
  %8 = fmul double %7, %1
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  %10 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %9)
  %11 = zext nneg i32 %10 to i64
  %12 = icmp slt i32 %10, 0
  %13 = shl nuw nsw i64 %11, 3
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #11
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %16)
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

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

._crit_edge:                                      ; preds = %21, %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #12
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %20 = getelementptr inbounds i8, ptr %0, i64 1040
  br label %30

21:                                               ; preds = %.lr.ph, %21
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %21 ]
  %22 = load ptr, ptr %19, align 8, !tbaa !12
  %23 = getelementptr inbounds double, ptr %22, i64 %indvars.iv
  %24 = load double, ptr %23, align 8, !tbaa !13
  %25 = getelementptr inbounds double, ptr %15, i64 %indvars.iv
  store double %24, ptr %25, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %26)
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %21, label %._crit_edge, !llvm.loop !14

30:                                               ; preds = %87, %._crit_edge
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %87 ], [ 0, %._crit_edge ]
  %31 = load ptr, ptr %0, align 8, !tbaa !5
  %32 = invoke noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %31)
          to label %33 unwind label %36

33:                                               ; preds = %30
  %34 = sext i32 %32 to i64
  %35 = icmp slt i64 %indvars.iv71, %34
  br i1 %35, label %38, label %89

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

38:                                               ; preds = %33
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = trunc nuw nsw i64 %indvars.iv71 to i32
  %41 = invoke noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %39, i32 noundef %40)
          to label %42 unwind label %47

42:                                               ; preds = %38
  %43 = load ptr, ptr %20, align 8, !tbaa !12
  %44 = getelementptr inbounds double, ptr %43, i64 %indvars.iv71
  %45 = load double, ptr %44, align 8, !tbaa !13
  %46 = fcmp oeq double %45, -1.000000e+00
  br i1 %46, label %87, label %49

47:                                               ; preds = %38
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %88

49:                                               ; preds = %42
  %50 = load ptr, ptr %0, align 8, !tbaa !5
  %51 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %50, ptr noundef %41, double noundef %6, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef null)
          to label %.preheader unwind label %55

.preheader:                                       ; preds = %49
  %52 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph67, label %._crit_edge68.thread

._crit_edge68:                                    ; preds = %77
  %54 = fcmp ogt double %.250, 0.000000e+00
  br i1 %54, label %81, label %._crit_edge68.thread

55:                                               ; preds = %49
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %88

.lr.ph67:                                         ; preds = %.preheader, %77
  %.04766 = phi i32 [ %78, %77 ], [ 0, %.preheader ]
  %.04865 = phi double [ %.250, %77 ], [ 0.000000e+00, %.preheader ]
  %.05164 = phi double [ %.253, %77 ], [ 0.000000e+00, %.preheader ]
  %57 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.04766)
          to label %58 unwind label %65

58:                                               ; preds = %.lr.ph67
  %59 = load ptr, ptr %0, align 8, !tbaa !5
  %60 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %59, ptr noundef %57)
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %15, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !13
  %64 = fcmp oeq double %63, -1.000000e+00
  br i1 %64, label %77, label %67

65:                                               ; preds = %.lr.ph67
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %88

67:                                               ; preds = %58
  %68 = getelementptr inbounds double, ptr %51, i64 %61
  %69 = load double, ptr %68, align 8, !tbaa !13
  %70 = fcmp ogt double %69, %6
  br i1 %70, label %77, label %71

71:                                               ; preds = %67
  %72 = fmul double %69, %69
  %73 = fdiv double %72, %8
  %74 = call double @exp(double noundef %73) #12
  %75 = call double @llvm.fmuladd.f64(double %74, double %63, double %.05164)
  %76 = fadd double %.04865, %74
  br label %77

77:                                               ; preds = %71, %67, %58
  %.253 = phi double [ %.05164, %58 ], [ %75, %71 ], [ %.05164, %67 ]
  %.250 = phi double [ %.04865, %58 ], [ %76, %71 ], [ %.04865, %67 ]
  %78 = add nuw nsw i32 %.04766, 1
  %79 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %.lr.ph67, label %._crit_edge68, !llvm.loop !16

81:                                               ; preds = %._crit_edge68
  %82 = fdiv double %.253, %.250
  %83 = load ptr, ptr %20, align 8, !tbaa !12
  %84 = getelementptr inbounds double, ptr %83, i64 %indvars.iv71
  store double %82, ptr %84, align 8, !tbaa !13
  br label %._crit_edge68.thread

._crit_edge68.thread:                             ; preds = %.preheader, %81, %._crit_edge68
  %85 = icmp eq ptr %51, null
  br i1 %85, label %87, label %86

86:                                               ; preds = %._crit_edge68.thread
  call void @_ZdaPv(ptr noundef nonnull %51) #13
  br label %87

87:                                               ; preds = %._crit_edge68.thread, %86, %42
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  br label %30, !llvm.loop !17

88:                                               ; preds = %47, %65, %55, %36
  %.pn.pn.pn = phi { ptr, i32 } [ %37, %36 ], [ %48, %47 ], [ %66, %65 ], [ %56, %55 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #12
  resume { ptr, i32 } %.pn.pn.pn

89:                                               ; preds = %33
  call void @_ZdaPv(ptr noundef nonnull %15) #13
  call void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096) %0)
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #12
  br label %90

90:                                               ; preds = %2, %89
  ret void
}

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { 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 #11 = { builtin allocsize(0) }
attributes #12 = { nounwind }
attributes #13 = { 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"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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