; LLVM IR from robotics-upo/Heuristic_path_planners :: include/voro++-0.4.6/src (v_base)

; 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.voro::voro_base" = type { i32, i32, i32, i32, i32, double, double, double, double, double, double, ptr }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4voro9voro_base15compute_minimumERdS1_S1_S1_S1_S1_S1_iii(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef %8, i32 noundef %9, i32 noundef %10) #1 align 2 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %3, ptr %15, align 8, !tbaa !5
  store ptr %4, ptr %16, align 8, !tbaa !5
  store ptr %5, ptr %17, align 8, !tbaa !5
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store i32 %8, ptr %20, align 4, !tbaa !9
  store i32 %9, ptr %21, align 4, !tbaa !9
  store i32 %10, ptr %22, align 4, !tbaa !9
  %25 = load ptr, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %26 = load i32, ptr %20, align 4, !tbaa !9
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %28, label %40

28:                                               ; preds = %11
  %29 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 5
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = load i32, ptr %20, align 4, !tbaa !9
  %32 = sitofp i32 %31 to double
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = load double, ptr %33, align 8, !tbaa !14
  %35 = fneg double %34
  %36 = call double @llvm.fmuladd.f64(double %30, double %32, double %35)
  store double %36, ptr %24, align 8, !tbaa !14
  %37 = load double, ptr %24, align 8, !tbaa !14
  %38 = load double, ptr %24, align 8, !tbaa !14
  %39 = fmul double %37, %38
  store double %39, ptr %23, align 8, !tbaa !14
  br label %58

40:                                               ; preds = %11
  %41 = load i32, ptr %20, align 4, !tbaa !9
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %56

43:                                               ; preds = %40
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = load double, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 5
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = load i32, ptr %20, align 4, !tbaa !9
  %49 = add nsw i32 1, %48
  %50 = sitofp i32 %49 to double
  %51 = fneg double %47
  %52 = call double @llvm.fmuladd.f64(double %51, double %50, double %45)
  store double %52, ptr %24, align 8, !tbaa !14
  %53 = load double, ptr %24, align 8, !tbaa !14
  %54 = load double, ptr %24, align 8, !tbaa !14
  %55 = fmul double %53, %54
  store double %55, ptr %23, align 8, !tbaa !14
  br label %57

56:                                               ; preds = %40
  store double 0.000000e+00, ptr %23, align 8, !tbaa !14
  br label %57

57:                                               ; preds = %56, %43
  br label %58

58:                                               ; preds = %57, %28
  %59 = load i32, ptr %21, align 4, !tbaa !9
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %61, label %74

61:                                               ; preds = %58
  %62 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 6
  %63 = load double, ptr %62, align 8, !tbaa !15
  %64 = load i32, ptr %21, align 4, !tbaa !9
  %65 = sitofp i32 %64 to double
  %66 = load ptr, ptr %17, align 8, !tbaa !5
  %67 = load double, ptr %66, align 8, !tbaa !14
  %68 = fneg double %67
  %69 = call double @llvm.fmuladd.f64(double %63, double %65, double %68)
  store double %69, ptr %24, align 8, !tbaa !14
  %70 = load double, ptr %24, align 8, !tbaa !14
  %71 = load double, ptr %24, align 8, !tbaa !14
  %72 = load double, ptr %23, align 8, !tbaa !14
  %73 = call double @llvm.fmuladd.f64(double %70, double %71, double %72)
  store double %73, ptr %23, align 8, !tbaa !14
  br label %92

74:                                               ; preds = %58
  %75 = load i32, ptr %21, align 4, !tbaa !9
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %91

77:                                               ; preds = %74
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = load double, ptr %78, align 8, !tbaa !14
  %80 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 6
  %81 = load double, ptr %80, align 8, !tbaa !15
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = add nsw i32 1, %82
  %84 = sitofp i32 %83 to double
  %85 = fneg double %81
  %86 = call double @llvm.fmuladd.f64(double %85, double %84, double %79)
  store double %86, ptr %24, align 8, !tbaa !14
  %87 = load double, ptr %24, align 8, !tbaa !14
  %88 = load double, ptr %24, align 8, !tbaa !14
  %89 = load double, ptr %23, align 8, !tbaa !14
  %90 = call double @llvm.fmuladd.f64(double %87, double %88, double %89)
  store double %90, ptr %23, align 8, !tbaa !14
  br label %91

91:                                               ; preds = %77, %74
  br label %92

92:                                               ; preds = %91, %61
  %93 = load i32, ptr %22, align 4, !tbaa !9
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %95, label %108

95:                                               ; preds = %92
  %96 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 7
  %97 = load double, ptr %96, align 8, !tbaa !16
  %98 = load i32, ptr %22, align 4, !tbaa !9
  %99 = sitofp i32 %98 to double
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  %101 = load double, ptr %100, align 8, !tbaa !14
  %102 = fneg double %101
  %103 = call double @llvm.fmuladd.f64(double %97, double %99, double %102)
  store double %103, ptr %24, align 8, !tbaa !14
  %104 = load double, ptr %24, align 8, !tbaa !14
  %105 = load double, ptr %24, align 8, !tbaa !14
  %106 = load double, ptr %23, align 8, !tbaa !14
  %107 = call double @llvm.fmuladd.f64(double %104, double %105, double %106)
  store double %107, ptr %23, align 8, !tbaa !14
  br label %126

108:                                              ; preds = %92
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = icmp slt i32 %109, 0
  br i1 %110, label %111, label %125

111:                                              ; preds = %108
  %112 = load ptr, ptr %18, align 8, !tbaa !5
  %113 = load double, ptr %112, align 8, !tbaa !14
  %114 = getelementptr inbounds %"class.voro::voro_base", ptr %25, i32 0, i32 7
  %115 = load double, ptr %114, align 8, !tbaa !16
  %116 = load i32, ptr %22, align 4, !tbaa !9
  %117 = add nsw i32 1, %116
  %118 = sitofp i32 %117 to double
  %119 = fneg double %115
  %120 = call double @llvm.fmuladd.f64(double %119, double %118, double %113)
  store double %120, ptr %24, align 8, !tbaa !14
  %121 = load double, ptr %24, align 8, !tbaa !14
  %122 = load double, ptr %24, align 8, !tbaa !14
  %123 = load double, ptr %23, align 8, !tbaa !14
  %124 = call double @llvm.fmuladd.f64(double %121, double %122, double %123)
  store double %124, ptr %23, align 8, !tbaa !14
  br label %125

125:                                              ; preds = %111, %108
  br label %126

126:                                              ; preds = %125, %95
  %127 = load double, ptr %23, align 8, !tbaa !14
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = load double, ptr %128, align 8, !tbaa !14
  %130 = fcmp olt double %127, %129
  br i1 %130, label %131, label %134

131:                                              ; preds = %126
  %132 = load double, ptr %23, align 8, !tbaa !14
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  store double %132, ptr %133, align 8, !tbaa !14
  br label %134

134:                                              ; preds = %131, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  ret void
}

; 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) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 24}
!12 = !{!"_ZTSN4voro9voro_baseE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !6, i64 72}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 32}
!16 = !{!12, !13, i64 40}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN4voro9voro_base15compute_minimumERdS1_S1_S1_S1_S1_S1_iii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(80) %0, ptr nocapture noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %4, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %5, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %6, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %7, i32 noundef %8, i32 noundef %9, i32 noundef %10) local_unnamed_addr #0 align 2 {
  %12 = icmp sgt i32 %8, 0
  br i1 %12, label %13, label %21

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = uitofp nneg i32 %8 to double
  %17 = load double, ptr %3, align 8, !tbaa !12
  %18 = fneg double %17
  %19 = tail call double @llvm.fmuladd.f64(double %15, double %16, double %18)
  %20 = fmul double %19, %19
  br label %32

21:                                               ; preds = %11
  %22 = icmp slt i32 %8, 0
  br i1 %22, label %23, label %32

23:                                               ; preds = %21
  %24 = load double, ptr %2, align 8, !tbaa !12
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %26 = load double, ptr %25, align 8, !tbaa !5
  %27 = add nsw i32 %8, 1
  %28 = sitofp i32 %27 to double
  %29 = fneg double %26
  %30 = tail call double @llvm.fmuladd.f64(double %29, double %28, double %24)
  %31 = fmul double %30, %30
  br label %32

32:                                               ; preds = %21, %23, %13
  %.0 = phi double [ %20, %13 ], [ %31, %23 ], [ 0.000000e+00, %21 ]
  %33 = icmp sgt i32 %9, 0
  br i1 %33, label %34, label %42

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %0, i64 32
  %36 = load double, ptr %35, align 8, !tbaa !13
  %37 = uitofp nneg i32 %9 to double
  %38 = load double, ptr %5, align 8, !tbaa !12
  %39 = fneg double %38
  %40 = tail call double @llvm.fmuladd.f64(double %36, double %37, double %39)
  %41 = tail call double @llvm.fmuladd.f64(double %40, double %40, double %.0)
  br label %53

42:                                               ; preds = %32
  %43 = icmp slt i32 %9, 0
  br i1 %43, label %44, label %53

44:                                               ; preds = %42
  %45 = load double, ptr %4, align 8, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %0, i64 32
  %47 = load double, ptr %46, align 8, !tbaa !13
  %48 = add nsw i32 %9, 1
  %49 = sitofp i32 %48 to double
  %50 = fneg double %47
  %51 = tail call double @llvm.fmuladd.f64(double %50, double %49, double %45)
  %52 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %.0)
  br label %53

53:                                               ; preds = %42, %44, %34
  %.1 = phi double [ %41, %34 ], [ %52, %44 ], [ %.0, %42 ]
  %54 = icmp sgt i32 %10, 0
  br i1 %54, label %55, label %63

55:                                               ; preds = %53
  %56 = getelementptr inbounds i8, ptr %0, i64 40
  %57 = load double, ptr %56, align 8, !tbaa !14
  %58 = uitofp nneg i32 %10 to double
  %59 = load double, ptr %7, align 8, !tbaa !12
  %60 = fneg double %59
  %61 = tail call double @llvm.fmuladd.f64(double %57, double %58, double %60)
  %62 = tail call double @llvm.fmuladd.f64(double %61, double %61, double %.1)
  br label %74

63:                                               ; preds = %53
  %64 = icmp slt i32 %10, 0
  br i1 %64, label %65, label %74

65:                                               ; preds = %63
  %66 = load double, ptr %6, align 8, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %0, i64 40
  %68 = load double, ptr %67, align 8, !tbaa !14
  %69 = add nsw i32 %10, 1
  %70 = sitofp i32 %69 to double
  %71 = fneg double %68
  %72 = tail call double @llvm.fmuladd.f64(double %71, double %70, double %66)
  %73 = tail call double @llvm.fmuladd.f64(double %72, double %72, double %.1)
  br label %74

74:                                               ; preds = %63, %65, %55
  %.2 = phi double [ %62, %55 ], [ %73, %65 ], [ %.1, %63 ]
  %75 = load double, ptr %1, align 8, !tbaa !12
  %76 = fcmp olt double %.2, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  store double %.2, ptr %1, align 8, !tbaa !12
  br label %78

78:                                               ; preds = %77, %74
  ret void
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 24}
!6 = !{!"_ZTSN4voro9voro_baseE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !11, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !10, i64 40}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass