; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnextract/medialSurf.ll (ZN13medialSurface16competeForParentEP10medialBallS1_)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.medialSurface = type <{ ptr, i32, i32, i32, [4 x i8], i64, i64, ptr, %class.segment, %"class.std::vector", %"class.std::vector.0", %class.medialBall, float, [4 x i8], double, double, double, double, double, double, i32, [4 x i8], double, float, [4 x i8] }>
%class.segment = type { i32, i8, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl" }
%"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl" = type { %"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl_data" }
%"struct.std::_Vector_base<voxel, std::allocator<voxel>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl" }
%"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl" = type { %"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl_data" }
%"struct.std::_Vector_base<medialBall, std::allocator<medialBall>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.medialBall = type { ptr, float, float, float, i16, float, i16, i16, i16, i16, i16, ptr, ptr, ptr }
%class.voxel = type <{ ptr, i16, i16, i16, [2 x i8], float, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.54 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252), i32 noundef, i32 noundef, i32 noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10makeFriendP10medialBallS0_(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface16competeForParentEP10medialBallS1_(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1, ptr noundef %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i16, align 2
  %18 = alloca i16, align 2
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i16, align 2
  %22 = alloca i16, align 2
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %27 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 17
  %28 = load double, ptr %27, align 8, !tbaa !9
  store double %28, ptr %7, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.medialBall, ptr %29, i32 0, i32 5
  %31 = load float, ptr %30, align 8, !tbaa !27
  %32 = fpext float %31 to double
  store double %32, ptr %8, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.medialBall, ptr %33, i32 0, i32 5
  %35 = load float, ptr %34, align 8, !tbaa !27
  %36 = fpext float %35 to double
  store double %36, ptr %9, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %37 = load double, ptr %8, align 8, !tbaa !26
  %38 = load double, ptr %8, align 8, !tbaa !26
  %39 = fmul double %37, %38
  store double %39, ptr %10, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %40 = load double, ptr %9, align 8, !tbaa !26
  %41 = load double, ptr %9, align 8, !tbaa !26
  %42 = fmul double %40, %41
  store double %42, ptr %11, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef %43, ptr noundef %44)
  store double %45, ptr %12, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %46 = load double, ptr %10, align 8, !tbaa !26
  %47 = load double, ptr %11, align 8, !tbaa !26
  %48 = fadd double %46, %47
  %49 = fdiv double 1.000000e+00, %48
  store double %49, ptr %13, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %50 = load double, ptr %13, align 8, !tbaa !26
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.medialBall, ptr %51, i32 0, i32 1
  %53 = load float, ptr %52, align 8, !tbaa !28
  %54 = fpext float %53 to double
  %55 = load double, ptr %11, align 8, !tbaa !26
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.medialBall, ptr %56, i32 0, i32 1
  %58 = load float, ptr %57, align 8, !tbaa !28
  %59 = fpext float %58 to double
  %60 = load double, ptr %10, align 8, !tbaa !26
  %61 = fmul double %59, %60
  %62 = call double @llvm.fmuladd.f64(double %54, double %55, double %61)
  %63 = fmul double %50, %62
  %64 = fptosi double %63 to i32
  %65 = load double, ptr %13, align 8, !tbaa !26
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.medialBall, ptr %66, i32 0, i32 2
  %68 = load float, ptr %67, align 4, !tbaa !29
  %69 = fpext float %68 to double
  %70 = load double, ptr %11, align 8, !tbaa !26
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.medialBall, ptr %71, i32 0, i32 2
  %73 = load float, ptr %72, align 4, !tbaa !29
  %74 = fpext float %73 to double
  %75 = load double, ptr %10, align 8, !tbaa !26
  %76 = fmul double %74, %75
  %77 = call double @llvm.fmuladd.f64(double %69, double %70, double %76)
  %78 = fmul double %65, %77
  %79 = fptosi double %78 to i32
  %80 = load double, ptr %13, align 8, !tbaa !26
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %class.medialBall, ptr %81, i32 0, i32 3
  %83 = load float, ptr %82, align 8, !tbaa !30
  %84 = fpext float %83 to double
  %85 = load double, ptr %11, align 8, !tbaa !26
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %class.medialBall, ptr %86, i32 0, i32 3
  %88 = load float, ptr %87, align 8, !tbaa !30
  %89 = fpext float %88 to double
  %90 = load double, ptr %10, align 8, !tbaa !26
  %91 = fmul double %89, %90
  %92 = call double @llvm.fmuladd.f64(double %84, double %85, double %91)
  %93 = fmul double %80, %92
  %94 = fptosi double %93 to i32
  %95 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %26, i32 noundef %64, i32 noundef %79, i32 noundef %94)
  store ptr %95, ptr %14, align 8, !tbaa !5
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %774

98:                                               ; preds = %3
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.voxel, ptr %99, i32 0, i32 5
  %101 = load float, ptr %100, align 8, !tbaa !31
  %102 = fpext float %101 to double
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %104 = load double, ptr %103, align 8, !tbaa !26
  %105 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 16
  %106 = load double, ptr %105, align 8, !tbaa !33
  %107 = call double @llvm.fmuladd.f64(double %104, double %106, double -5.000000e-01)
  %108 = fcmp ogt double %102, %107
  br i1 %108, label %109, label %774

109:                                              ; preds = %98
  %110 = load double, ptr %12, align 8, !tbaa !26
  %111 = call double @sqrt(double noundef %110) #8
  %112 = fmul double 1.010000e+00, %111
  %113 = load double, ptr %8, align 8, !tbaa !26
  %114 = load double, ptr %9, align 8, !tbaa !26
  %115 = fadd double %113, %114
  %116 = fadd double %115, 1.000000e+00
  %117 = load double, ptr %7, align 8, !tbaa !26
  %118 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %117, double %116)
  %119 = fcmp olt double %112, %118
  br i1 %119, label %120, label %774

120:                                              ; preds = %109
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %class.medialBall, ptr %121, i32 0, i32 11
  %123 = load ptr, ptr %122, align 8, !tbaa !34
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = icmp eq ptr %123, %124
  br i1 %125, label %126, label %175

126:                                              ; preds = %120
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %127)
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = icmp ne ptr %128, %129
  br i1 %130, label %131, label %174

131:                                              ; preds = %126
  %132 = load double, ptr %8, align 8, !tbaa !26
  %133 = load double, ptr %9, align 8, !tbaa !26
  %134 = fcmp oge double %132, %133
  br i1 %134, label %135, label %139

135:                                              ; preds = %131
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %class.medialBall, ptr %137, i32 0, i32 11
  store ptr %136, ptr %138, align 8, !tbaa !34
  br label %173

139:                                              ; preds = %131
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %class.medialBall, ptr %140, i32 0, i32 11
  %142 = load ptr, ptr %141, align 8, !tbaa !34
  %143 = getelementptr inbounds %class.medialBall, ptr %142, i32 0, i32 5
  %144 = load float, ptr %143, align 8, !tbaa !27
  %145 = fpext float %144 to double
  %146 = load double, ptr %9, align 8, !tbaa !26
  %147 = fcmp ole double %145, %146
  br i1 %147, label %148, label %152

148:                                              ; preds = %139
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %class.medialBall, ptr %150, i32 0, i32 11
  store ptr %149, ptr %151, align 8, !tbaa !34
  br label %172

152:                                              ; preds = %139
  %153 = load double, ptr %8, align 8, !tbaa !26
  %154 = load double, ptr %9, align 8, !tbaa !26
  %155 = load double, ptr %7, align 8, !tbaa !26
  %156 = fsub double %154, %155
  %157 = fcmp oge double %153, %156
  br i1 %157, label %158, label %171

158:                                              ; preds = %152
  %159 = load double, ptr %8, align 8, !tbaa !26
  %160 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %161 = load double, ptr %160, align 8, !tbaa !35
  %162 = load double, ptr %7, align 8, !tbaa !26
  %163 = fmul double 1.000000e+00, %162
  %164 = call double @llvm.fmuladd.f64(double %159, double %161, double %163)
  %165 = load double, ptr %9, align 8, !tbaa !26
  %166 = fcmp oge double %164, %165
  br i1 %166, label %167, label %171

167:                                              ; preds = %158
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %class.medialBall, ptr %169, i32 0, i32 11
  store ptr %168, ptr %170, align 8, !tbaa !34
  br label %171

171:                                              ; preds = %167, %158, %152
  br label %172

172:                                              ; preds = %171, %148
  br label %173

173:                                              ; preds = %172, %135
  br label %174

174:                                              ; preds = %173, %126
  br label %231

175:                                              ; preds = %120
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %class.medialBall, ptr %176, i32 0, i32 11
  %178 = load ptr, ptr %177, align 8, !tbaa !34
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = icmp eq ptr %178, %179
  br i1 %180, label %181, label %230

181:                                              ; preds = %175
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %182)
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = icmp ne ptr %183, %184
  br i1 %185, label %186, label %229

186:                                              ; preds = %181
  %187 = load double, ptr %9, align 8, !tbaa !26
  %188 = load double, ptr %8, align 8, !tbaa !26
  %189 = fcmp oge double %187, %188
  br i1 %189, label %190, label %194

190:                                              ; preds = %186
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %class.medialBall, ptr %192, i32 0, i32 11
  store ptr %191, ptr %193, align 8, !tbaa !34
  br label %228

194:                                              ; preds = %186
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %class.medialBall, ptr %195, i32 0, i32 11
  %197 = load ptr, ptr %196, align 8, !tbaa !34
  %198 = getelementptr inbounds %class.medialBall, ptr %197, i32 0, i32 5
  %199 = load float, ptr %198, align 8, !tbaa !27
  %200 = fpext float %199 to double
  %201 = load double, ptr %8, align 8, !tbaa !26
  %202 = fcmp ole double %200, %201
  br i1 %202, label %203, label %207

203:                                              ; preds = %194
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %class.medialBall, ptr %205, i32 0, i32 11
  store ptr %204, ptr %206, align 8, !tbaa !34
  br label %227

207:                                              ; preds = %194
  %208 = load double, ptr %9, align 8, !tbaa !26
  %209 = load double, ptr %8, align 8, !tbaa !26
  %210 = load double, ptr %7, align 8, !tbaa !26
  %211 = fsub double %209, %210
  %212 = fcmp oge double %208, %211
  br i1 %212, label %213, label %226

213:                                              ; preds = %207
  %214 = load double, ptr %9, align 8, !tbaa !26
  %215 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %216 = load double, ptr %215, align 8, !tbaa !35
  %217 = load double, ptr %7, align 8, !tbaa !26
  %218 = fmul double 1.000000e+00, %217
  %219 = call double @llvm.fmuladd.f64(double %214, double %216, double %218)
  %220 = load double, ptr %8, align 8, !tbaa !26
  %221 = fcmp oge double %219, %220
  br i1 %221, label %222, label %226

222:                                              ; preds = %213
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %class.medialBall, ptr %224, i32 0, i32 11
  store ptr %223, ptr %225, align 8, !tbaa !34
  br label %226

226:                                              ; preds = %222, %213, %207
  br label %227

227:                                              ; preds = %226, %203
  br label %228

228:                                              ; preds = %227, %190
  br label %229

229:                                              ; preds = %228, %181
  br label %230

230:                                              ; preds = %229, %175
  br label %231

231:                                              ; preds = %230, %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %232 = load ptr, ptr %5, align 8, !tbaa !5
  %233 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %232)
  store ptr %233, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %234)
  store ptr %235, ptr %16, align 8, !tbaa !5
  %236 = load ptr, ptr %15, align 8, !tbaa !5
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = icmp ne ptr %236, %237
  br i1 %238, label %239, label %773

239:                                              ; preds = %231
  %240 = load ptr, ptr %16, align 8, !tbaa !5
  %241 = load ptr, ptr %5, align 8, !tbaa !5
  %242 = icmp ne ptr %240, %241
  br i1 %242, label %243, label %773

243:                                              ; preds = %239
  %244 = load ptr, ptr %15, align 8, !tbaa !5
  %245 = load ptr, ptr %16, align 8, !tbaa !5
  %246 = icmp eq ptr %244, %245
  br i1 %246, label %247, label %485

247:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #8
  %248 = load ptr, ptr %5, align 8, !tbaa !5
  %249 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %248)
  store i16 %249, ptr %17, align 2, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #8
  %250 = load ptr, ptr %6, align 8, !tbaa !5
  %251 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %250)
  store i16 %251, ptr %18, align 2, !tbaa !36
  %252 = load i16, ptr %17, align 2, !tbaa !36
  %253 = sext i16 %252 to i32
  %254 = add nsw i32 %253, 1
  %255 = load i16, ptr %18, align 2, !tbaa !36
  %256 = sext i16 %255 to i32
  %257 = icmp slt i32 %254, %256
  br i1 %257, label %258, label %299

258:                                              ; preds = %247
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds %class.medialBall, ptr %259, i32 0, i32 11
  %261 = load ptr, ptr %260, align 8, !tbaa !34
  %262 = getelementptr inbounds %class.medialBall, ptr %261, i32 0, i32 5
  %263 = load float, ptr %262, align 8, !tbaa !27
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = getelementptr inbounds %class.medialBall, ptr %264, i32 0, i32 5
  %266 = load float, ptr %265, align 8, !tbaa !27
  %267 = fsub float %263, %266
  %268 = fpext float %267 to double
  %269 = load double, ptr %7, align 8, !tbaa !26
  %270 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %269, double %268)
  %271 = load ptr, ptr %6, align 8, !tbaa !5
  %272 = getelementptr inbounds %class.medialBall, ptr %271, i32 0, i32 11
  %273 = load ptr, ptr %272, align 8, !tbaa !34
  %274 = load ptr, ptr %6, align 8, !tbaa !5
  %275 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %273, ptr noundef %274)
  %276 = fadd double %275, 2.500000e-01
  %277 = fdiv double %270, %276
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  %279 = getelementptr inbounds %class.medialBall, ptr %278, i32 0, i32 5
  %280 = load float, ptr %279, align 8, !tbaa !27
  %281 = load ptr, ptr %6, align 8, !tbaa !5
  %282 = getelementptr inbounds %class.medialBall, ptr %281, i32 0, i32 5
  %283 = load float, ptr %282, align 8, !tbaa !27
  %284 = fsub float %280, %283
  %285 = fpext float %284 to double
  %286 = load double, ptr %7, align 8, !tbaa !26
  %287 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %286, double %285)
  %288 = fadd double %287, 1.000000e-02
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %289, ptr noundef %290)
  %292 = fadd double %291, 2.000000e-01
  %293 = fdiv double %288, %292
  %294 = fcmp olt double %277, %293
  br i1 %294, label %295, label %299

295:                                              ; preds = %258
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = getelementptr inbounds %class.medialBall, ptr %297, i32 0, i32 11
  store ptr %296, ptr %298, align 8, !tbaa !34
  br label %475

299:                                              ; preds = %258, %247
  %300 = load i16, ptr %17, align 2, !tbaa !36
  %301 = sext i16 %300 to i32
  %302 = load i16, ptr %18, align 2, !tbaa !36
  %303 = sext i16 %302 to i32
  %304 = add nsw i32 %303, 1
  %305 = icmp sgt i32 %301, %304
  br i1 %305, label %306, label %347

306:                                              ; preds = %299
  %307 = load ptr, ptr %5, align 8, !tbaa !5
  %308 = getelementptr inbounds %class.medialBall, ptr %307, i32 0, i32 11
  %309 = load ptr, ptr %308, align 8, !tbaa !34
  %310 = getelementptr inbounds %class.medialBall, ptr %309, i32 0, i32 5
  %311 = load float, ptr %310, align 8, !tbaa !27
  %312 = load ptr, ptr %5, align 8, !tbaa !5
  %313 = getelementptr inbounds %class.medialBall, ptr %312, i32 0, i32 5
  %314 = load float, ptr %313, align 8, !tbaa !27
  %315 = fsub float %311, %314
  %316 = fpext float %315 to double
  %317 = load double, ptr %7, align 8, !tbaa !26
  %318 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %317, double %316)
  %319 = load ptr, ptr %5, align 8, !tbaa !5
  %320 = getelementptr inbounds %class.medialBall, ptr %319, i32 0, i32 11
  %321 = load ptr, ptr %320, align 8, !tbaa !34
  %322 = load ptr, ptr %5, align 8, !tbaa !5
  %323 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %321, ptr noundef %322)
  %324 = fadd double %323, 2.500000e-01
  %325 = fdiv double %318, %324
  %326 = load ptr, ptr %6, align 8, !tbaa !5
  %327 = getelementptr inbounds %class.medialBall, ptr %326, i32 0, i32 5
  %328 = load float, ptr %327, align 8, !tbaa !27
  %329 = load ptr, ptr %5, align 8, !tbaa !5
  %330 = getelementptr inbounds %class.medialBall, ptr %329, i32 0, i32 5
  %331 = load float, ptr %330, align 8, !tbaa !27
  %332 = fsub float %328, %331
  %333 = fpext float %332 to double
  %334 = load double, ptr %7, align 8, !tbaa !26
  %335 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %334, double %333)
  %336 = fadd double %335, 1.000000e-02
  %337 = load ptr, ptr %6, align 8, !tbaa !5
  %338 = load ptr, ptr %5, align 8, !tbaa !5
  %339 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %337, ptr noundef %338)
  %340 = fadd double %339, 2.000000e-01
  %341 = fdiv double %336, %340
  %342 = fcmp olt double %325, %341
  br i1 %342, label %343, label %347

343:                                              ; preds = %306
  %344 = load ptr, ptr %6, align 8, !tbaa !5
  %345 = load ptr, ptr %5, align 8, !tbaa !5
  %346 = getelementptr inbounds %class.medialBall, ptr %345, i32 0, i32 11
  store ptr %344, ptr %346, align 8, !tbaa !34
  br label %474

347:                                              ; preds = %306, %299
  %348 = load i16, ptr %17, align 2, !tbaa !36
  %349 = sext i16 %348 to i32
  %350 = load i16, ptr %18, align 2, !tbaa !36
  %351 = sext i16 %350 to i32
  %352 = icmp sgt i32 %349, %351
  br i1 %352, label %353, label %397

353:                                              ; preds = %347
  %354 = load ptr, ptr %5, align 8, !tbaa !5
  %355 = getelementptr inbounds %class.medialBall, ptr %354, i32 0, i32 11
  %356 = load ptr, ptr %355, align 8, !tbaa !34
  %357 = getelementptr inbounds %class.medialBall, ptr %356, i32 0, i32 5
  %358 = load float, ptr %357, align 8, !tbaa !27
  %359 = load ptr, ptr %5, align 8, !tbaa !5
  %360 = getelementptr inbounds %class.medialBall, ptr %359, i32 0, i32 5
  %361 = load float, ptr %360, align 8, !tbaa !27
  %362 = fsub float %358, %361
  %363 = fpext float %362 to double
  %364 = load double, ptr %7, align 8, !tbaa !26
  %365 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %364, double %363)
  %366 = load ptr, ptr %5, align 8, !tbaa !5
  %367 = getelementptr inbounds %class.medialBall, ptr %366, i32 0, i32 11
  %368 = load ptr, ptr %367, align 8, !tbaa !34
  %369 = load ptr, ptr %5, align 8, !tbaa !5
  %370 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %368, ptr noundef %369)
  %371 = fadd double %370, 1.200000e+00
  %372 = fdiv double %365, %371
  %373 = load ptr, ptr %6, align 8, !tbaa !5
  %374 = getelementptr inbounds %class.medialBall, ptr %373, i32 0, i32 5
  %375 = load float, ptr %374, align 8, !tbaa !27
  %376 = load ptr, ptr %5, align 8, !tbaa !5
  %377 = getelementptr inbounds %class.medialBall, ptr %376, i32 0, i32 5
  %378 = load float, ptr %377, align 8, !tbaa !27
  %379 = fsub float %375, %378
  %380 = fpext float %379 to double
  %381 = load double, ptr %7, align 8, !tbaa !26
  %382 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %381, double %380)
  %383 = load ptr, ptr %6, align 8, !tbaa !5
  %384 = load ptr, ptr %5, align 8, !tbaa !5
  %385 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %383, ptr noundef %384)
  %386 = fadd double %385, 1.300000e+00
  %387 = fdiv double %382, %386
  %388 = fcmp olt double %372, %387
  br i1 %388, label %389, label %397

389:                                              ; preds = %353
  %390 = load ptr, ptr %6, align 8, !tbaa !5
  %391 = load ptr, ptr %5, align 8, !tbaa !5
  %392 = call noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64) %390, ptr noundef %391)
  br i1 %392, label %397, label %393

393:                                              ; preds = %389
  %394 = load ptr, ptr %6, align 8, !tbaa !5
  %395 = load ptr, ptr %5, align 8, !tbaa !5
  %396 = getelementptr inbounds %class.medialBall, ptr %395, i32 0, i32 11
  store ptr %394, ptr %396, align 8, !tbaa !34
  br label %473

397:                                              ; preds = %389, %353, %347
  %398 = load i16, ptr %17, align 2, !tbaa !36
  %399 = sext i16 %398 to i32
  %400 = load i16, ptr %18, align 2, !tbaa !36
  %401 = sext i16 %400 to i32
  %402 = icmp slt i32 %399, %401
  br i1 %402, label %403, label %447

403:                                              ; preds = %397
  %404 = load ptr, ptr %6, align 8, !tbaa !5
  %405 = getelementptr inbounds %class.medialBall, ptr %404, i32 0, i32 11
  %406 = load ptr, ptr %405, align 8, !tbaa !34
  %407 = getelementptr inbounds %class.medialBall, ptr %406, i32 0, i32 5
  %408 = load float, ptr %407, align 8, !tbaa !27
  %409 = load ptr, ptr %6, align 8, !tbaa !5
  %410 = getelementptr inbounds %class.medialBall, ptr %409, i32 0, i32 5
  %411 = load float, ptr %410, align 8, !tbaa !27
  %412 = fsub float %408, %411
  %413 = fpext float %412 to double
  %414 = load double, ptr %7, align 8, !tbaa !26
  %415 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %414, double %413)
  %416 = load ptr, ptr %6, align 8, !tbaa !5
  %417 = getelementptr inbounds %class.medialBall, ptr %416, i32 0, i32 11
  %418 = load ptr, ptr %417, align 8, !tbaa !34
  %419 = load ptr, ptr %6, align 8, !tbaa !5
  %420 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %418, ptr noundef %419)
  %421 = fadd double %420, 1.200000e+00
  %422 = fdiv double %415, %421
  %423 = load ptr, ptr %5, align 8, !tbaa !5
  %424 = getelementptr inbounds %class.medialBall, ptr %423, i32 0, i32 5
  %425 = load float, ptr %424, align 8, !tbaa !27
  %426 = load ptr, ptr %6, align 8, !tbaa !5
  %427 = getelementptr inbounds %class.medialBall, ptr %426, i32 0, i32 5
  %428 = load float, ptr %427, align 8, !tbaa !27
  %429 = fsub float %425, %428
  %430 = fpext float %429 to double
  %431 = load double, ptr %7, align 8, !tbaa !26
  %432 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %431, double %430)
  %433 = load ptr, ptr %5, align 8, !tbaa !5
  %434 = load ptr, ptr %6, align 8, !tbaa !5
  %435 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %433, ptr noundef %434)
  %436 = fadd double %435, 1.300000e+00
  %437 = fdiv double %432, %436
  %438 = fcmp olt double %422, %437
  br i1 %438, label %439, label %447

439:                                              ; preds = %403
  %440 = load ptr, ptr %5, align 8, !tbaa !5
  %441 = load ptr, ptr %6, align 8, !tbaa !5
  %442 = call noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64) %440, ptr noundef %441)
  br i1 %442, label %447, label %443

443:                                              ; preds = %439
  %444 = load ptr, ptr %5, align 8, !tbaa !5
  %445 = load ptr, ptr %6, align 8, !tbaa !5
  %446 = getelementptr inbounds %class.medialBall, ptr %445, i32 0, i32 11
  store ptr %444, ptr %446, align 8, !tbaa !34
  br label %472

447:                                              ; preds = %439, %403, %397
  %448 = load ptr, ptr %14, align 8, !tbaa !5
  %449 = icmp ne ptr %448, null
  br i1 %449, label %450, label %471

450:                                              ; preds = %447
  %451 = load ptr, ptr %14, align 8, !tbaa !5
  %452 = getelementptr inbounds %class.voxel, ptr %451, i32 0, i32 5
  %453 = load float, ptr %452, align 8, !tbaa !31
  %454 = fpext float %453 to double
  %455 = load double, ptr %8, align 8, !tbaa !26
  %456 = load double, ptr %9, align 8, !tbaa !26
  %457 = fadd double %455, %456
  %458 = call double @llvm.fmuladd.f64(double 4.500000e-01, double %457, double -1.000000e+00)
  %459 = fcmp oge double %454, %458
  br i1 %459, label %460, label %471

460:                                              ; preds = %450
  %461 = load double, ptr %12, align 8, !tbaa !26
  %462 = call double @sqrt(double noundef %461) #8
  %463 = load double, ptr %8, align 8, !tbaa !26
  %464 = load double, ptr %9, align 8, !tbaa !26
  %465 = fadd double %463, %464
  %466 = call double @llvm.fmuladd.f64(double %465, double 5.000000e-01, double 2.000000e+00)
  %467 = fcmp olt double %462, %466
  br i1 %467, label %468, label %471

468:                                              ; preds = %460
  %469 = load ptr, ptr %5, align 8, !tbaa !5
  %470 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z10makeFriendP10medialBallS0_(ptr noundef %469, ptr noundef %470)
  br label %471

471:                                              ; preds = %468, %460, %450, %447
  br label %472

472:                                              ; preds = %471, %443
  br label %473

473:                                              ; preds = %472, %393
  br label %474

474:                                              ; preds = %473, %343
  br label %475

475:                                              ; preds = %474, %295
  %476 = load ptr, ptr %5, align 8, !tbaa !5
  %477 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %476)
  %478 = load ptr, ptr %6, align 8, !tbaa !5
  %479 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %478)
  %480 = icmp ne ptr %477, %479
  br i1 %480, label %481, label %484

481:                                              ; preds = %475
  %482 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.54)
  %483 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %482, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef -1) #9
  unreachable

484:                                              ; preds = %475
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #8
  br label %772

485:                                              ; preds = %243
  %486 = load ptr, ptr %15, align 8, !tbaa !5
  %487 = load ptr, ptr %16, align 8, !tbaa !5
  %488 = call noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef %486, ptr noundef %487)
  %489 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 18
  %490 = load double, ptr %489, align 8, !tbaa !37
  %491 = load ptr, ptr %15, align 8, !tbaa !5
  %492 = getelementptr inbounds %class.medialBall, ptr %491, i32 0, i32 5
  %493 = load float, ptr %492, align 8, !tbaa !27
  %494 = load ptr, ptr %16, align 8, !tbaa !5
  %495 = getelementptr inbounds %class.medialBall, ptr %494, i32 0, i32 5
  %496 = load float, ptr %495, align 8, !tbaa !27
  %497 = fadd float %493, %496
  %498 = fpext float %497 to double
  %499 = load double, ptr %7, align 8, !tbaa !26
  %500 = fmul double 2.000000e+00, %499
  %501 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %498, double %500)
  %502 = fmul double %490, %501
  %503 = load ptr, ptr %15, align 8, !tbaa !5
  %504 = getelementptr inbounds %class.medialBall, ptr %503, i32 0, i32 5
  %505 = load float, ptr %504, align 8, !tbaa !27
  %506 = load ptr, ptr %16, align 8, !tbaa !5
  %507 = getelementptr inbounds %class.medialBall, ptr %506, i32 0, i32 5
  %508 = load float, ptr %507, align 8, !tbaa !27
  %509 = fadd float %505, %508
  %510 = fpext float %509 to double
  %511 = load double, ptr %7, align 8, !tbaa !26
  %512 = fmul double 2.000000e+00, %511
  %513 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %510, double %512)
  %514 = fmul double %502, %513
  %515 = fcmp ole double %488, %514
  br i1 %515, label %516, label %627

516:                                              ; preds = %485
  %517 = load ptr, ptr %15, align 8, !tbaa !5
  %518 = getelementptr inbounds %class.medialBall, ptr %517, i32 0, i32 5
  %519 = load float, ptr %518, align 8, !tbaa !27
  %520 = load ptr, ptr %16, align 8, !tbaa !5
  %521 = getelementptr inbounds %class.medialBall, ptr %520, i32 0, i32 5
  %522 = load float, ptr %521, align 8, !tbaa !27
  %523 = fcmp olt float %519, %522
  br i1 %523, label %524, label %531

524:                                              ; preds = %516
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %525 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %525, ptr %19, align 8, !tbaa !5
  %526 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %526, ptr %5, align 8, !tbaa !5
  %527 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %527, ptr %6, align 8, !tbaa !5
  %528 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %528, ptr %19, align 8, !tbaa !5
  %529 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %529, ptr %15, align 8, !tbaa !5
  %530 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %530, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %531

531:                                              ; preds = %524, %516
  %532 = load ptr, ptr %16, align 8, !tbaa !5
  %533 = getelementptr inbounds %class.medialBall, ptr %532, i32 0, i32 5
  %534 = load float, ptr %533, align 8, !tbaa !27
  %535 = fpext float %534 to double
  %536 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %537 = load double, ptr %536, align 8, !tbaa !35
  %538 = load ptr, ptr %6, align 8, !tbaa !5
  %539 = getelementptr inbounds %class.medialBall, ptr %538, i32 0, i32 5
  %540 = load float, ptr %539, align 8, !tbaa !27
  %541 = fpext float %540 to double
  %542 = load double, ptr %7, align 8, !tbaa !26
  %543 = call double @llvm.fmuladd.f64(double %537, double %541, double %542)
  %544 = fcmp olt double %535, %543
  br i1 %544, label %545, label %626

545:                                              ; preds = %531
  %546 = load ptr, ptr %16, align 8, !tbaa !5
  %547 = getelementptr inbounds %class.medialBall, ptr %546, i32 0, i32 5
  %548 = load float, ptr %547, align 8, !tbaa !27
  %549 = fpext float %548 to double
  %550 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %551 = load double, ptr %550, align 8, !tbaa !35
  %552 = load ptr, ptr %5, align 8, !tbaa !5
  %553 = getelementptr inbounds %class.medialBall, ptr %552, i32 0, i32 5
  %554 = load float, ptr %553, align 8, !tbaa !27
  %555 = fpext float %554 to double
  %556 = load double, ptr %7, align 8, !tbaa !26
  %557 = call double @llvm.fmuladd.f64(double %551, double %555, double %556)
  %558 = fcmp olt double %549, %557
  br i1 %558, label %559, label %626

559:                                              ; preds = %545
  %560 = load ptr, ptr %16, align 8, !tbaa !5
  %561 = getelementptr inbounds %class.medialBall, ptr %560, i32 0, i32 5
  %562 = load float, ptr %561, align 8, !tbaa !27
  %563 = fpext float %562 to double
  %564 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %565 = load double, ptr %564, align 8, !tbaa !35
  %566 = load ptr, ptr %5, align 8, !tbaa !5
  %567 = getelementptr inbounds %class.medialBall, ptr %566, i32 0, i32 11
  %568 = load ptr, ptr %567, align 8, !tbaa !34
  %569 = getelementptr inbounds %class.medialBall, ptr %568, i32 0, i32 5
  %570 = load float, ptr %569, align 8, !tbaa !27
  %571 = fpext float %570 to double
  %572 = load double, ptr %7, align 8, !tbaa !26
  %573 = call double @llvm.fmuladd.f64(double %565, double %571, double %572)
  %574 = fcmp olt double %563, %573
  br i1 %574, label %575, label %626

575:                                              ; preds = %559
  br label %576

576:                                              ; preds = %600, %575
  %577 = load ptr, ptr %6, align 8, !tbaa !5
  %578 = load ptr, ptr %6, align 8, !tbaa !5
  %579 = getelementptr inbounds %class.medialBall, ptr %578, i32 0, i32 11
  %580 = load ptr, ptr %579, align 8, !tbaa !34
  %581 = icmp ne ptr %577, %580
  br i1 %581, label %582, label %598

582:                                              ; preds = %576
  %583 = load ptr, ptr %16, align 8, !tbaa !5
  %584 = getelementptr inbounds %class.medialBall, ptr %583, i32 0, i32 5
  %585 = load float, ptr %584, align 8, !tbaa !27
  %586 = fpext float %585 to double
  %587 = getelementptr inbounds %class.medialSurface, ptr %26, i32 0, i32 19
  %588 = load double, ptr %587, align 8, !tbaa !35
  %589 = load ptr, ptr %6, align 8, !tbaa !5
  %590 = getelementptr inbounds %class.medialBall, ptr %589, i32 0, i32 11
  %591 = load ptr, ptr %590, align 8, !tbaa !34
  %592 = getelementptr inbounds %class.medialBall, ptr %591, i32 0, i32 5
  %593 = load float, ptr %592, align 8, !tbaa !27
  %594 = fpext float %593 to double
  %595 = load double, ptr %7, align 8, !tbaa !26
  %596 = call double @llvm.fmuladd.f64(double %588, double %594, double %595)
  %597 = fcmp olt double %586, %596
  br label %598

598:                                              ; preds = %582, %576
  %599 = phi i1 [ false, %576 ], [ %597, %582 ]
  br i1 %599, label %600, label %610

600:                                              ; preds = %598
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %601 = load ptr, ptr %6, align 8, !tbaa !5
  %602 = getelementptr inbounds %class.medialBall, ptr %601, i32 0, i32 11
  %603 = load ptr, ptr %602, align 8, !tbaa !34
  store ptr %603, ptr %20, align 8, !tbaa !5
  %604 = load ptr, ptr %5, align 8, !tbaa !5
  %605 = load ptr, ptr %6, align 8, !tbaa !5
  %606 = getelementptr inbounds %class.medialBall, ptr %605, i32 0, i32 11
  store ptr %604, ptr %606, align 8, !tbaa !34
  %607 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %607, ptr %5, align 8, !tbaa !5
  %608 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %608, ptr %6, align 8, !tbaa !5
  %609 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 46)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %576, !llvm.loop !38

610:                                              ; preds = %598
  %611 = load ptr, ptr %6, align 8, !tbaa !5
  %612 = getelementptr inbounds %class.medialBall, ptr %611, i32 0, i32 11
  %613 = load ptr, ptr %612, align 8, !tbaa !34
  %614 = load ptr, ptr %6, align 8, !tbaa !5
  %615 = icmp eq ptr %613, %614
  br i1 %615, label %616, label %625

616:                                              ; preds = %610
  %617 = load ptr, ptr %5, align 8, !tbaa !5
  %618 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %617)
  %619 = load ptr, ptr %6, align 8, !tbaa !5
  %620 = icmp ne ptr %618, %619
  br i1 %620, label %621, label %625

621:                                              ; preds = %616
  %622 = load ptr, ptr %5, align 8, !tbaa !5
  %623 = load ptr, ptr %6, align 8, !tbaa !5
  %624 = getelementptr inbounds %class.medialBall, ptr %623, i32 0, i32 11
  store ptr %622, ptr %624, align 8, !tbaa !34
  br label %625

625:                                              ; preds = %621, %616, %610
  br label %626

626:                                              ; preds = %625, %559, %545, %531
  br label %627

627:                                              ; preds = %626, %485
  %628 = load ptr, ptr %5, align 8, !tbaa !5
  %629 = load ptr, ptr %6, align 8, !tbaa !5
  %630 = getelementptr inbounds %class.medialBall, ptr %629, i32 0, i32 11
  %631 = load ptr, ptr %630, align 8, !tbaa !34
  %632 = icmp ne ptr %628, %631
  br i1 %632, label %633, label %771

633:                                              ; preds = %627
  %634 = load ptr, ptr %5, align 8, !tbaa !5
  %635 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %634)
  store ptr %635, ptr %15, align 8, !tbaa !5
  %636 = load ptr, ptr %6, align 8, !tbaa !5
  %637 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %636)
  store ptr %637, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #8
  %638 = load ptr, ptr %5, align 8, !tbaa !5
  %639 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %638)
  store i16 %639, ptr %21, align 2, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 2, ptr %22) #8
  %640 = load ptr, ptr %6, align 8, !tbaa !5
  %641 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %640)
  store i16 %641, ptr %22, align 2, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %642 = load ptr, ptr %16, align 8, !tbaa !5
  %643 = load ptr, ptr %15, align 8, !tbaa !5
  %644 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %642, ptr noundef %643)
  %645 = load double, ptr %7, align 8, !tbaa !26
  %646 = fmul double 5.000000e-01, %645
  %647 = call double @llvm.fmuladd.f64(double %644, double 1.000000e+00, double %646)
  %648 = fptrunc double %647 to float
  store float %648, ptr %23, align 4, !tbaa !40
  br label %649

649:                                              ; preds = %695, %633
  %650 = load i16, ptr %21, align 2, !tbaa !36
  %651 = sext i16 %650 to i32
  %652 = load i16, ptr %22, align 2, !tbaa !36
  %653 = sext i16 %652 to i32
  %654 = icmp sge i32 %651, %653
  br i1 %654, label %655, label %693

655:                                              ; preds = %649
  %656 = load ptr, ptr %5, align 8, !tbaa !5
  %657 = getelementptr inbounds %class.medialBall, ptr %656, i32 0, i32 11
  %658 = load ptr, ptr %657, align 8, !tbaa !34
  %659 = getelementptr inbounds %class.medialBall, ptr %658, i32 0, i32 5
  %660 = load float, ptr %659, align 8, !tbaa !27
  %661 = load ptr, ptr %5, align 8, !tbaa !5
  %662 = getelementptr inbounds %class.medialBall, ptr %661, i32 0, i32 5
  %663 = load float, ptr %662, align 8, !tbaa !27
  %664 = fsub float %660, %663
  %665 = fpext float %664 to double
  %666 = load double, ptr %7, align 8, !tbaa !26
  %667 = call double @llvm.fmuladd.f64(double 5.500000e-01, double %666, double %665)
  %668 = load ptr, ptr %15, align 8, !tbaa !5
  %669 = load ptr, ptr %5, align 8, !tbaa !5
  %670 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %668, ptr noundef %669)
  %671 = load float, ptr %23, align 4, !tbaa !40
  %672 = fpext float %671 to double
  %673 = fadd double %670, %672
  %674 = fdiv double %667, %673
  %675 = load ptr, ptr %6, align 8, !tbaa !5
  %676 = getelementptr inbounds %class.medialBall, ptr %675, i32 0, i32 5
  %677 = load float, ptr %676, align 8, !tbaa !27
  %678 = load ptr, ptr %5, align 8, !tbaa !5
  %679 = getelementptr inbounds %class.medialBall, ptr %678, i32 0, i32 5
  %680 = load float, ptr %679, align 8, !tbaa !27
  %681 = fsub float %677, %680
  %682 = fpext float %681 to double
  %683 = load double, ptr %7, align 8, !tbaa !26
  %684 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %683, double %682)
  %685 = load ptr, ptr %16, align 8, !tbaa !5
  %686 = load ptr, ptr %5, align 8, !tbaa !5
  %687 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %685, ptr noundef %686)
  %688 = load float, ptr %23, align 4, !tbaa !40
  %689 = fpext float %688 to double
  %690 = fadd double %687, %689
  %691 = fdiv double %684, %690
  %692 = fcmp olt double %674, %691
  br label %693

693:                                              ; preds = %655, %649
  %694 = phi i1 [ false, %649 ], [ %692, %655 ]
  br i1 %694, label %695, label %708

695:                                              ; preds = %693
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %696 = load ptr, ptr %5, align 8, !tbaa !5
  %697 = getelementptr inbounds %class.medialBall, ptr %696, i32 0, i32 11
  %698 = load ptr, ptr %697, align 8, !tbaa !34
  store ptr %698, ptr %24, align 8, !tbaa !5
  %699 = load ptr, ptr %6, align 8, !tbaa !5
  %700 = load ptr, ptr %5, align 8, !tbaa !5
  %701 = getelementptr inbounds %class.medialBall, ptr %700, i32 0, i32 11
  store ptr %699, ptr %701, align 8, !tbaa !34
  %702 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %702, ptr %6, align 8, !tbaa !5
  %703 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %703, ptr %5, align 8, !tbaa !5
  %704 = load i16, ptr %22, align 2, !tbaa !36
  %705 = add i16 %704, 1
  store i16 %705, ptr %22, align 2, !tbaa !36
  %706 = load i16, ptr %21, align 2, !tbaa !36
  %707 = add i16 %706, -1
  store i16 %707, ptr %21, align 2, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %649, !llvm.loop !41

708:                                              ; preds = %693
  br label %709

709:                                              ; preds = %755, %708
  %710 = load i16, ptr %22, align 2, !tbaa !36
  %711 = sext i16 %710 to i32
  %712 = load i16, ptr %21, align 2, !tbaa !36
  %713 = sext i16 %712 to i32
  %714 = icmp sge i32 %711, %713
  br i1 %714, label %715, label %753

715:                                              ; preds = %709
  %716 = load ptr, ptr %6, align 8, !tbaa !5
  %717 = getelementptr inbounds %class.medialBall, ptr %716, i32 0, i32 11
  %718 = load ptr, ptr %717, align 8, !tbaa !34
  %719 = getelementptr inbounds %class.medialBall, ptr %718, i32 0, i32 5
  %720 = load float, ptr %719, align 8, !tbaa !27
  %721 = load ptr, ptr %6, align 8, !tbaa !5
  %722 = getelementptr inbounds %class.medialBall, ptr %721, i32 0, i32 5
  %723 = load float, ptr %722, align 8, !tbaa !27
  %724 = fsub float %720, %723
  %725 = fpext float %724 to double
  %726 = load double, ptr %7, align 8, !tbaa !26
  %727 = call double @llvm.fmuladd.f64(double 5.500000e-01, double %726, double %725)
  %728 = load ptr, ptr %16, align 8, !tbaa !5
  %729 = load ptr, ptr %6, align 8, !tbaa !5
  %730 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %728, ptr noundef %729)
  %731 = load float, ptr %23, align 4, !tbaa !40
  %732 = fpext float %731 to double
  %733 = fadd double %730, %732
  %734 = fdiv double %727, %733
  %735 = load ptr, ptr %5, align 8, !tbaa !5
  %736 = getelementptr inbounds %class.medialBall, ptr %735, i32 0, i32 5
  %737 = load float, ptr %736, align 8, !tbaa !27
  %738 = load ptr, ptr %6, align 8, !tbaa !5
  %739 = getelementptr inbounds %class.medialBall, ptr %738, i32 0, i32 5
  %740 = load float, ptr %739, align 8, !tbaa !27
  %741 = fsub float %737, %740
  %742 = fpext float %741 to double
  %743 = load double, ptr %7, align 8, !tbaa !26
  %744 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %743, double %742)
  %745 = load ptr, ptr %15, align 8, !tbaa !5
  %746 = load ptr, ptr %6, align 8, !tbaa !5
  %747 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %745, ptr noundef %746)
  %748 = load float, ptr %23, align 4, !tbaa !40
  %749 = fpext float %748 to double
  %750 = fadd double %747, %749
  %751 = fdiv double %744, %750
  %752 = fcmp olt double %734, %751
  br label %753

753:                                              ; preds = %715, %709
  %754 = phi i1 [ false, %709 ], [ %752, %715 ]
  br i1 %754, label %755, label %768

755:                                              ; preds = %753
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %756 = load ptr, ptr %6, align 8, !tbaa !5
  %757 = getelementptr inbounds %class.medialBall, ptr %756, i32 0, i32 11
  %758 = load ptr, ptr %757, align 8, !tbaa !34
  store ptr %758, ptr %25, align 8, !tbaa !5
  %759 = load ptr, ptr %5, align 8, !tbaa !5
  %760 = load ptr, ptr %6, align 8, !tbaa !5
  %761 = getelementptr inbounds %class.medialBall, ptr %760, i32 0, i32 11
  store ptr %759, ptr %761, align 8, !tbaa !34
  %762 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %762, ptr %5, align 8, !tbaa !5
  %763 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %763, ptr %6, align 8, !tbaa !5
  %764 = load i16, ptr %21, align 2, !tbaa !36
  %765 = add i16 %764, 1
  store i16 %765, ptr %21, align 2, !tbaa !36
  %766 = load i16, ptr %22, align 2, !tbaa !36
  %767 = add i16 %766, -1
  store i16 %767, ptr %22, align 2, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %709, !llvm.loop !42

768:                                              ; preds = %753
  %769 = load ptr, ptr %5, align 8, !tbaa !5
  %770 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z10makeFriendP10medialBallS0_(ptr noundef %769, ptr noundef %770)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #8
  br label %771

771:                                              ; preds = %768, %627
  br label %772

772:                                              ; preds = %771, %484
  br label %773

773:                                              ; preds = %772, %239, %231
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %774

774:                                              ; preds = %773, %109, %98, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distPK10medialBallS1_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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, !25, i64 208}
!10 = !{!"_ZTS13medialSurface", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !13, i64 48, !14, i64 64, !18, i64 88, !22, i64 112, !23, i64 176, !25, i64 184, !25, i64 192, !25, i64 200, !25, i64 208, !25, i64 216, !25, i64 224, !11, i64 232, !25, i64 240, !23, i64 248}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTS7segment", !11, i64 0, !7, i64 4, !6, i64 8}
!14 = !{!"_ZTSSt6vectorI5voxelSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseI5voxelSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorI10medialBallSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI10medialBallSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTS10medialBall", !6, i64 0, !23, i64 8, !23, i64 12, !23, i64 16, !24, i64 20, !23, i64 24, !24, i64 28, !24, i64 30, !24, i64 32, !24, i64 34, !24, i64 36, !6, i64 40, !6, i64 48, !6, i64 56}
!23 = !{!"float", !7, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!25, !25, i64 0}
!27 = !{!22, !23, i64 24}
!28 = !{!22, !23, i64 8}
!29 = !{!22, !23, i64 12}
!30 = !{!22, !23, i64 16}
!31 = !{!32, !23, i64 16}
!32 = !{!"_ZTS5voxel", !6, i64 0, !24, i64 8, !24, i64 10, !24, i64 12, !23, i64 16}
!33 = !{!10, !25, i64 200}
!34 = !{!22, !6, i64 40}
!35 = !{!10, !25, i64 224}
!36 = !{!24, !24, i64 0}
!37 = !{!10, !25, i64 216}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!23, !23, i64 0}
!41 = distinct !{!41, !39}
!42 = distinct !{!42, !39}


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.54 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10makeFriendP10medialBallS0_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface16competeForParentEP10medialBallS1_(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 align 2 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = load double, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = load float, ptr %8, align 8, !tbaa !25
  %10 = fpext float %9 to double
  store double %10, ptr %4, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %11 = getelementptr inbounds i8, ptr %2, i64 24
  %12 = load float, ptr %11, align 8, !tbaa !25
  %13 = fpext float %12 to double
  store double %13, ptr %5, align 8, !tbaa !26
  %14 = fmul double %10, %10
  %15 = fmul double %13, %13
  %16 = tail call noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef %1, ptr noundef %2)
  %17 = fadd double %14, %15
  %18 = fdiv double 1.000000e+00, %17
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  %20 = load float, ptr %19, align 8, !tbaa !27
  %21 = fpext float %20 to double
  %22 = getelementptr inbounds i8, ptr %2, i64 8
  %23 = load float, ptr %22, align 8, !tbaa !27
  %24 = fpext float %23 to double
  %25 = fmul double %14, %24
  %26 = tail call double @llvm.fmuladd.f64(double %21, double %15, double %25)
  %27 = fmul double %18, %26
  %28 = fptosi double %27 to i32
  %29 = getelementptr inbounds i8, ptr %1, i64 12
  %30 = load float, ptr %29, align 4, !tbaa !28
  %31 = fpext float %30 to double
  %32 = getelementptr inbounds i8, ptr %2, i64 12
  %33 = load float, ptr %32, align 4, !tbaa !28
  %34 = fpext float %33 to double
  %35 = fmul double %14, %34
  %36 = tail call double @llvm.fmuladd.f64(double %31, double %15, double %35)
  %37 = fmul double %18, %36
  %38 = fptosi double %37 to i32
  %39 = getelementptr inbounds i8, ptr %1, i64 16
  %40 = load float, ptr %39, align 8, !tbaa !29
  %41 = fpext float %40 to double
  %42 = getelementptr inbounds i8, ptr %2, i64 16
  %43 = load float, ptr %42, align 8, !tbaa !29
  %44 = fpext float %43 to double
  %45 = fmul double %14, %44
  %46 = tail call double @llvm.fmuladd.f64(double %41, double %15, double %45)
  %47 = fmul double %18, %46
  %48 = fptosi double %47 to i32
  %49 = tail call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %28, i32 noundef %38, i32 noundef %48)
  %.not = icmp eq ptr %49, null
  br i1 %.not, label %415, label %50

50:                                               ; preds = %3
  %51 = getelementptr inbounds i8, ptr %49, i64 16
  %52 = load float, ptr %51, align 8, !tbaa !30
  %53 = fpext float %52 to double
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %55 = load double, ptr %54, align 8, !tbaa !26
  %56 = getelementptr inbounds i8, ptr %0, i64 200
  %57 = load double, ptr %56, align 8, !tbaa !32
  %58 = call double @llvm.fmuladd.f64(double %55, double %57, double -5.000000e-01)
  %59 = fcmp olt double %58, %53
  br i1 %59, label %60, label %415

60:                                               ; preds = %50
  %61 = call double @sqrt(double noundef %16) #9
  %62 = fmul double %61, 1.010000e+00
  %63 = load double, ptr %4, align 8, !tbaa !26
  %64 = load double, ptr %5, align 8, !tbaa !26
  %65 = fadd double %63, %64
  %66 = fadd double %65, 1.000000e+00
  %67 = fadd double %7, %66
  %68 = fcmp olt double %62, %67
  br i1 %68, label %69, label %415

69:                                               ; preds = %60
  %70 = getelementptr inbounds i8, ptr %2, i64 40
  %71 = load ptr, ptr %70, align 8, !tbaa !33
  %72 = icmp eq ptr %71, %2
  br i1 %72, label %73, label %97

73:                                               ; preds = %69
  %74 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %.not251 = icmp eq ptr %74, %2
  br i1 %.not251, label %124, label %75

75:                                               ; preds = %73
  %76 = load double, ptr %4, align 8, !tbaa !26
  %77 = load double, ptr %5, align 8, !tbaa !26
  %78 = fcmp ult double %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store ptr %1, ptr %70, align 8, !tbaa !33
  br label %124

80:                                               ; preds = %75
  %81 = getelementptr inbounds i8, ptr %1, i64 40
  %82 = load ptr, ptr %81, align 8, !tbaa !33
  %83 = getelementptr inbounds i8, ptr %82, i64 24
  %84 = load float, ptr %83, align 8, !tbaa !25
  %85 = fpext float %84 to double
  %86 = fcmp ult double %77, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %80
  store ptr %2, ptr %81, align 8, !tbaa !33
  br label %124

88:                                               ; preds = %80
  %89 = fsub double %77, %7
  %90 = fcmp ult double %76, %89
  br i1 %90, label %124, label %91

91:                                               ; preds = %88
  %92 = getelementptr inbounds i8, ptr %0, i64 224
  %93 = load double, ptr %92, align 8, !tbaa !34
  %94 = call double @llvm.fmuladd.f64(double %76, double %93, double %7)
  %95 = fcmp ult double %94, %77
  br i1 %95, label %124, label %96

96:                                               ; preds = %91
  store ptr %1, ptr %70, align 8, !tbaa !33
  br label %124

97:                                               ; preds = %69
  %98 = getelementptr inbounds i8, ptr %1, i64 40
  %99 = load ptr, ptr %98, align 8, !tbaa !33
  %100 = icmp eq ptr %99, %1
  br i1 %100, label %101, label %124

101:                                              ; preds = %97
  %102 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %.not250 = icmp eq ptr %102, %1
  br i1 %.not250, label %124, label %103

103:                                              ; preds = %101
  %104 = load double, ptr %5, align 8, !tbaa !26
  %105 = load double, ptr %4, align 8, !tbaa !26
  %106 = fcmp ult double %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store ptr %2, ptr %98, align 8, !tbaa !33
  br label %124

108:                                              ; preds = %103
  %109 = load ptr, ptr %70, align 8, !tbaa !33
  %110 = getelementptr inbounds i8, ptr %109, i64 24
  %111 = load float, ptr %110, align 8, !tbaa !25
  %112 = fpext float %111 to double
  %113 = fcmp ult double %105, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %108
  store ptr %1, ptr %70, align 8, !tbaa !33
  br label %124

115:                                              ; preds = %108
  %116 = fsub double %105, %7
  %117 = fcmp ult double %104, %116
  br i1 %117, label %124, label %118

118:                                              ; preds = %115
  %119 = getelementptr inbounds i8, ptr %0, i64 224
  %120 = load double, ptr %119, align 8, !tbaa !34
  %121 = call double @llvm.fmuladd.f64(double %104, double %120, double %7)
  %122 = fcmp ult double %121, %105
  br i1 %122, label %124, label %123

123:                                              ; preds = %118
  store ptr %2, ptr %98, align 8, !tbaa !33
  br label %124

124:                                              ; preds = %97, %107, %115, %118, %123, %114, %101, %73, %87, %96, %91, %88, %79
  %125 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %126 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %.not252 = icmp eq ptr %125, %2
  %.not253 = icmp eq ptr %126, %1
  %or.cond = or i1 %.not252, %.not253
  br i1 %or.cond, label %415, label %127

127:                                              ; preds = %124
  %128 = icmp eq ptr %125, %126
  br i1 %128, label %129, label %275

129:                                              ; preds = %127
  %130 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %131 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %132 = sext i16 %130 to i32
  %133 = add nsw i32 %132, 1
  %134 = sext i16 %131 to i32
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %136, label %162

136:                                              ; preds = %129
  %137 = load ptr, ptr %70, align 8, !tbaa !33
  %138 = getelementptr inbounds i8, ptr %137, i64 24
  %139 = load float, ptr %138, align 8, !tbaa !25
  %140 = load float, ptr %11, align 8, !tbaa !25
  %141 = fsub float %139, %140
  %142 = fpext float %141 to double
  %143 = call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %142)
  %144 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %137, ptr noundef nonnull %2)
  %145 = load float, ptr %8, align 8, !tbaa !25
  %146 = load float, ptr %11, align 8, !tbaa !25
  %147 = fsub float %145, %146
  %148 = fpext float %147 to double
  %149 = call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %148)
  %150 = fadd double %149, 1.000000e-02
  %151 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef nonnull %1, ptr noundef nonnull %2)
  %152 = insertelement <2 x double> poison, double %144, i64 0
  %153 = insertelement <2 x double> %152, double %151, i64 1
  %154 = fadd <2 x double> %153, <double 2.500000e-01, double 2.000000e-01>
  %155 = insertelement <2 x double> poison, double %143, i64 0
  %156 = insertelement <2 x double> %155, double %150, i64 1
  %157 = fdiv <2 x double> %156, %154
  %158 = extractelement <2 x double> %157, i64 0
  %159 = extractelement <2 x double> %157, i64 1
  %160 = fcmp olt double %158, %159
  br i1 %160, label %161, label %162

161:                                              ; preds = %136
  store ptr %1, ptr %70, align 8, !tbaa !33
  br label %269

162:                                              ; preds = %136, %129
  %163 = add nsw i32 %134, 1
  %164 = icmp slt i32 %163, %132
  br i1 %164, label %165, label %192

165:                                              ; preds = %162
  %166 = getelementptr inbounds i8, ptr %1, i64 40
  %167 = load ptr, ptr %166, align 8, !tbaa !33
  %168 = getelementptr inbounds i8, ptr %167, i64 24
  %169 = load float, ptr %168, align 8, !tbaa !25
  %170 = load float, ptr %8, align 8, !tbaa !25
  %171 = fsub float %169, %170
  %172 = fpext float %171 to double
  %173 = call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %172)
  %174 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %167, ptr noundef nonnull %1)
  %175 = load float, ptr %11, align 8, !tbaa !25
  %176 = load float, ptr %8, align 8, !tbaa !25
  %177 = fsub float %175, %176
  %178 = fpext float %177 to double
  %179 = call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %178)
  %180 = fadd double %179, 1.000000e-02
  %181 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef nonnull %2, ptr noundef nonnull %1)
  %182 = insertelement <2 x double> poison, double %174, i64 0
  %183 = insertelement <2 x double> %182, double %181, i64 1
  %184 = fadd <2 x double> %183, <double 2.500000e-01, double 2.000000e-01>
  %185 = insertelement <2 x double> poison, double %173, i64 0
  %186 = insertelement <2 x double> %185, double %180, i64 1
  %187 = fdiv <2 x double> %186, %184
  %188 = extractelement <2 x double> %187, i64 0
  %189 = extractelement <2 x double> %187, i64 1
  %190 = fcmp olt double %188, %189
  br i1 %190, label %191, label %192

191:                                              ; preds = %165
  store ptr %2, ptr %166, align 8, !tbaa !33
  br label %269

192:                                              ; preds = %165, %162
  %193 = icmp sgt i16 %130, %131
  br i1 %193, label %194, label %223

194:                                              ; preds = %192
  %195 = getelementptr inbounds i8, ptr %1, i64 40
  %196 = load ptr, ptr %195, align 8, !tbaa !33
  %197 = getelementptr inbounds i8, ptr %196, i64 24
  %198 = load float, ptr %197, align 8, !tbaa !25
  %199 = load float, ptr %8, align 8, !tbaa !25
  %200 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %196, ptr noundef nonnull %1)
  %201 = load float, ptr %11, align 8, !tbaa !25
  %202 = load float, ptr %8, align 8, !tbaa !25
  %203 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef nonnull %2, ptr noundef nonnull %1)
  %204 = insertelement <2 x float> poison, float %198, i64 0
  %205 = insertelement <2 x float> %204, float %201, i64 1
  %206 = insertelement <2 x float> poison, float %199, i64 0
  %207 = insertelement <2 x float> %206, float %202, i64 1
  %208 = fsub <2 x float> %205, %207
  %209 = fpext <2 x float> %208 to <2 x double>
  %210 = insertelement <2 x double> poison, double %7, i64 0
  %211 = shufflevector <2 x double> %210, <2 x double> poison, <2 x i32> zeroinitializer
  %212 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %211, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %209)
  %213 = insertelement <2 x double> poison, double %200, i64 0
  %214 = insertelement <2 x double> %213, double %203, i64 1
  %215 = fadd <2 x double> %214, <double 1.200000e+00, double 1.300000e+00>
  %216 = fdiv <2 x double> %212, %215
  %217 = extractelement <2 x double> %216, i64 0
  %218 = extractelement <2 x double> %216, i64 1
  %219 = fcmp olt double %217, %218
  br i1 %219, label %220, label %223

220:                                              ; preds = %194
  %221 = call noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull %1)
  br i1 %221, label %223, label %222

222:                                              ; preds = %220
  store ptr %2, ptr %195, align 8, !tbaa !33
  br label %269

223:                                              ; preds = %220, %194, %192
  %224 = icmp slt i16 %130, %131
  br i1 %224, label %225, label %253

225:                                              ; preds = %223
  %226 = load ptr, ptr %70, align 8, !tbaa !33
  %227 = getelementptr inbounds i8, ptr %226, i64 24
  %228 = load float, ptr %227, align 8, !tbaa !25
  %229 = load float, ptr %11, align 8, !tbaa !25
  %230 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %226, ptr noundef nonnull %2)
  %231 = load float, ptr %8, align 8, !tbaa !25
  %232 = load float, ptr %11, align 8, !tbaa !25
  %233 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef nonnull %1, ptr noundef nonnull %2)
  %234 = insertelement <2 x float> poison, float %228, i64 0
  %235 = insertelement <2 x float> %234, float %231, i64 1
  %236 = insertelement <2 x float> poison, float %229, i64 0
  %237 = insertelement <2 x float> %236, float %232, i64 1
  %238 = fsub <2 x float> %235, %237
  %239 = fpext <2 x float> %238 to <2 x double>
  %240 = insertelement <2 x double> poison, double %7, i64 0
  %241 = shufflevector <2 x double> %240, <2 x double> poison, <2 x i32> zeroinitializer
  %242 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %241, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %239)
  %243 = insertelement <2 x double> poison, double %230, i64 0
  %244 = insertelement <2 x double> %243, double %233, i64 1
  %245 = fadd <2 x double> %244, <double 1.200000e+00, double 1.300000e+00>
  %246 = fdiv <2 x double> %242, %245
  %247 = extractelement <2 x double> %246, i64 0
  %248 = extractelement <2 x double> %246, i64 1
  %249 = fcmp olt double %247, %248
  br i1 %249, label %250, label %253

250:                                              ; preds = %225
  %251 = call noundef zeroext i1 @_ZNK10medialBall9inParentsEPS_(ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull %2)
  br i1 %251, label %253, label %252

252:                                              ; preds = %250
  store ptr %1, ptr %70, align 8, !tbaa !33
  br label %269

253:                                              ; preds = %223, %225, %250
  %254 = load float, ptr %51, align 8, !tbaa !30
  %255 = fpext float %254 to double
  %256 = load double, ptr %4, align 8, !tbaa !26
  %257 = load double, ptr %5, align 8, !tbaa !26
  %258 = fadd double %256, %257
  %259 = call double @llvm.fmuladd.f64(double %258, double 4.500000e-01, double -1.000000e+00)
  %260 = fcmp ugt double %259, %255
  br i1 %260, label %269, label %261

261:                                              ; preds = %253
  %262 = call double @sqrt(double noundef %16) #9
  %263 = load double, ptr %4, align 8, !tbaa !26
  %264 = load double, ptr %5, align 8, !tbaa !26
  %265 = fadd double %263, %264
  %266 = call double @llvm.fmuladd.f64(double %265, double 5.000000e-01, double 2.000000e+00)
  %267 = fcmp olt double %262, %266
  br i1 %267, label %268, label %269

268:                                              ; preds = %261
  call void @_Z10makeFriendP10medialBallS0_(ptr noundef nonnull %1, ptr noundef nonnull %2)
  br label %269

269:                                              ; preds = %191, %252, %268, %261, %253, %222, %161
  %270 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %271 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %.not259 = icmp eq ptr %270, %271
  br i1 %.not259, label %415, label %272

272:                                              ; preds = %269
  %273 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.54)
  %274 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %273, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef -1) #10
  unreachable

275:                                              ; preds = %127
  %276 = call noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef %125, ptr noundef %126)
  %277 = getelementptr inbounds i8, ptr %0, i64 216
  %278 = load double, ptr %277, align 8, !tbaa !35
  %279 = getelementptr inbounds i8, ptr %125, i64 24
  %280 = load float, ptr %279, align 8, !tbaa !25
  %281 = getelementptr inbounds i8, ptr %126, i64 24
  %282 = load float, ptr %281, align 8, !tbaa !25
  %283 = fadd float %280, %282
  %284 = fpext float %283 to double
  %285 = fmul double %7, 2.000000e+00
  %286 = call double @llvm.fmuladd.f64(double %284, double 5.000000e-01, double %285)
  %287 = fmul double %278, %286
  %288 = fmul double %286, %287
  %289 = fcmp ugt double %276, %288
  br i1 %289, label %.critedge, label %290

290:                                              ; preds = %275
  %291 = fcmp olt float %280, %282
  %.0235 = select i1 %291, ptr %125, ptr %126
  %.0226 = select i1 %291, ptr %1, ptr %2
  %.0 = select i1 %291, ptr %2, ptr %1
  %292 = getelementptr inbounds i8, ptr %.0235, i64 24
  %293 = load float, ptr %292, align 8, !tbaa !25
  %294 = fpext float %293 to double
  %295 = getelementptr inbounds i8, ptr %0, i64 224
  %296 = load double, ptr %295, align 8, !tbaa !34
  %297 = getelementptr inbounds i8, ptr %.0226, i64 24
  %298 = load float, ptr %297, align 8, !tbaa !25
  %299 = fpext float %298 to double
  %300 = call double @llvm.fmuladd.f64(double %296, double %299, double %7)
  %301 = fcmp ogt double %300, %294
  br i1 %301, label %302, label %.critedge

302:                                              ; preds = %290
  %303 = getelementptr inbounds i8, ptr %.0, i64 24
  %304 = load float, ptr %303, align 8, !tbaa !25
  %305 = fpext float %304 to double
  %306 = call double @llvm.fmuladd.f64(double %296, double %305, double %7)
  %307 = fcmp ogt double %306, %294
  br i1 %307, label %308, label %.critedge

308:                                              ; preds = %302
  %309 = getelementptr inbounds i8, ptr %.0, i64 40
  %310 = load ptr, ptr %309, align 8, !tbaa !33
  %311 = getelementptr inbounds i8, ptr %310, i64 24
  %312 = load float, ptr %311, align 8, !tbaa !25
  %313 = fpext float %312 to double
  %314 = call double @llvm.fmuladd.f64(double %296, double %313, double %7)
  %315 = fcmp ogt double %314, %294
  br i1 %315, label %.preheader, label %.critedge

.preheader:                                       ; preds = %308
  %316 = getelementptr inbounds i8, ptr %.0226, i64 40
  %317 = load ptr, ptr %316, align 8, !tbaa !33
  %.not254263 = icmp eq ptr %.0226, %317
  br i1 %.not254263, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %328
  %318 = phi ptr [ %331, %328 ], [ %317, %.preheader ]
  %319 = phi ptr [ %330, %328 ], [ %316, %.preheader ]
  %.1265 = phi ptr [ %.1227264, %328 ], [ %.0, %.preheader ]
  %.1227264 = phi ptr [ %318, %328 ], [ %.0226, %.preheader ]
  %320 = load float, ptr %292, align 8, !tbaa !25
  %321 = fpext float %320 to double
  %322 = load double, ptr %295, align 8, !tbaa !34
  %323 = getelementptr inbounds i8, ptr %318, i64 24
  %324 = load float, ptr %323, align 8, !tbaa !25
  %325 = fpext float %324 to double
  %326 = call double @llvm.fmuladd.f64(double %322, double %325, double %7)
  %327 = fcmp ogt double %326, %321
  br i1 %327, label %328, label %.critedge

328:                                              ; preds = %.lr.ph
  store ptr %.1265, ptr %319, align 8, !tbaa !33
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 46)
  %330 = getelementptr inbounds i8, ptr %318, i64 40
  %331 = load ptr, ptr %330, align 8, !tbaa !33
  %.not254 = icmp eq ptr %318, %331
  br i1 %.not254, label %._crit_edge, label %.lr.ph, !llvm.loop !36

._crit_edge:                                      ; preds = %328, %.preheader
  %.1227.lcssa = phi ptr [ %.0226, %.preheader ], [ %318, %328 ]
  %.1.lcssa = phi ptr [ %.0, %.preheader ], [ %.1227264, %328 ]
  %.lcssa = phi ptr [ %316, %.preheader ], [ %330, %328 ]
  %332 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %.1.lcssa)
  %.not255 = icmp eq ptr %332, %.1227.lcssa
  br i1 %.not255, label %.critedge, label %333

333:                                              ; preds = %._crit_edge
  store ptr %.1.lcssa, ptr %.lcssa, align 8, !tbaa !33
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph, %290, %302, %308, %333, %._crit_edge, %275
  %.2228 = phi ptr [ %.1227.lcssa, %333 ], [ %.1227.lcssa, %._crit_edge ], [ %.0226, %308 ], [ %.0226, %302 ], [ %.0226, %290 ], [ %2, %275 ], [ %.1227264, %.lr.ph ]
  %.2 = phi ptr [ %.1.lcssa, %333 ], [ %.1.lcssa, %._crit_edge ], [ %.0, %308 ], [ %.0, %302 ], [ %.0, %290 ], [ %1, %275 ], [ %.1265, %.lr.ph ]
  %334 = getelementptr inbounds i8, ptr %.2228, i64 40
  %335 = load ptr, ptr %334, align 8, !tbaa !33
  %.not256 = icmp eq ptr %.2, %335
  br i1 %.not256, label %415, label %336

336:                                              ; preds = %.critedge
  %337 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %.2)
  %338 = call noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64) %.2228)
  %339 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %.2)
  %340 = call noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64) %.2228)
  %341 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %338, ptr noundef %337)
  %342 = fmul double %7, 5.000000e-01
  %343 = fadd double %342, %341
  %344 = fptrunc double %343 to float
  %.not257268 = icmp slt i16 %339, %340
  br i1 %.not257268, label %.critedge2, label %.lr.ph274

.lr.ph274:                                        ; preds = %336
  %345 = fpext float %344 to double
  %346 = insertelement <2 x double> poison, double %7, i64 0
  %347 = shufflevector <2 x double> %346, <2 x double> poison, <2 x i32> zeroinitializer
  %348 = insertelement <2 x double> poison, double %345, i64 0
  %349 = shufflevector <2 x double> %348, <2 x double> poison, <2 x i32> zeroinitializer
  br label %350

350:                                              ; preds = %.lr.ph274, %376
  %.3272 = phi ptr [ %.2, %.lr.ph274 ], [ %377, %376 ]
  %.3229271 = phi ptr [ %.2228, %.lr.ph274 ], [ %.3272, %376 ]
  %.0231270 = phi i16 [ %340, %.lr.ph274 ], [ %378, %376 ]
  %.0233269 = phi i16 [ %339, %.lr.ph274 ], [ %379, %376 ]
  %351 = getelementptr inbounds i8, ptr %.3272, i64 40
  %352 = load ptr, ptr %351, align 8, !tbaa !33
  %353 = getelementptr inbounds i8, ptr %352, i64 24
  %354 = load float, ptr %353, align 8, !tbaa !25
  %355 = getelementptr inbounds i8, ptr %.3272, i64 24
  %356 = load float, ptr %355, align 8, !tbaa !25
  %357 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %337, ptr noundef %.3272)
  %358 = getelementptr inbounds i8, ptr %.3229271, i64 24
  %359 = load float, ptr %358, align 8, !tbaa !25
  %360 = load float, ptr %355, align 8, !tbaa !25
  %361 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %338, ptr noundef %.3272)
  %362 = insertelement <2 x float> poison, float %354, i64 0
  %363 = insertelement <2 x float> %362, float %359, i64 1
  %364 = insertelement <2 x float> poison, float %356, i64 0
  %365 = insertelement <2 x float> %364, float %360, i64 1
  %366 = fsub <2 x float> %363, %365
  %367 = fpext <2 x float> %366 to <2 x double>
  %368 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %347, <2 x double> <double 5.500000e-01, double 5.000000e-01>, <2 x double> %367)
  %369 = insertelement <2 x double> poison, double %357, i64 0
  %370 = insertelement <2 x double> %369, double %361, i64 1
  %371 = fadd <2 x double> %370, %349
  %372 = fdiv <2 x double> %368, %371
  %373 = extractelement <2 x double> %372, i64 0
  %374 = extractelement <2 x double> %372, i64 1
  %375 = fcmp olt double %373, %374
  br i1 %375, label %376, label %.critedge2

376:                                              ; preds = %350
  %377 = load ptr, ptr %351, align 8, !tbaa !33
  store ptr %.3229271, ptr %351, align 8, !tbaa !33
  %378 = add i16 %.0231270, 1
  %379 = add i16 %.0233269, -1
  %.not257 = icmp slt i16 %379, %378
  br i1 %.not257, label %.critedge2, label %350, !llvm.loop !38

.critedge2:                                       ; preds = %350, %376, %336
  %.0233.lcssa = phi i16 [ %339, %336 ], [ %379, %376 ], [ %.0233269, %350 ]
  %.0231.lcssa = phi i16 [ %340, %336 ], [ %378, %376 ], [ %.0231270, %350 ]
  %.3229.lcssa = phi ptr [ %.2228, %336 ], [ %.3272, %376 ], [ %.3229271, %350 ]
  %.3.lcssa = phi ptr [ %.2, %336 ], [ %377, %376 ], [ %.3272, %350 ]
  %.not258284 = icmp slt i16 %.0231.lcssa, %.0233.lcssa
  br i1 %.not258284, label %.critedge4, label %.lr.ph289

.lr.ph289:                                        ; preds = %.critedge2
  %380 = fpext float %344 to double
  %381 = insertelement <2 x double> poison, double %7, i64 0
  %382 = shufflevector <2 x double> %381, <2 x double> poison, <2 x i32> zeroinitializer
  %383 = insertelement <2 x double> poison, double %380, i64 0
  %384 = shufflevector <2 x double> %383, <2 x double> poison, <2 x i32> zeroinitializer
  br label %385

385:                                              ; preds = %.lr.ph289, %411
  %.4288 = phi ptr [ %.3.lcssa, %.lr.ph289 ], [ %.4230287, %411 ]
  %.4230287 = phi ptr [ %.3229.lcssa, %.lr.ph289 ], [ %412, %411 ]
  %.1232286 = phi i16 [ %.0231.lcssa, %.lr.ph289 ], [ %414, %411 ]
  %.1234285 = phi i16 [ %.0233.lcssa, %.lr.ph289 ], [ %413, %411 ]
  %386 = getelementptr inbounds i8, ptr %.4230287, i64 40
  %387 = load ptr, ptr %386, align 8, !tbaa !33
  %388 = getelementptr inbounds i8, ptr %387, i64 24
  %389 = load float, ptr %388, align 8, !tbaa !25
  %390 = getelementptr inbounds i8, ptr %.4230287, i64 24
  %391 = load float, ptr %390, align 8, !tbaa !25
  %392 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %338, ptr noundef %.4230287)
  %393 = getelementptr inbounds i8, ptr %.4288, i64 24
  %394 = load float, ptr %393, align 8, !tbaa !25
  %395 = load float, ptr %390, align 8, !tbaa !25
  %396 = call noundef double @_Z4distPK10medialBallS1_(ptr noundef %337, ptr noundef %.4230287)
  %397 = insertelement <2 x float> poison, float %389, i64 0
  %398 = insertelement <2 x float> %397, float %394, i64 1
  %399 = insertelement <2 x float> poison, float %391, i64 0
  %400 = insertelement <2 x float> %399, float %395, i64 1
  %401 = fsub <2 x float> %398, %400
  %402 = fpext <2 x float> %401 to <2 x double>
  %403 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %382, <2 x double> <double 5.500000e-01, double 5.000000e-01>, <2 x double> %402)
  %404 = insertelement <2 x double> poison, double %392, i64 0
  %405 = insertelement <2 x double> %404, double %396, i64 1
  %406 = fadd <2 x double> %405, %384
  %407 = fdiv <2 x double> %403, %406
  %408 = extractelement <2 x double> %407, i64 0
  %409 = extractelement <2 x double> %407, i64 1
  %410 = fcmp olt double %408, %409
  br i1 %410, label %411, label %.critedge4

411:                                              ; preds = %385
  %412 = load ptr, ptr %386, align 8, !tbaa !33
  store ptr %.4288, ptr %386, align 8, !tbaa !33
  %413 = add i16 %.1234285, 1
  %414 = add i16 %.1232286, -1
  %.not258 = icmp slt i16 %414, %413
  br i1 %.not258, label %.critedge4, label %385, !llvm.loop !39

.critedge4:                                       ; preds = %385, %411, %.critedge2
  %.4230.lcssa = phi ptr [ %.3229.lcssa, %.critedge2 ], [ %412, %411 ], [ %.4230287, %385 ]
  %.4.lcssa = phi ptr [ %.3.lcssa, %.critedge2 ], [ %.4230287, %411 ], [ %.4288, %385 ]
  call void @_Z10makeFriendP10medialBallS0_(ptr noundef %.4.lcssa, ptr noundef %.4230.lcssa)
  br label %415

415:                                              ; preds = %124, %.critedge, %.critedge4, %269, %60, %50, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z7distSqrPK10medialBallS1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK10medialBall11mastrSphereEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i16 @_ZNK10medialBall5levelEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z4distPK10medialBallS1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn 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, !24, i64 208}
!6 = !{!"_ZTS13medialSurface", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !12, i64 48, !13, i64 64, !17, i64 88, !21, i64 112, !22, i64 176, !24, i64 184, !24, i64 192, !24, i64 200, !24, i64 208, !24, i64 216, !24, i64 224, !10, i64 232, !24, i64 240, !22, i64 248}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTS7segment", !10, i64 0, !8, i64 4, !7, i64 8}
!13 = !{!"_ZTSSt6vectorI5voxelSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseI5voxelSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!17 = !{!"_ZTSSt6vectorI10medialBallSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI10medialBallSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"_ZTS10medialBall", !7, i64 0, !22, i64 8, !22, i64 12, !22, i64 16, !23, i64 20, !22, i64 24, !23, i64 28, !23, i64 30, !23, i64 32, !23, i64 34, !23, i64 36, !7, i64 40, !7, i64 48, !7, i64 56}
!22 = !{!"float", !8, i64 0}
!23 = !{!"short", !8, i64 0}
!24 = !{!"double", !8, i64 0}
!25 = !{!21, !22, i64 24}
!26 = !{!24, !24, i64 0}
!27 = !{!21, !22, i64 8}
!28 = !{!21, !22, i64 12}
!29 = !{!21, !22, i64 16}
!30 = !{!31, !22, i64 16}
!31 = !{!"_ZTS5voxel", !7, i64 0, !23, i64 8, !23, i64 10, !23, i64 12, !22, i64 16}
!32 = !{!6, !24, i64 200}
!33 = !{!21, !7, i64 40}
!34 = !{!6, !24, i64 224}
!35 = !{!6, !24, i64 216}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = distinct !{!39, !37}


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