; LLVM IR from simbody/simbody :: SimTKmath/Integrators/src/CPodes/sundials/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 void @denseGETRS(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %48, %4
  %15 = load i32, ptr %10, align 4, !tbaa !9
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %18, label %51

18:                                               ; preds = %14
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load i32, ptr %10, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr %19, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %23, ptr %11, align 4, !tbaa !9
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = icmp ne i32 %24, %25
  br i1 %26, label %27, label %47

27:                                               ; preds = %18
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds double, ptr %28, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !11
  store double %32, ptr %13, align 8, !tbaa !11
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds double, ptr %33, i64 %35
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %8, 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 %37, ptr %41, align 8, !tbaa !11
  %42 = load double, ptr %13, align 8, !tbaa !11
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  store double %42, ptr %46, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %27, %18
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %10, align 4, !tbaa !9
  br label %14, !llvm.loop !13

51:                                               ; preds = %14
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %91, %51
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = sub nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %57, label %94

57:                                               ; preds = %52
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  store ptr %62, ptr %12, align 8, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %9, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %87, %57
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %90

69:                                               ; preds = %65
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %75, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !11
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = fneg double %74
  %86 = call double @llvm.fmuladd.f64(double %85, double %79, double %84)
  store double %86, ptr %83, align 8, !tbaa !11
  br label %87

87:                                               ; preds = %69
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !9
  br label %65, !llvm.loop !15

90:                                               ; preds = %65
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %10, align 4, !tbaa !9
  br label %52, !llvm.loop !16

94:                                               ; preds = %52
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = sub nsw i32 %95, 1
  store i32 %96, ptr %10, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %143, %94
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %100, label %146

100:                                              ; preds = %97
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  store ptr %105, ptr %12, align 8, !tbaa !5
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !11
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %111, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !11
  %116 = fdiv double %115, %110
  store double %116, ptr %114, align 8, !tbaa !11
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %139, %100
  %118 = load i32, ptr %9, align 4, !tbaa !9
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %142

121:                                              ; preds = %117
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %122, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load i32, ptr %9, 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 = fneg double %126
  %138 = call double @llvm.fmuladd.f64(double %137, double %131, double %136)
  store double %138, ptr %135, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %121
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %9, align 4, !tbaa !9
  br label %117, !llvm.loop !17

142:                                              ; preds = %117
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = add nsw i32 %144, -1
  store i32 %145, ptr %10, align 4, !tbaa !9
  br label %97, !llvm.loop !18

146:                                              ; preds = %97
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds ptr, ptr %147, i64 0
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = getelementptr inbounds double, ptr %149, i64 0
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds double, ptr %152, i64 0
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = fdiv double %154, %151
  store double %155, ptr %153, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

; 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

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 }

!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}


; 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 norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @denseGETRS(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef %3) local_unnamed_addr #0 {
  %5 = icmp sgt i32 %1, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %4
  %wide.trip.count = zext nneg i32 %1 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %6 = icmp eq i32 %1, 1
  br i1 %6, label %.preheader55.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader55.unr-lcssa:                           ; preds = %37, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader55, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader55.unr-lcssa
  %7 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.unr
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = zext i32 %8 to i64
  %.not.epil = icmp eq i64 %indvars.iv.unr, %9
  br i1 %.not.epil, label %.preheader55, label %10

10:                                               ; preds = %.lr.ph.epil
  %11 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.unr
  %12 = load double, ptr %11, align 8, !tbaa !9
  %13 = sext i32 %8 to i64
  %14 = getelementptr inbounds double, ptr %3, i64 %13
  %15 = load double, ptr %14, align 8, !tbaa !9
  store double %15, ptr %11, align 8, !tbaa !9
  store double %12, ptr %14, align 8, !tbaa !9
  br label %.preheader55

.preheader55:                                     ; preds = %.lr.ph.epil, %10, %.preheader55.unr-lcssa
  %16 = add nsw i32 %1, -1
  %.not86 = icmp eq i32 %1, 1
  br i1 %.not86, label %._crit_edge, label %.lr.ph60.preheader

.lr.ph60.preheader:                               ; preds = %.preheader55
  %wide.trip.count75 = zext i32 %16 to i64
  %wide.trip.count70 = zext nneg i32 %1 to i64
  %17 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep87 = getelementptr i8, ptr %3, i64 %17
  %18 = add nsw i64 %wide.trip.count, -1
  br label %.lr.ph58

.lr.ph:                                           ; preds = %37, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %37 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %37 ]
  %19 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = zext i32 %20 to i64
  %.not = icmp eq i64 %indvars.iv, %21
  br i1 %.not, label %.lr.ph.1, label %22

22:                                               ; preds = %.lr.ph
  %23 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = sext i32 %20 to i64
  %26 = getelementptr inbounds double, ptr %3, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !9
  store double %27, ptr %23, align 8, !tbaa !9
  store double %24, ptr %26, align 8, !tbaa !9
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %22
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %28 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = zext i32 %29 to i64
  %.not.1 = icmp eq i64 %indvars.iv.next, %30
  br i1 %.not.1, label %37, label %31

31:                                               ; preds = %.lr.ph.1
  %32 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = sext i32 %29 to i64
  %35 = getelementptr inbounds double, ptr %3, i64 %34
  %36 = load double, ptr %35, align 8, !tbaa !9
  store double %36, ptr %32, align 8, !tbaa !9
  store double %33, ptr %35, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %31, %.lr.ph.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader55.unr-lcssa, label %.lr.ph, !llvm.loop !11

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %.preheader, label %.lr.ph58, !llvm.loop !13

.preheader:                                       ; preds = %.loopexit
  br i1 %.not86, label %._crit_edge, label %.lr.ph63.preheader

.lr.ph63.preheader:                               ; preds = %.preheader
  %38 = zext i32 %16 to i64
  br label %.lr.ph63

.lr.ph58:                                         ; preds = %.loopexit, %.lr.ph60.preheader
  %indvars.iv72 = phi i64 [ 0, %.lr.ph60.preheader ], [ %indvars.iv.next73, %.loopexit ]
  %indvars.iv65 = phi i64 [ 1, %.lr.ph60.preheader ], [ %indvars.iv.next66, %.loopexit ]
  %39 = xor i64 %indvars.iv72, -1
  %40 = add nsw i64 %39, %wide.trip.count
  %41 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv72
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %43 = getelementptr inbounds double, ptr %3, i64 %indvars.iv72
  %min.iters.check = icmp ult i64 %40, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph58
  %44 = shl i64 %indvars.iv72, 3
  %45 = add i64 %44, 8
  %scevgep = getelementptr i8, ptr %3, i64 %45
  %scevgep88 = getelementptr i8, ptr %42, i64 %45
  %scevgep89 = getelementptr i8, ptr %42, i64 %17
  %bound0 = icmp ult ptr %scevgep, %scevgep89
  %bound1 = icmp ult ptr %scevgep88, %scevgep87
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %40, -4
  %ind.end = add i64 %indvars.iv65, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv65, %index
  %46 = getelementptr inbounds double, ptr %42, i64 %offset.idx
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <2 x double>, ptr %46, align 8, !tbaa !9, !alias.scope !16
  %wide.load90 = load <2 x double>, ptr %47, align 8, !tbaa !9, !alias.scope !16
  %48 = load double, ptr %43, align 8, !tbaa !9, !alias.scope !19
  %broadcast.splatinsert93 = insertelement <2 x double> poison, double %48, i64 0
  %broadcast.splat94 = shufflevector <2 x double> %broadcast.splatinsert93, <2 x double> poison, <2 x i32> zeroinitializer
  %49 = getelementptr inbounds double, ptr %3, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load91 = load <2 x double>, ptr %49, align 8, !tbaa !9, !alias.scope !21, !noalias !16
  %wide.load92 = load <2 x double>, ptr %50, align 8, !tbaa !9, !alias.scope !21, !noalias !16
  %51 = fneg <2 x double> %wide.load
  %52 = fneg <2 x double> %wide.load90
  %53 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %broadcast.splat94, <2 x double> %wide.load91)
  %54 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %broadcast.splat94, <2 x double> %wide.load92)
  store <2 x double> %53, ptr %49, align 8, !tbaa !9, !alias.scope !21, !noalias !16
  store <2 x double> %54, ptr %50, align 8, !tbaa !9, !alias.scope !21, !noalias !16
  %index.next = add nuw i64 %index, 4
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !23

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %40, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph58
  %indvars.iv67.ph = phi i64 [ %indvars.iv65, %vector.memcheck ], [ %indvars.iv65, %.lr.ph58 ], [ %ind.end, %middle.block ]
  %56 = sub i64 %wide.trip.count, %indvars.iv67.ph
  %xtraiter119 = and i64 %56, 1
  %lcmp.mod120.not = icmp eq i64 %xtraiter119, 0
  br i1 %lcmp.mod120.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %57 = getelementptr inbounds double, ptr %42, i64 %indvars.iv67.ph
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = load double, ptr %43, align 8, !tbaa !9
  %60 = getelementptr inbounds double, ptr %3, i64 %indvars.iv67.ph
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fneg double %58
  %63 = tail call double @llvm.fmuladd.f64(double %62, double %59, double %61)
  store double %63, ptr %60, align 8, !tbaa !9
  %indvars.iv.next68.prol = add nuw nsw i64 %indvars.iv67.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv67.unr = phi i64 [ %indvars.iv67.ph, %scalar.ph.preheader ], [ %indvars.iv.next68.prol, %scalar.ph.prol ]
  %64 = icmp eq i64 %indvars.iv67.ph, %18
  br i1 %64, label %.loopexit, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv67 = phi i64 [ %indvars.iv.next68.1, %scalar.ph ], [ %indvars.iv67.unr, %scalar.ph.prol.loopexit ]
  %65 = getelementptr inbounds double, ptr %42, i64 %indvars.iv67
  %66 = load double, ptr %65, align 8, !tbaa !9
  %67 = load double, ptr %43, align 8, !tbaa !9
  %68 = getelementptr inbounds double, ptr %3, i64 %indvars.iv67
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = fneg double %66
  %71 = tail call double @llvm.fmuladd.f64(double %70, double %67, double %69)
  store double %71, ptr %68, align 8, !tbaa !9
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %72 = getelementptr inbounds double, ptr %42, i64 %indvars.iv.next68
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = load double, ptr %43, align 8, !tbaa !9
  %75 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next68
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = fneg double %73
  %78 = tail call double @llvm.fmuladd.f64(double %77, double %74, double %76)
  store double %78, ptr %75, align 8, !tbaa !9
  %indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2
  %exitcond71.not.1 = icmp eq i64 %indvars.iv.next68.1, %wide.trip.count70
  br i1 %exitcond71.not.1, label %.loopexit, label %scalar.ph, !llvm.loop !26

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %.loopexit118
  %indvar = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvar.next, %.loopexit118 ]
  %indvars.iv82 = phi i64 [ %38, %.lr.ph63.preheader ], [ %indvars.iv.next83, %.loopexit118 ]
  %79 = xor i64 %indvar, -1
  %80 = add i64 %79, %38
  %81 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv82
  %82 = load ptr, ptr %81, align 8, !tbaa !14
  %83 = getelementptr inbounds double, ptr %82, i64 %indvars.iv82
  %84 = load double, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds double, ptr %3, i64 %indvars.iv82
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fdiv double %86, %84
  store double %87, ptr %85, align 8, !tbaa !9
  %min.iters.check103 = icmp ult i64 %indvars.iv82, 4
  br i1 %min.iters.check103, label %scalar.ph102.preheader, label %vector.memcheck95

vector.memcheck95:                                ; preds = %.lr.ph63
  %88 = sub i64 %wide.trip.count75, %indvar
  %89 = shl i64 %88, 3
  %scevgep96 = getelementptr i8, ptr %3, i64 %89
  %scevgep97 = getelementptr i8, ptr %82, i64 %89
  %bound098 = icmp ugt ptr %scevgep97, %3
  %bound199 = icmp ult ptr %82, %scevgep96
  %found.conflict100 = and i1 %bound098, %bound199
  br i1 %found.conflict100, label %scalar.ph102.preheader, label %vector.ph104

vector.ph104:                                     ; preds = %vector.memcheck95
  %n.vec106 = and i64 %indvars.iv82, -4
  br label %vector.body108

vector.body108:                                   ; preds = %vector.body108, %vector.ph104
  %index109 = phi i64 [ 0, %vector.ph104 ], [ %index.next116, %vector.body108 ]
  %90 = getelementptr inbounds double, ptr %82, i64 %index109
  %91 = getelementptr inbounds i8, ptr %90, i64 16
  %wide.load110 = load <2 x double>, ptr %90, align 8, !tbaa !9, !alias.scope !27
  %wide.load111 = load <2 x double>, ptr %91, align 8, !tbaa !9, !alias.scope !27
  %92 = load double, ptr %85, align 8, !tbaa !9, !alias.scope !30
  %broadcast.splatinsert114 = insertelement <2 x double> poison, double %92, i64 0
  %broadcast.splat115 = shufflevector <2 x double> %broadcast.splatinsert114, <2 x double> poison, <2 x i32> zeroinitializer
  %93 = getelementptr inbounds double, ptr %3, i64 %index109
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  %wide.load112 = load <2 x double>, ptr %93, align 8, !tbaa !9, !alias.scope !32, !noalias !27
  %wide.load113 = load <2 x double>, ptr %94, align 8, !tbaa !9, !alias.scope !32, !noalias !27
  %95 = fneg <2 x double> %wide.load110
  %96 = fneg <2 x double> %wide.load111
  %97 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %95, <2 x double> %broadcast.splat115, <2 x double> %wide.load112)
  %98 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %96, <2 x double> %broadcast.splat115, <2 x double> %wide.load113)
  store <2 x double> %97, ptr %93, align 8, !tbaa !9, !alias.scope !32, !noalias !27
  store <2 x double> %98, ptr %94, align 8, !tbaa !9, !alias.scope !32, !noalias !27
  %index.next116 = add nuw i64 %index109, 4
  %99 = icmp eq i64 %index.next116, %n.vec106
  br i1 %99, label %middle.block101, label %vector.body108, !llvm.loop !34

middle.block101:                                  ; preds = %vector.body108
  %cmp.n117 = icmp eq i64 %indvars.iv82, %n.vec106
  br i1 %cmp.n117, label %.loopexit118, label %scalar.ph102.preheader

scalar.ph102.preheader:                           ; preds = %middle.block101, %vector.memcheck95, %.lr.ph63
  %indvars.iv77.ph = phi i64 [ 0, %vector.memcheck95 ], [ 0, %.lr.ph63 ], [ %n.vec106, %middle.block101 ]
  %xtraiter121 = and i64 %indvars.iv82, 1
  %lcmp.mod122.not = icmp eq i64 %xtraiter121, 0
  br i1 %lcmp.mod122.not, label %scalar.ph102.prol.loopexit, label %scalar.ph102.prol

scalar.ph102.prol:                                ; preds = %scalar.ph102.preheader
  %100 = getelementptr inbounds double, ptr %82, i64 %indvars.iv77.ph
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = load double, ptr %85, align 8, !tbaa !9
  %103 = getelementptr inbounds double, ptr %3, i64 %indvars.iv77.ph
  %104 = load double, ptr %103, align 8, !tbaa !9
  %105 = fneg double %101
  %106 = tail call double @llvm.fmuladd.f64(double %105, double %102, double %104)
  store double %106, ptr %103, align 8, !tbaa !9
  %indvars.iv.next78.prol = or disjoint i64 %indvars.iv77.ph, 1
  br label %scalar.ph102.prol.loopexit

scalar.ph102.prol.loopexit:                       ; preds = %scalar.ph102.prol, %scalar.ph102.preheader
  %indvars.iv77.unr = phi i64 [ %indvars.iv77.ph, %scalar.ph102.preheader ], [ %indvars.iv.next78.prol, %scalar.ph102.prol ]
  %107 = icmp eq i64 %80, %indvars.iv77.ph
  br i1 %107, label %.loopexit118, label %scalar.ph102

scalar.ph102:                                     ; preds = %scalar.ph102.prol.loopexit, %scalar.ph102
  %indvars.iv77 = phi i64 [ %indvars.iv.next78.1, %scalar.ph102 ], [ %indvars.iv77.unr, %scalar.ph102.prol.loopexit ]
  %108 = getelementptr inbounds double, ptr %82, i64 %indvars.iv77
  %109 = load double, ptr %108, align 8, !tbaa !9
  %110 = load double, ptr %85, align 8, !tbaa !9
  %111 = getelementptr inbounds double, ptr %3, i64 %indvars.iv77
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = fneg double %109
  %114 = tail call double @llvm.fmuladd.f64(double %113, double %110, double %112)
  store double %114, ptr %111, align 8, !tbaa !9
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %115 = getelementptr inbounds double, ptr %82, i64 %indvars.iv.next78
  %116 = load double, ptr %115, align 8, !tbaa !9
  %117 = load double, ptr %85, align 8, !tbaa !9
  %118 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next78
  %119 = load double, ptr %118, align 8, !tbaa !9
  %120 = fneg double %116
  %121 = tail call double @llvm.fmuladd.f64(double %120, double %117, double %119)
  store double %121, ptr %118, align 8, !tbaa !9
  %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
  %exitcond81.not.1 = icmp eq i64 %indvars.iv.next78.1, %indvars.iv82
  br i1 %exitcond81.not.1, label %.loopexit118, label %scalar.ph102, !llvm.loop !35

.loopexit118:                                     ; preds = %scalar.ph102.prol.loopexit, %scalar.ph102, %middle.block101
  %indvars.iv.next83 = add nsw i64 %indvars.iv82, -1
  %122 = icmp sgt i64 %indvars.iv82, 1
  %indvar.next = add i64 %indvar, 1
  br i1 %122, label %.lr.ph63, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %.loopexit118, %4, %.preheader55, %.preheader
  %123 = load ptr, ptr %0, align 8, !tbaa !14
  %124 = load double, ptr %123, align 8, !tbaa !9
  %125 = load double, ptr %3, align 8, !tbaa !9
  %126 = fdiv double %125, %124
  store double %126, ptr %3, align 8, !tbaa !9
  ret void
}

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

; 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 = { nofree norecurse nosync nounwind memory(read, argmem: 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !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, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17}
!17 = distinct !{!17, !18}
!18 = distinct !{!18, !"LVerDomain"}
!19 = !{!20}
!20 = distinct !{!20, !18}
!21 = !{!22}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !12, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !12, !24}
!27 = !{!28}
!28 = distinct !{!28, !29}
!29 = distinct !{!29, !"LVerDomain"}
!30 = !{!31}
!31 = distinct !{!31, !29}
!32 = !{!33}
!33 = distinct !{!33, !29}
!34 = distinct !{!34, !12, !24, !25}
!35 = distinct !{!35, !12, !24}
!36 = distinct !{!36, !12}


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