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

; 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 }
%class.R3Mesh = type { ptr, %class.RNArray, %class.RNArray.0, %class.RNArray.1, ptr, ptr, ptr, [128 x i8], %class.R3Box, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNArray.1 = type { %class.RNVArray }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.RNFlags = type { i64 }

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

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh23MergeCoincidentVerticesEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca [32 x [32 x [32 x %class.RNArray]]], align 16
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %23 = load ptr, ptr %3, align 8
  %24 = load double, ptr %4, align 8, !tbaa !9
  %25 = fcmp olt double %24, 0.000000e+00
  br i1 %25, label %26, label %30

26:                                               ; preds = %2
  %27 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %28 = call noundef double @_ZNK5R3Box14DiagonalLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %27)
  %29 = fmul double 1.000000e-04, %28
  store double %29, ptr %4, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %26, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 32, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 524288, ptr %6) #6
  %31 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i32 0, i32 0, i32 0, i32 0
  %32 = getelementptr inbounds %class.RNArray, ptr %31, i64 32768
  br label %33

33:                                               ; preds = %35, %30
  %34 = phi ptr [ %31, %30 ], [ %36, %35 ]
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %35 unwind label %46

35:                                               ; preds = %33
  %36 = getelementptr inbounds %class.RNArray, ptr %34, i64 1
  %37 = icmp eq ptr %36, %32
  br i1 %37, label %38, label %33

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %39

39:                                               ; preds = %162, %38
  %40 = load i32, ptr %9, align 4, !tbaa !11
  %41 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 1
  %42 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %41)
          to label %43 unwind label %56

43:                                               ; preds = %39
  %44 = icmp slt i32 %40, %42
  br i1 %44, label %60, label %45

45:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %169

46:                                               ; preds = %33
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  %50 = icmp eq ptr %31, %34
  br i1 %50, label %55, label %51

51:                                               ; preds = %51, %46
  %52 = phi ptr [ %34, %46 ], [ %53, %51 ]
  %53 = getelementptr inbounds %class.RNArray, ptr %52, i64 -1
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %53) #6
  %54 = icmp eq ptr %53, %31
  br i1 %54, label %55, label %51

55:                                               ; preds = %51, %46
  br label %313

56:                                               ; preds = %39
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %7, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %8, align 4
  br label %168

60:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %61 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 1
  %62 = load i32, ptr %9, align 4, !tbaa !11
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %61, i32 noundef %62)
          to label %64 unwind label %110

64:                                               ; preds = %60
  %65 = load ptr, ptr %63, align 8, !tbaa !5
  store ptr %65, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.R3MeshVertex, ptr %66, i32 0, i32 2
  store ptr %67, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = invoke noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %68)
          to label %70 unwind label %114

70:                                               ; preds = %64
  %71 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %72 = invoke noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %71)
          to label %73 unwind label %114

73:                                               ; preds = %70
  %74 = fsub double %69, %72
  %75 = fmul double 3.200000e+01, %74
  %76 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %77 = invoke noundef double @_ZNK5R3Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %76)
          to label %78 unwind label %114

78:                                               ; preds = %73
  %79 = fdiv double %75, %77
  %80 = fptosi double %79 to i32
  store i32 %80, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = invoke noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %81)
          to label %83 unwind label %118

83:                                               ; preds = %78
  %84 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %85 = invoke noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %84)
          to label %86 unwind label %118

86:                                               ; preds = %83
  %87 = fsub double %82, %85
  %88 = fmul double 3.200000e+01, %87
  %89 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %90 = invoke noundef double @_ZNK5R3Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %89)
          to label %91 unwind label %118

91:                                               ; preds = %86
  %92 = fdiv double %88, %90
  %93 = fptosi double %92 to i32
  store i32 %93, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %94)
          to label %96 unwind label %122

96:                                               ; preds = %91
  %97 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %98 = invoke noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %97)
          to label %99 unwind label %122

99:                                               ; preds = %96
  %100 = fsub double %95, %98
  %101 = fmul double 3.200000e+01, %100
  %102 = getelementptr inbounds %class.R3Mesh, ptr %23, i32 0, i32 8
  %103 = invoke noundef double @_ZNK5R3Box7ZLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %102)
          to label %104 unwind label %122

104:                                              ; preds = %99
  %105 = fdiv double %101, %103
  %106 = fptosi double %105 to i32
  store i32 %106, ptr %14, align 4, !tbaa !11
  %107 = load i32, ptr %12, align 4, !tbaa !11
  %108 = icmp slt i32 %107, 0
  br i1 %108, label %109, label %126

109:                                              ; preds = %104
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %131

110:                                              ; preds = %60
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %7, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %8, align 4
  br label %167

114:                                              ; preds = %73, %70, %64
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %7, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %8, align 4
  br label %166

118:                                              ; preds = %86, %83, %78
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  br label %165

122:                                              ; preds = %149, %99, %96, %91
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %7, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %165

126:                                              ; preds = %104
  %127 = load i32, ptr %12, align 4, !tbaa !11
  %128 = icmp sgt i32 %127, 31
  br i1 %128, label %129, label %130

129:                                              ; preds = %126
  store i32 31, ptr %12, align 4, !tbaa !11
  br label %130

130:                                              ; preds = %129, %126
  br label %131

131:                                              ; preds = %130, %109
  %132 = load i32, ptr %13, align 4, !tbaa !11
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %131
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %140

135:                                              ; preds = %131
  %136 = load i32, ptr %13, align 4, !tbaa !11
  %137 = icmp sgt i32 %136, 31
  br i1 %137, label %138, label %139

138:                                              ; preds = %135
  store i32 31, ptr %13, align 4, !tbaa !11
  br label %139

139:                                              ; preds = %138, %135
  br label %140

140:                                              ; preds = %139, %134
  %141 = load i32, ptr %14, align 4, !tbaa !11
  %142 = icmp slt i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %140
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %149

144:                                              ; preds = %140
  %145 = load i32, ptr %14, align 4, !tbaa !11
  %146 = icmp sgt i32 %145, 31
  br i1 %146, label %147, label %148

147:                                              ; preds = %144
  store i32 31, ptr %14, align 4, !tbaa !11
  br label %148

148:                                              ; preds = %147, %144
  br label %149

149:                                              ; preds = %148, %143
  %150 = load i32, ptr %12, align 4, !tbaa !11
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i64 0, i64 %151
  %153 = load i32, ptr %13, align 4, !tbaa !11
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [32 x [32 x %class.RNArray]], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %14, align 4, !tbaa !11
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [32 x %class.RNArray], ptr %155, i64 0, i64 %157
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %158, ptr noundef %159)
          to label %161 unwind label %122

161:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %9, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %9, align 4, !tbaa !11
  br label %39, !llvm.loop !13

165:                                              ; preds = %122, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %166

166:                                              ; preds = %165, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %167

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

168:                                              ; preds = %167, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %305

169:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %170

170:                                              ; preds = %294, %169
  %171 = load i32, ptr %15, align 4, !tbaa !11
  %172 = icmp slt i32 %171, 32
  br i1 %172, label %174, label %173

173:                                              ; preds = %170
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %297

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %175

175:                                              ; preds = %290, %174
  %176 = load i32, ptr %17, align 4, !tbaa !11
  %177 = icmp slt i32 %176, 32
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %293

179:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %180

180:                                              ; preds = %286, %179
  %181 = load i32, ptr %18, align 4, !tbaa !11
  %182 = icmp slt i32 %181, 32
  br i1 %182, label %184, label %183

183:                                              ; preds = %180
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %289

184:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %185

185:                                              ; preds = %280, %184
  %186 = load i32, ptr %19, align 4, !tbaa !11
  %187 = load i32, ptr %15, align 4, !tbaa !11
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i64 0, i64 %188
  %190 = load i32, ptr %17, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [32 x [32 x %class.RNArray]], ptr %189, i64 0, i64 %191
  %193 = load i32, ptr %18, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [32 x %class.RNArray], ptr %192, i64 0, i64 %194
  %196 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %195)
          to label %197 unwind label %200

197:                                              ; preds = %185
  %198 = icmp slt i32 %186, %196
  br i1 %198, label %204, label %199

199:                                              ; preds = %197
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %285

200:                                              ; preds = %185
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %7, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %8, align 4
  br label %284

204:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %205 = load i32, ptr %15, align 4, !tbaa !11
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i64 0, i64 %206
  %208 = load i32, ptr %17, align 4, !tbaa !11
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [32 x [32 x %class.RNArray]], ptr %207, i64 0, i64 %209
  %211 = load i32, ptr %18, align 4, !tbaa !11
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [32 x %class.RNArray], ptr %210, i64 0, i64 %212
  %214 = load i32, ptr %19, align 4, !tbaa !11
  %215 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %213, i32 noundef %214)
          to label %216 unwind label %234

216:                                              ; preds = %204
  store ptr %215, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %217 = load i32, ptr %19, align 4, !tbaa !11
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %21, align 4, !tbaa !11
  br label %219

219:                                              ; preds = %275, %216
  %220 = load i32, ptr %21, align 4, !tbaa !11
  %221 = load i32, ptr %15, align 4, !tbaa !11
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i64 0, i64 %222
  %224 = load i32, ptr %17, align 4, !tbaa !11
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [32 x [32 x %class.RNArray]], ptr %223, i64 0, i64 %225
  %227 = load i32, ptr %18, align 4, !tbaa !11
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [32 x %class.RNArray], ptr %226, i64 0, i64 %228
  %230 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %229)
          to label %231 unwind label %238

231:                                              ; preds = %219
  %232 = icmp slt i32 %220, %230
  br i1 %232, label %242, label %233

233:                                              ; preds = %231
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %279

234:                                              ; preds = %204
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %7, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %8, align 4
  br label %283

238:                                              ; preds = %219
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %7, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %8, align 4
  br label %278

242:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %243 = load i32, ptr %15, align 4, !tbaa !11
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i64 0, i64 %244
  %246 = load i32, ptr %17, align 4, !tbaa !11
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [32 x [32 x %class.RNArray]], ptr %245, i64 0, i64 %247
  %249 = load i32, ptr %18, align 4, !tbaa !11
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [32 x %class.RNArray], ptr %248, i64 0, i64 %250
  %252 = load i32, ptr %21, align 4, !tbaa !11
  %253 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %251, i32 noundef %252)
          to label %254 unwind label %270

254:                                              ; preds = %242
  store ptr %253, ptr %22, align 8, !tbaa !5
  %255 = load ptr, ptr %20, align 8, !tbaa !5
  %256 = getelementptr inbounds %class.R3MeshVertex, ptr %255, i32 0, i32 2
  %257 = load ptr, ptr %22, align 8, !tbaa !5
  %258 = getelementptr inbounds %class.R3MeshVertex, ptr %257, i32 0, i32 2
  %259 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %256, ptr noundef nonnull align 8 dereferenceable(24) %258)
          to label %260 unwind label %270

260:                                              ; preds = %254
  %261 = icmp ne i32 %259, 0
  br i1 %261, label %262, label %274

262:                                              ; preds = %260
  %263 = load ptr, ptr %20, align 8, !tbaa !5
  %264 = load ptr, ptr %22, align 8, !tbaa !5
  %265 = load ptr, ptr %23, align 8, !tbaa !15
  %266 = getelementptr inbounds ptr, ptr %265, i64 17
  %267 = load ptr, ptr %266, align 8
  %268 = invoke noundef ptr %267(ptr noundef nonnull align 8 dereferenceable(272) %23, ptr noundef %263, ptr noundef %264)
          to label %269 unwind label %270

269:                                              ; preds = %262
  br label %274

270:                                              ; preds = %262, %254, %242
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %7, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %278

274:                                              ; preds = %269, %260
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %275

275:                                              ; preds = %274
  %276 = load i32, ptr %21, align 4, !tbaa !11
  %277 = add nsw i32 %276, 1
  store i32 %277, ptr %21, align 4, !tbaa !11
  br label %219, !llvm.loop !17

278:                                              ; preds = %270, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %283

279:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %280

280:                                              ; preds = %279
  %281 = load i32, ptr %19, align 4, !tbaa !11
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %19, align 4, !tbaa !11
  br label %185, !llvm.loop !18

283:                                              ; preds = %278, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %284

284:                                              ; preds = %283, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %305

285:                                              ; preds = %199
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %18, align 4, !tbaa !11
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %18, align 4, !tbaa !11
  br label %180, !llvm.loop !19

289:                                              ; preds = %183
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %17, align 4, !tbaa !11
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %17, align 4, !tbaa !11
  br label %175, !llvm.loop !20

293:                                              ; preds = %178
  br label %294

294:                                              ; preds = %293
  %295 = load i32, ptr %15, align 4, !tbaa !11
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %15, align 4, !tbaa !11
  br label %170, !llvm.loop !21

297:                                              ; preds = %173
  %298 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i32 0, i32 0, i32 0, i32 0
  %299 = getelementptr inbounds %class.RNArray, ptr %298, i64 32768
  br label %300

300:                                              ; preds = %300, %297
  %301 = phi ptr [ %299, %297 ], [ %302, %300 ]
  %302 = getelementptr inbounds %class.RNArray, ptr %301, i64 -1
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %302) #6
  %303 = icmp eq ptr %302, %298
  br i1 %303, label %304, label %300

304:                                              ; preds = %300
  call void @llvm.lifetime.end.p0(i64 524288, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void

305:                                              ; preds = %284, %168
  %306 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %6, i32 0, i32 0, i32 0, i32 0
  %307 = getelementptr inbounds %class.RNArray, ptr %306, i64 32768
  br label %308

308:                                              ; preds = %308, %305
  %309 = phi ptr [ %307, %305 ], [ %310, %308 ]
  %310 = getelementptr inbounds %class.RNArray, ptr %309, i64 -1
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %310) #6
  %311 = icmp eq ptr %310, %306
  br i1 %311, label %312, label %308

312:                                              ; preds = %308
  br label %313

313:                                              ; preds = %312, %55
  call void @llvm.lifetime.end.p0(i64 524288, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %314

314:                                              ; preds = %313
  %315 = load ptr, ptr %7, align 8
  %316 = load i32, ptr %8, align 4
  %317 = insertvalue { ptr, i32 } poison, ptr %315, 0
  %318 = insertvalue { ptr, i32 } %317, i32 %316, 1
  resume { ptr, i32 } %318
}

declare noundef double @_ZNK5R3Box14DiagonalLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7ZLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

declare noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

attributes #0 = { 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 = { 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 #3 = { "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 = { 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 #5 = { 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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

%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh23MergeCoincidentVerticesEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [32 x [32 x [32 x %class.RNArray]]], align 16
  %4 = fcmp olt double %1, 0.000000e+00
  br i1 %4, label %5, label %8

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = tail call noundef double @_ZNK5R3Box14DiagonalLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  br label %8

8:                                                ; preds = %5, %2
  call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %3) #7
  %9 = getelementptr inbounds i8, ptr %3, i64 524288
  br label %10

10:                                               ; preds = %11, %8
  %.idx = phi i64 [ 0, %8 ], [ %.add, %11 ]
  %.ptr = getelementptr inbounds i8, ptr %3, i64 %.idx
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr)
          to label %11 unwind label %17

11:                                               ; preds = %10
  %.add = add nuw nsw i64 %.idx, 16
  %12 = icmp eq i64 %.add, 524288
  br i1 %12, label %.preheader86, label %10

.preheader86:                                     ; preds = %11
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader84.preheader

.lr.ph:                                           ; preds = %.preheader86
  %16 = getelementptr inbounds i8, ptr %0, i64 208
  br label %23

17:                                               ; preds = %10
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = icmp eq i64 %.idx, 0
  br i1 %19, label %.loopexit, label %.preheader87

.preheader87:                                     ; preds = %17, %.preheader87
  %20 = phi ptr [ %21, %.preheader87 ], [ %.ptr, %17 ]
  %21 = getelementptr inbounds i8, ptr %20, i64 -16
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  %22 = icmp eq ptr %21, %3
  br i1 %22, label %.loopexit, label %.preheader87

23:                                               ; preds = %.lr.ph, %65
  %.06591 = phi i32 [ 0, %.lr.ph ], [ %66, %65 ]
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %.06591)
          to label %25 unwind label %57

25:                                               ; preds = %23
  %26 = load ptr, ptr %24, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %29 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
  %30 = invoke noundef double @_ZNK5R3Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
          to label %31 unwind label %59

31:                                               ; preds = %25
  %32 = fsub double %28, %29
  %33 = fmul double %32, 3.200000e+01
  %34 = fdiv double %33, %30
  %35 = fptosi double %34 to i32
  %36 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %37 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
  %38 = invoke noundef double @_ZNK5R3Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
          to label %39 unwind label %61

39:                                               ; preds = %31
  %40 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %41 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
  %42 = invoke noundef double @_ZNK5R3Box7ZLengthEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
          to label %43 unwind label %63

43:                                               ; preds = %39
  %44 = fsub double %36, %37
  %45 = fmul double %44, 3.200000e+01
  %46 = fdiv double %45, %38
  %47 = fptosi double %46 to i32
  %48 = fsub double %40, %41
  %49 = fmul double %48, 3.200000e+01
  %50 = fdiv double %49, %42
  %51 = fptosi double %50 to i32
  %spec.store.select = call i32 @llvm.smin.i32(i32 %35, i32 31)
  %.058 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 0)
  %spec.store.select1 = call i32 @llvm.smin.i32(i32 %47, i32 31)
  %.057 = call i32 @llvm.smax.i32(i32 %spec.store.select1, i32 0)
  %spec.store.select2 = call i32 @llvm.smin.i32(i32 %51, i32 31)
  %.056 = call i32 @llvm.smax.i32(i32 %spec.store.select2, i32 0)
  %52 = zext nneg i32 %.058 to i64
  %53 = zext nneg i32 %.057 to i64
  %54 = zext nneg i32 %.056 to i64
  %55 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %3, i64 0, i64 %52, i64 %53, i64 %54
  %56 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef %26)
          to label %65 unwind label %63

57:                                               ; preds = %23
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %105

59:                                               ; preds = %25
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %105

61:                                               ; preds = %31
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %105

63:                                               ; preds = %43, %39
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %105

65:                                               ; preds = %43
  %66 = add nuw nsw i32 %.06591, 1
  %67 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %23, label %.preheader84.preheader, !llvm.loop !9

.preheader84.preheader:                           ; preds = %65, %.preheader86
  br label %.preheader84

.preheader84:                                     ; preds = %.preheader84.preheader, %69
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %69 ], [ 0, %.preheader84.preheader ]
  br label %.preheader83

.preheader83:                                     ; preds = %.preheader84, %73
  %indvars.iv103 = phi i64 [ 0, %.preheader84 ], [ %indvars.iv.next104, %73 ]
  br label %.preheader82

69:                                               ; preds = %73
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next108, 32
  br i1 %exitcond110.not, label %.preheader, label %.preheader84, !llvm.loop !11

.preheader82:                                     ; preds = %.preheader83, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.preheader83 ], [ %indvars.iv.next, %._crit_edge ]
  %70 = getelementptr inbounds [32 x [32 x [32 x %class.RNArray]]], ptr %3, i64 0, i64 %indvars.iv107, i64 %indvars.iv103, i64 %indvars.iv
  %71 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %70)
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph95, label %._crit_edge

73:                                               ; preds = %._crit_edge
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next104, 32
  br i1 %exitcond106.not, label %69, label %.preheader83, !llvm.loop !12

.loopexit81:                                      ; preds = %97, %77
  %74 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %70)
  %75 = icmp slt i32 %78, %74
  br i1 %75, label %.lr.ph95, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.loopexit81, %.preheader82
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 32
  br i1 %exitcond.not, label %73, label %.preheader82, !llvm.loop !14

.lr.ph95:                                         ; preds = %.preheader82, %.loopexit81
  %.05294 = phi i32 [ %78, %.loopexit81 ], [ 0, %.preheader82 ]
  %76 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %70, i32 noundef %.05294)
          to label %77 unwind label %82

77:                                               ; preds = %.lr.ph95
  %78 = add nuw nsw i32 %.05294, 1
  %79 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %70)
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %.lr.ph93, label %.loopexit81

.lr.ph93:                                         ; preds = %77
  %81 = getelementptr inbounds i8, ptr %76, i64 24
  br label %84

82:                                               ; preds = %.lr.ph95
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %105

84:                                               ; preds = %.lr.ph93, %97
  %.092 = phi i32 [ %78, %.lr.ph93 ], [ %98, %97 ]
  %85 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %70, i32 noundef %.092)
          to label %86 unwind label %95

86:                                               ; preds = %84
  %87 = getelementptr inbounds i8, ptr %85, i64 24
  %88 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 8 dereferenceable(24) %87)
          to label %89 unwind label %95

89:                                               ; preds = %86
  %.not = icmp eq i32 %88, 0
  br i1 %.not, label %97, label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %0, align 8, !tbaa !15
  %92 = getelementptr inbounds i8, ptr %91, i64 136
  %93 = load ptr, ptr %92, align 8
  %94 = invoke noundef ptr %93(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %76, ptr noundef %85)
          to label %97 unwind label %95

95:                                               ; preds = %90, %86, %84
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %105

97:                                               ; preds = %90, %89
  %98 = add nuw nsw i32 %.092, 1
  %99 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %70)
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %84, label %.loopexit81, !llvm.loop !17

.preheader:                                       ; preds = %69, %.preheader
  %101 = phi ptr [ %102, %.preheader ], [ %9, %69 ]
  %102 = getelementptr inbounds i8, ptr %101, i64 -16
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %102) #7
  %103 = icmp eq ptr %102, %3
  br i1 %103, label %104, label %.preheader

104:                                              ; preds = %.preheader
  call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %3) #7
  ret void

105:                                              ; preds = %82, %95, %57, %61, %63, %59
  %.pn75.pn.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %60, %59 ], [ %64, %63 ], [ %62, %61 ], [ %96, %95 ], [ %83, %82 ]
  br label %106

106:                                              ; preds = %106, %105
  %107 = phi ptr [ %9, %105 ], [ %108, %106 ]
  %108 = getelementptr inbounds i8, ptr %107, i64 -16
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %108) #7
  %109 = icmp eq ptr %108, %3
  br i1 %109, label %.loopexit, label %106

.loopexit:                                        ; preds = %.preheader87, %106, %17
  %.pn75.pn.pn.pn.pn = phi { ptr, i32 } [ %18, %17 ], [ %.pn75.pn.pn.pn, %106 ], [ %18, %.preheader87 ]
  call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn75.pn.pn.pn.pn
}

declare noundef double @_ZNK5R3Box14DiagonalLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R3Box7ZLengthEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

declare noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

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

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

attributes #0 = { 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 = { 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 #3 = { "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 = { 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 #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = distinct !{!17, !10}


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