; LLVM IR from AlgoGenesis/C :: Machine_Learning_Algorithms/Ridge Regression (Program)

; 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

; Function Attrs: nounwind uwtable
define dso_local i32 @invertMatrix(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %46, %3
  %18 = load i32, ptr %8, align 4, !tbaa !9
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %49

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %42, %22
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %45

28:                                               ; preds = %23
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = icmp eq i32 %29, %30
  %32 = zext i1 %31 to i64
  %33 = select i1 %31, double 1.000000e+00, double 0.000000e+00
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %34, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds double, ptr %38, i64 %40
  store double %33, ptr %41, align 8, !tbaa !11
  br label %42

42:                                               ; preds = %28
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !9
  br label %23, !llvm.loop !13

45:                                               ; preds = %27
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %8, align 4, !tbaa !9
  br label %17, !llvm.loop !15

49:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %181, %49
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 8, ptr %9, align 4
  br label %184

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !11
  store double %64, ptr %12, align 8, !tbaa !11
  %65 = load double, ptr %12, align 8, !tbaa !11
  %66 = call double @llvm.fabs.f64(double %65)
  %67 = fcmp olt double %66, 1.000000e-10
  br i1 %67, label %68, label %69

68:                                               ; preds = %55
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %178

69:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %98, %69
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %101

75:                                               ; preds = %70
  %76 = load double, ptr %12, align 8, !tbaa !11
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %77, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = load i32, ptr %13, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds double, ptr %81, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = fdiv double %85, %76
  store double %86, ptr %84, align 8, !tbaa !11
  %87 = load double, ptr %12, align 8, !tbaa !11
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = fdiv double %96, %87
  store double %97, ptr %95, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %75
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !9
  br label %70, !llvm.loop !16

101:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %174, %101
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %177

107:                                              ; preds = %102
  %108 = load i32, ptr %14, align 4, !tbaa !9
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = icmp ne i32 %108, %109
  br i1 %110, label %111, label %173

111:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds double, ptr %116, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !11
  store double %120, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %169, %111
  %122 = load i32, ptr %16, align 4, !tbaa !9
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %172

126:                                              ; preds = %121
  %127 = load double, ptr %15, align 8, !tbaa !11
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i32, ptr %11, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds ptr, ptr %128, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = load i32, ptr %16, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %132, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds ptr, ptr %137, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  %142 = load i32, ptr %16, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %141, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = fneg double %127
  %147 = call double @llvm.fmuladd.f64(double %146, double %136, double %145)
  store double %147, ptr %144, align 8, !tbaa !11
  %148 = load double, ptr %15, align 8, !tbaa !11
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = load i32, ptr %11, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds ptr, ptr %149, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = load i32, ptr %16, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds double, ptr %153, i64 %155
  %157 = load double, ptr %156, align 8, !tbaa !11
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = load i32, ptr %14, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds ptr, ptr %158, i64 %160
  %162 = load ptr, ptr %161, align 8, !tbaa !5
  %163 = load i32, ptr %16, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds double, ptr %162, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !11
  %167 = fneg double %148
  %168 = call double @llvm.fmuladd.f64(double %167, double %157, double %166)
  store double %168, ptr %165, align 8, !tbaa !11
  br label %169

169:                                              ; preds = %126
  %170 = load i32, ptr %16, align 4, !tbaa !9
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %16, align 4, !tbaa !9
  br label %121, !llvm.loop !17

172:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %173

173:                                              ; preds = %172, %107
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %14, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %14, align 4, !tbaa !9
  br label %102, !llvm.loop !18

177:                                              ; preds = %106
  store i32 0, ptr %9, align 4
  br label %178

178:                                              ; preds = %177, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %179 = load i32, ptr %9, align 4
  switch i32 %179, label %184 [
    i32 0, label %180
  ]

180:                                              ; preds = %178
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %11, align 4, !tbaa !9
  br label %50, !llvm.loop !19

184:                                              ; preds = %178, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %185 = load i32, ptr %9, align 4
  switch i32 %185, label %189 [
    i32 8, label %186
    i32 1, label %187
  ]

186:                                              ; preds = %184
  store i32 0, ptr %4, align 4
  br label %187

187:                                              ; preds = %186, %184
  %188 = load i32, ptr %4, align 4
  ret i32 %188

189:                                              ; preds = %184
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = !{!"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"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !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.fmuladd.f64(double, double, double) #0

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @invertMatrix(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = icmp sgt i32 %2, 0
  br i1 %4, label %.preheader69.us.preheader, label %.critedge

.preheader69.us.preheader:                        ; preds = %3
  %wide.trip.count105 = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 4
  %n.vec = and i64 %wide.trip.count105, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count105
  br label %.preheader69.us

.preheader69.us:                                  ; preds = %.preheader69.us.preheader, %._crit_edge.us
  %indvars.iv102 = phi i64 [ 0, %.preheader69.us.preheader ], [ %indvars.iv.next103, %._crit_edge.us ]
  %5 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv102
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader69.us
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %indvars.iv102, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %7 = icmp eq <2 x i64> %broadcast.splat, %vec.ind
  %8 = icmp eq <2 x i64> %broadcast.splat, %step.add
  %9 = select <2 x i1> %7, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
  %10 = select <2 x i1> %8, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
  %11 = getelementptr inbounds double, ptr %6, i64 %index
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  store <2 x double> %9, ptr %11, align 8, !tbaa !9
  store <2 x double> %10, ptr %12, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader69.us
  %indvars.iv.ph = phi i64 [ 0, %.preheader69.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %14 = icmp eq i64 %indvars.iv102, %indvars.iv
  %15 = select i1 %14, double 1.000000e+00, double 0.000000e+00
  %16 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double %15, ptr %16, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count105
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !15

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
  br i1 %exitcond106.not, label %.preheader68, label %.preheader69.us, !llvm.loop !16

.preheader68:                                     ; preds = %._crit_edge.us
  br i1 %4, label %.lr.ph80, label %.critedge

.lr.ph80:                                         ; preds = %.preheader68
  %17 = zext nneg i32 %2 to i64
  %wide.trip.count124 = zext nneg i32 %2 to i64
  %18 = load ptr, ptr %0, align 8, !tbaa !5
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = tail call double @llvm.fabs.f64(double %19)
  %21 = fcmp uge double %20, 1.000000e-10
  br i1 %21, label %.lr.ph.us.lr.ph, label %.critedge

.lr.ph.us.lr.ph:                                  ; preds = %.lr.ph80
  %22 = shl nuw nsw i64 %wide.trip.count105, 3
  %23 = shl nuw nsw i64 %wide.trip.count105, 3
  %min.iters.check172 = icmp eq i32 %2, 1
  %n.vec175 = and i64 %wide.trip.count105, 2147483646
  %cmp.n184 = icmp eq i64 %n.vec175, %wide.trip.count105
  %xtraiter = and i64 %wide.trip.count124, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %24 = add nsw i64 %wide.trip.count124, -1
  %min.iters.check150 = icmp ult i32 %2, 6
  %n.vec153 = and i64 %wide.trip.count105, 2147483646
  %cmp.n163 = icmp eq i64 %n.vec153, %wide.trip.count105
  %xtraiter185 = and i64 %wide.trip.count124, 1
  %lcmp.mod186.not = icmp eq i64 %xtraiter185, 0
  %25 = add nsw i64 %wide.trip.count124, -1
  br label %.lr.ph.us

26:                                               ; preds = %33
  %27 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next123
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 %indvars.iv.next123
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = tail call double @llvm.fabs.f64(double %30)
  %32 = fcmp uge double %31, 1.000000e-10
  br i1 %32, label %.lr.ph.us, label %.critedge.loopexit.loopexit, !llvm.loop !17

33:                                               ; preds = %..loopexit_crit_edge.us.us
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122126, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count124
  br i1 %exitcond125.not, label %.critedge.loopexit.loopexit, label %26, !llvm.loop !17

scalar.ph171:                                     ; preds = %scalar.ph171.prol.loopexit, %scalar.ph171
  %indvars.iv107 = phi i64 [ %indvars.iv.next108.1, %scalar.ph171 ], [ %indvars.iv107.unr, %scalar.ph171.prol.loopexit ]
  %34 = getelementptr inbounds double, ptr %48, i64 %indvars.iv107
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = fdiv double %35, %47
  store double %36, ptr %34, align 8, !tbaa !9
  %37 = getelementptr inbounds double, ptr %50, i64 %indvars.iv107
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = fdiv double %38, %47
  store double %39, ptr %37, align 8, !tbaa !9
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %40 = getelementptr inbounds double, ptr %48, i64 %indvars.iv.next108
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fdiv double %41, %47
  store double %42, ptr %40, align 8, !tbaa !9
  %43 = getelementptr inbounds double, ptr %50, i64 %indvars.iv.next108
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = fdiv double %44, %47
  store double %45, ptr %43, align 8, !tbaa !9
  %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2
  %exitcond111.not.1 = icmp eq i64 %indvars.iv.next108.1, %wide.trip.count124
  br i1 %exitcond111.not.1, label %.preheader.us, label %scalar.ph171, !llvm.loop !18

.preheader.us:                                    ; preds = %scalar.ph171.prol.loopexit, %scalar.ph171, %middle.block170
  %46 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv122126
  %scevgep131 = getelementptr i8, ptr %48, i64 %22
  br label %63

.lr.ph.us:                                        ; preds = %.lr.ph.us.lr.ph, %26
  %47 = phi double [ %19, %.lr.ph.us.lr.ph ], [ %30, %26 ]
  %48 = phi ptr [ %18, %.lr.ph.us.lr.ph ], [ %28, %26 ]
  %indvars.iv122126 = phi i64 [ 0, %.lr.ph.us.lr.ph ], [ %indvars.iv.next123, %26 ]
  %49 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv122126
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  br i1 %min.iters.check172, label %scalar.ph171.preheader, label %vector.memcheck164

scalar.ph171.preheader:                           ; preds = %middle.block170, %vector.memcheck164, %.lr.ph.us
  %indvars.iv107.ph = phi i64 [ 0, %vector.memcheck164 ], [ 0, %.lr.ph.us ], [ %n.vec175, %middle.block170 ]
  br i1 %lcmp.mod.not, label %scalar.ph171.prol.loopexit, label %scalar.ph171.prol

scalar.ph171.prol:                                ; preds = %scalar.ph171.preheader
  %51 = getelementptr inbounds double, ptr %48, i64 %indvars.iv107.ph
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = fdiv double %52, %47
  store double %53, ptr %51, align 8, !tbaa !9
  %54 = getelementptr inbounds double, ptr %50, i64 %indvars.iv107.ph
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = fdiv double %55, %47
  store double %56, ptr %54, align 8, !tbaa !9
  %indvars.iv.next108.prol = or disjoint i64 %indvars.iv107.ph, 1
  br label %scalar.ph171.prol.loopexit

scalar.ph171.prol.loopexit:                       ; preds = %scalar.ph171.prol, %scalar.ph171.preheader
  %indvars.iv107.unr = phi i64 [ %indvars.iv107.ph, %scalar.ph171.preheader ], [ %indvars.iv.next108.prol, %scalar.ph171.prol ]
  %57 = icmp eq i64 %indvars.iv107.ph, %24
  br i1 %57, label %.preheader.us, label %scalar.ph171

vector.memcheck164:                               ; preds = %.lr.ph.us
  %scevgep165 = getelementptr i8, ptr %48, i64 %23
  %scevgep166 = getelementptr i8, ptr %50, i64 %23
  %bound0167 = icmp ult ptr %48, %scevgep166
  %bound1168 = icmp ult ptr %50, %scevgep165
  %found.conflict169 = and i1 %bound0167, %bound1168
  br i1 %found.conflict169, label %scalar.ph171.preheader, label %vector.ph173

vector.ph173:                                     ; preds = %vector.memcheck164
  %broadcast.splatinsert180 = insertelement <2 x double> poison, double %47, i64 0
  %broadcast.splat181 = shufflevector <2 x double> %broadcast.splatinsert180, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body177

vector.body177:                                   ; preds = %vector.body177, %vector.ph173
  %index178 = phi i64 [ 0, %vector.ph173 ], [ %index.next183, %vector.body177 ]
  %58 = getelementptr inbounds double, ptr %48, i64 %index178
  %wide.load179 = load <2 x double>, ptr %58, align 8, !tbaa !9, !alias.scope !19, !noalias !22
  %59 = fdiv <2 x double> %wide.load179, %broadcast.splat181
  store <2 x double> %59, ptr %58, align 8, !tbaa !9, !alias.scope !19, !noalias !22
  %60 = getelementptr inbounds double, ptr %50, i64 %index178
  %wide.load182 = load <2 x double>, ptr %60, align 8, !tbaa !9, !alias.scope !22
  %61 = fdiv <2 x double> %wide.load182, %broadcast.splat181
  store <2 x double> %61, ptr %60, align 8, !tbaa !9, !alias.scope !22
  %index.next183 = add nuw i64 %index178, 2
  %62 = icmp eq i64 %index.next183, %n.vec175
  br i1 %62, label %middle.block170, label %vector.body177, !llvm.loop !24

middle.block170:                                  ; preds = %vector.body177
  br i1 %cmp.n184, label %.preheader.us, label %scalar.ph171.preheader

63:                                               ; preds = %..loopexit_crit_edge.us.us, %.preheader.us
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %..loopexit_crit_edge.us.us ], [ 0, %.preheader.us ]
  %.not.us.us = icmp eq i64 %indvars.iv117, %indvars.iv122126
  br i1 %.not.us.us, label %..loopexit_crit_edge.us.us, label %.lr.ph74.us.us

.lr.ph74.us.us:                                   ; preds = %63
  %64 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv117
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv122126
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fneg double %67
  %69 = load ptr, ptr %46, align 8, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv117
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  br i1 %min.iters.check150, label %scalar.ph149.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph74.us.us
  %scevgep = getelementptr i8, ptr %65, i64 %22
  %scevgep130 = getelementptr i8, ptr %71, i64 %22
  %scevgep132 = getelementptr i8, ptr %69, i64 %22
  %bound0 = icmp ult ptr %65, %scevgep130
  %bound1 = icmp ult ptr %71, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound0133 = icmp ult ptr %65, %scevgep131
  %bound1134 = icmp ult ptr %48, %scevgep
  %found.conflict135 = and i1 %bound0133, %bound1134
  %conflict.rdx = or i1 %found.conflict, %found.conflict135
  %bound0136 = icmp ult ptr %65, %scevgep132
  %bound1137 = icmp ult ptr %69, %scevgep
  %found.conflict138 = and i1 %bound0136, %bound1137
  %conflict.rdx139 = or i1 %conflict.rdx, %found.conflict138
  %bound0140 = icmp ult ptr %71, %scevgep131
  %bound1141 = icmp ult ptr %48, %scevgep130
  %found.conflict142 = and i1 %bound0140, %bound1141
  %conflict.rdx143 = or i1 %conflict.rdx139, %found.conflict142
  %bound0144 = icmp ult ptr %71, %scevgep132
  %bound1145 = icmp ult ptr %69, %scevgep130
  %found.conflict146 = and i1 %bound0144, %bound1145
  %conflict.rdx147 = or i1 %conflict.rdx143, %found.conflict146
  br i1 %conflict.rdx147, label %scalar.ph149.preheader, label %vector.ph151

vector.ph151:                                     ; preds = %vector.memcheck
  %broadcast.splatinsert158 = insertelement <2 x double> poison, double %68, i64 0
  %broadcast.splat159 = shufflevector <2 x double> %broadcast.splatinsert158, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body155

vector.body155:                                   ; preds = %vector.body155, %vector.ph151
  %index156 = phi i64 [ 0, %vector.ph151 ], [ %index.next162, %vector.body155 ]
  %72 = getelementptr inbounds double, ptr %48, i64 %index156
  %wide.load = load <2 x double>, ptr %72, align 8, !tbaa !9, !alias.scope !25
  %73 = getelementptr inbounds double, ptr %65, i64 %index156
  %wide.load157 = load <2 x double>, ptr %73, align 8, !tbaa !9, !alias.scope !28, !noalias !30
  %74 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat159, <2 x double> %wide.load, <2 x double> %wide.load157)
  store <2 x double> %74, ptr %73, align 8, !tbaa !9, !alias.scope !28, !noalias !30
  %75 = getelementptr inbounds double, ptr %69, i64 %index156
  %wide.load160 = load <2 x double>, ptr %75, align 8, !tbaa !9, !alias.scope !33
  %76 = getelementptr inbounds double, ptr %71, i64 %index156
  %wide.load161 = load <2 x double>, ptr %76, align 8, !tbaa !9, !alias.scope !34, !noalias !35
  %77 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat159, <2 x double> %wide.load160, <2 x double> %wide.load161)
  store <2 x double> %77, ptr %76, align 8, !tbaa !9, !alias.scope !34, !noalias !35
  %index.next162 = add nuw i64 %index156, 2
  %78 = icmp eq i64 %index.next162, %n.vec153
  br i1 %78, label %middle.block148, label %vector.body155, !llvm.loop !36

middle.block148:                                  ; preds = %vector.body155
  br i1 %cmp.n163, label %..loopexit_crit_edge.us.us, label %scalar.ph149.preheader

scalar.ph149.preheader:                           ; preds = %middle.block148, %vector.memcheck, %.lr.ph74.us.us
  %indvars.iv112.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph74.us.us ], [ %n.vec153, %middle.block148 ]
  br i1 %lcmp.mod186.not, label %scalar.ph149.prol.loopexit, label %scalar.ph149.prol

scalar.ph149.prol:                                ; preds = %scalar.ph149.preheader
  %79 = getelementptr inbounds double, ptr %48, i64 %indvars.iv112.ph
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds double, ptr %65, i64 %indvars.iv112.ph
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = tail call double @llvm.fmuladd.f64(double %68, double %80, double %82)
  store double %83, ptr %81, align 8, !tbaa !9
  %84 = getelementptr inbounds double, ptr %69, i64 %indvars.iv112.ph
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds double, ptr %71, i64 %indvars.iv112.ph
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = tail call double @llvm.fmuladd.f64(double %68, double %85, double %87)
  store double %88, ptr %86, align 8, !tbaa !9
  %indvars.iv.next113.prol = or disjoint i64 %indvars.iv112.ph, 1
  br label %scalar.ph149.prol.loopexit

scalar.ph149.prol.loopexit:                       ; preds = %scalar.ph149.prol, %scalar.ph149.preheader
  %indvars.iv112.unr = phi i64 [ %indvars.iv112.ph, %scalar.ph149.preheader ], [ %indvars.iv.next113.prol, %scalar.ph149.prol ]
  %89 = icmp eq i64 %indvars.iv112.ph, %25
  br i1 %89, label %..loopexit_crit_edge.us.us, label %scalar.ph149

scalar.ph149:                                     ; preds = %scalar.ph149.prol.loopexit, %scalar.ph149
  %indvars.iv112 = phi i64 [ %indvars.iv.next113.1, %scalar.ph149 ], [ %indvars.iv112.unr, %scalar.ph149.prol.loopexit ]
  %90 = getelementptr inbounds double, ptr %48, i64 %indvars.iv112
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds double, ptr %65, i64 %indvars.iv112
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = tail call double @llvm.fmuladd.f64(double %68, double %91, double %93)
  store double %94, ptr %92, align 8, !tbaa !9
  %95 = getelementptr inbounds double, ptr %69, i64 %indvars.iv112
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %71, i64 %indvars.iv112
  %98 = load double, ptr %97, align 8, !tbaa !9
  %99 = tail call double @llvm.fmuladd.f64(double %68, double %96, double %98)
  store double %99, ptr %97, align 8, !tbaa !9
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %100 = getelementptr inbounds double, ptr %48, i64 %indvars.iv.next113
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds double, ptr %65, i64 %indvars.iv.next113
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = tail call double @llvm.fmuladd.f64(double %68, double %101, double %103)
  store double %104, ptr %102, align 8, !tbaa !9
  %105 = getelementptr inbounds double, ptr %69, i64 %indvars.iv.next113
  %106 = load double, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds double, ptr %71, i64 %indvars.iv.next113
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = tail call double @llvm.fmuladd.f64(double %68, double %106, double %108)
  store double %109, ptr %107, align 8, !tbaa !9
  %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2
  %exitcond116.not.1 = icmp eq i64 %indvars.iv.next113.1, %wide.trip.count124
  br i1 %exitcond116.not.1, label %..loopexit_crit_edge.us.us, label %scalar.ph149, !llvm.loop !37

..loopexit_crit_edge.us.us:                       ; preds = %scalar.ph149.prol.loopexit, %scalar.ph149, %middle.block148, %63
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count124
  br i1 %exitcond121.not, label %33, label %63, !llvm.loop !38

.critedge.loopexit.loopexit:                      ; preds = %26, %33
  %.not66.us.le = icmp ult i64 %indvars.iv.next123, %17
  %110 = sext i1 %.not66.us.le to i32
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph80, %.critedge.loopexit.loopexit, %3, %.preheader68
  %.not66.lcssa = phi i32 [ 0, %.preheader68 ], [ 0, %3 ], [ -1, %.lr.ph80 ], [ %110, %.critedge.loopexit.loopexit ]
  ret i32 %.not66.lcssa
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !13}
!19 = !{!20}
!20 = distinct !{!20, !21}
!21 = distinct !{!21, !"LVerDomain"}
!22 = !{!23}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !12, !13, !14}
!25 = !{!26}
!26 = distinct !{!26, !27}
!27 = distinct !{!27, !"LVerDomain"}
!28 = !{!29}
!29 = distinct !{!29, !27}
!30 = !{!31, !26, !32}
!31 = distinct !{!31, !27}
!32 = distinct !{!32, !27}
!33 = !{!32}
!34 = !{!31}
!35 = !{!26, !32}
!36 = distinct !{!36, !12, !13, !14}
!37 = distinct !{!37, !12, !13}
!38 = distinct !{!38, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass