; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (optimization)

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

declare noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef, ptr noundef) #2

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22estimateparabolicmodelEdddddddPlS0_PNS_8ae_stateE(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #3 {
  %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 ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  store double %0, ptr %11, align 8, !tbaa !5
  store double %1, ptr %12, align 8, !tbaa !5
  store double %2, ptr %13, align 8, !tbaa !5
  store double %3, ptr %14, align 8, !tbaa !5
  store double %4, ptr %15, align 8, !tbaa !5
  store double %5, ptr %16, align 8, !tbaa !5
  store double %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !9
  store ptr %9, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %26 = load ptr, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr %19, align 8, !tbaa !9
  store i64 0, ptr %27, align 8, !tbaa !11
  store double 2.000000e-15, ptr %23, align 8, !tbaa !5
  %28 = load double, ptr %23, align 8, !tbaa !5
  %29 = load double, ptr %15, align 8, !tbaa !5
  %30 = fmul double %28, %29
  %31 = load double, ptr %13, align 8, !tbaa !5
  %32 = load double, ptr %11, align 8, !tbaa !5
  %33 = load double, ptr %14, align 8, !tbaa !5
  %34 = call double @llvm.fmuladd.f64(double %31, double %32, double %33)
  %35 = fmul double %30, %34
  store double %35, ptr %24, align 8, !tbaa !5
  %36 = load double, ptr %23, align 8, !tbaa !5
  %37 = load double, ptr %15, align 8, !tbaa !5
  %38 = fmul double %36, %37
  %39 = load double, ptr %13, align 8, !tbaa !5
  %40 = load double, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %20, align 8, !tbaa !9
  %42 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %40, ptr noundef %41)
  %43 = load double, ptr %14, align 8, !tbaa !5
  %44 = call double @llvm.fmuladd.f64(double %39, double %42, double %43)
  %45 = fmul double %38, %44
  store double %45, ptr %25, align 8, !tbaa !5
  %46 = load double, ptr %24, align 8, !tbaa !5
  %47 = load double, ptr %25, align 8, !tbaa !5
  %48 = fmul double %46, %47
  %49 = load ptr, ptr %20, align 8, !tbaa !9
  %50 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %48, ptr noundef %49)
  store double %50, ptr %21, align 8, !tbaa !5
  %51 = load double, ptr %16, align 8, !tbaa !5
  %52 = load ptr, ptr %20, align 8, !tbaa !9
  %53 = call noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef %51, ptr noundef %52)
  %54 = load double, ptr %21, align 8, !tbaa !5
  %55 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %53, double noundef %54)
  br i1 %55, label %56, label %58

56:                                               ; preds = %10
  %57 = load ptr, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %57, align 8, !tbaa !11
  br label %63

58:                                               ; preds = %10
  %59 = load double, ptr %16, align 8, !tbaa !5
  %60 = load ptr, ptr %20, align 8, !tbaa !9
  %61 = call noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef %59, ptr noundef %60)
  %62 = load ptr, ptr %18, align 8, !tbaa !9
  store i64 %61, ptr %62, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %58, %56
  %64 = load double, ptr %23, align 8, !tbaa !5
  %65 = load double, ptr %15, align 8, !tbaa !5
  %66 = fmul double %64, %65
  %67 = load double, ptr %15, align 8, !tbaa !5
  %68 = fmul double %66, %67
  %69 = load double, ptr %11, align 8, !tbaa !5
  %70 = fmul double %68, %69
  store double %70, ptr %24, align 8, !tbaa !5
  %71 = load double, ptr %23, align 8, !tbaa !5
  %72 = load double, ptr %15, align 8, !tbaa !5
  %73 = fmul double %71, %72
  %74 = load double, ptr %15, align 8, !tbaa !5
  %75 = fmul double %73, %74
  %76 = load double, ptr %12, align 8, !tbaa !5
  %77 = load ptr, ptr %20, align 8, !tbaa !9
  %78 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %76, ptr noundef %77)
  %79 = fmul double %75, %78
  store double %79, ptr %25, align 8, !tbaa !5
  %80 = load double, ptr %24, align 8, !tbaa !5
  %81 = load double, ptr %25, align 8, !tbaa !5
  %82 = fmul double %80, %81
  %83 = load ptr, ptr %20, align 8, !tbaa !9
  %84 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %82, ptr noundef %83)
  store double %84, ptr %22, align 8, !tbaa !5
  %85 = load double, ptr %17, align 8, !tbaa !5
  %86 = load ptr, ptr %20, align 8, !tbaa !9
  %87 = call noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef %85, ptr noundef %86)
  %88 = load double, ptr %22, align 8, !tbaa !5
  %89 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %87, double noundef %88)
  br i1 %89, label %90, label %92

90:                                               ; preds = %63
  %91 = load ptr, ptr %19, align 8, !tbaa !9
  store i64 0, ptr %91, align 8, !tbaa !11
  br label %97

92:                                               ; preds = %63
  %93 = load double, ptr %17, align 8, !tbaa !5
  %94 = load ptr, ptr %20, align 8, !tbaa !9
  %95 = call noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef %93, ptr noundef %94)
  %96 = load ptr, ptr %19, align 8, !tbaa !9
  store i64 %95, ptr %96, align 8, !tbaa !11
  br label %97

97:                                               ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  ret void
}

declare noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !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"

declare noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22estimateparabolicmodelEdddddddPlS0_PNS_8ae_stateE(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, ptr nocapture noundef writeonly %7, ptr nocapture noundef writeonly %8, ptr noundef %9) local_unnamed_addr #1 {
  store i64 0, ptr %7, align 8, !tbaa !5
  store i64 0, ptr %8, align 8, !tbaa !5
  %11 = fmul double %4, 2.000000e-15
  %12 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %1, ptr noundef %9)
  %13 = insertelement <2 x double> poison, double %2, i64 0
  %14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
  %15 = insertelement <2 x double> poison, double %0, i64 0
  %16 = insertelement <2 x double> %15, double %12, i64 1
  %17 = insertelement <2 x double> poison, double %3, i64 0
  %18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
  %19 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> %18)
  %20 = insertelement <2 x double> poison, double %11, i64 0
  %21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
  %22 = fmul <2 x double> %19, %21
  %shift = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %23 = fmul <2 x double> %22, %shift
  %24 = extractelement <2 x double> %23, i64 0
  %25 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %24, ptr noundef %9)
  %26 = tail call noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef %5, ptr noundef %9)
  %27 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %26, double noundef %25)
  br i1 %27, label %30, label %28

28:                                               ; preds = %10
  %29 = tail call noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef %5, ptr noundef %9)
  br label %30

30:                                               ; preds = %10, %28
  %storemerge = phi i64 [ %29, %28 ], [ 0, %10 ]
  store i64 %storemerge, ptr %7, align 8, !tbaa !5
  %31 = fmul double %11, %4
  %32 = fmul double %31, %0
  %33 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %1, ptr noundef %9)
  %34 = fmul double %31, %33
  %35 = fmul double %32, %34
  %36 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef %35, ptr noundef %9)
  %37 = tail call noundef double @_ZN11alglib_impl7ae_fabsEdPNS_8ae_stateE(double noundef %6, ptr noundef %9)
  %38 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %37, double noundef %36)
  br i1 %38, label %41, label %39

39:                                               ; preds = %30
  %40 = tail call noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef %6, ptr noundef %9)
  br label %41

41:                                               ; preds = %30, %39
  %storemerge42 = phi i64 [ %40, %39 ], [ 0, %30 ]
  store i64 %storemerge42, ptr %8, align 8, !tbaa !5
  ret void
}

declare noundef i64 @_ZN11alglib_impl7ae_signEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

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

attributes #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 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) }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass