; LLVM IR from avrtt/finite-element-method :: main.ll (Z3losv)

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

@N = external dso_local global i32, align 4
@i = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@flag = external dso_local global i32, align 4
@x = external dso_local global ptr, align 8
@f = external dso_local global ptr, align 8
@r = external dso_local global ptr, align 8
@p = external dso_local global ptr, align 8
@z = external dso_local global ptr, align 8
@q = external dso_local global ptr, align 8
@alpha = external dso_local global double, align 8
@beta = external dso_local global double, align 8
@breakValue = external dso_local global double, align 8
@numIter = external global i32, align 4
@eps = external global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3losv() #0 {
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %1

1:                                                ; preds = %19, %0
  %2 = load i32, ptr @i, align 4, !tbaa !5
  %3 = load i32, ptr @N, align 4, !tbaa !5
  %4 = icmp slt i32 %2, %3
  br i1 %4, label %5, label %22

5:                                                ; preds = %1
  %6 = load ptr, ptr @x, align 8, !tbaa !9
  %7 = load i32, ptr @i, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds double, ptr %6, i64 %8
  store double 0.000000e+00, ptr %9, align 8, !tbaa !11
  %10 = load ptr, ptr @f, align 8, !tbaa !9
  %11 = load i32, ptr @i, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds double, ptr %10, i64 %12
  %14 = load double, ptr %13, align 8, !tbaa !11
  %15 = load ptr, ptr @r, align 8, !tbaa !9
  %16 = load i32, ptr @i, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds double, ptr %15, i64 %17
  store double %14, ptr %18, align 8, !tbaa !11
  br label %19

19:                                               ; preds = %5
  %20 = load i32, ptr @i, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @i, align 4, !tbaa !5
  br label %1, !llvm.loop !13

22:                                               ; preds = %1
  %23 = load ptr, ptr @r, align 8, !tbaa !9
  %24 = load ptr, ptr @r, align 8, !tbaa !9
  call void @_Z12forwardGaussPdS_(ptr noundef %23, ptr noundef %24)
  %25 = load ptr, ptr @r, align 8, !tbaa !9
  %26 = load ptr, ptr @z, align 8, !tbaa !9
  call void @_Z13backwardGaussPdS_(ptr noundef %25, ptr noundef %26)
  %27 = load ptr, ptr @z, align 8, !tbaa !9
  %28 = load ptr, ptr @p, align 8, !tbaa !9
  call void @_Z11multVectByAPdS_(ptr noundef %27, ptr noundef %28)
  %29 = load ptr, ptr @p, align 8, !tbaa !9
  %30 = load ptr, ptr @p, align 8, !tbaa !9
  call void @_Z12forwardGaussPdS_(ptr noundef %29, ptr noundef %30)
  store i32 0, ptr @k, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %145, %22
  %32 = load i32, ptr @k, align 4, !tbaa !5
  %33 = load i32, ptr @numIter, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = load i32, ptr @flag, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 0
  br label %38

38:                                               ; preds = %35, %31
  %39 = phi i1 [ false, %31 ], [ %37, %35 ]
  br i1 %39, label %40, label %148

40:                                               ; preds = %38
  %41 = load ptr, ptr @p, align 8, !tbaa !9
  %42 = load ptr, ptr @r, align 8, !tbaa !9
  %43 = call noundef double @_Z14multVectByVectPdS_(ptr noundef %41, ptr noundef %42)
  %44 = load ptr, ptr @p, align 8, !tbaa !9
  %45 = load ptr, ptr @p, align 8, !tbaa !9
  %46 = call noundef double @_Z14multVectByVectPdS_(ptr noundef %44, ptr noundef %45)
  %47 = fdiv double %43, %46
  store double %47, ptr @alpha, align 8, !tbaa !11
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %78, %40
  %49 = load i32, ptr @i, align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %52, label %81

52:                                               ; preds = %48
  %53 = load double, ptr @alpha, align 8, !tbaa !11
  %54 = load ptr, ptr @z, align 8, !tbaa !9
  %55 = load i32, ptr @i, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %54, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !11
  %59 = load ptr, ptr @x, align 8, !tbaa !9
  %60 = load i32, ptr @i, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %59, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = call double @llvm.fmuladd.f64(double %53, double %58, double %63)
  store double %64, ptr %62, align 8, !tbaa !11
  %65 = load double, ptr @alpha, align 8, !tbaa !11
  %66 = load ptr, ptr @p, align 8, !tbaa !9
  %67 = load i32, ptr @i, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %66, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = load ptr, ptr @r, align 8, !tbaa !9
  %72 = load i32, ptr @i, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %71, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !11
  %76 = fneg double %65
  %77 = call double @llvm.fmuladd.f64(double %76, double %70, double %75)
  store double %77, ptr %74, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %52
  %79 = load i32, ptr @i, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr @i, align 4, !tbaa !5
  br label %48, !llvm.loop !15

81:                                               ; preds = %48
  %82 = load ptr, ptr @r, align 8, !tbaa !9
  %83 = load ptr, ptr @q, align 8, !tbaa !9
  call void @_Z13backwardGaussPdS_(ptr noundef %82, ptr noundef %83)
  %84 = load ptr, ptr @q, align 8, !tbaa !9
  %85 = load ptr, ptr @q, align 8, !tbaa !9
  call void @_Z11multVectByAPdS_(ptr noundef %84, ptr noundef %85)
  %86 = load ptr, ptr @q, align 8, !tbaa !9
  %87 = load ptr, ptr @q, align 8, !tbaa !9
  call void @_Z12forwardGaussPdS_(ptr noundef %86, ptr noundef %87)
  %88 = load ptr, ptr @p, align 8, !tbaa !9
  %89 = load ptr, ptr @q, align 8, !tbaa !9
  %90 = call noundef double @_Z14multVectByVectPdS_(ptr noundef %88, ptr noundef %89)
  %91 = load ptr, ptr @p, align 8, !tbaa !9
  %92 = load ptr, ptr @p, align 8, !tbaa !9
  %93 = call noundef double @_Z14multVectByVectPdS_(ptr noundef %91, ptr noundef %92)
  %94 = fdiv double %90, %93
  %95 = fneg double %94
  store double %95, ptr @beta, align 8, !tbaa !11
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %133, %81
  %97 = load i32, ptr @i, align 4, !tbaa !5
  %98 = load i32, ptr @N, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %136

100:                                              ; preds = %96
  %101 = load double, ptr @beta, align 8, !tbaa !11
  %102 = load ptr, ptr @z, align 8, !tbaa !9
  %103 = load i32, ptr @i, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = load ptr, ptr @q, align 8, !tbaa !9
  %108 = load i32, ptr @i, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %107, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !11
  %112 = call double @llvm.fmuladd.f64(double %101, double %106, double %111)
  %113 = load ptr, ptr @z, align 8, !tbaa !9
  %114 = load i32, ptr @i, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  store double %112, ptr %116, align 8, !tbaa !11
  %117 = load double, ptr @beta, align 8, !tbaa !11
  %118 = load ptr, ptr @p, align 8, !tbaa !9
  %119 = load i32, ptr @i, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %118, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !11
  %123 = load ptr, ptr @q, align 8, !tbaa !9
  %124 = load i32, ptr @i, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !11
  %128 = call double @llvm.fmuladd.f64(double %117, double %122, double %127)
  %129 = load ptr, ptr @p, align 8, !tbaa !9
  %130 = load i32, ptr @i, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  store double %128, ptr %132, align 8, !tbaa !11
  br label %133

133:                                              ; preds = %100
  %134 = load i32, ptr @i, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr @i, align 4, !tbaa !5
  br label %96, !llvm.loop !16

136:                                              ; preds = %96
  %137 = load ptr, ptr @r, align 8, !tbaa !9
  %138 = load ptr, ptr @r, align 8, !tbaa !9
  %139 = call noundef double @_Z14multVectByVectPdS_(ptr noundef %137, ptr noundef %138)
  store double %139, ptr @breakValue, align 8, !tbaa !11
  %140 = load double, ptr @breakValue, align 8, !tbaa !11
  %141 = load double, ptr @eps, align 8, !tbaa !11
  %142 = fcmp olt double %140, %141
  br i1 %142, label %143, label %144

143:                                              ; preds = %136
  store i32 1, ptr @flag, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %143, %136
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr @k, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr @k, align 4, !tbaa !5
  br label %31, !llvm.loop !17

148:                                              ; preds = %38
  ret void
}

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

declare void @_Z12forwardGaussPdS_(ptr noundef, ptr noundef) #2

declare void @_Z13backwardGaussPdS_(ptr noundef, ptr noundef) #2

declare void @_Z11multVectByAPdS_(ptr noundef, ptr noundef) #2

declare noundef double @_Z14multVectByVectPdS_(ptr noundef, ptr noundef) #2

attributes #0 = { mustprogress 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 speculatable willreturn memory(none) }
attributes #2 = { "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" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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}


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

@N = external dso_local local_unnamed_addr global i32, align 4
@i = external dso_local local_unnamed_addr global i32, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@flag = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local local_unnamed_addr global ptr, align 8
@f = external dso_local local_unnamed_addr global ptr, align 8
@r = external dso_local local_unnamed_addr global ptr, align 8
@p = external dso_local local_unnamed_addr global ptr, align 8
@z = external dso_local local_unnamed_addr global ptr, align 8
@q = external dso_local local_unnamed_addr global ptr, align 8
@alpha = external dso_local local_unnamed_addr global double, align 8
@beta = external dso_local local_unnamed_addr global double, align 8
@breakValue = external dso_local local_unnamed_addr global double, align 8
@numIter = external local_unnamed_addr global i32, align 4
@eps = external local_unnamed_addr global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3losv() local_unnamed_addr #0 {
  %1 = load i32, ptr @N, align 4, !tbaa !5
  %2 = icmp sgt i32 %1, 0
  %.pre = load ptr, ptr @r, align 8, !tbaa !9
  %.pre35 = ptrtoint ptr %.pre to i64
  br i1 %2, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %3 = load ptr, ptr @x, align 8, !tbaa !9
  %4 = load ptr, ptr @f, align 8, !tbaa !9
  %wide.trip.count = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 14
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %5 = ptrtoint ptr %4 to i64
  %6 = ptrtoint ptr %3 to i64
  %7 = sub i64 %.pre35, %6
  %diff.check = icmp ult i64 %7, 32
  %8 = sub i64 %5, %6
  %diff.check36 = icmp ult i64 %8, 32
  %conflict.rdx = or i1 %diff.check, %diff.check36
  %9 = sub i64 %.pre35, %5
  %diff.check37 = icmp ult i64 %9, 32
  %conflict.rdx38 = or i1 %conflict.rdx, %diff.check37
  br i1 %conflict.rdx38, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %10 = getelementptr inbounds double, ptr %3, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  store <2 x double> zeroinitializer, ptr %10, align 8, !tbaa !11
  store <2 x double> zeroinitializer, ptr %11, align 8, !tbaa !11
  %12 = getelementptr inbounds double, ptr %4, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <2 x double>, ptr %12, align 8, !tbaa !11
  %wide.load39 = load <2 x double>, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds double, ptr %.pre, i64 %index
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  store <2 x double> %wide.load, ptr %14, align 8, !tbaa !11
  store <2 x double> %wide.load39, ptr %15, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %17 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.prol
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.prol
  %19 = load double, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds double, ptr %.pre, i64 %indvars.iv.prol
  store double %19, ptr %20, align 8, !tbaa !11
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !17

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %21 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %22 = icmp ugt i64 %21, -4
  br i1 %22, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %23 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  store double 0.000000e+00, ptr %23, align 8, !tbaa !11
  %24 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  %25 = load double, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds double, ptr %.pre, i64 %indvars.iv
  store double %25, ptr %26, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next
  store double 0.000000e+00, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next
  %29 = load double, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds double, ptr %.pre, i64 %indvars.iv.next
  store double %29, ptr %30, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %31 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next.1
  store double 0.000000e+00, ptr %31, align 8, !tbaa !11
  %32 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next.1
  %33 = load double, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds double, ptr %.pre, i64 %indvars.iv.next.1
  store double %33, ptr %34, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %35 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next.2
  store double 0.000000e+00, ptr %35, align 8, !tbaa !11
  %36 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next.2
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds double, ptr %.pre, i64 %indvars.iv.next.2
  store double %37, ptr %38, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %0
  %storemerge.lcssa = phi i32 [ 0, %0 ], [ %1, %middle.block ], [ %1, %scalar.ph ], [ %1, %scalar.ph.prol.loopexit ]
  store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
  tail call void @_Z12forwardGaussPdS_(ptr noundef %.pre, ptr noundef %.pre)
  %39 = load ptr, ptr @r, align 8, !tbaa !9
  %40 = load ptr, ptr @z, align 8, !tbaa !9
  tail call void @_Z13backwardGaussPdS_(ptr noundef %39, ptr noundef %40)
  %41 = load ptr, ptr @z, align 8, !tbaa !9
  %42 = load ptr, ptr @p, align 8, !tbaa !9
  tail call void @_Z11multVectByAPdS_(ptr noundef %41, ptr noundef %42)
  %43 = load ptr, ptr @p, align 8, !tbaa !9
  tail call void @_Z12forwardGaussPdS_(ptr noundef %43, ptr noundef %43)
  store i32 0, ptr @k, align 4, !tbaa !5
  %44 = load i32, ptr @numIter, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  %46 = load i32, ptr @flag, align 4
  %47 = icmp eq i32 %46, 0
  %48 = select i1 %45, i1 %47, i1 false
  br i1 %48, label %.lr.ph18, label %._crit_edge19

.lr.ph18:                                         ; preds = %._crit_edge, %139
  %49 = load ptr, ptr @p, align 8, !tbaa !9
  %50 = load ptr, ptr @r, align 8, !tbaa !9
  %51 = tail call noundef double @_Z14multVectByVectPdS_(ptr noundef %49, ptr noundef %50)
  %52 = load ptr, ptr @p, align 8, !tbaa !9
  %53 = tail call noundef double @_Z14multVectByVectPdS_(ptr noundef %52, ptr noundef %52)
  %54 = fdiv double %51, %53
  store double %54, ptr @alpha, align 8, !tbaa !11
  %55 = load i32, ptr @N, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 0
  %.pre33 = load ptr, ptr @r, align 8, !tbaa !9
  br i1 %56, label %.lr.ph9, label %._crit_edge10

.lr.ph9:                                          ; preds = %.lr.ph18
  %57 = load ptr, ptr @z, align 8, !tbaa !9
  %58 = load ptr, ptr @x, align 8, !tbaa !9
  %59 = load ptr, ptr @p, align 8, !tbaa !9
  %wide.trip.count26 = zext nneg i32 %55 to i64
  %min.iters.check110 = icmp ult i32 %55, 8
  br i1 %min.iters.check110, label %scalar.ph109.preheader, label %vector.memcheck76

vector.memcheck76:                                ; preds = %.lr.ph9
  %60 = shl nuw nsw i64 %wide.trip.count26, 3
  %scevgep77 = getelementptr i8, ptr %58, i64 %60
  %scevgep78 = getelementptr i8, ptr %.pre33, i64 %60
  %scevgep79 = getelementptr i8, ptr %57, i64 %60
  %scevgep80 = getelementptr i8, ptr %59, i64 %60
  %61 = insertelement <4 x ptr> poison, ptr %58, i64 0
  %62 = shufflevector <4 x ptr> %61, <4 x ptr> poison, <4 x i32> zeroinitializer
  %63 = insertelement <4 x ptr> <ptr poison, ptr getelementptr inbounds (i8, ptr @alpha, i64 8), ptr poison, ptr poison>, ptr %scevgep78, i64 0
  %64 = insertelement <4 x ptr> %63, ptr %scevgep79, i64 2
  %65 = insertelement <4 x ptr> %64, ptr %scevgep80, i64 3
  %66 = icmp ult <4 x ptr> %62, %65
  %67 = insertelement <4 x ptr> <ptr poison, ptr @alpha, ptr poison, ptr poison>, ptr %.pre33, i64 0
  %68 = insertelement <4 x ptr> %67, ptr %57, i64 2
  %69 = insertelement <4 x ptr> %68, ptr %59, i64 3
  %70 = insertelement <4 x ptr> poison, ptr %scevgep77, i64 0
  %71 = shufflevector <4 x ptr> %70, <4 x ptr> poison, <4 x i32> zeroinitializer
  %72 = icmp ult <4 x ptr> %69, %71
  %73 = and <4 x i1> %66, %72
  %bound096 = icmp ult ptr %.pre33, getelementptr inbounds (i8, ptr @alpha, i64 8)
  %bound197 = icmp ugt ptr %scevgep78, @alpha
  %found.conflict98 = and i1 %bound096, %bound197
  %bound0100 = icmp ult ptr %.pre33, %scevgep79
  %bound1101 = icmp ult ptr %57, %scevgep78
  %found.conflict102 = and i1 %bound0100, %bound1101
  %bound0104 = icmp ult ptr %.pre33, %scevgep80
  %bound1105 = icmp ult ptr %59, %scevgep78
  %found.conflict106 = and i1 %bound0104, %bound1105
  %74 = bitcast <4 x i1> %73 to i4
  %75 = icmp ne i4 %74, 0
  %op.rdx = or i1 %75, %found.conflict98
  %op.rdx127 = or i1 %found.conflict102, %found.conflict106
  %op.rdx128 = or i1 %op.rdx, %op.rdx127
  br i1 %op.rdx128, label %scalar.ph109.preheader, label %vector.ph111

vector.ph111:                                     ; preds = %vector.memcheck76
  %n.vec113 = and i64 %wide.trip.count26, 2147483646
  %76 = load double, ptr @alpha, align 8, !tbaa !11, !alias.scope !20
  %broadcast.splatinsert119 = insertelement <2 x double> poison, double %76, i64 0
  %broadcast.splat120 = shufflevector <2 x double> %broadcast.splatinsert119, <2 x double> poison, <2 x i32> zeroinitializer
  %77 = load double, ptr @alpha, align 8, !tbaa !11, !alias.scope !20
  %broadcast.splatinsert123 = insertelement <2 x double> poison, double %77, i64 0
  %broadcast.splat124 = shufflevector <2 x double> %broadcast.splatinsert123, <2 x double> poison, <2 x i32> zeroinitializer
  %78 = fneg <2 x double> %broadcast.splat124
  br label %vector.body115

vector.body115:                                   ; preds = %vector.body115, %vector.ph111
  %index116 = phi i64 [ 0, %vector.ph111 ], [ %index.next125, %vector.body115 ]
  %79 = getelementptr inbounds double, ptr %57, i64 %index116
  %wide.load117 = load <2 x double>, ptr %79, align 8, !tbaa !11, !alias.scope !23
  %80 = getelementptr inbounds double, ptr %58, i64 %index116
  %wide.load118 = load <2 x double>, ptr %80, align 8, !tbaa !11, !alias.scope !25, !noalias !27
  %81 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat120, <2 x double> %wide.load117, <2 x double> %wide.load118)
  store <2 x double> %81, ptr %80, align 8, !tbaa !11, !alias.scope !25, !noalias !27
  %82 = getelementptr inbounds double, ptr %59, i64 %index116
  %wide.load121 = load <2 x double>, ptr %82, align 8, !tbaa !11, !alias.scope !30
  %83 = getelementptr inbounds double, ptr %.pre33, i64 %index116
  %wide.load122 = load <2 x double>, ptr %83, align 8, !tbaa !11, !alias.scope !31, !noalias !32
  %84 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %78, <2 x double> %wide.load121, <2 x double> %wide.load122)
  store <2 x double> %84, ptr %83, align 8, !tbaa !11, !alias.scope !31, !noalias !32
  %index.next125 = add nuw i64 %index116, 2
  %85 = icmp eq i64 %index.next125, %n.vec113
  br i1 %85, label %middle.block108, label %vector.body115, !llvm.loop !33

middle.block108:                                  ; preds = %vector.body115
  %cmp.n126 = icmp eq i64 %n.vec113, %wide.trip.count26
  br i1 %cmp.n126, label %._crit_edge10, label %scalar.ph109.preheader

scalar.ph109.preheader:                           ; preds = %middle.block108, %vector.memcheck76, %.lr.ph9
  %indvars.iv23.ph = phi i64 [ 0, %vector.memcheck76 ], [ 0, %.lr.ph9 ], [ %n.vec113, %middle.block108 ]
  br label %scalar.ph109

scalar.ph109:                                     ; preds = %scalar.ph109.preheader, %scalar.ph109
  %indvars.iv23 = phi i64 [ %indvars.iv.next24, %scalar.ph109 ], [ %indvars.iv23.ph, %scalar.ph109.preheader ]
  %86 = load double, ptr @alpha, align 8, !tbaa !11
  %87 = getelementptr inbounds double, ptr %57, i64 %indvars.iv23
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds double, ptr %58, i64 %indvars.iv23
  %90 = load double, ptr %89, align 8, !tbaa !11
  %91 = tail call double @llvm.fmuladd.f64(double %86, double %88, double %90)
  store double %91, ptr %89, align 8, !tbaa !11
  %92 = load double, ptr @alpha, align 8, !tbaa !11
  %93 = getelementptr inbounds double, ptr %59, i64 %indvars.iv23
  %94 = load double, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds double, ptr %.pre33, i64 %indvars.iv23
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = fneg double %92
  %98 = tail call double @llvm.fmuladd.f64(double %97, double %94, double %96)
  store double %98, ptr %95, align 8, !tbaa !11
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %exitcond27.not = icmp eq i64 %indvars.iv.next24, %wide.trip.count26
  br i1 %exitcond27.not, label %._crit_edge10, label %scalar.ph109, !llvm.loop !34

._crit_edge10:                                    ; preds = %scalar.ph109, %middle.block108, %.lr.ph18
  %storemerge4.lcssa = phi i32 [ 0, %.lr.ph18 ], [ %55, %middle.block108 ], [ %55, %scalar.ph109 ]
  store i32 %storemerge4.lcssa, ptr @i, align 4, !tbaa !5
  %99 = load ptr, ptr @q, align 8, !tbaa !9
  tail call void @_Z13backwardGaussPdS_(ptr noundef %.pre33, ptr noundef %99)
  %100 = load ptr, ptr @q, align 8, !tbaa !9
  tail call void @_Z11multVectByAPdS_(ptr noundef %100, ptr noundef %100)
  %101 = load ptr, ptr @q, align 8, !tbaa !9
  tail call void @_Z12forwardGaussPdS_(ptr noundef %101, ptr noundef %101)
  %102 = load ptr, ptr @p, align 8, !tbaa !9
  %103 = load ptr, ptr @q, align 8, !tbaa !9
  %104 = tail call noundef double @_Z14multVectByVectPdS_(ptr noundef %102, ptr noundef %103)
  %105 = load ptr, ptr @p, align 8, !tbaa !9
  %106 = tail call noundef double @_Z14multVectByVectPdS_(ptr noundef %105, ptr noundef %105)
  %107 = fneg double %104
  %108 = fdiv double %107, %106
  store double %108, ptr @beta, align 8, !tbaa !11
  %109 = load i32, ptr @N, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.lr.ph14, label %._crit_edge15

.lr.ph14:                                         ; preds = %._crit_edge10
  %111 = load ptr, ptr @z, align 8, !tbaa !9
  %112 = load ptr, ptr @q, align 8, !tbaa !9
  %113 = load ptr, ptr @p, align 8, !tbaa !9
  %wide.trip.count31 = zext nneg i32 %109 to i64
  %min.iters.check61 = icmp ult i32 %109, 6
  br i1 %min.iters.check61, label %scalar.ph60.preheader, label %vector.memcheck40

vector.memcheck40:                                ; preds = %.lr.ph14
  %114 = shl nuw nsw i64 %wide.trip.count31, 3
  %scevgep = getelementptr i8, ptr %111, i64 %114
  %scevgep41 = getelementptr i8, ptr %113, i64 %114
  %scevgep42 = getelementptr i8, ptr %112, i64 %114
  %bound0 = icmp ult ptr %111, %scevgep41
  %bound1 = icmp ult ptr %113, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound043 = icmp ult ptr %111, getelementptr inbounds (i8, ptr @beta, i64 8)
  %bound144 = icmp ugt ptr %scevgep, @beta
  %found.conflict45 = and i1 %bound043, %bound144
  %conflict.rdx46 = or i1 %found.conflict, %found.conflict45
  %bound047 = icmp ult ptr %111, %scevgep42
  %bound148 = icmp ult ptr %112, %scevgep
  %found.conflict49 = and i1 %bound047, %bound148
  %conflict.rdx50 = or i1 %conflict.rdx46, %found.conflict49
  %bound051 = icmp ult ptr %113, getelementptr inbounds (i8, ptr @beta, i64 8)
  %bound152 = icmp ugt ptr %scevgep41, @beta
  %found.conflict53 = and i1 %bound051, %bound152
  %conflict.rdx54 = or i1 %conflict.rdx50, %found.conflict53
  %bound055 = icmp ult ptr %113, %scevgep42
  %bound156 = icmp ult ptr %112, %scevgep41
  %found.conflict57 = and i1 %bound055, %bound156
  %conflict.rdx58 = or i1 %conflict.rdx54, %found.conflict57
  br i1 %conflict.rdx58, label %scalar.ph60.preheader, label %vector.ph62

vector.ph62:                                      ; preds = %vector.memcheck40
  %n.vec64 = and i64 %wide.trip.count31, 2147483646
  %115 = load double, ptr @beta, align 8, !tbaa !11, !alias.scope !35
  %broadcast.splatinsert = insertelement <2 x double> poison, double %115, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %116 = load double, ptr @beta, align 8, !tbaa !11, !alias.scope !35
  %broadcast.splatinsert72 = insertelement <2 x double> poison, double %116, i64 0
  %broadcast.splat73 = shufflevector <2 x double> %broadcast.splatinsert72, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body66

vector.body66:                                    ; preds = %vector.body66, %vector.ph62
  %index67 = phi i64 [ 0, %vector.ph62 ], [ %index.next74, %vector.body66 ]
  %117 = getelementptr inbounds double, ptr %111, i64 %index67
  %wide.load68 = load <2 x double>, ptr %117, align 8, !tbaa !11, !alias.scope !38, !noalias !40
  %118 = getelementptr inbounds double, ptr %112, i64 %index67
  %wide.load69 = load <2 x double>, ptr %118, align 8, !tbaa !11, !alias.scope !43
  %119 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load68, <2 x double> %wide.load69)
  store <2 x double> %119, ptr %117, align 8, !tbaa !11, !alias.scope !38, !noalias !40
  %120 = getelementptr inbounds double, ptr %113, i64 %index67
  %wide.load70 = load <2 x double>, ptr %120, align 8, !tbaa !11, !alias.scope !44, !noalias !45
  %wide.load71 = load <2 x double>, ptr %118, align 8, !tbaa !11, !alias.scope !43
  %121 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat73, <2 x double> %wide.load70, <2 x double> %wide.load71)
  store <2 x double> %121, ptr %120, align 8, !tbaa !11, !alias.scope !44, !noalias !45
  %index.next74 = add nuw i64 %index67, 2
  %122 = icmp eq i64 %index.next74, %n.vec64
  br i1 %122, label %middle.block59, label %vector.body66, !llvm.loop !46

middle.block59:                                   ; preds = %vector.body66
  %cmp.n75 = icmp eq i64 %n.vec64, %wide.trip.count31
  br i1 %cmp.n75, label %._crit_edge15, label %scalar.ph60.preheader

scalar.ph60.preheader:                            ; preds = %middle.block59, %vector.memcheck40, %.lr.ph14
  %indvars.iv28.ph = phi i64 [ 0, %vector.memcheck40 ], [ 0, %.lr.ph14 ], [ %n.vec64, %middle.block59 ]
  br label %scalar.ph60

scalar.ph60:                                      ; preds = %scalar.ph60.preheader, %scalar.ph60
  %indvars.iv28 = phi i64 [ %indvars.iv.next29, %scalar.ph60 ], [ %indvars.iv28.ph, %scalar.ph60.preheader ]
  %123 = load double, ptr @beta, align 8, !tbaa !11
  %124 = getelementptr inbounds double, ptr %111, i64 %indvars.iv28
  %125 = load double, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds double, ptr %112, i64 %indvars.iv28
  %127 = load double, ptr %126, align 8, !tbaa !11
  %128 = tail call double @llvm.fmuladd.f64(double %123, double %125, double %127)
  store double %128, ptr %124, align 8, !tbaa !11
  %129 = load double, ptr @beta, align 8, !tbaa !11
  %130 = getelementptr inbounds double, ptr %113, i64 %indvars.iv28
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = load double, ptr %126, align 8, !tbaa !11
  %133 = tail call double @llvm.fmuladd.f64(double %129, double %131, double %132)
  store double %133, ptr %130, align 8, !tbaa !11
  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
  %exitcond32.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count31
  br i1 %exitcond32.not, label %._crit_edge15, label %scalar.ph60, !llvm.loop !47

._crit_edge15:                                    ; preds = %scalar.ph60, %middle.block59, %._crit_edge10
  %storemerge5.lcssa = phi i32 [ 0, %._crit_edge10 ], [ %109, %middle.block59 ], [ %109, %scalar.ph60 ]
  store i32 %storemerge5.lcssa, ptr @i, align 4, !tbaa !5
  %134 = load ptr, ptr @r, align 8, !tbaa !9
  %135 = tail call noundef double @_Z14multVectByVectPdS_(ptr noundef %134, ptr noundef %134)
  store double %135, ptr @breakValue, align 8, !tbaa !11
  %136 = load double, ptr @eps, align 8, !tbaa !11
  %137 = fcmp olt double %135, %136
  br i1 %137, label %138, label %._crit_edge15._crit_edge

._crit_edge15._crit_edge:                         ; preds = %._crit_edge15
  %.pre34 = load i32, ptr @flag, align 4
  br label %139

138:                                              ; preds = %._crit_edge15
  store i32 1, ptr @flag, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %._crit_edge15._crit_edge, %138
  %140 = phi i32 [ %.pre34, %._crit_edge15._crit_edge ], [ 1, %138 ]
  %141 = load i32, ptr @k, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @k, align 4, !tbaa !5
  %143 = load i32, ptr @numIter, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  %145 = icmp eq i32 %140, 0
  %146 = select i1 %144, i1 %145, i1 false
  br i1 %146, label %.lr.ph18, label %._crit_edge19, !llvm.loop !48

._crit_edge19:                                    ; preds = %139, %._crit_edge
  ret void
}

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

declare void @_Z12forwardGaussPdS_(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_Z13backwardGaussPdS_(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_Z11multVectByAPdS_(ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef double @_Z14multVectByVectPdS_(ptr noundef, ptr 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 = { mustprogress 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 = { "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) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !14, !15}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = !{!26}
!26 = distinct !{!26, !22}
!27 = !{!28, !21, !24, !29}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}
!30 = !{!29}
!31 = !{!28}
!32 = !{!21, !24, !29}
!33 = distinct !{!33, !14, !15, !16}
!34 = distinct !{!34, !14, !15}
!35 = !{!36}
!36 = distinct !{!36, !37}
!37 = distinct !{!37, !"LVerDomain"}
!38 = !{!39}
!39 = distinct !{!39, !37}
!40 = !{!41, !36, !42}
!41 = distinct !{!41, !37}
!42 = distinct !{!42, !37}
!43 = !{!42}
!44 = !{!41}
!45 = !{!36, !42}
!46 = distinct !{!46, !14, !15, !16}
!47 = distinct !{!47, !14, !15}
!48 = distinct !{!48, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SLPVectorizerPass,SimplifyCFGPass,TailCallElimPass