; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/sundials (sundials_dense)

; 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: nounwind uwtable
define dso_local i32 @SUNDlsMat_denseGEQRF(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %225, %5
  %22 = load i64, ptr %19, align 8, !tbaa !9
  %23 = load i64, ptr %8, align 8, !tbaa !9
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %25, label %228

25:                                               ; preds = %21
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load i64, ptr %19, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %26, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %29, ptr %16, align 8, !tbaa !5
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  %31 = load i64, ptr %19, align 8, !tbaa !9
  %32 = getelementptr inbounds double, ptr %30, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !11
  store double %33, ptr %11, align 8, !tbaa !11
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds double, ptr %34, i64 0
  store double 1.000000e+00, ptr %35, align 8, !tbaa !11
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %62, %25
  %37 = load i64, ptr %18, align 8, !tbaa !9
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = load i64, ptr %19, align 8, !tbaa !9
  %40 = sub nsw i64 %38, %39
  %41 = icmp slt i64 %37, %40
  br i1 %41, label %42, label %65

42:                                               ; preds = %36
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  %44 = load i64, ptr %18, align 8, !tbaa !9
  %45 = load i64, ptr %19, align 8, !tbaa !9
  %46 = add nsw i64 %44, %45
  %47 = getelementptr inbounds double, ptr %43, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load i64, ptr %18, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %49, i64 %50
  store double %48, ptr %51, align 8, !tbaa !11
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = load i64, ptr %18, align 8, !tbaa !9
  %54 = getelementptr inbounds double, ptr %52, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i64, ptr %18, align 8, !tbaa !9
  %58 = getelementptr inbounds double, ptr %56, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !11
  %60 = load double, ptr %12, align 8, !tbaa !11
  %61 = call double @llvm.fmuladd.f64(double %55, double %59, double %60)
  store double %61, ptr %12, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %42
  %63 = load i64, ptr %18, align 8, !tbaa !9
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %18, align 8, !tbaa !9
  br label %36, !llvm.loop !13

65:                                               ; preds = %36
  %66 = load double, ptr %12, align 8, !tbaa !11
  %67 = fcmp une double %66, 0.000000e+00
  br i1 %67, label %68, label %127

68:                                               ; preds = %65
  %69 = load double, ptr %11, align 8, !tbaa !11
  %70 = load double, ptr %11, align 8, !tbaa !11
  %71 = load double, ptr %12, align 8, !tbaa !11
  %72 = call double @llvm.fmuladd.f64(double %69, double %70, double %71)
  %73 = fcmp ole double %72, 0.000000e+00
  br i1 %73, label %74, label %75

74:                                               ; preds = %68
  br label %81

75:                                               ; preds = %68
  %76 = load double, ptr %11, align 8, !tbaa !11
  %77 = load double, ptr %11, align 8, !tbaa !11
  %78 = load double, ptr %12, align 8, !tbaa !11
  %79 = call double @llvm.fmuladd.f64(double %76, double %77, double %78)
  %80 = call double @sqrt(double noundef %79) #4
  br label %81

81:                                               ; preds = %75, %74
  %82 = phi double [ 0.000000e+00, %74 ], [ %80, %75 ]
  store double %82, ptr %13, align 8, !tbaa !11
  %83 = load double, ptr %11, align 8, !tbaa !11
  %84 = fcmp ole double %83, 0.000000e+00
  br i1 %84, label %85, label %89

85:                                               ; preds = %81
  %86 = load double, ptr %11, align 8, !tbaa !11
  %87 = load double, ptr %13, align 8, !tbaa !11
  %88 = fsub double %86, %87
  br label %96

89:                                               ; preds = %81
  %90 = load double, ptr %12, align 8, !tbaa !11
  %91 = fneg double %90
  %92 = load double, ptr %11, align 8, !tbaa !11
  %93 = load double, ptr %13, align 8, !tbaa !11
  %94 = fadd double %92, %93
  %95 = fdiv double %91, %94
  br label %96

96:                                               ; preds = %89, %85
  %97 = phi double [ %88, %85 ], [ %95, %89 ]
  store double %97, ptr %14, align 8, !tbaa !11
  %98 = load double, ptr %14, align 8, !tbaa !11
  %99 = load double, ptr %14, align 8, !tbaa !11
  %100 = fmul double %98, %99
  store double %100, ptr %15, align 8, !tbaa !11
  %101 = load double, ptr %15, align 8, !tbaa !11
  %102 = fmul double 2.000000e+00, %101
  %103 = load double, ptr %12, align 8, !tbaa !11
  %104 = load double, ptr %15, align 8, !tbaa !11
  %105 = fadd double %103, %104
  %106 = fdiv double %102, %105
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = load i64, ptr %19, align 8, !tbaa !9
  %109 = getelementptr inbounds double, ptr %107, i64 %108
  store double %106, ptr %109, align 8, !tbaa !11
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %110

110:                                              ; preds = %123, %96
  %111 = load i64, ptr %18, align 8, !tbaa !9
  %112 = load i64, ptr %7, align 8, !tbaa !9
  %113 = load i64, ptr %19, align 8, !tbaa !9
  %114 = sub nsw i64 %112, %113
  %115 = icmp slt i64 %111, %114
  br i1 %115, label %116, label %126

116:                                              ; preds = %110
  %117 = load double, ptr %14, align 8, !tbaa !11
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = load i64, ptr %18, align 8, !tbaa !9
  %120 = getelementptr inbounds double, ptr %118, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !11
  %122 = fdiv double %121, %117
  store double %122, ptr %120, align 8, !tbaa !11
  br label %123

123:                                              ; preds = %116
  %124 = load i64, ptr %18, align 8, !tbaa !9
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %18, align 8, !tbaa !9
  br label %110, !llvm.loop !15

126:                                              ; preds = %110
  br label %131

127:                                              ; preds = %65
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = load i64, ptr %19, align 8, !tbaa !9
  %130 = getelementptr inbounds double, ptr %128, i64 %129
  store double 0.000000e+00, ptr %130, align 8, !tbaa !11
  br label %131

131:                                              ; preds = %127, %126
  %132 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %132, ptr %20, align 8, !tbaa !9
  br label %133

133:                                              ; preds = %195, %131
  %134 = load i64, ptr %20, align 8, !tbaa !9
  %135 = load i64, ptr %8, align 8, !tbaa !9
  %136 = icmp slt i64 %134, %135
  br i1 %136, label %137, label %198

137:                                              ; preds = %133
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = load i64, ptr %20, align 8, !tbaa !9
  %140 = getelementptr inbounds ptr, ptr %138, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  store ptr %141, ptr %17, align 8, !tbaa !5
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %161, %137
  %143 = load i64, ptr %18, align 8, !tbaa !9
  %144 = load i64, ptr %7, align 8, !tbaa !9
  %145 = load i64, ptr %19, align 8, !tbaa !9
  %146 = sub nsw i64 %144, %145
  %147 = icmp slt i64 %143, %146
  br i1 %147, label %148, label %164

148:                                              ; preds = %142
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = load i64, ptr %18, align 8, !tbaa !9
  %151 = load i64, ptr %19, align 8, !tbaa !9
  %152 = add nsw i64 %150, %151
  %153 = getelementptr inbounds double, ptr %149, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = load i64, ptr %18, align 8, !tbaa !9
  %157 = getelementptr inbounds double, ptr %155, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !11
  %159 = load double, ptr %12, align 8, !tbaa !11
  %160 = call double @llvm.fmuladd.f64(double %154, double %158, double %159)
  store double %160, ptr %12, align 8, !tbaa !11
  br label %161

161:                                              ; preds = %148
  %162 = load i64, ptr %18, align 8, !tbaa !9
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %18, align 8, !tbaa !9
  br label %142, !llvm.loop !16

164:                                              ; preds = %142
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = load i64, ptr %19, align 8, !tbaa !9
  %167 = getelementptr inbounds double, ptr %165, i64 %166
  %168 = load double, ptr %167, align 8, !tbaa !11
  %169 = load double, ptr %12, align 8, !tbaa !11
  %170 = fmul double %169, %168
  store double %170, ptr %12, align 8, !tbaa !11
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %171

171:                                              ; preds = %191, %164
  %172 = load i64, ptr %18, align 8, !tbaa !9
  %173 = load i64, ptr %7, align 8, !tbaa !9
  %174 = load i64, ptr %19, align 8, !tbaa !9
  %175 = sub nsw i64 %173, %174
  %176 = icmp slt i64 %172, %175
  br i1 %176, label %177, label %194

177:                                              ; preds = %171
  %178 = load double, ptr %12, align 8, !tbaa !11
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = load i64, ptr %18, align 8, !tbaa !9
  %181 = getelementptr inbounds double, ptr %179, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !11
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = load i64, ptr %18, align 8, !tbaa !9
  %185 = load i64, ptr %19, align 8, !tbaa !9
  %186 = add nsw i64 %184, %185
  %187 = getelementptr inbounds double, ptr %183, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = fneg double %178
  %190 = call double @llvm.fmuladd.f64(double %189, double %182, double %188)
  store double %190, ptr %187, align 8, !tbaa !11
  br label %191

191:                                              ; preds = %177
  %192 = load i64, ptr %18, align 8, !tbaa !9
  %193 = add nsw i64 %192, 1
  store i64 %193, ptr %18, align 8, !tbaa !9
  br label %171, !llvm.loop !17

194:                                              ; preds = %171
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %20, align 8, !tbaa !9
  %197 = add nsw i64 %196, 1
  store i64 %197, ptr %20, align 8, !tbaa !9
  br label %133, !llvm.loop !18

198:                                              ; preds = %133
  %199 = load i64, ptr %19, align 8, !tbaa !9
  %200 = load i64, ptr %7, align 8, !tbaa !9
  %201 = sub nsw i64 %200, 1
  %202 = icmp slt i64 %199, %201
  br i1 %202, label %203, label %224

203:                                              ; preds = %198
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %220, %203
  %205 = load i64, ptr %18, align 8, !tbaa !9
  %206 = load i64, ptr %7, align 8, !tbaa !9
  %207 = load i64, ptr %19, align 8, !tbaa !9
  %208 = sub nsw i64 %206, %207
  %209 = icmp slt i64 %205, %208
  br i1 %209, label %210, label %223

210:                                              ; preds = %204
  %211 = load ptr, ptr %10, align 8, !tbaa !5
  %212 = load i64, ptr %18, align 8, !tbaa !9
  %213 = getelementptr inbounds double, ptr %211, i64 %212
  %214 = load double, ptr %213, align 8, !tbaa !11
  %215 = load ptr, ptr %16, align 8, !tbaa !5
  %216 = load i64, ptr %18, align 8, !tbaa !9
  %217 = load i64, ptr %19, align 8, !tbaa !9
  %218 = add nsw i64 %216, %217
  %219 = getelementptr inbounds double, ptr %215, i64 %218
  store double %214, ptr %219, align 8, !tbaa !11
  br label %220

220:                                              ; preds = %210
  %221 = load i64, ptr %18, align 8, !tbaa !9
  %222 = add nsw i64 %221, 1
  store i64 %222, ptr %18, align 8, !tbaa !9
  br label %204, !llvm.loop !19

223:                                              ; preds = %204
  br label %224

224:                                              ; preds = %223, %198
  br label %225

225:                                              ; preds = %224
  %226 = load i64, ptr %19, align 8, !tbaa !9
  %227 = add nsw i64 %226, 1
  store i64 %227, ptr %19, align 8, !tbaa !9
  br label %21, !llvm.loop !20

228:                                              ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret i32 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !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}
!20 = distinct !{!20, !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: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local noundef i32 @SUNDlsMat_denseGEQRF(ptr nocapture noundef readonly %0, i64 noundef %1, i64 noundef %2, ptr nocapture noundef %3, ptr nocapture noundef %4) local_unnamed_addr #0 {
  %6 = icmp sgt i64 %2, 0
  br i1 %6, label %.lr.ph130, label %._crit_edge131

.lr.ph130:                                        ; preds = %5
  %7 = ptrtoint ptr %4 to i64
  %8 = add i64 %1, -1
  %9 = shl i64 %1, 3
  br label %10

10:                                               ; preds = %.lr.ph130, %.loopexit
  %.090128 = phi i64 [ 0, %.lr.ph130 ], [ %120, %.loopexit ]
  %11 = sub i64 %1, %.090128
  %12 = sub i64 %8, %.090128
  %13 = sub i64 %8, %.090128
  %14 = sub i64 %1, %.090128
  %15 = sub i64 %1, %.090128
  %16 = shl i64 %15, 3
  %scevgep141 = getelementptr i8, ptr %4, i64 %16
  %17 = sub i64 %8, %.090128
  %18 = shl i64 %.090128, 3
  %19 = sub i64 %18, %7
  %20 = getelementptr inbounds ptr, ptr %0, i64 %.090128
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = ptrtoint ptr %21 to i64
  %23 = getelementptr inbounds double, ptr %21, i64 %.090128
  %24 = load double, ptr %23, align 8, !tbaa !9
  store double 1.000000e+00, ptr %4, align 8, !tbaa !9
  %25 = sub nsw i64 %1, %.090128
  %26 = icmp slt i64 %25, 2
  br i1 %26, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.091101 = phi i64 [ %30, %.lr.ph ], [ 1, %10 ]
  %.092100 = phi double [ %29, %.lr.ph ], [ 0.000000e+00, %10 ]
  %gep = getelementptr inbounds double, ptr %23, i64 %.091101
  %27 = load double, ptr %gep, align 8, !tbaa !9
  %28 = getelementptr inbounds double, ptr %4, i64 %.091101
  store double %27, ptr %28, align 8, !tbaa !9
  %29 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %.092100)
  %30 = add nuw nsw i64 %.091101, 1
  %31 = icmp slt i64 %30, %25
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %32 = fcmp une double %29, 0.000000e+00
  br i1 %32, label %33, label %._crit_edge.thread

33:                                               ; preds = %._crit_edge
  %34 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %29)
  %35 = fcmp ugt double %34, 0.000000e+00
  br i1 %35, label %36, label %38

36:                                               ; preds = %33
  %37 = tail call double @sqrt(double noundef %34) #4
  br label %38

38:                                               ; preds = %33, %36
  %39 = phi double [ %37, %36 ], [ 0.000000e+00, %33 ]
  %40 = fcmp ugt double %24, 0.000000e+00
  %41 = fsub double %24, %39
  %42 = fneg double %29
  %43 = fadd double %24, %39
  %44 = fdiv double %42, %43
  %45 = select i1 %40, double %44, double %41
  %46 = fmul double %45, %45
  %47 = fmul double %46, 2.000000e+00
  %48 = fadd double %29, %46
  %49 = fdiv double %47, %48
  %50 = getelementptr inbounds double, ptr %3, i64 %.090128
  store double %49, ptr %50, align 8, !tbaa !9
  br i1 %26, label %.lr.ph122, label %.lr.ph105.preheader

.lr.ph105.preheader:                              ; preds = %38
  %min.iters.check159 = icmp ult i64 %13, 2
  br i1 %min.iters.check159, label %.lr.ph105.preheader174, label %vector.ph160

vector.ph160:                                     ; preds = %.lr.ph105.preheader
  %n.vec162 = and i64 %13, -2
  %ind.end163 = or i64 %13, 1
  %broadcast.splatinsert169 = insertelement <2 x double> poison, double %45, i64 0
  %broadcast.splat170 = shufflevector <2 x double> %broadcast.splatinsert169, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body165

vector.body165:                                   ; preds = %vector.body165, %vector.ph160
  %index166 = phi i64 [ 0, %vector.ph160 ], [ %index.next171, %vector.body165 ]
  %offset.idx167 = or disjoint i64 %index166, 1
  %51 = getelementptr inbounds double, ptr %4, i64 %offset.idx167
  %wide.load168 = load <2 x double>, ptr %51, align 8, !tbaa !9
  %52 = fdiv <2 x double> %wide.load168, %broadcast.splat170
  store <2 x double> %52, ptr %51, align 8, !tbaa !9
  %index.next171 = add nuw i64 %index166, 2
  %53 = icmp eq i64 %index.next171, %n.vec162
  br i1 %53, label %middle.block157, label %vector.body165, !llvm.loop !13

middle.block157:                                  ; preds = %vector.body165
  %cmp.n172 = icmp eq i64 %13, %n.vec162
  br i1 %cmp.n172, label %.lr.ph122, label %.lr.ph105.preheader174

.lr.ph105.preheader174:                           ; preds = %middle.block157, %.lr.ph105.preheader
  %.1103.ph = phi i64 [ 1, %.lr.ph105.preheader ], [ %ind.end163, %middle.block157 ]
  br label %.lr.ph105

.lr.ph105:                                        ; preds = %.lr.ph105.preheader174, %.lr.ph105
  %.1103 = phi i64 [ %57, %.lr.ph105 ], [ %.1103.ph, %.lr.ph105.preheader174 ]
  %54 = getelementptr inbounds double, ptr %4, i64 %.1103
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = fdiv double %55, %45
  store double %56, ptr %54, align 8, !tbaa !9
  %57 = add nuw nsw i64 %.1103, 1
  %58 = icmp slt i64 %57, %25
  br i1 %58, label %.lr.ph105, label %.lr.ph122, !llvm.loop !16

._crit_edge.thread:                               ; preds = %10, %._crit_edge
  %59 = getelementptr inbounds double, ptr %3, i64 %.090128
  store double 0.000000e+00, ptr %59, align 8, !tbaa !9
  br label %.lr.ph122

.lr.ph122:                                        ; preds = %.lr.ph105, %middle.block157, %._crit_edge.thread, %38
  %60 = icmp sgt i64 %25, 0
  %61 = getelementptr inbounds double, ptr %3, i64 %.090128
  %xtraiter = and i64 %11, 3
  %62 = icmp ult i64 %12, 3
  %unroll_iter = and i64 %11, -4
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %min.iters.check144 = icmp ult i64 %14, 4
  %n.vec147 = and i64 %14, -4
  %cmp.n156 = icmp eq i64 %14, %n.vec147
  br label %63

63:                                               ; preds = %.lr.ph122, %._crit_edge119
  %.0120 = phi i64 [ %.090128, %.lr.ph122 ], [ %107, %._crit_edge119 ]
  %64 = getelementptr inbounds ptr, ptr %0, i64 %.0120
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %invariant.gep106 = getelementptr double, ptr %65, i64 %.090128
  br i1 %60, label %.lr.ph111.preheader, label %._crit_edge119

.lr.ph111.preheader:                              ; preds = %63
  br i1 %62, label %._crit_edge112.unr-lcssa, label %.lr.ph111

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %.lr.ph111
  %.2109 = phi i64 [ %85, %.lr.ph111 ], [ 0, %.lr.ph111.preheader ]
  %.193108 = phi double [ %84, %.lr.ph111 ], [ 0.000000e+00, %.lr.ph111.preheader ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph111 ], [ 0, %.lr.ph111.preheader ]
  %gep107 = getelementptr inbounds double, ptr %invariant.gep106, i64 %.2109
  %66 = load double, ptr %gep107, align 8, !tbaa !9
  %67 = getelementptr inbounds double, ptr %4, i64 %.2109
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = tail call double @llvm.fmuladd.f64(double %66, double %68, double %.193108)
  %70 = or disjoint i64 %.2109, 1
  %gep107.1 = getelementptr inbounds double, ptr %invariant.gep106, i64 %70
  %71 = load double, ptr %gep107.1, align 8, !tbaa !9
  %72 = getelementptr inbounds double, ptr %4, i64 %70
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = tail call double @llvm.fmuladd.f64(double %71, double %73, double %69)
  %75 = or disjoint i64 %.2109, 2
  %gep107.2 = getelementptr inbounds double, ptr %invariant.gep106, i64 %75
  %76 = load double, ptr %gep107.2, align 8, !tbaa !9
  %77 = getelementptr inbounds double, ptr %4, i64 %75
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = tail call double @llvm.fmuladd.f64(double %76, double %78, double %74)
  %80 = or disjoint i64 %.2109, 3
  %gep107.3 = getelementptr inbounds double, ptr %invariant.gep106, i64 %80
  %81 = load double, ptr %gep107.3, align 8, !tbaa !9
  %82 = getelementptr inbounds double, ptr %4, i64 %80
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = tail call double @llvm.fmuladd.f64(double %81, double %83, double %79)
  %85 = add nuw nsw i64 %.2109, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3.not, label %._crit_edge112.unr-lcssa, label %.lr.ph111, !llvm.loop !17

._crit_edge112.unr-lcssa:                         ; preds = %.lr.ph111, %.lr.ph111.preheader
  %.lcssa175.ph = phi double [ poison, %.lr.ph111.preheader ], [ %84, %.lr.ph111 ]
  %.2109.unr = phi i64 [ 0, %.lr.ph111.preheader ], [ %85, %.lr.ph111 ]
  %.193108.unr = phi double [ 0.000000e+00, %.lr.ph111.preheader ], [ %84, %.lr.ph111 ]
  br i1 %lcmp.mod.not, label %._crit_edge112, label %.lr.ph111.epil

.lr.ph111.epil:                                   ; preds = %._crit_edge112.unr-lcssa, %.lr.ph111.epil
  %.2109.epil = phi i64 [ %90, %.lr.ph111.epil ], [ %.2109.unr, %._crit_edge112.unr-lcssa ]
  %.193108.epil = phi double [ %89, %.lr.ph111.epil ], [ %.193108.unr, %._crit_edge112.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph111.epil ], [ 0, %._crit_edge112.unr-lcssa ]
  %gep107.epil = getelementptr inbounds double, ptr %invariant.gep106, i64 %.2109.epil
  %86 = load double, ptr %gep107.epil, align 8, !tbaa !9
  %87 = getelementptr inbounds double, ptr %4, i64 %.2109.epil
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = tail call double @llvm.fmuladd.f64(double %86, double %88, double %.193108.epil)
  %90 = add nuw nsw i64 %.2109.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge112, label %.lr.ph111.epil, !llvm.loop !18

._crit_edge112:                                   ; preds = %.lr.ph111.epil, %._crit_edge112.unr-lcssa
  %.lcssa175 = phi double [ %.lcssa175.ph, %._crit_edge112.unr-lcssa ], [ %89, %.lr.ph111.epil ]
  br i1 %60, label %.lr.ph118, label %._crit_edge119

.lr.ph118:                                        ; preds = %._crit_edge112
  %91 = load double, ptr %61, align 8, !tbaa !9
  %92 = fneg double %.lcssa175
  %93 = fmul double %91, %92
  br i1 %min.iters.check144, label %scalar.ph143.preheader, label %vector.memcheck140

vector.memcheck140:                               ; preds = %.lr.ph118
  %scevgep = getelementptr i8, ptr %65, i64 %9
  %bound0 = icmp ult ptr %invariant.gep106, %scevgep141
  %bound1 = icmp ugt ptr %scevgep, %4
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph143.preheader, label %vector.ph145

vector.ph145:                                     ; preds = %vector.memcheck140
  %broadcast.splatinsert = insertelement <2 x double> poison, double %93, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body149

vector.body149:                                   ; preds = %vector.body149, %vector.ph145
  %index150 = phi i64 [ 0, %vector.ph145 ], [ %index.next155, %vector.body149 ]
  %94 = getelementptr inbounds double, ptr %4, i64 %index150
  %95 = getelementptr inbounds i8, ptr %94, i64 16
  %wide.load151 = load <2 x double>, ptr %94, align 8, !tbaa !9, !alias.scope !20
  %wide.load152 = load <2 x double>, ptr %95, align 8, !tbaa !9, !alias.scope !20
  %96 = getelementptr inbounds double, ptr %invariant.gep106, i64 %index150
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  %wide.load153 = load <2 x double>, ptr %96, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  %wide.load154 = load <2 x double>, ptr %97, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  %98 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load151, <2 x double> %wide.load153)
  %99 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load152, <2 x double> %wide.load154)
  store <2 x double> %98, ptr %96, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  store <2 x double> %99, ptr %97, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  %index.next155 = add nuw i64 %index150, 4
  %100 = icmp eq i64 %index.next155, %n.vec147
  br i1 %100, label %middle.block142, label %vector.body149, !llvm.loop !25

middle.block142:                                  ; preds = %vector.body149
  br i1 %cmp.n156, label %._crit_edge119, label %scalar.ph143.preheader

scalar.ph143.preheader:                           ; preds = %middle.block142, %vector.memcheck140, %.lr.ph118
  %.3116.ph = phi i64 [ 0, %vector.memcheck140 ], [ 0, %.lr.ph118 ], [ %n.vec147, %middle.block142 ]
  br label %scalar.ph143

scalar.ph143:                                     ; preds = %scalar.ph143.preheader, %scalar.ph143
  %.3116 = phi i64 [ %105, %scalar.ph143 ], [ %.3116.ph, %scalar.ph143.preheader ]
  %101 = getelementptr inbounds double, ptr %4, i64 %.3116
  %102 = load double, ptr %101, align 8, !tbaa !9
  %gep115 = getelementptr inbounds double, ptr %invariant.gep106, i64 %.3116
  %103 = load double, ptr %gep115, align 8, !tbaa !9
  %104 = tail call double @llvm.fmuladd.f64(double %93, double %102, double %103)
  store double %104, ptr %gep115, align 8, !tbaa !9
  %105 = add nuw nsw i64 %.3116, 1
  %106 = icmp slt i64 %105, %25
  br i1 %106, label %scalar.ph143, label %._crit_edge119, !llvm.loop !26

._crit_edge119:                                   ; preds = %scalar.ph143, %middle.block142, %63, %._crit_edge112
  %107 = add nuw nsw i64 %.0120, 1
  %108 = icmp slt i64 %107, %2
  br i1 %108, label %63, label %._crit_edge123, !llvm.loop !27

._crit_edge123:                                   ; preds = %._crit_edge119
  %109 = icmp sge i64 %.090128, %8
  %brmerge = or i1 %109, %26
  br i1 %brmerge, label %.loopexit, label %.lr.ph127.preheader

.lr.ph127.preheader:                              ; preds = %._crit_edge123
  %min.iters.check = icmp ult i64 %17, 4
  %110 = add i64 %19, %22
  %diff.check = icmp ult i64 %110, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph127.preheader173, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph127.preheader
  %n.vec = and i64 %17, -4
  %ind.end = or disjoint i64 %n.vec, 1
  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, 1
  %111 = getelementptr inbounds double, ptr %4, i64 %offset.idx
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  %wide.load = load <2 x double>, ptr %111, align 8, !tbaa !9
  %wide.load139 = load <2 x double>, ptr %112, align 8, !tbaa !9
  %113 = getelementptr inbounds double, ptr %23, i64 %offset.idx
  %114 = getelementptr inbounds i8, ptr %113, i64 16
  store <2 x double> %wide.load, ptr %113, align 8, !tbaa !9
  store <2 x double> %wide.load139, ptr %114, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %115 = icmp eq i64 %index.next, %n.vec
  br i1 %115, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %17, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph127.preheader173

.lr.ph127.preheader173:                           ; preds = %middle.block, %.lr.ph127.preheader
  %.4126.ph = phi i64 [ 1, %.lr.ph127.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph127

.lr.ph127:                                        ; preds = %.lr.ph127.preheader173, %.lr.ph127
  %.4126 = phi i64 [ %118, %.lr.ph127 ], [ %.4126.ph, %.lr.ph127.preheader173 ]
  %116 = getelementptr inbounds double, ptr %4, i64 %.4126
  %117 = load double, ptr %116, align 8, !tbaa !9
  %gep125 = getelementptr inbounds double, ptr %23, i64 %.4126
  store double %117, ptr %gep125, align 8, !tbaa !9
  %118 = add nuw nsw i64 %.4126, 1
  %119 = icmp slt i64 %118, %25
  br i1 %119, label %.lr.ph127, label %.loopexit, !llvm.loop !29

.loopexit:                                        ; preds = %.lr.ph127, %middle.block, %._crit_edge123
  %120 = add nuw nsw i64 %.090128, 1
  %exitcond.not = icmp eq i64 %120, %2
  br i1 %exitcond.not, label %._crit_edge131, label %10, !llvm.loop !30

._crit_edge131:                                   ; preds = %.loopexit, %5
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #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 = { nofree nounwind memory(readwrite, inaccessiblemem: write) 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !12, !14, !15}
!26 = distinct !{!26, !12, !14}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12, !14, !15}
!29 = distinct !{!29, !12, !14}
!30 = distinct !{!30, !12}


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