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

; 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.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

@RN_EPSILON = external global double, align 8
@R3null_plane = external global %class.R3Plane, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15R3PrincipleAxesRK7R3PointRK7RNArrayIPS_EPKdPd(ptr dead_on_unwind noalias writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z22R3EstimatePlaneWithPCARK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Plane) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

declare void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #3 align 2

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25R3EstimatePlaneWithRansacRK7RNArrayIP7R3PointEPKddiPdS7_(ptr dead_on_unwind noalias writable sret(%class.R3Plane) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, double noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) #2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [3 x double], align 16
  %16 = alloca %class.RNArray, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i1, align 1
  %23 = alloca %class.R3Point, align 8
  %24 = alloca %class.R3Triad, align 8
  %25 = alloca i32, align 4
  %26 = alloca %class.R3Plane, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca %class.R3Plane, align 8
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  %41 = alloca double, align 8
  %42 = alloca double, align 8
  %43 = alloca %class.R3Plane, align 8
  store ptr %0, ptr %8, align 8
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store double %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !11
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %44)
  %46 = icmp slt i32 %45, 3
  br i1 %46, label %47, label %48

47:                                               ; preds = %7
  call void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
  br label %388

48:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  call void @_ZN7RNArrayIP7R3PointEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  store i1 false, ptr %22, align 1
  br i1 %50, label %51, label %62

51:                                               ; preds = %48
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %52)
          to label %54 unwind label %79

54:                                               ; preds = %51
  %55 = sext i32 %53 to i64
  %56 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %55, i64 8)
  %57 = extractvalue { i64, i1 } %56, 1
  %58 = extractvalue { i64, i1 } %56, 0
  %59 = select i1 %57, i64 -1, i64 %58
  %60 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %59) #9
          to label %61 unwind label %79

61:                                               ; preds = %54
  store ptr %60, ptr %20, align 8
  store i64 %59, ptr %21, align 8
  store i1 true, ptr %22, align 1
  br label %63

62:                                               ; preds = %48
  br label %63

63:                                               ; preds = %62, %61
  %64 = phi ptr [ %60, %61 ], [ null, %62 ]
  store ptr %64, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #8
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %23, ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef null)
          to label %66 unwind label %83

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 72, ptr %24) #8
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 0
  invoke void @_Z15R3PrincipleAxesRK7R3PointRK7RNArrayIPS_EPKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef %68, ptr noundef %69)
          to label %70 unwind label %87

70:                                               ; preds = %66
  %71 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 1
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %74 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %72, double noundef %73)
          to label %75 unwind label %87

75:                                               ; preds = %70
  %76 = icmp ne i32 %74, 0
  br i1 %76, label %77, label %91

77:                                               ; preds = %75
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
          to label %78 unwind label %87

78:                                               ; preds = %77
  store i32 1, ptr %25, align 4
  br label %384

79:                                               ; preds = %54, %51
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %18, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %19, align 4
  br label %387

83:                                               ; preds = %63
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %18, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %19, align 4
  br label %386

87:                                               ; preds = %77, %70, %66
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %18, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %19, align 4
  br label %385

91:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #8
  %92 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %24, i32 noundef 2)
          to label %93 unwind label %101

93:                                               ; preds = %91
  invoke void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %92)
          to label %94 unwind label %101

94:                                               ; preds = %93
  %95 = load double, ptr %11, align 8, !tbaa !9
  %96 = fcmp oeq double %95, 0.000000e+00
  br i1 %96, label %97, label %105

97:                                               ; preds = %94
  %98 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 2
  %99 = load double, ptr %98, align 16, !tbaa !9
  %100 = call double @sqrt(double noundef %99) #8
  store double %100, ptr %11, align 8, !tbaa !9
  br label %105

101:                                              ; preds = %163, %93, %91
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %18, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %19, align 4
  br label %383

105:                                              ; preds = %97, %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %158, %105
  %107 = load i32, ptr %27, align 4, !tbaa !11
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %108)
          to label %110 unwind label %113

110:                                              ; preds = %106
  %111 = icmp slt i32 %107, %109
  br i1 %111, label %117, label %112

112:                                              ; preds = %110
  store i32 2, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %163

113:                                              ; preds = %106
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %18, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %19, align 4
  br label %162

117:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = load i32, ptr %27, align 4, !tbaa !11
  %120 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %118, i32 noundef %119)
          to label %121 unwind label %129

121:                                              ; preds = %117
  store ptr %120, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %122 = load ptr, ptr %28, align 8, !tbaa !5
  %123 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(24) %122)
          to label %124 unwind label %133

124:                                              ; preds = %121
  store double %123, ptr %29, align 8, !tbaa !9
  %125 = load double, ptr %29, align 8, !tbaa !9
  %126 = load double, ptr %11, align 8, !tbaa !9
  %127 = fcmp ogt double %125, %126
  br i1 %127, label %128, label %137

128:                                              ; preds = %124
  store i32 4, ptr %25, align 4
  br label %155

129:                                              ; preds = %117
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %18, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %19, align 4
  br label %161

133:                                              ; preds = %151, %140, %121
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %18, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %161

137:                                              ; preds = %124
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %151

140:                                              ; preds = %137
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = load i32, ptr %27, align 4, !tbaa !11
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %141, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !9
  %146 = load ptr, ptr %17, align 8, !tbaa !5
  %147 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %148 unwind label %133

148:                                              ; preds = %140
  %149 = sext i32 %147 to i64
  %150 = getelementptr inbounds double, ptr %146, i64 %149
  store double %145, ptr %150, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %148, %137
  %152 = load ptr, ptr %28, align 8, !tbaa !5
  %153 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %152)
          to label %154 unwind label %133

154:                                              ; preds = %151
  store i32 0, ptr %25, align 4
  br label %155

155:                                              ; preds = %154, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %156 = load i32, ptr %25, align 4
  switch i32 %156, label %394 [
    i32 0, label %157
    i32 4, label %158
  ]

157:                                              ; preds = %155
  br label %158

158:                                              ; preds = %157, %155
  %159 = load i32, ptr %27, align 4, !tbaa !11
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %27, align 4, !tbaa !11
  br label %106, !llvm.loop !13

161:                                              ; preds = %133, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %162

162:                                              ; preds = %161, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %383

163:                                              ; preds = %112
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %26)
          to label %164 unwind label %101

164:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %165 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %166 unwind label %180

166:                                              ; preds = %164
  %167 = sitofp i32 %165 to double
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %168)
          to label %170 unwind label %180

170:                                              ; preds = %166
  %171 = sitofp i32 %169 to double
  %172 = fdiv double %167, %171
  store double %172, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %173 = load double, ptr %30, align 8, !tbaa !9
  store double %173, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %174 = load double, ptr %30, align 8, !tbaa !9
  store double %174, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 1, ptr %33, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  store i32 0, ptr %34, align 4, !tbaa !11
  br label %175

175:                                              ; preds = %358, %170
  %176 = load i32, ptr %34, align 4, !tbaa !11
  %177 = load i32, ptr %12, align 4, !tbaa !11
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %184, label %179

179:                                              ; preds = %175
  store i32 5, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %366

180:                                              ; preds = %166, %164
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %18, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %19, align 4
  br label %382

184:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = invoke noundef double @_Z14RNRandomScalarv()
          to label %187 unwind label %236

187:                                              ; preds = %184
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %188)
          to label %190 unwind label %236

190:                                              ; preds = %187
  %191 = sitofp i32 %189 to double
  %192 = fmul double %186, %191
  %193 = fptosi double %192 to i32
  %194 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %185, i32 noundef %193)
          to label %195 unwind label %236

195:                                              ; preds = %190
  store ptr %194, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = invoke noundef double @_Z14RNRandomScalarv()
          to label %198 unwind label %240

198:                                              ; preds = %195
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %199)
          to label %201 unwind label %240

201:                                              ; preds = %198
  %202 = sitofp i32 %200 to double
  %203 = fmul double %197, %202
  %204 = fptosi double %203 to i32
  %205 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %196, i32 noundef %204)
          to label %206 unwind label %240

206:                                              ; preds = %201
  store ptr %205, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = invoke noundef double @_Z14RNRandomScalarv()
          to label %209 unwind label %244

209:                                              ; preds = %206
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %210)
          to label %212 unwind label %244

212:                                              ; preds = %209
  %213 = sitofp i32 %211 to double
  %214 = fmul double %208, %213
  %215 = fptosi double %214 to i32
  %216 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %207, i32 noundef %215)
          to label %217 unwind label %244

217:                                              ; preds = %212
  store ptr %216, ptr %37, align 8, !tbaa !5
  %218 = load ptr, ptr %35, align 8, !tbaa !5
  %219 = load ptr, ptr %36, align 8, !tbaa !5
  %220 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %218, ptr noundef nonnull align 8 dereferenceable(24) %219)
          to label %221 unwind label %244

221:                                              ; preds = %217
  %222 = icmp ne i32 %220, 0
  br i1 %222, label %235, label %223

223:                                              ; preds = %221
  %224 = load ptr, ptr %36, align 8, !tbaa !5
  %225 = load ptr, ptr %37, align 8, !tbaa !5
  %226 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %224, ptr noundef nonnull align 8 dereferenceable(24) %225)
          to label %227 unwind label %244

227:                                              ; preds = %223
  %228 = icmp ne i32 %226, 0
  br i1 %228, label %235, label %229

229:                                              ; preds = %227
  %230 = load ptr, ptr %37, align 8, !tbaa !5
  %231 = load ptr, ptr %35, align 8, !tbaa !5
  %232 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %230, ptr noundef nonnull align 8 dereferenceable(24) %231)
          to label %233 unwind label %244

233:                                              ; preds = %229
  %234 = icmp ne i32 %232, 0
  br i1 %234, label %235, label %248

235:                                              ; preds = %233, %227, %221
  store i32 7, ptr %25, align 4
  br label %355

236:                                              ; preds = %190, %187, %184
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %18, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %19, align 4
  br label %365

240:                                              ; preds = %201, %198, %195
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %18, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %19, align 4
  br label %364

244:                                              ; preds = %229, %223, %217, %212, %209, %206
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %18, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %19, align 4
  br label %363

248:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 32, ptr %38) #8
  %249 = load ptr, ptr %35, align 8, !tbaa !5
  %250 = load ptr, ptr %36, align 8, !tbaa !5
  %251 = load ptr, ptr %37, align 8, !tbaa !5
  invoke void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(24) %249, ptr noundef nonnull align 8 dereferenceable(24) %250, ptr noundef nonnull align 8 dereferenceable(24) %251)
          to label %252 unwind label %261

252:                                              ; preds = %248
  invoke void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 0)
          to label %253 unwind label %261

253:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  store i32 0, ptr %39, align 4, !tbaa !11
  br label %254

254:                                              ; preds = %310, %253
  %255 = load i32, ptr %39, align 4, !tbaa !11
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %256)
          to label %258 unwind label %265

258:                                              ; preds = %254
  %259 = icmp slt i32 %255, %257
  br i1 %259, label %269, label %260

260:                                              ; preds = %258
  store i32 8, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %315

261:                                              ; preds = %252, %248
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %18, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %19, align 4
  br label %362

265:                                              ; preds = %254
  %266 = landingpad { ptr, i32 }
          cleanup
  %267 = extractvalue { ptr, i32 } %266, 0
  store ptr %267, ptr %18, align 8
  %268 = extractvalue { ptr, i32 } %266, 1
  store i32 %268, ptr %19, align 4
  br label %314

269:                                              ; preds = %258
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %270 = load ptr, ptr %9, align 8, !tbaa !5
  %271 = load i32, ptr %39, align 4, !tbaa !11
  %272 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %270, i32 noundef %271)
          to label %273 unwind label %281

273:                                              ; preds = %269
  store ptr %272, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %274 = load ptr, ptr %40, align 8, !tbaa !5
  %275 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(24) %274)
          to label %276 unwind label %285

276:                                              ; preds = %273
  store double %275, ptr %41, align 8, !tbaa !9
  %277 = load double, ptr %41, align 8, !tbaa !9
  %278 = load double, ptr %11, align 8, !tbaa !9
  %279 = fcmp ogt double %277, %278
  br i1 %279, label %280, label %289

280:                                              ; preds = %276
  store i32 10, ptr %25, align 4
  br label %307

281:                                              ; preds = %269
  %282 = landingpad { ptr, i32 }
          cleanup
  %283 = extractvalue { ptr, i32 } %282, 0
  store ptr %283, ptr %18, align 8
  %284 = extractvalue { ptr, i32 } %282, 1
  store i32 %284, ptr %19, align 4
  br label %313

285:                                              ; preds = %303, %292, %273
  %286 = landingpad { ptr, i32 }
          cleanup
  %287 = extractvalue { ptr, i32 } %286, 0
  store ptr %287, ptr %18, align 8
  %288 = extractvalue { ptr, i32 } %286, 1
  store i32 %288, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %313

289:                                              ; preds = %276
  %290 = load ptr, ptr %17, align 8, !tbaa !5
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %303

292:                                              ; preds = %289
  %293 = load ptr, ptr %10, align 8, !tbaa !5
  %294 = load i32, ptr %39, align 4, !tbaa !11
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds double, ptr %293, i64 %295
  %297 = load double, ptr %296, align 8, !tbaa !9
  %298 = load ptr, ptr %17, align 8, !tbaa !5
  %299 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %300 unwind label %285

300:                                              ; preds = %292
  %301 = sext i32 %299 to i64
  %302 = getelementptr inbounds double, ptr %298, i64 %301
  store double %297, ptr %302, align 8, !tbaa !9
  br label %303

303:                                              ; preds = %300, %289
  %304 = load ptr, ptr %40, align 8, !tbaa !5
  %305 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %304)
          to label %306 unwind label %285

306:                                              ; preds = %303
  store i32 0, ptr %25, align 4
  br label %307

307:                                              ; preds = %306, %280
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  %308 = load i32, ptr %25, align 4
  switch i32 %308, label %394 [
    i32 0, label %309
    i32 10, label %310
  ]

309:                                              ; preds = %307
  br label %310

310:                                              ; preds = %309, %307
  %311 = load i32, ptr %39, align 4, !tbaa !11
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %39, align 4, !tbaa !11
  br label %254, !llvm.loop !15

313:                                              ; preds = %285, %281
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %314

314:                                              ; preds = %313, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %362

315:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %316 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %317 unwind label %333

317:                                              ; preds = %315
  %318 = sitofp i32 %316 to double
  %319 = load ptr, ptr %9, align 8, !tbaa !5
  %320 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %319)
          to label %321 unwind label %333

321:                                              ; preds = %317
  %322 = sitofp i32 %320 to double
  %323 = fdiv double %318, %322
  store double %323, ptr %42, align 8, !tbaa !9
  %324 = load double, ptr %42, align 8, !tbaa !9
  %325 = load double, ptr %32, align 8, !tbaa !9
  %326 = fadd double %325, %324
  store double %326, ptr %32, align 8, !tbaa !9
  %327 = load i32, ptr %33, align 4, !tbaa !11
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %33, align 4, !tbaa !11
  %329 = load double, ptr %42, align 8, !tbaa !9
  %330 = load double, ptr %31, align 8, !tbaa !9
  %331 = fcmp ole double %329, %330
  br i1 %331, label %332, label %337

332:                                              ; preds = %321
  store i32 7, ptr %25, align 4
  br label %354

333:                                              ; preds = %350, %341, %317, %315
  %334 = landingpad { ptr, i32 }
          cleanup
  %335 = extractvalue { ptr, i32 } %334, 0
  store ptr %335, ptr %18, align 8
  %336 = extractvalue { ptr, i32 } %334, 1
  store i32 %336, ptr %19, align 4
  br label %361

337:                                              ; preds = %321
  call void @llvm.lifetime.start.p0(i64 32, ptr %43) #8
  %338 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_Z22R3EstimatePlaneWithPCARK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind writable sret(%class.R3Plane) align 8 %43, ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %338)
          to label %339 unwind label %346

339:                                              ; preds = %337
  %340 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(32) %43)
          to label %341 unwind label %346

341:                                              ; preds = %339
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #8
  %342 = invoke noundef i32 @_ZNK7R3PlaneeqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
          to label %343 unwind label %333

343:                                              ; preds = %341
  %344 = icmp ne i32 %342, 0
  br i1 %344, label %345, label %350

345:                                              ; preds = %343
  store i32 7, ptr %25, align 4
  br label %354

346:                                              ; preds = %339, %337
  %347 = landingpad { ptr, i32 }
          cleanup
  %348 = extractvalue { ptr, i32 } %347, 0
  store ptr %348, ptr %18, align 8
  %349 = extractvalue { ptr, i32 } %347, 1
  store i32 %349, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #8
  br label %361

350:                                              ; preds = %343
  %351 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %38)
          to label %352 unwind label %333

352:                                              ; preds = %350
  %353 = load double, ptr %42, align 8, !tbaa !9
  store double %353, ptr %31, align 8, !tbaa !9
  store i32 0, ptr %25, align 4
  br label %354

354:                                              ; preds = %352, %345, %332
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #8
  br label %355

355:                                              ; preds = %354, %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  %356 = load i32, ptr %25, align 4
  switch i32 %356, label %394 [
    i32 0, label %357
    i32 7, label %358
  ]

357:                                              ; preds = %355
  br label %358

358:                                              ; preds = %357, %355
  %359 = load i32, ptr %34, align 4, !tbaa !11
  %360 = add nsw i32 %359, 1
  store i32 %360, ptr %34, align 4, !tbaa !11
  br label %175, !llvm.loop !16

361:                                              ; preds = %346, %333
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  br label %362

362:                                              ; preds = %361, %314, %261
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #8
  br label %363

363:                                              ; preds = %362, %244
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %364

364:                                              ; preds = %363, %240
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %365

365:                                              ; preds = %364, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br label %382

366:                                              ; preds = %179
  %367 = load ptr, ptr %13, align 8, !tbaa !5
  %368 = icmp ne ptr %367, null
  br i1 %368, label %369, label %372

369:                                              ; preds = %366
  %370 = load double, ptr %31, align 8, !tbaa !9
  %371 = load ptr, ptr %13, align 8, !tbaa !5
  store double %370, ptr %371, align 8, !tbaa !9
  br label %372

372:                                              ; preds = %369, %366
  %373 = load ptr, ptr %14, align 8, !tbaa !5
  %374 = icmp ne ptr %373, null
  br i1 %374, label %375, label %381

375:                                              ; preds = %372
  %376 = load double, ptr %32, align 8, !tbaa !9
  %377 = load i32, ptr %33, align 4, !tbaa !11
  %378 = sitofp i32 %377 to double
  %379 = fdiv double %376, %378
  %380 = load ptr, ptr %14, align 8, !tbaa !5
  store double %379, ptr %380, align 8, !tbaa !9
  br label %381

381:                                              ; preds = %375, %372
  store i32 1, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #8
  br label %384

382:                                              ; preds = %365, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %383

383:                                              ; preds = %382, %162, %101
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #8
  br label %385

384:                                              ; preds = %381, %78
  call void @llvm.lifetime.end.p0(i64 72, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #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 24, ptr %15) #8
  br label %388

385:                                              ; preds = %383, %87
  call void @llvm.lifetime.end.p0(i64 72, ptr %24) #8
  br label %386

386:                                              ; preds = %385, %83
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #8
  br label %387

387:                                              ; preds = %386, %79
  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 24, ptr %15) #8
  br label %389

388:                                              ; preds = %384, %47
  ret void

389:                                              ; preds = %387
  %390 = load ptr, ptr %18, align 8
  %391 = load i32, ptr %19, align 4
  %392 = insertvalue { ptr, i32 } poison, ptr %390, 0
  %393 = insertvalue { ptr, i32 } %392, i32 %391, 1
  resume { ptr, i32 } %393

394:                                              ; preds = %355, %307, %155
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

declare noundef double @_Z14RNRandomScalarv() #5

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

declare void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7R3PlaneeqERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

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

!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 = distinct !{!15, !14}
!16 = distinct !{!16, !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.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

@RN_EPSILON = external local_unnamed_addr global double, align 8
@R3null_plane = external global %class.R3Plane, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15R3PrincipleAxesRK7R3PointRK7RNArrayIPS_EPKdPd(ptr dead_on_unwind noalias writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z22R3EstimatePlaneWithPCARK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Plane) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

declare void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #3 align 2

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25R3EstimatePlaneWithRansacRK7RNArrayIP7R3PointEPKddiPdS7_(ptr dead_on_unwind noalias writable sret(%class.R3Plane) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, double noundef %3, i32 noundef %4, ptr noundef writeonly %5, ptr noundef writeonly %6) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %8 = alloca [3 x double], align 16
  %9 = alloca %class.RNArray, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Triad, align 8
  %12 = alloca %class.R3Plane, align 8
  %13 = alloca %class.R3Plane, align 8
  %14 = alloca %class.R3Plane, align 8
  %15 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %16 = icmp slt i32 %15, 3
  br i1 %16, label %17, label %18

17:                                               ; preds = %7
  tail call void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
  br label %207

18:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  call void @_ZN7RNArrayIP7R3PointEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %26, label %19

19:                                               ; preds = %18
  %20 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %21 = zext nneg i32 %20 to i64
  %22 = icmp slt i32 %20, 0
  %23 = shl nuw nsw i64 %21, 3
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %24) #9
          to label %26 unwind label %36

26:                                               ; preds = %19, %18
  %27 = phi ptr [ null, %18 ], [ %25, %19 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #8
  invoke void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef null)
          to label %28 unwind label %38

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #8
  invoke void @_Z15R3PrincipleAxesRK7R3PointRK7RNArrayIPS_EPKdPd(ptr dead_on_unwind nonnull writable sret(%class.R3Triad) align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, ptr noundef nonnull %8)
          to label %29 unwind label %40

29:                                               ; preds = %28
  %30 = getelementptr inbounds i8, ptr %8, i64 8
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %33 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %31, double noundef %32)
          to label %34 unwind label %40

34:                                               ; preds = %29
  %.not98 = icmp eq i32 %33, 0
  br i1 %.not98, label %42, label %35

35:                                               ; preds = %34
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
          to label %203 unwind label %40

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

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %205

40:                                               ; preds = %35, %29, %28
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %204

42:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #8
  %43 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %11, i32 noundef 2)
          to label %44 unwind label %51

44:                                               ; preds = %42
  invoke void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %43)
          to label %45 unwind label %51

45:                                               ; preds = %44
  %46 = fcmp oeq double %3, 0.000000e+00
  br i1 %46, label %47, label %53

47:                                               ; preds = %45
  %48 = getelementptr inbounds i8, ptr %8, i64 16
  %49 = load double, ptr %48, align 16, !tbaa !5
  %50 = call double @sqrt(double noundef %49) #8
  br label %53

51:                                               ; preds = %._crit_edge, %44, %42
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %202

53:                                               ; preds = %47, %45
  %.0 = phi double [ %50, %47 ], [ %3, %45 ]
  %54 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %53
  %.not113 = icmp eq ptr %27, null
  br i1 %.not113, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %63
  %.083145.us = phi i32 [ %64, %63 ], [ 0, %.lr.ph ]
  %56 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.083145.us)
          to label %57 unwind label %.split.us

57:                                               ; preds = %.lr.ph.split.us
  %58 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(24) %56)
          to label %59 unwind label %.split148.us

59:                                               ; preds = %57
  %60 = fcmp ogt double %58, %.0
  br i1 %60, label %63, label %61

61:                                               ; preds = %59
  %62 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %56)
          to label %63 unwind label %.split148.us

63:                                               ; preds = %61, %59
  %64 = add nuw nsw i32 %.083145.us, 1
  %65 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !9

.split.us:                                        ; preds = %.lr.ph.split.us
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %202

.split148.us:                                     ; preds = %61, %57
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %202

._crit_edge:                                      ; preds = %84, %63, %53
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %88 unwind label %51

.lr.ph.split:                                     ; preds = %.lr.ph, %84
  %indvars.iv = phi i64 [ %indvars.iv.next, %84 ], [ 0, %.lr.ph ]
  %69 = trunc nuw nsw i64 %indvars.iv to i32
  %70 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %69)
          to label %71 unwind label %.split

71:                                               ; preds = %.lr.ph.split
  %72 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(24) %70)
          to label %73 unwind label %.split148

73:                                               ; preds = %71
  %74 = fcmp ogt double %72, %.0
  br i1 %74, label %84, label %77

.split:                                           ; preds = %.lr.ph.split
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %202

.split148:                                        ; preds = %77, %71
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %202

77:                                               ; preds = %73
  %78 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %27, i64 %81
  store double %79, ptr %82, align 8, !tbaa !5
  %83 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %70)
          to label %84 unwind label %.split148

84:                                               ; preds = %77, %73
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %85 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next, %86
  br i1 %87, label %.lr.ph.split, label %._crit_edge, !llvm.loop !9

88:                                               ; preds = %._crit_edge
  %89 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %90 = sitofp i32 %89 to double
  %91 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %92 = sitofp i32 %91 to double
  %93 = fdiv double %90, %92
  %94 = icmp sgt i32 %4, 0
  br i1 %94, label %.lr.ph165, label %._crit_edge166

.lr.ph165:                                        ; preds = %88
  %.not106 = icmp eq ptr %27, null
  br label %96

._crit_edge166.loopexit:                          ; preds = %194
  %95 = sitofp i32 %.186 to double
  br label %._crit_edge166

._crit_edge166:                                   ; preds = %._crit_edge166.loopexit, %88
  %.089.lcssa = phi double [ %93, %88 ], [ %.291, %._crit_edge166.loopexit ]
  %.087.lcssa = phi double [ %93, %88 ], [ %.188, %._crit_edge166.loopexit ]
  %.085.lcssa = phi double [ 1.000000e+00, %88 ], [ %95, %._crit_edge166.loopexit ]
  %.not99 = icmp eq ptr %5, null
  br i1 %.not99, label %198, label %197

96:                                               ; preds = %.lr.ph165, %194
  %.084163 = phi i32 [ 0, %.lr.ph165 ], [ %195, %194 ]
  %.085162 = phi i32 [ 1, %.lr.ph165 ], [ %.186, %194 ]
  %.087161 = phi double [ %93, %.lr.ph165 ], [ %.188, %194 ]
  %.089160 = phi double [ %93, %.lr.ph165 ], [ %.291, %194 ]
  %97 = invoke noundef double @_Z14RNRandomScalarv()
          to label %98 unwind label %129

98:                                               ; preds = %96
  %99 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %100 = sitofp i32 %99 to double
  %101 = fmul double %97, %100
  %102 = fptosi double %101 to i32
  %103 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %102)
          to label %104 unwind label %129

104:                                              ; preds = %98
  %105 = invoke noundef double @_Z14RNRandomScalarv()
          to label %106 unwind label %131

106:                                              ; preds = %104
  %107 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %108 = sitofp i32 %107 to double
  %109 = fmul double %105, %108
  %110 = fptosi double %109 to i32
  %111 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %110)
          to label %112 unwind label %131

112:                                              ; preds = %106
  %113 = invoke noundef double @_Z14RNRandomScalarv()
          to label %114 unwind label %133

114:                                              ; preds = %112
  %115 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %116 = sitofp i32 %115 to double
  %117 = fmul double %113, %116
  %118 = fptosi double %117 to i32
  %119 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %118)
          to label %120 unwind label %133

120:                                              ; preds = %114
  %121 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 8 dereferenceable(24) %111)
          to label %122 unwind label %133

122:                                              ; preds = %120
  %.not101 = icmp eq i32 %121, 0
  br i1 %.not101, label %123, label %194

123:                                              ; preds = %122
  %124 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef nonnull align 8 dereferenceable(24) %119)
          to label %125 unwind label %133

125:                                              ; preds = %123
  %.not102 = icmp eq i32 %124, 0
  br i1 %.not102, label %126, label %194

126:                                              ; preds = %125
  %127 = invoke noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %119, ptr noundef nonnull align 8 dereferenceable(24) %103)
          to label %128 unwind label %133

128:                                              ; preds = %126
  %.not103 = icmp eq i32 %127, 0
  br i1 %.not103, label %135, label %194

129:                                              ; preds = %98, %96
  %130 = landingpad { ptr, i32 }
          cleanup
  br label %202

131:                                              ; preds = %106, %104
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %202

133:                                              ; preds = %126, %123, %120, %114, %112
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %202

135:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #8
  invoke void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef nonnull align 8 dereferenceable(24) %119)
          to label %136 unwind label %160

136:                                              ; preds = %135
  invoke void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 0)
          to label %.preheader unwind label %160

.preheader:                                       ; preds = %136
  %137 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %.lr.ph152, label %._crit_edge153

.lr.ph152:                                        ; preds = %.preheader
  br i1 %.not106, label %.lr.ph152.split.us, label %.lr.ph152.split

.lr.ph152.split.us:                               ; preds = %.lr.ph152, %146
  %.082150.us = phi i32 [ %147, %146 ], [ 0, %.lr.ph152 ]
  %139 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.082150.us)
          to label %140 unwind label %.split155.us

140:                                              ; preds = %.lr.ph152.split.us
  %141 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(24) %139)
          to label %142 unwind label %.split158.us

142:                                              ; preds = %140
  %143 = fcmp ogt double %141, %.0
  br i1 %143, label %146, label %144

144:                                              ; preds = %142
  %145 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %139)
          to label %146 unwind label %.split158.us

146:                                              ; preds = %144, %142
  %147 = add nuw nsw i32 %.082150.us, 1
  %148 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %.lr.ph152.split.us, label %._crit_edge153, !llvm.loop !11

.split155.us:                                     ; preds = %.lr.ph152.split.us
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %196

.split158.us:                                     ; preds = %144, %140
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %196

._crit_edge153:                                   ; preds = %177, %146, %.preheader
  %152 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %153 = sitofp i32 %152 to double
  %154 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %155 = sitofp i32 %154 to double
  %156 = fdiv double %153, %155
  %157 = fadd double %.087161, %156
  %158 = add nsw i32 %.085162, 1
  %159 = fcmp ugt double %156, %.089160
  br i1 %159, label %183, label %193

160:                                              ; preds = %136, %135
  %161 = landingpad { ptr, i32 }
          cleanup
  br label %196

.lr.ph152.split:                                  ; preds = %.lr.ph152, %177
  %indvars.iv172 = phi i64 [ %indvars.iv.next173, %177 ], [ 0, %.lr.ph152 ]
  %162 = trunc nuw nsw i64 %indvars.iv172 to i32
  %163 = invoke noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %162)
          to label %164 unwind label %.split155

164:                                              ; preds = %.lr.ph152.split
  %165 = invoke noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(24) %163)
          to label %166 unwind label %.split158

166:                                              ; preds = %164
  %167 = fcmp ogt double %165, %.0
  br i1 %167, label %177, label %170

.split155:                                        ; preds = %.lr.ph152.split
  %168 = landingpad { ptr, i32 }
          cleanup
  br label %196

.split158:                                        ; preds = %170, %164
  %169 = landingpad { ptr, i32 }
          cleanup
  br label %196

170:                                              ; preds = %166
  %171 = getelementptr inbounds double, ptr %2, i64 %indvars.iv172
  %172 = load double, ptr %171, align 8, !tbaa !5
  %173 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds double, ptr %27, i64 %174
  store double %172, ptr %175, align 8, !tbaa !5
  %176 = invoke noundef ptr @_ZN7RNArrayIP7R3PointE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %163)
          to label %177 unwind label %.split158

177:                                              ; preds = %170, %166
  %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
  %178 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %179 = sext i32 %178 to i64
  %180 = icmp slt i64 %indvars.iv.next173, %179
  br i1 %180, label %.lr.ph152.split, label %._crit_edge153, !llvm.loop !11

181:                                              ; preds = %191, %186
  %182 = landingpad { ptr, i32 }
          cleanup
  br label %196

183:                                              ; preds = %._crit_edge153
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #8
  invoke void @_Z22R3EstimatePlaneWithPCARK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Plane) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %27)
          to label %184 unwind label %189

184:                                              ; preds = %183
  %185 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %186 unwind label %189

186:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #8
  %187 = invoke noundef i32 @_ZNK7R3PlaneeqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
          to label %188 unwind label %181

188:                                              ; preds = %186
  %.not104 = icmp eq i32 %187, 0
  br i1 %.not104, label %191, label %193

189:                                              ; preds = %184, %183
  %190 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #8
  br label %196

191:                                              ; preds = %188
  %192 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %193 unwind label %181

193:                                              ; preds = %191, %188, %._crit_edge153
  %.190 = phi double [ %.089160, %._crit_edge153 ], [ %.089160, %188 ], [ %156, %191 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #8
  br label %194

194:                                              ; preds = %122, %125, %128, %193
  %.291 = phi double [ %.190, %193 ], [ %.089160, %128 ], [ %.089160, %125 ], [ %.089160, %122 ]
  %.188 = phi double [ %157, %193 ], [ %.087161, %128 ], [ %.087161, %125 ], [ %.087161, %122 ]
  %.186 = phi i32 [ %158, %193 ], [ %.085162, %128 ], [ %.085162, %125 ], [ %.085162, %122 ]
  %195 = add nuw nsw i32 %.084163, 1
  %exitcond.not = icmp eq i32 %195, %4
  br i1 %exitcond.not, label %._crit_edge166.loopexit, label %96, !llvm.loop !12

196:                                              ; preds = %.split158, %.split158.us, %.split155, %.split155.us, %181, %189, %160
  %.pn107.pn = phi { ptr, i32 } [ %161, %160 ], [ %182, %181 ], [ %190, %189 ], [ %168, %.split155 ], [ %150, %.split155.us ], [ %169, %.split158 ], [ %151, %.split158.us ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #8
  br label %202

197:                                              ; preds = %._crit_edge166
  store double %.089.lcssa, ptr %5, align 8, !tbaa !5
  br label %198

198:                                              ; preds = %197, %._crit_edge166
  %.not100 = icmp eq ptr %6, null
  br i1 %.not100, label %201, label %199

199:                                              ; preds = %198
  %200 = fdiv double %.087.lcssa, %.085.lcssa
  store double %200, ptr %6, align 8, !tbaa !5
  br label %201

201:                                              ; preds = %199, %198
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  br label %203

202:                                              ; preds = %.split148, %.split148.us, %.split, %.split.us, %129, %133, %196, %131, %51
  %.pn114.pn = phi { ptr, i32 } [ %52, %51 ], [ %130, %129 ], [ %132, %131 ], [ %.pn107.pn, %196 ], [ %134, %133 ], [ %75, %.split ], [ %67, %.split.us ], [ %76, %.split148 ], [ %68, %.split148.us ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  br label %204

203:                                              ; preds = %35, %201
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  br label %207

204:                                              ; preds = %202, %40
  %.pn117 = phi { ptr, i32 } [ %41, %40 ], [ %.pn114.pn, %202 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #8
  br label %205

205:                                              ; preds = %204, %38
  %.pn117.pn = phi { ptr, i32 } [ %.pn117, %204 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  br label %206

206:                                              ; preds = %205, %36
  %.pn117.pn.pn = phi { ptr, i32 } [ %.pn117.pn, %205 ], [ %37, %36 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  resume { ptr, i32 } %.pn117.pn.pn

207:                                              ; preds = %203, %17
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z10R3DistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

declare noundef double @_Z14RNRandomScalarv() local_unnamed_addr #5

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

declare void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7R3PlaneeqERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

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

!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 = !{!"double", !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}


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