; LLVM IR from radualexandrub/Optimization-Algorithms-Find-local-minimum :: 1D_DerivativeFree_Algorithms (sectionare)

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @sectionare(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca double, 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 double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !9
  store double %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %22 = load double, ptr %6, align 8, !tbaa !9
  store double %22, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %23 = load double, ptr %7, align 8, !tbaa !9
  store double %23, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %24 = load double, ptr %8, align 8, !tbaa !9
  store double %24, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %25 = load double, ptr %9, align 8, !tbaa !9
  %26 = load double, ptr %10, align 8, !tbaa !9
  %27 = fsub double %25, %26
  %28 = load double, ptr %9, align 8, !tbaa !9
  %29 = load double, ptr %11, align 8, !tbaa !9
  %30 = fsub double %28, %29
  %31 = fmul double %27, %30
  %32 = load double, ptr %10, align 8, !tbaa !9
  %33 = load double, ptr %11, align 8, !tbaa !9
  %34 = fsub double %32, %33
  %35 = fmul double %31, %34
  store double %35, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load double, ptr %10, align 8, !tbaa !9
  %38 = call double %36(double noundef %37)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load double, ptr %9, align 8, !tbaa !9
  %41 = call double %39(double noundef %40)
  %42 = fsub double %38, %41
  store double %42, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load double, ptr %9, align 8, !tbaa !9
  %45 = call double %43(double noundef %44)
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load double, ptr %10, align 8, !tbaa !9
  %48 = call double %46(double noundef %47)
  %49 = fsub double %45, %48
  store double %49, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load double, ptr %9, align 8, !tbaa !9
  %52 = call double %50(double noundef %51)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load double, ptr %11, align 8, !tbaa !9
  %55 = call double %53(double noundef %54)
  %56 = fsub double %52, %55
  store double %56, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load double, ptr %11, align 8, !tbaa !9
  %59 = call double %57(double noundef %58)
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load double, ptr %9, align 8, !tbaa !9
  %62 = call double %60(double noundef %61)
  %63 = fsub double %59, %62
  store double %63, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load double, ptr %11, align 8, !tbaa !9
  %66 = call double %64(double noundef %65)
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load double, ptr %10, align 8, !tbaa !9
  %69 = call double %67(double noundef %68)
  %70 = fsub double %66, %69
  store double %70, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load double, ptr %10, align 8, !tbaa !9
  %73 = call double %71(double noundef %72)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load double, ptr %11, align 8, !tbaa !9
  %76 = call double %74(double noundef %75)
  %77 = fsub double %73, %76
  store double %77, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %78 = load double, ptr %11, align 8, !tbaa !9
  %79 = load double, ptr %13, align 8, !tbaa !9
  %80 = load double, ptr %10, align 8, !tbaa !9
  %81 = load double, ptr %15, align 8, !tbaa !9
  %82 = fmul double %80, %81
  %83 = call double @llvm.fmuladd.f64(double %78, double %79, double %82)
  %84 = load double, ptr %9, align 8, !tbaa !9
  %85 = load double, ptr %17, align 8, !tbaa !9
  %86 = call double @llvm.fmuladd.f64(double %84, double %85, double %83)
  %87 = load double, ptr %12, align 8, !tbaa !9
  %88 = fdiv double %86, %87
  store double %88, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %89 = load double, ptr %11, align 8, !tbaa !9
  %90 = call double @pow(double noundef %89, double noundef 2.000000e+00) #4
  %91 = load double, ptr %14, align 8, !tbaa !9
  %92 = load double, ptr %10, align 8, !tbaa !9
  %93 = call double @pow(double noundef %92, double noundef 2.000000e+00) #4
  %94 = load double, ptr %16, align 8, !tbaa !9
  %95 = fmul double %93, %94
  %96 = call double @llvm.fmuladd.f64(double %90, double %91, double %95)
  %97 = load double, ptr %9, align 8, !tbaa !9
  %98 = call double @pow(double noundef %97, double noundef 2.000000e+00) #4
  %99 = load double, ptr %18, align 8, !tbaa !9
  %100 = call double @llvm.fmuladd.f64(double %98, double %99, double %96)
  %101 = load double, ptr %12, align 8, !tbaa !9
  %102 = fdiv double %100, %101
  store double %102, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %103 = load double, ptr %20, align 8, !tbaa !9
  %104 = fneg double %103
  %105 = load double, ptr %19, align 8, !tbaa !9
  %106 = fmul double 2.000000e+00, %105
  %107 = fdiv double %104, %106
  store double %107, ptr %21, align 8, !tbaa !9
  %108 = load double, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret double %108
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; 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: nounwind uwtable
define dso_local double @sectionare(ptr nocapture noundef readonly %0, double noundef %1, double noundef %2, double noundef %3) local_unnamed_addr #1 {
  %5 = fsub double %1, %2
  %6 = fsub double %1, %3
  %7 = fmul double %5, %6
  %8 = fsub double %2, %3
  %9 = fmul double %8, %7
  %10 = tail call double %0(double noundef %2) #2
  %11 = tail call double %0(double noundef %1) #2
  %12 = fsub double %10, %11
  %13 = tail call double %0(double noundef %1) #2
  %14 = tail call double %0(double noundef %2) #2
  %15 = fsub double %13, %14
  %16 = tail call double %0(double noundef %1) #2
  %17 = tail call double %0(double noundef %3) #2
  %18 = fsub double %16, %17
  %19 = tail call double %0(double noundef %3) #2
  %20 = tail call double %0(double noundef %1) #2
  %21 = fsub double %19, %20
  %22 = tail call double %0(double noundef %3) #2
  %23 = tail call double %0(double noundef %2) #2
  %24 = fsub double %22, %23
  %25 = tail call double %0(double noundef %2) #2
  %26 = tail call double %0(double noundef %3) #2
  %27 = fsub double %25, %26
  %28 = fmul double %18, %2
  %29 = tail call double @llvm.fmuladd.f64(double %3, double %12, double %28)
  %30 = tail call double @llvm.fmuladd.f64(double %1, double %24, double %29)
  %square = fmul double %3, %3
  %square50 = fmul double %2, %2
  %31 = fmul double %square50, %21
  %32 = tail call double @llvm.fmuladd.f64(double %square, double %15, double %31)
  %square51 = fmul double %1, %1
  %33 = tail call double @llvm.fmuladd.f64(double %square51, double %27, double %32)
  %34 = fneg double %33
  %35 = insertelement <2 x double> poison, double %34, i64 0
  %36 = insertelement <2 x double> %35, double %30, i64 1
  %37 = insertelement <2 x double> poison, double %9, i64 0
  %38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
  %39 = fdiv <2 x double> %36, %38
  %40 = extractelement <2 x double> %39, i64 1
  %41 = fmul double %40, 2.000000e+00
  %42 = extractelement <2 x double> %39, i64 0
  %43 = fdiv double %42, %41
  ret double %43
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 = { 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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass