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

; 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.fabs.f64(double) #1

; 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 @_Z9nextK_ak1iidddPdS_S_S_S_(i32 noundef %0, i32 noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #2 {
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  store i32 %0, ptr %11, align 4, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !5
  store double %2, ptr %13, align 8, !tbaa !9
  store double %3, ptr %14, align 8, !tbaa !9
  store double %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !11
  store ptr %6, ptr %17, align 8, !tbaa !11
  store ptr %7, ptr %18, align 8, !tbaa !11
  store ptr %8, ptr %19, align 8, !tbaa !11
  store ptr %9, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %24 = load i32, ptr %12, align 4, !tbaa !5
  %25 = icmp eq i32 %24, 3
  br i1 %25, label %26, label %50

26:                                               ; preds = %10
  %27 = load ptr, ptr %18, align 8, !tbaa !11
  %28 = getelementptr inbounds double, ptr %27, i64 0
  store double 0.000000e+00, ptr %28, align 8, !tbaa !9
  %29 = load ptr, ptr %18, align 8, !tbaa !11
  %30 = getelementptr inbounds double, ptr %29, i64 1
  store double 0.000000e+00, ptr %30, align 8, !tbaa !9
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %46, %26
  %32 = load i32, ptr %21, align 4, !tbaa !5
  %33 = load i32, ptr %11, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %49

35:                                               ; preds = %31
  %36 = load ptr, ptr %19, align 8, !tbaa !11
  %37 = load i32, ptr %21, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 2
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds double, ptr %36, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %18, align 8, !tbaa !11
  %43 = load i32, ptr %21, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %42, i64 %44
  store double %41, ptr %45, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %35
  %47 = load i32, ptr %21, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %21, align 4, !tbaa !5
  br label %31, !llvm.loop !13

49:                                               ; preds = %31
  store i32 1, ptr %23, align 4
  br label %174

50:                                               ; preds = %10
  %51 = load i32, ptr %12, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  %54 = load double, ptr %14, align 8, !tbaa !9
  br label %57

55:                                               ; preds = %50
  %56 = load double, ptr %13, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %55, %53
  %58 = phi double [ %54, %53 ], [ %56, %55 ]
  store double %58, ptr %22, align 8, !tbaa !9
  %59 = load double, ptr %15, align 8, !tbaa !9
  %60 = call double @llvm.fabs.f64(double %59)
  %61 = load double, ptr %22, align 8, !tbaa !9
  %62 = call double @llvm.fabs.f64(double %61)
  %63 = fmul double 0x3CE4000000000000, %62
  %64 = fcmp ogt double %60, %63
  br i1 %64, label %65, label %129

65:                                               ; preds = %57
  %66 = load double, ptr %15, align 8, !tbaa !9
  %67 = load ptr, ptr %17, align 8, !tbaa !11
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = fdiv double %68, %66
  store double %69, ptr %67, align 8, !tbaa !9
  %70 = load double, ptr %15, align 8, !tbaa !9
  %71 = load ptr, ptr %16, align 8, !tbaa !11
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = fdiv double %72, %70
  store double %73, ptr %71, align 8, !tbaa !9
  %74 = load ptr, ptr %20, align 8, !tbaa !11
  %75 = getelementptr inbounds double, ptr %74, i64 0
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = load ptr, ptr %18, align 8, !tbaa !11
  %78 = getelementptr inbounds double, ptr %77, i64 0
  store double %76, ptr %78, align 8, !tbaa !9
  %79 = load ptr, ptr %17, align 8, !tbaa !11
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = load ptr, ptr %20, align 8, !tbaa !11
  %82 = getelementptr inbounds double, ptr %81, i64 0
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = load ptr, ptr %20, align 8, !tbaa !11
  %85 = getelementptr inbounds double, ptr %84, i64 1
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fneg double %80
  %88 = call double @llvm.fmuladd.f64(double %87, double %83, double %86)
  %89 = load ptr, ptr %18, align 8, !tbaa !11
  %90 = getelementptr inbounds double, ptr %89, i64 1
  store double %88, ptr %90, align 8, !tbaa !9
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %125, %65
  %92 = load i32, ptr %21, align 4, !tbaa !5
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %128

95:                                               ; preds = %91
  %96 = load ptr, ptr %17, align 8, !tbaa !11
  %97 = load double, ptr %96, align 8, !tbaa !9
  %98 = load ptr, ptr %20, align 8, !tbaa !11
  %99 = load i32, ptr %21, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds double, ptr %98, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = load ptr, ptr %16, align 8, !tbaa !11
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = load ptr, ptr %19, align 8, !tbaa !11
  %107 = load i32, ptr %21, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 2
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %106, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = fmul double %105, %111
  %113 = fneg double %97
  %114 = call double @llvm.fmuladd.f64(double %113, double %103, double %112)
  %115 = load ptr, ptr %20, align 8, !tbaa !11
  %116 = load i32, ptr %21, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds double, ptr %115, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !9
  %120 = fadd double %114, %119
  %121 = load ptr, ptr %18, align 8, !tbaa !11
  %122 = load i32, ptr %21, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds double, ptr %121, i64 %123
  store double %120, ptr %124, align 8, !tbaa !9
  br label %125

125:                                              ; preds = %95
  %126 = load i32, ptr %21, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %21, align 4, !tbaa !5
  br label %91, !llvm.loop !15

128:                                              ; preds = %91
  br label %173

129:                                              ; preds = %57
  %130 = load ptr, ptr %18, align 8, !tbaa !11
  %131 = getelementptr inbounds double, ptr %130, i64 0
  store double 0.000000e+00, ptr %131, align 8, !tbaa !9
  %132 = load ptr, ptr %17, align 8, !tbaa !11
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = fneg double %133
  %135 = load ptr, ptr %20, align 8, !tbaa !11
  %136 = getelementptr inbounds double, ptr %135, i64 0
  %137 = load double, ptr %136, align 8, !tbaa !9
  %138 = fmul double %134, %137
  %139 = load ptr, ptr %18, align 8, !tbaa !11
  %140 = getelementptr inbounds double, ptr %139, i64 1
  store double %138, ptr %140, align 8, !tbaa !9
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %169, %129
  %142 = load i32, ptr %21, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %145, label %172

145:                                              ; preds = %141
  %146 = load ptr, ptr %17, align 8, !tbaa !11
  %147 = load double, ptr %146, align 8, !tbaa !9
  %148 = load ptr, ptr %20, align 8, !tbaa !11
  %149 = load i32, ptr %21, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %148, i64 %151
  %153 = load double, ptr %152, align 8, !tbaa !9
  %154 = load ptr, ptr %16, align 8, !tbaa !11
  %155 = load double, ptr %154, align 8, !tbaa !9
  %156 = load ptr, ptr %19, align 8, !tbaa !11
  %157 = load i32, ptr %21, align 4, !tbaa !5
  %158 = sub nsw i32 %157, 2
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds double, ptr %156, i64 %159
  %161 = load double, ptr %160, align 8, !tbaa !9
  %162 = fmul double %155, %161
  %163 = fneg double %147
  %164 = call double @llvm.fmuladd.f64(double %163, double %153, double %162)
  %165 = load ptr, ptr %18, align 8, !tbaa !11
  %166 = load i32, ptr %21, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %165, i64 %167
  store double %164, ptr %168, align 8, !tbaa !9
  br label %169

169:                                              ; preds = %145
  %170 = load i32, ptr %21, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %21, align 4, !tbaa !5
  br label %141, !llvm.loop !16

172:                                              ; preds = %141
  br label %173

173:                                              ; preds = %172, %128
  store i32 1, ptr %23, align 4
  br label %174

174:                                              ; preds = %173, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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.fabs.f64(double) #0

; 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 memory(argmem: readwrite) uwtable
define dso_local void @_Z9nextK_ak1iidddPdS_S_S_S_(i32 noundef %0, i32 noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr nocapture noundef %5, ptr nocapture noundef %6, ptr nocapture noundef writeonly %7, ptr nocapture noundef readonly %8, ptr nocapture noundef readonly %9) local_unnamed_addr #1 {
  %11 = ptrtoint ptr %8 to i64
  %12 = ptrtoint ptr %7 to i64
  %13 = icmp eq i32 %1, 3
  br i1 %13, label %14, label %36

14:                                               ; preds = %10
  %invariant.gep62 = getelementptr i8, ptr %8, i64 -16
  %15 = icmp sgt i32 %0, 2
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  br i1 %15, label %.lr.ph65.preheader, label %.loopexit

.lr.ph65.preheader:                               ; preds = %14
  %wide.trip.count77 = zext nneg i32 %0 to i64
  %16 = add nsw i64 %wide.trip.count77, -2
  %min.iters.check160 = icmp ult i64 %16, 8
  br i1 %min.iters.check160, label %.lr.ph65.preheader173, label %vector.memcheck157

vector.memcheck157:                               ; preds = %.lr.ph65.preheader
  %17 = add i64 %12, 16
  %18 = sub i64 %17, %11
  %diff.check = icmp ult i64 %18, 32
  br i1 %diff.check, label %.lr.ph65.preheader173, label %vector.ph161

vector.ph161:                                     ; preds = %vector.memcheck157
  %n.vec163 = and i64 %16, -4
  %ind.end164 = or disjoint i64 %n.vec163, 2
  br label %vector.body166

vector.body166:                                   ; preds = %vector.body166, %vector.ph161
  %index167 = phi i64 [ 0, %vector.ph161 ], [ %index.next171, %vector.body166 ]
  %offset.idx168 = or disjoint i64 %index167, 2
  %19 = getelementptr double, ptr %8, i64 %index167
  %20 = getelementptr i8, ptr %19, i64 16
  %wide.load169 = load <2 x double>, ptr %19, align 8, !tbaa !5
  %wide.load170 = load <2 x double>, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds double, ptr %7, i64 %offset.idx168
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  store <2 x double> %wide.load169, ptr %21, align 8, !tbaa !5
  store <2 x double> %wide.load170, ptr %22, align 8, !tbaa !5
  %index.next171 = add nuw i64 %index167, 4
  %23 = icmp eq i64 %index.next171, %n.vec163
  br i1 %23, label %middle.block158, label %vector.body166, !llvm.loop !9

middle.block158:                                  ; preds = %vector.body166
  %cmp.n172 = icmp eq i64 %16, %n.vec163
  br i1 %cmp.n172, label %.loopexit, label %.lr.ph65.preheader173

.lr.ph65.preheader173:                            ; preds = %middle.block158, %vector.memcheck157, %.lr.ph65.preheader
  %indvars.iv74.ph = phi i64 [ 2, %vector.memcheck157 ], [ 2, %.lr.ph65.preheader ], [ %ind.end164, %middle.block158 ]
  %24 = sub nsw i64 %wide.trip.count77, %indvars.iv74.ph
  %xtraiter180 = and i64 %24, 3
  %lcmp.mod181.not = icmp eq i64 %xtraiter180, 0
  br i1 %lcmp.mod181.not, label %.lr.ph65.prol.loopexit, label %.lr.ph65.prol

.lr.ph65.prol:                                    ; preds = %.lr.ph65.preheader173, %.lr.ph65.prol
  %indvars.iv74.prol = phi i64 [ %indvars.iv.next75.prol, %.lr.ph65.prol ], [ %indvars.iv74.ph, %.lr.ph65.preheader173 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph65.prol ], [ 0, %.lr.ph65.preheader173 ]
  %gep63.prol = getelementptr double, ptr %invariant.gep62, i64 %indvars.iv74.prol
  %25 = load double, ptr %gep63.prol, align 8, !tbaa !5
  %26 = getelementptr inbounds double, ptr %7, i64 %indvars.iv74.prol
  store double %25, ptr %26, align 8, !tbaa !5
  %indvars.iv.next75.prol = add nuw nsw i64 %indvars.iv74.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter180
  br i1 %prol.iter.cmp.not, label %.lr.ph65.prol.loopexit, label %.lr.ph65.prol, !llvm.loop !13

.lr.ph65.prol.loopexit:                           ; preds = %.lr.ph65.prol, %.lr.ph65.preheader173
  %indvars.iv74.unr = phi i64 [ %indvars.iv74.ph, %.lr.ph65.preheader173 ], [ %indvars.iv.next75.prol, %.lr.ph65.prol ]
  %27 = sub nsw i64 %indvars.iv74.ph, %wide.trip.count77
  %28 = icmp ugt i64 %27, -4
  br i1 %28, label %.loopexit, label %.lr.ph65.preheader173.new

.lr.ph65.preheader173.new:                        ; preds = %.lr.ph65.prol.loopexit
  %invariant.gep182 = getelementptr i8, ptr %7, i64 16
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65, %.lr.ph65.preheader173.new
  %indvars.iv74 = phi i64 [ %indvars.iv74.unr, %.lr.ph65.preheader173.new ], [ %indvars.iv.next75.3, %.lr.ph65 ]
  %gep63 = getelementptr double, ptr %invariant.gep62, i64 %indvars.iv74
  %29 = load double, ptr %gep63, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %7, i64 %indvars.iv74
  store double %29, ptr %30, align 8, !tbaa !5
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %gep63.1 = getelementptr double, ptr %invariant.gep62, i64 %indvars.iv.next75
  %31 = load double, ptr %gep63.1, align 8, !tbaa !5
  %32 = getelementptr inbounds double, ptr %7, i64 %indvars.iv.next75
  store double %31, ptr %32, align 8, !tbaa !5
  %gep63.2 = getelementptr double, ptr %8, i64 %indvars.iv74
  %33 = load double, ptr %gep63.2, align 8, !tbaa !5
  %gep183 = getelementptr double, ptr %invariant.gep182, i64 %indvars.iv74
  store double %33, ptr %gep183, align 8, !tbaa !5
  %indvars.iv.next75.2 = add nuw nsw i64 %indvars.iv74, 3
  %gep63.3 = getelementptr double, ptr %invariant.gep62, i64 %indvars.iv.next75.2
  %34 = load double, ptr %gep63.3, align 8, !tbaa !5
  %35 = getelementptr inbounds double, ptr %7, i64 %indvars.iv.next75.2
  store double %34, ptr %35, align 8, !tbaa !5
  %indvars.iv.next75.3 = add nuw nsw i64 %indvars.iv74, 4
  %exitcond78.not.3 = icmp eq i64 %indvars.iv.next75.3, %wide.trip.count77
  br i1 %exitcond78.not.3, label %.loopexit, label %.lr.ph65, !llvm.loop !15

36:                                               ; preds = %10
  %37 = icmp eq i32 %1, 1
  %38 = select i1 %37, double %3, double %2
  %39 = tail call double @llvm.fabs.f64(double %4)
  %40 = tail call double @llvm.fabs.f64(double %38)
  %41 = fmul double %40, 0x3CE4000000000000
  %42 = fcmp ogt double %39, %41
  br i1 %42, label %43, label %117

43:                                               ; preds = %36
  %44 = load double, ptr %6, align 8, !tbaa !5
  %45 = fdiv double %44, %4
  store double %45, ptr %6, align 8, !tbaa !5
  %46 = load double, ptr %5, align 8, !tbaa !5
  %47 = fdiv double %46, %4
  store double %47, ptr %5, align 8, !tbaa !5
  %48 = load double, ptr %9, align 8, !tbaa !5
  store double %48, ptr %7, align 8, !tbaa !5
  %49 = load double, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %9, i64 8
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = fneg double %49
  %53 = tail call double @llvm.fmuladd.f64(double %52, double %48, double %51)
  %54 = getelementptr inbounds i8, ptr %7, i64 8
  store double %53, ptr %54, align 8, !tbaa !5
  %invariant.gep58 = getelementptr i8, ptr %8, i64 -16
  %55 = icmp sgt i32 %0, 2
  br i1 %55, label %.lr.ph61.preheader, label %.loopexit

.lr.ph61.preheader:                               ; preds = %43
  %wide.trip.count72 = zext nneg i32 %0 to i64
  %56 = add nsw i64 %wide.trip.count72, -2
  %min.iters.check134 = icmp ult i64 %56, 10
  br i1 %min.iters.check134, label %.lr.ph61.preheader174, label %vector.memcheck109

vector.memcheck109:                               ; preds = %.lr.ph61.preheader
  %scevgep110 = getelementptr i8, ptr %7, i64 16
  %57 = shl nuw nsw i64 %wide.trip.count72, 3
  %scevgep111 = getelementptr i8, ptr %7, i64 %57
  %scevgep112 = getelementptr i8, ptr %6, i64 8
  %scevgep113 = getelementptr i8, ptr %9, i64 8
  %scevgep114 = getelementptr i8, ptr %9, i64 %57
  %scevgep115 = getelementptr i8, ptr %5, i64 8
  %58 = getelementptr i8, ptr %8, i64 %57
  %scevgep116 = getelementptr i8, ptr %58, i64 -16
  %bound0117 = icmp ult ptr %scevgep110, %scevgep112
  %bound1118 = icmp ugt ptr %scevgep111, %6
  %found.conflict119 = and i1 %bound0117, %bound1118
  %bound0120 = icmp ult ptr %scevgep110, %scevgep114
  %bound1121 = icmp ult ptr %scevgep113, %scevgep111
  %found.conflict122 = and i1 %bound0120, %bound1121
  %conflict.rdx123 = or i1 %found.conflict119, %found.conflict122
  %bound0124 = icmp ult ptr %scevgep110, %scevgep115
  %bound1125 = icmp ugt ptr %scevgep111, %5
  %found.conflict126 = and i1 %bound0124, %bound1125
  %conflict.rdx127 = or i1 %conflict.rdx123, %found.conflict126
  %bound0128 = icmp ult ptr %scevgep110, %scevgep116
  %bound1129 = icmp ugt ptr %scevgep111, %8
  %found.conflict130 = and i1 %bound0128, %bound1129
  %conflict.rdx131 = or i1 %conflict.rdx127, %found.conflict130
  br i1 %conflict.rdx131, label %.lr.ph61.preheader174, label %vector.ph135

vector.ph135:                                     ; preds = %vector.memcheck109
  %n.vec137 = and i64 %56, -4
  %ind.end138 = or disjoint i64 %n.vec137, 2
  %59 = load double, ptr %6, align 8, !tbaa !5, !alias.scope !16
  %broadcast.splatinsert151 = insertelement <2 x double> poison, double %59, i64 0
  %broadcast.splat152 = shufflevector <2 x double> %broadcast.splatinsert151, <2 x double> poison, <2 x i32> zeroinitializer
  %60 = load double, ptr %5, align 8, !tbaa !5, !alias.scope !19
  %broadcast.splatinsert147 = insertelement <2 x double> poison, double %60, i64 0
  %broadcast.splat148 = shufflevector <2 x double> %broadcast.splatinsert147, <2 x double> poison, <2 x i32> zeroinitializer
  %61 = fneg <2 x double> %broadcast.splat152
  %62 = fneg <2 x double> %broadcast.splat152
  br label %vector.body140

vector.body140:                                   ; preds = %vector.body140, %vector.ph135
  %index141 = phi i64 [ 0, %vector.ph135 ], [ %index.next155, %vector.body140 ]
  %offset.idx142 = or disjoint i64 %index141, 2
  %63 = getelementptr double, ptr %9, i64 %offset.idx142
  %64 = getelementptr i8, ptr %63, i64 -8
  %65 = getelementptr i8, ptr %63, i64 8
  %wide.load143 = load <2 x double>, ptr %64, align 8, !tbaa !5, !alias.scope !21
  %wide.load144 = load <2 x double>, ptr %65, align 8, !tbaa !5, !alias.scope !21
  %66 = getelementptr double, ptr %8, i64 %index141
  %67 = getelementptr i8, ptr %66, i64 16
  %wide.load145 = load <2 x double>, ptr %66, align 8, !tbaa !5, !alias.scope !23
  %wide.load146 = load <2 x double>, ptr %67, align 8, !tbaa !5, !alias.scope !23
  %68 = fmul <2 x double> %broadcast.splat148, %wide.load145
  %69 = fmul <2 x double> %broadcast.splat148, %wide.load146
  %70 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %wide.load143, <2 x double> %68)
  %71 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %62, <2 x double> %wide.load144, <2 x double> %69)
  %72 = getelementptr i8, ptr %63, i64 16
  %wide.load153 = load <2 x double>, ptr %63, align 8, !tbaa !5, !alias.scope !21
  %wide.load154 = load <2 x double>, ptr %72, align 8, !tbaa !5, !alias.scope !21
  %73 = fadd <2 x double> %wide.load153, %70
  %74 = fadd <2 x double> %wide.load154, %71
  %75 = getelementptr inbounds double, ptr %7, i64 %offset.idx142
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  store <2 x double> %73, ptr %75, align 8, !tbaa !5, !alias.scope !25, !noalias !27
  store <2 x double> %74, ptr %76, align 8, !tbaa !5, !alias.scope !25, !noalias !27
  %index.next155 = add nuw i64 %index141, 4
  %77 = icmp eq i64 %index.next155, %n.vec137
  br i1 %77, label %middle.block132, label %vector.body140, !llvm.loop !28

middle.block132:                                  ; preds = %vector.body140
  %cmp.n156 = icmp eq i64 %56, %n.vec137
  br i1 %cmp.n156, label %.loopexit, label %.lr.ph61.preheader174

.lr.ph61.preheader174:                            ; preds = %middle.block132, %vector.memcheck109, %.lr.ph61.preheader
  %indvars.iv69.ph = phi i64 [ 2, %vector.memcheck109 ], [ 2, %.lr.ph61.preheader ], [ %ind.end138, %middle.block132 ]
  %78 = sub nsw i64 %wide.trip.count72, %indvars.iv69.ph
  %xtraiter178 = and i64 %78, 1
  %lcmp.mod179.not = icmp eq i64 %xtraiter178, 0
  br i1 %lcmp.mod179.not, label %.lr.ph61.prol.loopexit, label %.lr.ph61.prol

.lr.ph61.prol:                                    ; preds = %.lr.ph61.preheader174
  %79 = load double, ptr %6, align 8, !tbaa !5
  %80 = getelementptr double, ptr %9, i64 %indvars.iv69.ph
  %81 = getelementptr i8, ptr %80, i64 -8
  %82 = load double, ptr %81, align 8, !tbaa !5
  %83 = load double, ptr %5, align 8, !tbaa !5
  %gep59.prol = getelementptr double, ptr %invariant.gep58, i64 %indvars.iv69.ph
  %84 = load double, ptr %gep59.prol, align 8, !tbaa !5
  %85 = fmul double %83, %84
  %86 = fneg double %79
  %87 = tail call double @llvm.fmuladd.f64(double %86, double %82, double %85)
  %88 = load double, ptr %80, align 8, !tbaa !5
  %89 = fadd double %88, %87
  %90 = getelementptr inbounds double, ptr %7, i64 %indvars.iv69.ph
  store double %89, ptr %90, align 8, !tbaa !5
  %indvars.iv.next70.prol = add nuw nsw i64 %indvars.iv69.ph, 1
  br label %.lr.ph61.prol.loopexit

.lr.ph61.prol.loopexit:                           ; preds = %.lr.ph61.prol, %.lr.ph61.preheader174
  %indvars.iv69.unr = phi i64 [ %indvars.iv69.ph, %.lr.ph61.preheader174 ], [ %indvars.iv.next70.prol, %.lr.ph61.prol ]
  %91 = add nsw i64 %wide.trip.count72, -1
  %92 = icmp eq i64 %indvars.iv69.ph, %91
  br i1 %92, label %.loopexit, label %.lr.ph61

.lr.ph61:                                         ; preds = %.lr.ph61.prol.loopexit, %.lr.ph61
  %indvars.iv69 = phi i64 [ %indvars.iv.next70.1, %.lr.ph61 ], [ %indvars.iv69.unr, %.lr.ph61.prol.loopexit ]
  %93 = load double, ptr %6, align 8, !tbaa !5
  %94 = getelementptr double, ptr %9, i64 %indvars.iv69
  %95 = getelementptr i8, ptr %94, i64 -8
  %96 = load double, ptr %95, align 8, !tbaa !5
  %97 = load double, ptr %5, align 8, !tbaa !5
  %gep59 = getelementptr double, ptr %invariant.gep58, i64 %indvars.iv69
  %98 = load double, ptr %gep59, align 8, !tbaa !5
  %99 = fmul double %97, %98
  %100 = fneg double %93
  %101 = tail call double @llvm.fmuladd.f64(double %100, double %96, double %99)
  %102 = load double, ptr %94, align 8, !tbaa !5
  %103 = fadd double %102, %101
  %104 = getelementptr inbounds double, ptr %7, i64 %indvars.iv69
  store double %103, ptr %104, align 8, !tbaa !5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %105 = load double, ptr %6, align 8, !tbaa !5
  %106 = getelementptr double, ptr %9, i64 %indvars.iv.next70
  %107 = getelementptr i8, ptr %106, i64 -8
  %108 = load double, ptr %107, align 8, !tbaa !5
  %109 = load double, ptr %5, align 8, !tbaa !5
  %gep59.1 = getelementptr double, ptr %invariant.gep58, i64 %indvars.iv.next70
  %110 = load double, ptr %gep59.1, align 8, !tbaa !5
  %111 = fmul double %109, %110
  %112 = fneg double %105
  %113 = tail call double @llvm.fmuladd.f64(double %112, double %108, double %111)
  %114 = load double, ptr %106, align 8, !tbaa !5
  %115 = fadd double %114, %113
  %116 = getelementptr inbounds double, ptr %7, i64 %indvars.iv.next70
  store double %115, ptr %116, align 8, !tbaa !5
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %exitcond73.not.1 = icmp eq i64 %indvars.iv.next70.1, %wide.trip.count72
  br i1 %exitcond73.not.1, label %.loopexit, label %.lr.ph61, !llvm.loop !29

117:                                              ; preds = %36
  store double 0.000000e+00, ptr %7, align 8, !tbaa !5
  %118 = load double, ptr %6, align 8, !tbaa !5
  %119 = fneg double %118
  %120 = load double, ptr %9, align 8, !tbaa !5
  %121 = fmul double %120, %119
  %122 = getelementptr inbounds i8, ptr %7, i64 8
  store double %121, ptr %122, align 8, !tbaa !5
  %invariant.gep = getelementptr i8, ptr %9, i64 -8
  %invariant.gep55 = getelementptr i8, ptr %8, i64 -16
  %123 = icmp sgt i32 %0, 2
  br i1 %123, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %117
  %wide.trip.count = zext nneg i32 %0 to i64
  %124 = add nsw i64 %wide.trip.count, -2
  %min.iters.check = icmp ult i64 %124, 14
  br i1 %min.iters.check, label %.lr.ph.preheader176, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %scevgep = getelementptr i8, ptr %7, i64 16
  %125 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep83 = getelementptr i8, ptr %7, i64 %125
  %scevgep84 = getelementptr i8, ptr %6, i64 8
  %scevgep85 = getelementptr i8, ptr %9, i64 8
  %126 = getelementptr i8, ptr %9, i64 %125
  %scevgep86 = getelementptr i8, ptr %126, i64 -8
  %scevgep87 = getelementptr i8, ptr %5, i64 8
  %127 = getelementptr i8, ptr %8, i64 %125
  %scevgep88 = getelementptr i8, ptr %127, i64 -16
  %bound0 = icmp ult ptr %scevgep, %scevgep84
  %bound1 = icmp ugt ptr %scevgep83, %6
  %found.conflict = and i1 %bound0, %bound1
  %bound089 = icmp ult ptr %scevgep, %scevgep86
  %bound190 = icmp ult ptr %scevgep85, %scevgep83
  %found.conflict91 = and i1 %bound089, %bound190
  %conflict.rdx = or i1 %found.conflict, %found.conflict91
  %bound092 = icmp ult ptr %scevgep, %scevgep87
  %bound193 = icmp ugt ptr %scevgep83, %5
  %found.conflict94 = and i1 %bound092, %bound193
  %conflict.rdx95 = or i1 %conflict.rdx, %found.conflict94
  %bound096 = icmp ult ptr %scevgep, %scevgep88
  %bound197 = icmp ugt ptr %scevgep83, %8
  %found.conflict98 = and i1 %bound096, %bound197
  %conflict.rdx99 = or i1 %conflict.rdx95, %found.conflict98
  br i1 %conflict.rdx99, label %.lr.ph.preheader176, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %124, -4
  %ind.end = or disjoint i64 %n.vec, 2
  %128 = load double, ptr %6, align 8, !tbaa !5, !alias.scope !30
  %broadcast.splatinsert107 = insertelement <2 x double> poison, double %128, i64 0
  %broadcast.splat108 = shufflevector <2 x double> %broadcast.splatinsert107, <2 x double> poison, <2 x i32> zeroinitializer
  %129 = load double, ptr %5, align 8, !tbaa !5, !alias.scope !33
  %broadcast.splatinsert103 = insertelement <2 x double> poison, double %129, i64 0
  %broadcast.splat104 = shufflevector <2 x double> %broadcast.splatinsert103, <2 x double> poison, <2 x i32> zeroinitializer
  %130 = fneg <2 x double> %broadcast.splat108
  %131 = fneg <2 x double> %broadcast.splat108
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 2
  %132 = getelementptr double, ptr %invariant.gep, i64 %offset.idx
  %133 = getelementptr i8, ptr %132, i64 16
  %wide.load = load <2 x double>, ptr %132, align 8, !tbaa !5, !alias.scope !35
  %wide.load100 = load <2 x double>, ptr %133, align 8, !tbaa !5, !alias.scope !35
  %134 = getelementptr double, ptr %8, i64 %index
  %135 = getelementptr i8, ptr %134, i64 16
  %wide.load101 = load <2 x double>, ptr %134, align 8, !tbaa !5, !alias.scope !37
  %wide.load102 = load <2 x double>, ptr %135, align 8, !tbaa !5, !alias.scope !37
  %136 = fmul <2 x double> %broadcast.splat104, %wide.load101
  %137 = fmul <2 x double> %broadcast.splat104, %wide.load102
  %138 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %130, <2 x double> %wide.load, <2 x double> %136)
  %139 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %131, <2 x double> %wide.load100, <2 x double> %137)
  %140 = getelementptr inbounds double, ptr %7, i64 %offset.idx
  %141 = getelementptr inbounds i8, ptr %140, i64 16
  store <2 x double> %138, ptr %140, align 8, !tbaa !5, !alias.scope !39, !noalias !41
  store <2 x double> %139, ptr %141, align 8, !tbaa !5, !alias.scope !39, !noalias !41
  %index.next = add nuw i64 %index, 4
  %142 = icmp eq i64 %index.next, %n.vec
  br i1 %142, label %middle.block, label %vector.body, !llvm.loop !42

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %124, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader176

.lr.ph.preheader176:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 2, %vector.memcheck ], [ 2, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %143 = sub nsw i64 %wide.trip.count, %indvars.iv.ph
  %xtraiter = and i64 %143, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader176
  %144 = load double, ptr %6, align 8, !tbaa !5
  %gep.prol = getelementptr double, ptr %invariant.gep, i64 %indvars.iv.ph
  %145 = load double, ptr %gep.prol, align 8, !tbaa !5
  %146 = load double, ptr %5, align 8, !tbaa !5
  %gep56.prol = getelementptr double, ptr %invariant.gep55, i64 %indvars.iv.ph
  %147 = load double, ptr %gep56.prol, align 8, !tbaa !5
  %148 = fmul double %146, %147
  %149 = fneg double %144
  %150 = tail call double @llvm.fmuladd.f64(double %149, double %145, double %148)
  %151 = getelementptr inbounds double, ptr %7, i64 %indvars.iv.ph
  store double %150, ptr %151, align 8, !tbaa !5
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader176
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader176 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %152 = add nsw i64 %wide.trip.count, -1
  %153 = icmp eq i64 %indvars.iv.ph, %152
  br i1 %153, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %154 = load double, ptr %6, align 8, !tbaa !5
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv
  %155 = load double, ptr %gep, align 8, !tbaa !5
  %156 = load double, ptr %5, align 8, !tbaa !5
  %gep56 = getelementptr double, ptr %invariant.gep55, i64 %indvars.iv
  %157 = load double, ptr %gep56, align 8, !tbaa !5
  %158 = fmul double %156, %157
  %159 = fneg double %154
  %160 = tail call double @llvm.fmuladd.f64(double %159, double %155, double %158)
  %161 = getelementptr inbounds double, ptr %7, i64 %indvars.iv
  store double %160, ptr %161, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %162 = load double, ptr %6, align 8, !tbaa !5
  %gep.1 = getelementptr double, ptr %9, i64 %indvars.iv
  %163 = load double, ptr %gep.1, align 8, !tbaa !5
  %164 = load double, ptr %5, align 8, !tbaa !5
  %gep56.1 = getelementptr double, ptr %invariant.gep55, i64 %indvars.iv.next
  %165 = load double, ptr %gep56.1, align 8, !tbaa !5
  %166 = fmul double %164, %165
  %167 = fneg double %162
  %168 = tail call double @llvm.fmuladd.f64(double %167, double %163, double %166)
  %169 = getelementptr inbounds double, ptr %7, i64 %indvars.iv.next
  store double %168, ptr %169, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %.loopexit, label %.lr.ph, !llvm.loop !43

.loopexit:                                        ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %.lr.ph61.prol.loopexit, %.lr.ph61, %.lr.ph65.prol.loopexit, %.lr.ph65, %middle.block, %middle.block132, %middle.block158, %117, %43, %14
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind 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 nounwind willreturn memory(argmem: write) }
attributes #3 = { 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"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11}
!16 = !{!17}
!17 = distinct !{!17, !18}
!18 = distinct !{!18, !"LVerDomain"}
!19 = !{!20}
!20 = distinct !{!20, !18}
!21 = !{!22}
!22 = distinct !{!22, !18}
!23 = !{!24}
!24 = distinct !{!24, !18}
!25 = !{!26}
!26 = distinct !{!26, !18}
!27 = !{!17, !22, !20, !24}
!28 = distinct !{!28, !10, !11, !12}
!29 = distinct !{!29, !10, !11}
!30 = !{!31}
!31 = distinct !{!31, !32}
!32 = distinct !{!32, !"LVerDomain"}
!33 = !{!34}
!34 = distinct !{!34, !32}
!35 = !{!36}
!36 = distinct !{!36, !32}
!37 = !{!38}
!38 = distinct !{!38, !32}
!39 = !{!40}
!40 = distinct !{!40, !32}
!41 = !{!31, !36, !34, !38}
!42 = distinct !{!42, !10, !11, !12}
!43 = distinct !{!43, !10, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass