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

; 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 }
%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)) #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK14R3MeshProperty11VertexValueEi(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef) #6 align 2

; 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
declare dso_local noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14R3MeshProperty22NonExtremumSuppressionEdii(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef %1, i32 noundef %2, i32 noundef %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.R3MeshProperty, 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 double, align 8
  %16 = alloca %class.RNArray, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  store i32 %3, ptr %8, align 4, !tbaa !11
  %24 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1096, ptr %9) #8
  call void @_ZN14R3MeshPropertyC1ERKS_(ptr noundef nonnull align 8 dereferenceable(1096) %9, ptr noundef nonnull align 8 dereferenceable(1096) %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %172, %4
  %26 = load i32, ptr %10, align 4, !tbaa !11
  %27 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = invoke noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %28)
          to label %30 unwind label %33

30:                                               ; preds = %25
  %31 = icmp slt i32 %26, %29
  br i1 %31, label %37, label %32

32:                                               ; preds = %30
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %185

33:                                               ; preds = %37, %25
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %11, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %12, align 4
  br label %184

37:                                               ; preds = %30
  %38 = load i32, ptr %10, align 4, !tbaa !11
  %39 = invoke noundef double @_ZNK14R3MeshProperty11VertexValueEi(ptr noundef nonnull align 8 dereferenceable(1096) %9, i32 noundef %38)
          to label %40 unwind label %33

40:                                               ; preds = %37
  %41 = fcmp oeq double %39, -1.000000e+00
  br i1 %41, label %42, label %43

42:                                               ; preds = %40
  br label %172

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %44 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = load i32, ptr %10, align 4, !tbaa !11
  %47 = invoke noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %45, i32 noundef %46)
          to label %48 unwind label %68

48:                                               ; preds = %43
  store ptr %47, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %49 = load i32, ptr %10, align 4, !tbaa !11
  %50 = invoke noundef double @_ZNK14R3MeshProperty11VertexValueEi(ptr noundef nonnull align 8 dereferenceable(1096) %9, i32 noundef %49)
          to label %51 unwind label %72

51:                                               ; preds = %48
  store double %50, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %52 unwind label %76

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %53 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = load double, ptr %6, align 8, !tbaa !9
  %57 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %54, ptr noundef %55, double noundef %56, ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef null)
          to label %58 unwind label %80

58:                                               ; preds = %52
  store ptr %57, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %59

59:                                               ; preds = %97, %58
  %60 = load i32, ptr %18, align 4, !tbaa !11
  %61 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = invoke noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %62, ptr noundef %63)
          to label %65 unwind label %84

65:                                               ; preds = %59
  %66 = icmp slt i32 %60, %64
  br i1 %66, label %88, label %67

67:                                               ; preds = %65
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %100

68:                                               ; preds = %43
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %11, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %12, align 4
  br label %183

72:                                               ; preds = %48
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %11, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %12, align 4
  br label %182

76:                                               ; preds = %51
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %11, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %12, align 4
  br label %181

80:                                               ; preds = %52
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %11, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %12, align 4
  br label %180

84:                                               ; preds = %94, %88, %59
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %11, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %180

88:                                               ; preds = %65
  %89 = getelementptr inbounds %struct.R3MeshProperty, ptr %24, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = load i32, ptr %18, align 4, !tbaa !11
  %93 = invoke noundef ptr @_ZNK6R3Mesh14VertexOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %90, ptr noundef %91, i32 noundef %92)
          to label %94 unwind label %84

94:                                               ; preds = %88
  %95 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %93)
          to label %96 unwind label %84

96:                                               ; preds = %94
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %18, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %18, align 4, !tbaa !11
  br label %59, !llvm.loop !15

100:                                              ; preds = %67
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @_ZdaPv(ptr noundef %101) #9
  br label %104

104:                                              ; preds = %103, %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 1, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 1, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %147, %104
  %106 = load i32, ptr %21, align 4, !tbaa !11
  %107 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %108 unwind label %111

108:                                              ; preds = %105
  %109 = icmp slt i32 %106, %107
  br i1 %109, label %115, label %110

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

111:                                              ; preds = %105
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %11, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %12, align 4
  br label %151

115:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %116 = load i32, ptr %21, align 4, !tbaa !11
  %117 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %116)
          to label %118 unwind label %125

118:                                              ; preds = %115
  store ptr %117, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %119 = load ptr, ptr %22, align 8, !tbaa !5
  %120 = invoke noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %9, ptr noundef %119)
          to label %121 unwind label %129

121:                                              ; preds = %118
  store double %120, ptr %23, align 8, !tbaa !9
  %122 = load double, ptr %23, align 8, !tbaa !9
  %123 = fcmp oeq double %122, -1.000000e+00
  br i1 %123, label %124, label %133

124:                                              ; preds = %121
  store i32 10, ptr %13, align 4
  br label %144

125:                                              ; preds = %115
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %11, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %12, align 4
  br label %150

129:                                              ; preds = %118
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %11, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %150

133:                                              ; preds = %121
  %134 = load double, ptr %23, align 8, !tbaa !9
  %135 = load double, ptr %15, align 8, !tbaa !9
  %136 = fcmp olt double %134, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %138

138:                                              ; preds = %137, %133
  %139 = load double, ptr %23, align 8, !tbaa !9
  %140 = load double, ptr %15, align 8, !tbaa !9
  %141 = fcmp ogt double %139, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %138
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %143

143:                                              ; preds = %142, %138
  store i32 0, ptr %13, align 4
  br label %144

144:                                              ; preds = %143, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  %145 = load i32, ptr %13, align 4
  switch i32 %145, label %197 [
    i32 0, label %146
    i32 10, label %147
  ]

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146, %144
  %148 = load i32, ptr %21, align 4, !tbaa !11
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %21, align 4, !tbaa !11
  br label %105, !llvm.loop !17

150:                                              ; preds = %129, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %151

151:                                              ; preds = %150, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %179

152:                                              ; preds = %110
  %153 = load i32, ptr %7, align 4, !tbaa !11
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %159

155:                                              ; preds = %152
  %156 = load i32, ptr %19, align 4, !tbaa !11
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %159

158:                                              ; preds = %155
  store i32 4, ptr %13, align 4
  br label %169

159:                                              ; preds = %155, %152
  %160 = load i32, ptr %8, align 4, !tbaa !11
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %166

162:                                              ; preds = %159
  %163 = load i32, ptr %20, align 4, !tbaa !11
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %162
  store i32 4, ptr %13, align 4
  br label %169

166:                                              ; preds = %162, %159
  %167 = load i32, ptr %10, align 4, !tbaa !11
  invoke void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096) %24, i32 noundef %167, double noundef -1.000000e+00)
          to label %168 unwind label %175

168:                                              ; preds = %166
  store i32 0, ptr %13, align 4
  br label %169

169:                                              ; preds = %168, %165, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %170 = load i32, ptr %13, align 4
  switch i32 %170, label %197 [
    i32 0, label %171
    i32 4, label %172
  ]

171:                                              ; preds = %169
  br label %172

172:                                              ; preds = %171, %169, %42
  %173 = load i32, ptr %10, align 4, !tbaa !11
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %10, align 4, !tbaa !11
  br label %25, !llvm.loop !18

175:                                              ; preds = %166
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %11, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %12, align 4
  br label %179

179:                                              ; preds = %175, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %180

180:                                              ; preds = %179, %84, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #8
  br label %181

181:                                              ; preds = %180, %76
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  br label %182

182:                                              ; preds = %181, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %183

183:                                              ; preds = %182, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %184

184:                                              ; preds = %183, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %191

185:                                              ; preds = %32
  invoke void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096) %24)
          to label %186 unwind label %187

186:                                              ; preds = %185
  call void @_ZN14R3MeshPropertyD1Ev(ptr noundef nonnull align 8 dereferenceable(1096) %9) #8
  call void @llvm.lifetime.end.p0(i64 1096, ptr %9) #8
  ret void

187:                                              ; preds = %185
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %11, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %12, align 4
  br label %191

191:                                              ; preds = %187, %184
  call void @_ZN14R3MeshPropertyD1Ev(ptr noundef nonnull align 8 dereferenceable(1096) %9) #8
  call void @llvm.lifetime.end.p0(i64 1096, ptr %9) #8
  br label %192

192:                                              ; preds = %191
  %193 = load ptr, ptr %11, align 8
  %194 = load i32, ptr %12, align 4
  %195 = insertvalue { ptr, i32 } poison, ptr %193, 0
  %196 = insertvalue { ptr, i32 } %195, i32 %194, 1
  resume { ptr, i32 } %196

197:                                              ; preds = %169, %144
  unreachable
}

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

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

declare void @_ZN14R3MeshPropertyC1ERKS_(ptr, ptr)

declare void @_ZN14R3MeshPropertyD1Ev(ptr)

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

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

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

%struct.R3MeshProperty = type { ptr, [1024 x i8], i32, ptr, double, double, double, double, double, double }
%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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

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

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

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

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

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

; 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
declare dso_local noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14R3MeshProperty22NonExtremumSuppressionEdii(ptr noundef nonnull align 8 dereferenceable(1096) %0, double noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.R3MeshProperty, align 8
  %6 = alloca %class.RNArray, align 8
  call void @llvm.lifetime.start.p0(i64 1096, ptr nonnull %5) #8
  call void @_ZN14R3MeshPropertyC1ERKS_(ptr noundef nonnull align 8 dereferenceable(1096) %5, ptr noundef nonnull align 8 dereferenceable(1096) %0)
  %7 = icmp ne i32 %2, 0
  %8 = icmp ne i32 %3, 0
  br label %9

9:                                                ; preds = %71, %4
  %.0 = phi i32 [ 0, %4 ], [ %72, %71 ]
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %11 = invoke noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %10)
          to label %12 unwind label %15

12:                                               ; preds = %9
  %13 = icmp slt i32 %.0, %11
  br i1 %13, label %17, label %14

14:                                               ; preds = %12
  call void @_ZN14R3MeshProperty15ResetStatisticsEv(ptr noundef nonnull align 8 dereferenceable(1096) %0)
  call void @_ZN14R3MeshPropertyD1Ev(ptr noundef nonnull align 8 dereferenceable(1096) %5) #8
  call void @llvm.lifetime.end.p0(i64 1096, ptr nonnull %5) #8
  ret void

15:                                               ; preds = %9
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %77

17:                                               ; preds = %12
  %18 = call noundef double @_ZNK14R3MeshProperty11VertexValueEi(ptr noundef nonnull align 8 dereferenceable(1096) %5, i32 noundef %.0)
  %19 = fcmp oeq double %18, -1.000000e+00
  br i1 %19, label %71, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %22 = invoke noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %21, i32 noundef %.0)
          to label %23 unwind label %32

23:                                               ; preds = %20
  %24 = call noundef double @_ZNK14R3MeshProperty11VertexValueEi(ptr noundef nonnull align 8 dereferenceable(1096) %5, i32 noundef %.0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %25 unwind label %34

25:                                               ; preds = %23
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = invoke noundef ptr @_ZNK6R3Mesh17DijkstraDistancesEPK12R3MeshVertexdR7RNArrayIPS0_EPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %26, ptr noundef %22, double noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef null)
          to label %.preheader unwind label %36

.preheader:                                       ; preds = %25
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %22)
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %44, %.preheader
  %31 = icmp eq ptr %27, null
  br i1 %31, label %50, label %49

32:                                               ; preds = %20
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %77

34:                                               ; preds = %23
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %76

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

38:                                               ; preds = %42, %.lr.ph
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %75

.lr.ph:                                           ; preds = %.preheader, %44
  %.04060 = phi i32 [ %45, %44 ], [ 0, %.preheader ]
  %40 = load ptr, ptr %0, align 8, !tbaa !5
  %41 = invoke noundef ptr @_ZNK6R3Mesh14VertexOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %40, ptr noundef %22, i32 noundef %.04060)
          to label %42 unwind label %38

42:                                               ; preds = %.lr.ph
  %43 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %41)
          to label %44 unwind label %38

44:                                               ; preds = %42
  %45 = add nuw nsw i32 %.04060, 1
  %46 = load ptr, ptr %0, align 8, !tbaa !5
  %47 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %46, ptr noundef %22)
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !12

49:                                               ; preds = %._crit_edge
  call void @_ZdaPv(ptr noundef nonnull %27) #9
  br label %50

50:                                               ; preds = %49, %._crit_edge
  %51 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph65, label %._crit_edge66

._crit_edge66:                                    ; preds = %58, %50
  %.037.lcssa = phi i32 [ 1, %50 ], [ %.239, %58 ]
  %.034.lcssa = phi i32 [ 1, %50 ], [ %.236, %58 ]
  %53 = icmp ne i32 %.037.lcssa, 0
  %or.cond = select i1 %7, i1 %53, i1 false
  %54 = icmp ne i32 %.034.lcssa, 0
  %or.cond3 = select i1 %8, i1 %54, i1 false
  %or.cond68 = select i1 %or.cond, i1 true, i1 %or.cond3
  br i1 %or.cond68, label %70, label %69

.lr.ph65:                                         ; preds = %50, %58
  %.03363 = phi i32 [ %62, %58 ], [ 0, %50 ]
  %.03462 = phi i32 [ %.236, %58 ], [ 1, %50 ]
  %.03761 = phi i32 [ %.239, %58 ], [ 1, %50 ]
  %55 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.03363)
          to label %56 unwind label %65

56:                                               ; preds = %.lr.ph65
  %57 = invoke noundef double @_ZNK14R3MeshProperty11VertexValueEP12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(1096) %5, ptr noundef %55)
          to label %58 unwind label %67

58:                                               ; preds = %56
  %59 = fcmp oeq double %57, -1.000000e+00
  %60 = fcmp olt double %57, %24
  %.138 = select i1 %60, i32 0, i32 %.03761
  %61 = fcmp ogt double %57, %24
  %.135 = select i1 %61, i32 0, i32 %.03462
  %.239 = select i1 %59, i32 %.03761, i32 %.138
  %.236 = select i1 %59, i32 %.03462, i32 %.135
  %62 = add nuw nsw i32 %.03363, 1
  %63 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph65, label %._crit_edge66, !llvm.loop !14

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

67:                                               ; preds = %56
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %75

69:                                               ; preds = %._crit_edge66
  invoke void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %.0, double noundef -1.000000e+00)
          to label %70 unwind label %73

70:                                               ; preds = %69, %._crit_edge66
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  br label %71

71:                                               ; preds = %70, %17
  %72 = add nuw nsw i32 %.0, 1
  br label %9, !llvm.loop !15

73:                                               ; preds = %69
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %75

75:                                               ; preds = %73, %67, %65, %38, %36
  %.pn51 = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ], [ %74, %73 ], [ %68, %67 ], [ %66, %65 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  br label %76

76:                                               ; preds = %75, %34
  %.pn51.pn = phi { ptr, i32 } [ %.pn51, %75 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  br label %77

77:                                               ; preds = %32, %76, %15
  %.pn51.pn.pn.pn = phi { ptr, i32 } [ %16, %15 ], [ %.pn51.pn, %76 ], [ %33, %32 ]
  call void @_ZN14R3MeshPropertyD1Ev(ptr noundef nonnull align 8 dereferenceable(1096) %5) #8
  call void @llvm.lifetime.end.p0(i64 1096, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn51.pn.pn.pn
}

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

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

declare void @_ZN14R3MeshPropertyC1ERKS_(ptr, ptr) local_unnamed_addr

declare void @_ZN14R3MeshPropertyD1Ev(ptr) local_unnamed_addr

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

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

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


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