; LLVM IR from jgaeddert/liquid-dsp :: src/math/src/poly.findroots (liquid_poly_findroots_bairstow)

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

@.str = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 x i8], align 1

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @liquid_poly_findroots_bairstow(ptr noundef %0, i32 noundef %1, ptr noundef %2) #5 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca { double, double }, align 8
  %20 = alloca { float, float }, align 4
  %21 = alloca { float, float }, align 4
  %22 = alloca { double, double }, align 8
  %23 = alloca { float, float }, align 4
  %24 = alloca { float, float }, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %7, align 8
  %28 = alloca double, i64 %26, align 16
  store i64 %26, ptr %8, align 8
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = alloca double, i64 %30, align 16
  store i64 %30, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = mul i64 %34, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 16 %28, ptr align 8 %32, i64 %35, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %36 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %36, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = urem i32 %37, 2
  store i32 %38, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = load i32, ptr %17, align 4, !tbaa !9
  %41 = sub i32 %39, %40
  %42 = udiv i32 %41, 2
  store i32 %42, ptr %18, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %187, %3
  %44 = load i32, ptr %12, align 4, !tbaa !9
  %45 = load i32, ptr %18, align 4, !tbaa !9
  %46 = sub i32 %45, 1
  %47 = load i32, ptr %17, align 4, !tbaa !9
  %48 = add i32 %46, %47
  %49 = icmp ult i32 %44, %48
  br i1 %49, label %50, label %190

50:                                               ; preds = %43
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = urem i32 %51, 2
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  br label %56

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %55, %54
  %57 = phi ptr [ %28, %54 ], [ %31, %55 ]
  store ptr %57, ptr %10, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = urem i32 %58, 2
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  br label %63

62:                                               ; preds = %56
  br label %63

63:                                               ; preds = %62, %61
  %64 = phi ptr [ %31, %61 ], [ %28, %62 ]
  store ptr %64, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = sub i32 %66, 1
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %65, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = fcmp oeq double %70, 0.000000e+00
  br i1 %71, label %72, label %79

72:                                               ; preds = %63
  %73 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 4, ptr noundef @.str, i32 noundef 148, ptr noundef @.str.3)
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load i32, ptr %16, align 4, !tbaa !9
  %76 = sub i32 %75, 1
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %74, i64 %77
  store double 0x3D719799812DEA11, ptr %78, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %72, %63
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = sub i32 %81, 2
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds double, ptr %80, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = sub i32 %87, 1
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %86, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = fdiv double %85, %91
  store double %92, ptr %14, align 8, !tbaa !11
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = load i32, ptr %16, align 4, !tbaa !9
  %95 = sub i32 %94, 3
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds double, ptr %93, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !11
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = sub i32 %100, 1
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %99, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !11
  %105 = fdiv double %98, %104
  store double %105, ptr %15, align 8, !tbaa !11
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = icmp ugt i32 %106, 3
  br i1 %107, label %108, label %113

108:                                              ; preds = %79
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = call i32 @liquid_poly_findroots_bairstow_persistent(ptr noundef %109, i32 noundef %110, ptr noundef %111, ptr noundef %14, ptr noundef %15)
  br label %113

113:                                              ; preds = %108, %79
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %114 = load double, ptr %14, align 8, !tbaa !11
  %115 = fneg double %114
  %116 = load double, ptr %14, align 8, !tbaa !11
  %117 = load double, ptr %14, align 8, !tbaa !11
  %118 = load double, ptr %15, align 8, !tbaa !11
  %119 = fmul double 4.000000e+00, %118
  %120 = fneg double %119
  %121 = call double @llvm.fmuladd.f64(double %116, double %117, double %120)
  %122 = fptrunc double %121 to float
  %123 = getelementptr inbounds { float, float }, ptr %20, i32 0, i32 0
  %124 = getelementptr inbounds { float, float }, ptr %20, i32 0, i32 1
  store float %122, ptr %123, align 4
  store float 0.000000e+00, ptr %124, align 4
  %125 = load <2 x float>, ptr %20, align 4
  %126 = call <2 x float> @csqrtf(<2 x float> noundef %125) #8
  store <2 x float> %126, ptr %21, align 4
  %127 = getelementptr inbounds { float, float }, ptr %21, i32 0, i32 0
  %128 = load float, ptr %127, align 4
  %129 = getelementptr inbounds { float, float }, ptr %21, i32 0, i32 1
  %130 = load float, ptr %129, align 4
  %131 = fpext float %128 to double
  %132 = fpext float %130 to double
  %133 = fadd double %115, %131
  %134 = fmul double 5.000000e-01, %133
  %135 = fmul double 5.000000e-01, %132
  %136 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %137 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  store double %134, ptr %136, align 8
  store double %135, ptr %137, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #8
  %138 = load double, ptr %14, align 8, !tbaa !11
  %139 = fneg double %138
  %140 = load double, ptr %14, align 8, !tbaa !11
  %141 = load double, ptr %14, align 8, !tbaa !11
  %142 = load double, ptr %15, align 8, !tbaa !11
  %143 = fmul double 4.000000e+00, %142
  %144 = fneg double %143
  %145 = call double @llvm.fmuladd.f64(double %140, double %141, double %144)
  %146 = fptrunc double %145 to float
  %147 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 0
  %148 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 1
  store float %146, ptr %147, align 4
  store float 0.000000e+00, ptr %148, align 4
  %149 = load <2 x float>, ptr %23, align 4
  %150 = call <2 x float> @csqrtf(<2 x float> noundef %149) #8
  store <2 x float> %150, ptr %24, align 4
  %151 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 0
  %152 = load float, ptr %151, align 4
  %153 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 1
  %154 = load float, ptr %153, align 4
  %155 = fpext float %152 to double
  %156 = fpext float %154 to double
  %157 = fsub double %139, %155
  %158 = fneg double %156
  %159 = fmul double 5.000000e-01, %157
  %160 = fmul double 5.000000e-01, %158
  %161 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %162 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  store double %159, ptr %161, align 8
  store double %160, ptr %162, align 8
  %163 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %164 = load double, ptr %163, align 8
  %165 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %166 = load double, ptr %165, align 8
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !9
  %169 = add i32 %168, 1
  store i32 %169, ptr %13, align 4, !tbaa !9
  %170 = zext i32 %168 to i64
  %171 = getelementptr inbounds { double, double }, ptr %167, i64 %170
  %172 = getelementptr inbounds { double, double }, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds { double, double }, ptr %171, i32 0, i32 1
  store double %164, ptr %172, align 8
  store double %166, ptr %173, align 8
  %174 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %175 = load double, ptr %174, align 8
  %176 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %177 = load double, ptr %176, align 8
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = load i32, ptr %13, align 4, !tbaa !9
  %180 = add i32 %179, 1
  store i32 %180, ptr %13, align 4, !tbaa !9
  %181 = zext i32 %179 to i64
  %182 = getelementptr inbounds { double, double }, ptr %178, i64 %181
  %183 = getelementptr inbounds { double, double }, ptr %182, i32 0, i32 0
  %184 = getelementptr inbounds { double, double }, ptr %182, i32 0, i32 1
  store double %175, ptr %183, align 8
  store double %177, ptr %184, align 8
  %185 = load i32, ptr %16, align 4, !tbaa !9
  %186 = sub i32 %185, 2
  store i32 %186, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  br label %187

187:                                              ; preds = %113
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = add i32 %188, 1
  store i32 %189, ptr %12, align 4, !tbaa !9
  br label %43, !llvm.loop !13

190:                                              ; preds = %43
  %191 = load i32, ptr %17, align 4, !tbaa !9
  %192 = icmp eq i32 %191, 0
  br i1 %192, label %193, label %209

193:                                              ; preds = %190
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds double, ptr %194, i64 0
  %196 = load double, ptr %195, align 8, !tbaa !11
  %197 = fneg double %196
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = getelementptr inbounds double, ptr %198, i64 1
  %200 = load double, ptr %199, align 8, !tbaa !11
  %201 = fdiv double %197, %200
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = load i32, ptr %13, align 4, !tbaa !9
  %204 = add i32 %203, 1
  store i32 %204, ptr %13, align 4, !tbaa !9
  %205 = zext i32 %203 to i64
  %206 = getelementptr inbounds { double, double }, ptr %202, i64 %205
  %207 = getelementptr inbounds { double, double }, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds { double, double }, ptr %206, i32 0, i32 1
  store double %201, ptr %207, align 8
  store double 0.000000e+00, ptr %208, align 8
  br label %209

209:                                              ; preds = %193, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %210 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %210)
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @liquid_poly_findroots_bairstow_persistent(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #6

; Function Attrs: nounwind
declare <2 x float> @csqrtf(<2 x float> noundef) #7

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="64" "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 #6 = { 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 #7 = { 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 #8 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [50 x i8], align 1

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @liquid_poly_findroots_bairstow(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #3 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = zext i32 %1 to i64
  %7 = alloca double, i64 %6, align 16
  %8 = alloca double, i64 %6, align 16
  %9 = shl nuw nsw i64 %6, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %7, ptr align 8 %0, i64 %9, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %10 = and i32 %1, 1
  %11 = lshr i32 %1, 1
  %12 = add nsw i32 %11, -1
  %13 = add nsw i32 %12, %10
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %46
  %.04853 = phi i32 [ %79, %46 ], [ 0, %3 ]
  %.04952 = phi i32 [ %73, %46 ], [ 0, %3 ]
  %.05051 = phi i32 [ %26, %46 ], [ %1, %3 ]
  %14 = and i32 %.04853, 1
  %15 = icmp eq i32 %14, 0
  %. = select i1 %15, ptr %7, ptr %8
  %16 = select i1 %15, ptr %8, ptr %7
  %17 = add i32 %.05051, -1
  %18 = zext i32 %17 to i64
  %19 = getelementptr inbounds double, ptr %., i64 %18
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = fcmp oeq double %20, 0.000000e+00
  br i1 %21, label %22, label %24

22:                                               ; preds = %.lr.ph
  %23 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 4, ptr noundef nonnull @.str, i32 noundef 148, ptr noundef nonnull @.str.3) #7
  store double 0x3D719799812DEA11, ptr %19, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %22, %.lr.ph
  %25 = phi double [ 0x3D719799812DEA11, %22 ], [ %20, %.lr.ph ]
  %26 = add i32 %.05051, -2
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds double, ptr %., i64 %27
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = add i32 %.05051, -3
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds double, ptr %., i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = insertelement <2 x double> poison, double %33, i64 0
  %35 = insertelement <2 x double> %34, double %29, i64 1
  %36 = insertelement <2 x double> poison, double %25, i64 0
  %37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
  %38 = fdiv <2 x double> %35, %37
  %39 = extractelement <2 x double> %38, i64 1
  store double %39, ptr %4, align 8, !tbaa !5
  %40 = extractelement <2 x double> %38, i64 0
  store double %40, ptr %5, align 8, !tbaa !5
  %41 = icmp ugt i32 %.05051, 3
  br i1 %41, label %42, label %46

42:                                               ; preds = %24
  %43 = call i32 @liquid_poly_findroots_bairstow_persistent(ptr noundef nonnull %., i32 noundef %.05051, ptr noundef nonnull %16, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.pre = load double, ptr %4, align 8, !tbaa !5
  %.pre56 = load double, ptr %5, align 8, !tbaa !5
  %44 = insertelement <2 x double> poison, double %.pre56, i64 0
  %45 = insertelement <2 x double> %44, double %.pre, i64 1
  br label %46

46:                                               ; preds = %42, %24
  %47 = phi <2 x double> [ %45, %42 ], [ %38, %24 ]
  %48 = extractelement <2 x double> %47, i64 0
  %49 = fmul double %48, -4.000000e+00
  %50 = extractelement <2 x double> %47, i64 1
  %51 = call double @llvm.fmuladd.f64(double %50, double %50, double %49)
  %52 = fptrunc double %51 to float
  %.sroa.05.4.vec.insert = insertelement <2 x float> <float poison, float 0.000000e+00>, float %52, i64 0
  %53 = call <2 x float> @csqrtf(<2 x float> noundef %.sroa.05.4.vec.insert) #7
  %.sroa.04.0.vec.extract = extractelement <2 x float> %53, i64 0
  %.sroa.04.4.vec.extract = extractelement <2 x float> %53, i64 1
  %54 = fpext float %.sroa.04.0.vec.extract to double
  %55 = fpext float %.sroa.04.4.vec.extract to double
  %56 = fsub double %54, %50
  %57 = load double, ptr %4, align 8, !tbaa !5
  %58 = fneg double %57
  %59 = load double, ptr %5, align 8, !tbaa !5
  %60 = fmul double %59, -4.000000e+00
  %61 = call double @llvm.fmuladd.f64(double %57, double %57, double %60)
  %62 = fptrunc double %61 to float
  %.sroa.01.4.vec.insert = insertelement <2 x float> <float poison, float 0.000000e+00>, float %62, i64 0
  %63 = call <2 x float> @csqrtf(<2 x float> noundef %.sroa.01.4.vec.insert) #7
  %.sroa.0.0.vec.extract = extractelement <2 x float> %63, i64 0
  %.sroa.0.4.vec.extract = extractelement <2 x float> %63, i64 1
  %64 = fpext float %.sroa.0.0.vec.extract to double
  %65 = fpext float %.sroa.0.4.vec.extract to double
  %66 = fsub double %58, %64
  %67 = or disjoint i32 %.04952, 1
  %68 = zext i32 %.04952 to i64
  %69 = getelementptr inbounds { double, double }, ptr %2, i64 %68
  %70 = insertelement <2 x double> poison, double %56, i64 0
  %71 = insertelement <2 x double> %70, double %55, i64 1
  %72 = fmul <2 x double> %71, <double 5.000000e-01, double 5.000000e-01>
  store <2 x double> %72, ptr %69, align 8
  %73 = add i32 %.04952, 2
  %74 = zext i32 %67 to i64
  %75 = getelementptr inbounds { double, double }, ptr %2, i64 %74
  %76 = insertelement <2 x double> poison, double %66, i64 0
  %77 = insertelement <2 x double> %76, double %65, i64 1
  %78 = fmul <2 x double> %77, <double 5.000000e-01, double -5.000000e-01>
  store <2 x double> %78, ptr %75, align 8
  %79 = add nuw i32 %.04853, 1
  %exitcond.not = icmp eq i32 %79, %13
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %46
  %80 = zext i32 %73 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %3
  %.049.lcssa = phi i64 [ 0, %3 ], [ %80, %._crit_edge.loopexit ]
  %.0.lcssa = phi ptr [ null, %3 ], [ %16, %._crit_edge.loopexit ]
  %81 = icmp eq i32 %10, 0
  br i1 %81, label %82, label %90

82:                                               ; preds = %._crit_edge
  %83 = load double, ptr %.0.lcssa, align 8, !tbaa !5
  %84 = fneg double %83
  %85 = getelementptr inbounds i8, ptr %.0.lcssa, i64 8
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = fdiv double %84, %86
  %88 = getelementptr inbounds { double, double }, ptr %2, i64 %.049.lcssa
  %89 = getelementptr inbounds i8, ptr %88, i64 8
  store double %87, ptr %88, align 8
  store double 0.000000e+00, ptr %89, align 8
  br label %90

90:                                               ; preds = %82, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @liquid_poly_findroots_bairstow_persistent(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare <2 x float> @csqrtf(<2 x float> noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "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 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 "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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass