; LLVM IR from stillwater-sc/universal :: applications/accuracy/roots/rpoly_ak1.ll (Z10newest_ak1iPdS_ddddddddddddS_iS_)

; 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 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.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z10newest_ak1iPdS_ddddddddddddS_iS_(i32 noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, double noundef %10, double noundef %11, double noundef %12, double noundef %13, double noundef %14, ptr noundef %15, i32 noundef %16, ptr noundef %17) #2 {
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca double, align 8
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca double, align 8
  %42 = alloca double, align 8
  %43 = alloca double, align 8
  %44 = alloca double, align 8
  %45 = alloca double, align 8
  store i32 %0, ptr %19, align 4, !tbaa !5
  store ptr %1, ptr %20, align 8, !tbaa !9
  store ptr %2, ptr %21, align 8, !tbaa !9
  store double %3, ptr %22, align 8, !tbaa !11
  store double %4, ptr %23, align 8, !tbaa !11
  store double %5, ptr %24, align 8, !tbaa !11
  store double %6, ptr %25, align 8, !tbaa !11
  store double %7, ptr %26, align 8, !tbaa !11
  store double %8, ptr %27, align 8, !tbaa !11
  store double %9, ptr %28, align 8, !tbaa !11
  store double %10, ptr %29, align 8, !tbaa !11
  store double %11, ptr %30, align 8, !tbaa !11
  store double %12, ptr %31, align 8, !tbaa !11
  store double %13, ptr %32, align 8, !tbaa !11
  store double %14, ptr %33, align 8, !tbaa !11
  store ptr %15, ptr %34, align 8, !tbaa !9
  store i32 %16, ptr %35, align 4, !tbaa !5
  store ptr %17, ptr %36, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #3
  %46 = load ptr, ptr %20, align 8, !tbaa !9
  store double 0.000000e+00, ptr %46, align 8, !tbaa !11
  %47 = load ptr, ptr %21, align 8, !tbaa !9
  store double 0.000000e+00, ptr %47, align 8, !tbaa !11
  %48 = load i32, ptr %19, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 3
  br i1 %49, label %50, label %174

50:                                               ; preds = %18
  %51 = load i32, ptr %19, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 2
  br i1 %52, label %53, label %68

53:                                               ; preds = %50
  %54 = load double, ptr %22, align 8, !tbaa !11
  %55 = load double, ptr %32, align 8, !tbaa !11
  %56 = load double, ptr %26, align 8, !tbaa !11
  %57 = call double @llvm.fmuladd.f64(double %55, double %56, double %54)
  %58 = load double, ptr %31, align 8, !tbaa !11
  %59 = load double, ptr %29, align 8, !tbaa !11
  %60 = call double @llvm.fmuladd.f64(double %58, double %59, double %57)
  store double %60, ptr %37, align 8, !tbaa !11
  %61 = load double, ptr %27, align 8, !tbaa !11
  %62 = load double, ptr %32, align 8, !tbaa !11
  %63 = load double, ptr %33, align 8, !tbaa !11
  %64 = load double, ptr %29, align 8, !tbaa !11
  %65 = call double @llvm.fmuladd.f64(double %63, double %64, double %62)
  %66 = load double, ptr %28, align 8, !tbaa !11
  %67 = call double @llvm.fmuladd.f64(double %65, double %66, double %61)
  store double %67, ptr %38, align 8, !tbaa !11
  br label %83

68:                                               ; preds = %50
  %69 = load double, ptr %22, align 8, !tbaa !11
  %70 = load double, ptr %30, align 8, !tbaa !11
  %71 = fadd double %69, %70
  %72 = load double, ptr %29, align 8, !tbaa !11
  %73 = load double, ptr %31, align 8, !tbaa !11
  %74 = call double @llvm.fmuladd.f64(double %71, double %72, double %73)
  store double %74, ptr %37, align 8, !tbaa !11
  %75 = load double, ptr %29, align 8, !tbaa !11
  %76 = load double, ptr %32, align 8, !tbaa !11
  %77 = fadd double %75, %76
  %78 = load double, ptr %27, align 8, !tbaa !11
  %79 = load double, ptr %33, align 8, !tbaa !11
  %80 = load double, ptr %28, align 8, !tbaa !11
  %81 = fmul double %79, %80
  %82 = call double @llvm.fmuladd.f64(double %77, double %78, double %81)
  store double %82, ptr %38, align 8, !tbaa !11
  br label %83

83:                                               ; preds = %68, %53
  %84 = load ptr, ptr %34, align 8, !tbaa !9
  %85 = load i32, ptr %35, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %84, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !11
  %90 = fneg double %89
  %91 = load ptr, ptr %36, align 8, !tbaa !9
  %92 = load i32, ptr %35, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %91, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !11
  %96 = fdiv double %90, %95
  store double %96, ptr %39, align 8, !tbaa !11
  %97 = load ptr, ptr %34, align 8, !tbaa !9
  %98 = load i32, ptr %35, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 2
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %97, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = load double, ptr %39, align 8, !tbaa !11
  %104 = load ptr, ptr %36, align 8, !tbaa !9
  %105 = load i32, ptr %35, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %104, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !11
  %110 = call double @llvm.fmuladd.f64(double %103, double %109, double %102)
  %111 = fneg double %110
  %112 = load ptr, ptr %36, align 8, !tbaa !9
  %113 = load i32, ptr %35, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = fdiv double %111, %116
  store double %117, ptr %40, align 8, !tbaa !11
  %118 = load double, ptr %33, align 8, !tbaa !11
  %119 = load double, ptr %40, align 8, !tbaa !11
  %120 = fmul double %118, %119
  %121 = load double, ptr %23, align 8, !tbaa !11
  %122 = fmul double %120, %121
  store double %122, ptr %41, align 8, !tbaa !11
  %123 = load double, ptr %39, align 8, !tbaa !11
  %124 = load double, ptr %25, align 8, !tbaa !11
  %125 = fmul double %123, %124
  store double %125, ptr %42, align 8, !tbaa !11
  %126 = load double, ptr %39, align 8, !tbaa !11
  %127 = load double, ptr %39, align 8, !tbaa !11
  %128 = fmul double %126, %127
  %129 = load double, ptr %24, align 8, !tbaa !11
  %130 = fmul double %128, %129
  store double %130, ptr %43, align 8, !tbaa !11
  %131 = load double, ptr %42, align 8, !tbaa !11
  %132 = load double, ptr %43, align 8, !tbaa !11
  %133 = fadd double %131, %132
  %134 = fneg double %133
  %135 = load double, ptr %41, align 8, !tbaa !11
  %136 = fadd double %134, %135
  store double %136, ptr %44, align 8, !tbaa !11
  %137 = load double, ptr %44, align 8, !tbaa !11
  %138 = fneg double %137
  %139 = load double, ptr %38, align 8, !tbaa !11
  %140 = fadd double %138, %139
  %141 = load double, ptr %39, align 8, !tbaa !11
  %142 = load double, ptr %37, align 8, !tbaa !11
  %143 = call double @llvm.fmuladd.f64(double %141, double %142, double %140)
  store double %143, ptr %45, align 8, !tbaa !11
  %144 = load double, ptr %45, align 8, !tbaa !11
  %145 = fcmp une double %144, 0.000000e+00
  br i1 %145, label %146, label %173

146:                                              ; preds = %83
  %147 = load double, ptr %32, align 8, !tbaa !11
  %148 = load double, ptr %43, align 8, !tbaa !11
  %149 = load double, ptr %42, align 8, !tbaa !11
  %150 = fadd double %148, %149
  %151 = load double, ptr %33, align 8, !tbaa !11
  %152 = load double, ptr %39, align 8, !tbaa !11
  %153 = load double, ptr %23, align 8, !tbaa !11
  %154 = load double, ptr %40, align 8, !tbaa !11
  %155 = load double, ptr %25, align 8, !tbaa !11
  %156 = fmul double %154, %155
  %157 = call double @llvm.fmuladd.f64(double %152, double %153, double %156)
  %158 = fmul double %151, %157
  %159 = call double @llvm.fmuladd.f64(double %147, double %150, double %158)
  %160 = load double, ptr %45, align 8, !tbaa !11
  %161 = fdiv double %159, %160
  %162 = fneg double %161
  %163 = load double, ptr %32, align 8, !tbaa !11
  %164 = fadd double %162, %163
  %165 = load ptr, ptr %20, align 8, !tbaa !9
  store double %164, ptr %165, align 8, !tbaa !11
  %166 = load double, ptr %33, align 8, !tbaa !11
  %167 = load double, ptr %44, align 8, !tbaa !11
  %168 = load double, ptr %45, align 8, !tbaa !11
  %169 = fdiv double %167, %168
  %170 = fadd double 1.000000e+00, %169
  %171 = fmul double %166, %170
  %172 = load ptr, ptr %21, align 8, !tbaa !9
  store double %171, ptr %172, align 8, !tbaa !11
  br label %173

173:                                              ; preds = %146, %83
  br label %174

174:                                              ; preds = %173, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #3
  ret void
}

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 = { 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 = !{!"int", !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 = !{!"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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_Z10newest_ak1iPdS_ddddddddddddS_iS_(i32 noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, double noundef %10, double noundef %11, double noundef %12, double noundef %13, double noundef %14, ptr nocapture noundef readonly %15, i32 noundef %16, ptr nocapture noundef readonly %17) local_unnamed_addr #1 {
  store double 0.000000e+00, ptr %1, align 8, !tbaa !5
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  switch i32 %0, label %19 [
    i32 3, label %82
    i32 2, label %29
  ]

19:                                               ; preds = %18
  %20 = tail call double @llvm.fmuladd.f64(double %13, double %7, double %3)
  %21 = tail call double @llvm.fmuladd.f64(double %14, double %10, double %13)
  %22 = insertelement <2 x double> poison, double %21, i64 0
  %23 = insertelement <2 x double> %22, double %12, i64 1
  %24 = insertelement <2 x double> poison, double %9, i64 0
  %25 = insertelement <2 x double> %24, double %10, i64 1
  %26 = insertelement <2 x double> poison, double %8, i64 0
  %27 = insertelement <2 x double> %26, double %20, i64 1
  %28 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %25, <2 x double> %27)
  br label %41

29:                                               ; preds = %18
  %30 = insertelement <2 x double> poison, double %10, i64 0
  %31 = insertelement <2 x double> %30, double %3, i64 1
  %32 = insertelement <2 x double> poison, double %13, i64 0
  %33 = insertelement <2 x double> %32, double %11, i64 1
  %34 = fadd <2 x double> %31, %33
  %35 = fmul double %9, %14
  %36 = insertelement <2 x double> poison, double %8, i64 0
  %37 = insertelement <2 x double> %36, double %10, i64 1
  %38 = insertelement <2 x double> poison, double %35, i64 0
  %39 = insertelement <2 x double> %38, double %12, i64 1
  %40 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %37, <2 x double> %39)
  br label %41

41:                                               ; preds = %29, %19
  %42 = phi <2 x double> [ %28, %19 ], [ %40, %29 ]
  %43 = add nsw i32 %16, -1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %15, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = fneg double %46
  %48 = sext i32 %16 to i64
  %49 = getelementptr inbounds double, ptr %17, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !5
  %51 = fdiv double %47, %50
  %52 = getelementptr double, ptr %15, i64 %48
  %53 = getelementptr i8, ptr %52, i64 -16
  %54 = load double, ptr %53, align 8, !tbaa !5
  %55 = getelementptr inbounds double, ptr %17, i64 %44
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = tail call double @llvm.fmuladd.f64(double %51, double %56, double %54)
  %58 = fneg double %57
  %59 = fdiv double %58, %50
  %60 = fmul double %59, %14
  %61 = fmul double %60, %4
  %62 = fmul double %51, %6
  %63 = fmul double %51, %51
  %64 = fmul double %63, %5
  %65 = fadd double %62, %64
  %66 = fsub double %61, %65
  %67 = extractelement <2 x double> %42, i64 0
  %68 = fsub double %67, %66
  %69 = extractelement <2 x double> %42, i64 1
  %70 = tail call double @llvm.fmuladd.f64(double %51, double %69, double %68)
  %71 = fcmp une double %70, 0.000000e+00
  br i1 %71, label %72, label %82

72:                                               ; preds = %41
  %73 = fmul double %59, %6
  %74 = tail call double @llvm.fmuladd.f64(double %51, double %4, double %73)
  %75 = fmul double %74, %14
  %76 = tail call double @llvm.fmuladd.f64(double %13, double %65, double %75)
  %77 = fdiv double %76, %70
  %78 = fsub double %13, %77
  store double %78, ptr %1, align 8, !tbaa !5
  %79 = fdiv double %66, %70
  %80 = fadd double %79, 1.000000e+00
  %81 = fmul double %80, %14
  store double %81, ptr %2, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %18, %41, %72
  ret void
}

; 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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