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

; 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.medialBall = type { ptr, float, float, float, i16, float, i16, i16, i16, i16, i16, ptr, ptr, 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.voxel = type <{ ptr, i16, i16, i16, [2 x i8], float, [4 x i8] }>

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13medialSurface16competeForParentEP10medialBallS1_(ptr noundef nonnull align 8 dereferenceable(252), ptr noundef, ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface8findBossEP10medialBall(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.medialBall, ptr %18, i32 0, i32 1
  %20 = load float, ptr %19, align 8, !tbaa !9
  store float %20, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %class.medialBall, ptr %21, i32 0, i32 2
  %23 = load float, ptr %22, align 4, !tbaa !14
  store float %23, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.medialBall, ptr %24, i32 0, i32 3
  %26 = load float, ptr %25, align 8, !tbaa !15
  store float %26, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.medialBall, ptr %27, i32 0, i32 5
  %29 = load float, ptr %28, align 8, !tbaa !16
  %30 = fpext float %29 to double
  %31 = getelementptr inbounds %class.medialSurface, ptr %17, i32 0, i32 17
  %32 = load double, ptr %31, align 8, !tbaa !17
  %33 = fmul double 2.000000e+00, %32
  %34 = call double @llvm.fmuladd.f64(double %30, double 6.000000e-01, double %33)
  %35 = fadd double %34, 2.000000e+00
  %36 = fptrunc double %35 to float
  store float %36, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %37 = load float, ptr %5, align 4, !tbaa !13
  %38 = load float, ptr %8, align 4, !tbaa !13
  %39 = fadd float %37, %38
  store float %39, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %40 = load float, ptr %5, align 4, !tbaa !13
  %41 = fpext float %40 to double
  %42 = load float, ptr %9, align 4, !tbaa !13
  %43 = fpext float %42 to double
  %44 = fneg double %43
  %45 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %41, double %44)
  %46 = fptrunc double %45 to float
  store float %46, ptr %10, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %147, %2
  %48 = load float, ptr %10, align 4, !tbaa !13
  %49 = load float, ptr %9, align 4, !tbaa !13
  %50 = fcmp ole float %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %150

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %53 = load float, ptr %6, align 4, !tbaa !13
  %54 = load float, ptr %8, align 4, !tbaa !13
  %55 = load float, ptr %8, align 4, !tbaa !13
  %56 = load float, ptr %10, align 4, !tbaa !13
  %57 = load float, ptr %5, align 4, !tbaa !13
  %58 = fsub float %56, %57
  %59 = load float, ptr %10, align 4, !tbaa !13
  %60 = load float, ptr %5, align 4, !tbaa !13
  %61 = fsub float %59, %60
  %62 = fmul float %58, %61
  %63 = fneg float %62
  %64 = call float @llvm.fmuladd.f32(float %54, float %55, float %63)
  %65 = call noundef float @_ZSt4sqrtf(float noundef %64)
  %66 = fadd float %53, %65
  store float %66, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %67 = load float, ptr %6, align 4, !tbaa !13
  %68 = fpext float %67 to double
  %69 = load float, ptr %12, align 4, !tbaa !13
  %70 = fpext float %69 to double
  %71 = fneg double %70
  %72 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %68, double %71)
  %73 = fptrunc double %72 to float
  store float %73, ptr %13, align 4, !tbaa !13
  br label %74

74:                                               ; preds = %143, %52
  %75 = load float, ptr %13, align 4, !tbaa !13
  %76 = load float, ptr %12, align 4, !tbaa !13
  %77 = fcmp ole float %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %146

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %80 = load float, ptr %7, align 4, !tbaa !13
  %81 = load float, ptr %8, align 4, !tbaa !13
  %82 = load float, ptr %8, align 4, !tbaa !13
  %83 = load float, ptr %10, align 4, !tbaa !13
  %84 = load float, ptr %5, align 4, !tbaa !13
  %85 = fsub float %83, %84
  %86 = load float, ptr %10, align 4, !tbaa !13
  %87 = load float, ptr %5, align 4, !tbaa !13
  %88 = fsub float %86, %87
  %89 = fmul float %85, %88
  %90 = fneg float %89
  %91 = call float @llvm.fmuladd.f32(float %81, float %82, float %90)
  %92 = load float, ptr %6, align 4, !tbaa !13
  %93 = load float, ptr %13, align 4, !tbaa !13
  %94 = fsub float %92, %93
  %95 = load float, ptr %6, align 4, !tbaa !13
  %96 = load float, ptr %13, align 4, !tbaa !13
  %97 = fsub float %95, %96
  %98 = fneg float %94
  %99 = call float @llvm.fmuladd.f32(float %98, float %97, float %91)
  %100 = call noundef float @_ZSt4sqrtf(float noundef %99)
  %101 = fadd float %80, %100
  store float %101, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %102 = load float, ptr %7, align 4, !tbaa !13
  %103 = fpext float %102 to double
  %104 = load float, ptr %14, align 4, !tbaa !13
  %105 = fpext float %104 to double
  %106 = fneg double %105
  %107 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %103, double %106)
  %108 = fptrunc double %107 to float
  store float %108, ptr %15, align 4, !tbaa !13
  br label %109

109:                                              ; preds = %139, %79
  %110 = load float, ptr %15, align 4, !tbaa !13
  %111 = load float, ptr %14, align 4, !tbaa !13
  %112 = fcmp ole float %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %142

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %115 = load float, ptr %10, align 4, !tbaa !13
  %116 = fptosi float %115 to i32
  %117 = load float, ptr %13, align 4, !tbaa !13
  %118 = fptosi float %117 to i32
  %119 = load float, ptr %15, align 4, !tbaa !13
  %120 = fptosi float %119 to i32
  %121 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %17, i32 noundef %116, i32 noundef %118, i32 noundef %120)
  store ptr %121, ptr %16, align 8, !tbaa !5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %138

124:                                              ; preds = %114
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = getelementptr inbounds %class.voxel, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !31
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %138

129:                                              ; preds = %124
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load ptr, ptr %16, align 8, !tbaa !5
  %132 = call noundef zeroext i1 @_ZneRK10medialBallRK5voxel(ptr noundef nonnull align 8 dereferenceable(64) %130, ptr noundef nonnull align 8 dereferenceable(20) %131)
  br i1 %132, label %133, label %138

133:                                              ; preds = %129
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = getelementptr inbounds %class.voxel, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !31
  call void @_ZN13medialSurface16competeForParentEP10medialBallS1_(ptr noundef nonnull align 8 dereferenceable(252) %17, ptr noundef %134, ptr noundef %137)
  br label %138

138:                                              ; preds = %133, %129, %124, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %139

139:                                              ; preds = %138
  %140 = load float, ptr %15, align 4, !tbaa !13
  %141 = fadd float %140, 1.000000e+00
  store float %141, ptr %15, align 4, !tbaa !13
  br label %109, !llvm.loop !33

142:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %143

143:                                              ; preds = %142
  %144 = load float, ptr %13, align 4, !tbaa !13
  %145 = fadd float %144, 1.000000e+00
  store float %145, ptr %13, align 4, !tbaa !13
  br label %74, !llvm.loop !35

146:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %147

147:                                              ; preds = %146
  %148 = load float, ptr %10, align 4, !tbaa !13
  %149 = fadd float %148, 1.000000e+00
  store float %149, ptr %10, align 4, !tbaa !13
  br label %47, !llvm.loop !36

150:                                              ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZneRK10medialBallRK5voxel(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(20)) #3

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


; 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"

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface8findBossEP10medialBall(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load float, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 12
  %6 = load float, ptr %5, align 4, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load float, ptr %7, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = load float, ptr %9, align 8, !tbaa !14
  %11 = fpext float %10 to double
  %12 = getelementptr inbounds i8, ptr %0, i64 208
  %13 = load double, ptr %12, align 8, !tbaa !15
  %14 = fmul double %13, 2.000000e+00
  %15 = tail call double @llvm.fmuladd.f64(double %11, double 6.000000e-01, double %14)
  %16 = fadd double %15, 2.000000e+00
  %17 = fptrunc double %16 to float
  %18 = fadd float %4, %17
  %19 = fpext float %4 to double
  %20 = fpext float %18 to double
  %21 = fneg double %20
  %22 = tail call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double %21)
  %23 = fptrunc double %22 to float
  %24 = fcmp ult float %18, %23
  br i1 %24, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %2
  %25 = fpext float %6 to double
  %26 = fpext float %8 to double
  br label %27

._crit_edge61:                                    ; preds = %._crit_edge57, %2
  ret void

27:                                               ; preds = %.lr.ph60, %._crit_edge57
  %.058 = phi float [ %23, %.lr.ph60 ], [ %40, %._crit_edge57 ]
  %28 = fsub float %.058, %4
  %29 = fneg float %28
  %30 = fmul float %28, %29
  %31 = tail call float @llvm.fmuladd.f32(float %17, float %17, float %30)
  %32 = tail call noundef float @_ZSt4sqrtf(float noundef %31)
  %33 = fadd float %6, %32
  %34 = fpext float %33 to double
  %35 = fneg double %34
  %36 = tail call double @llvm.fmuladd.f64(double %25, double 2.000000e+00, double %35)
  %37 = fptrunc double %36 to float
  %38 = fcmp ult float %33, %37
  br i1 %38, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %27
  %39 = fptosi float %.058 to i32
  br label %42

._crit_edge57:                                    ; preds = %._crit_edge, %27
  %40 = fadd float %.058, 1.000000e+00
  %41 = fcmp ugt float %40, %18
  br i1 %41, label %._crit_edge61, label %27, !llvm.loop !29

42:                                               ; preds = %.lr.ph56, %._crit_edge
  %.05054 = phi float [ %37, %.lr.ph56 ], [ %54, %._crit_edge ]
  %43 = fsub float %6, %.05054
  %44 = fneg float %43
  %45 = tail call float @llvm.fmuladd.f32(float %44, float %43, float %31)
  %46 = tail call noundef float @_ZSt4sqrtf(float noundef %45)
  %47 = fadd float %8, %46
  %48 = fpext float %47 to double
  %49 = fneg double %48
  %50 = tail call double @llvm.fmuladd.f64(double %26, double 2.000000e+00, double %49)
  %51 = fptrunc double %50 to float
  %52 = fcmp ult float %47, %51
  br i1 %52, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %42
  %53 = fptosi float %.05054 to i32
  br label %56

._crit_edge:                                      ; preds = %65, %42
  %54 = fadd float %.05054, 1.000000e+00
  %55 = fcmp ugt float %54, %33
  br i1 %55, label %._crit_edge57, label %42, !llvm.loop !31

56:                                               ; preds = %.lr.ph, %65
  %.04953 = phi float [ %51, %.lr.ph ], [ %66, %65 ]
  %57 = fptosi float %.04953 to i32
  %58 = tail call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %39, i32 noundef %53, i32 noundef %57)
  %.not = icmp eq ptr %58, null
  br i1 %.not, label %65, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr %58, align 8, !tbaa !32
  %.not52 = icmp eq ptr %60, null
  br i1 %.not52, label %65, label %61

61:                                               ; preds = %59
  %62 = tail call noundef zeroext i1 @_ZneRK10medialBallRK5voxel(ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(20) %58)
  br i1 %62, label %63, label %65

63:                                               ; preds = %61
  %64 = load ptr, ptr %58, align 8, !tbaa !32
  tail call void @_ZN13medialSurface16competeForParentEP10medialBallS1_(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef nonnull %1, ptr noundef %64)
  br label %65

65:                                               ; preds = %63, %61, %59, %56
  %66 = fadd float %.04953, 1.000000e+00
  %67 = fcmp ugt float %66, %47
  br i1 %67, label %._crit_edge, label %56, !llvm.loop !34
}

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

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

!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, !10, i64 8}
!6 = !{!"_ZTS10medialBall", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20, !10, i64 24, !11, i64 28, !11, i64 30, !11, i64 32, !11, i64 34, !11, i64 36, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !10, i64 24}
!15 = !{!16, !28, i64 208}
!16 = !{!"_ZTS13medialSurface", !7, i64 0, !17, i64 8, !17, i64 12, !17, i64 16, !18, i64 24, !18, i64 32, !7, i64 40, !19, i64 48, !20, i64 64, !24, i64 88, !6, i64 112, !10, i64 176, !28, i64 184, !28, i64 192, !28, i64 200, !28, i64 208, !28, i64 216, !28, i64 224, !17, i64 232, !28, i64 240, !10, i64 248}
!17 = !{!"int", !8, i64 0}
!18 = !{!"long", !8, i64 0}
!19 = !{!"_ZTS7segment", !17, i64 0, !8, i64 4, !7, i64 8}
!20 = !{!"_ZTSSt6vectorI5voxelSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseI5voxelSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI5voxelSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!24 = !{!"_ZTSSt6vectorI10medialBallSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseI10medialBallSaIS0_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseI10medialBallSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!28 = !{!"double", !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!33, !7, i64 0}
!33 = !{!"_ZTS5voxel", !7, i64 0, !11, i64 8, !11, i64 10, !11, i64 12, !10, i64 16}
!34 = distinct !{!34, !30}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass