; LLVM IR from OpenMathLib/OpenBLAS :: lapack-netlib/SRC (dlargv)

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

32:                                               ; preds = %170, %7
  %33 = load i32, ptr %18, align 4, !tbaa !9
  %34 = load i32, ptr %15, align 4, !tbaa !9
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %36, label %173

36:                                               ; preds = %32
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i32, ptr %21, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds double, ptr %37, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !11
  store double %41, ptr %16, align 8, !tbaa !11
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load i32, ptr %22, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %42, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  store double %46, ptr %17, align 8, !tbaa !11
  %47 = load double, ptr %17, align 8, !tbaa !11
  %48 = fcmp oeq double %47, 0.000000e+00
  br i1 %48, label %49, label %54

49:                                               ; preds = %36
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = load i32, ptr %20, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds double, ptr %50, i64 %52
  store double 1.000000e+00, ptr %53, align 8, !tbaa !11
  br label %157

54:                                               ; preds = %36
  %55 = load double, ptr %16, align 8, !tbaa !11
  %56 = fcmp oeq double %55, 0.000000e+00
  br i1 %56, label %57, label %71

57:                                               ; preds = %54
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load i32, ptr %20, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  store double 0.000000e+00, ptr %61, align 8, !tbaa !11
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = load i32, ptr %22, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  store double 1.000000e+00, ptr %65, align 8, !tbaa !11
  %66 = load double, ptr %17, align 8, !tbaa !11
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = load i32, ptr %21, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  store double %66, ptr %70, align 8, !tbaa !11
  br label %156

71:                                               ; preds = %54
  %72 = load double, ptr %16, align 8, !tbaa !11
  %73 = fcmp oge double %72, 0.000000e+00
  br i1 %73, label %74, label %76

74:                                               ; preds = %71
  %75 = load double, ptr %16, align 8, !tbaa !11
  br label %79

76:                                               ; preds = %71
  %77 = load double, ptr %16, align 8, !tbaa !11
  %78 = fneg double %77
  br label %79

79:                                               ; preds = %76, %74
  %80 = phi double [ %75, %74 ], [ %78, %76 ]
  %81 = load double, ptr %17, align 8, !tbaa !11
  %82 = fcmp oge double %81, 0.000000e+00
  br i1 %82, label %83, label %85

83:                                               ; preds = %79
  %84 = load double, ptr %17, align 8, !tbaa !11
  br label %88

85:                                               ; preds = %79
  %86 = load double, ptr %17, align 8, !tbaa !11
  %87 = fneg double %86
  br label %88

88:                                               ; preds = %85, %83
  %89 = phi double [ %84, %83 ], [ %87, %85 ]
  %90 = fcmp ogt double %80, %89
  br i1 %90, label %91, label %123

91:                                               ; preds = %88
  %92 = load double, ptr %17, align 8, !tbaa !11
  %93 = load double, ptr %16, align 8, !tbaa !11
  %94 = fdiv double %92, %93
  store double %94, ptr %19, align 8, !tbaa !11
  %95 = load double, ptr %19, align 8, !tbaa !11
  %96 = load double, ptr %19, align 8, !tbaa !11
  %97 = call double @llvm.fmuladd.f64(double %95, double %96, double 1.000000e+00)
  %98 = call double @sqrt(double noundef %97) #4
  store double %98, ptr %23, align 8, !tbaa !11
  %99 = load double, ptr %23, align 8, !tbaa !11
  %100 = fdiv double 1.000000e+00, %99
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = load i32, ptr %20, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %101, i64 %103
  store double %100, ptr %104, align 8, !tbaa !11
  %105 = load double, ptr %19, align 8, !tbaa !11
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load i32, ptr %20, 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 = fmul double %105, %110
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = load i32, ptr %22, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  store double %111, ptr %115, align 8, !tbaa !11
  %116 = load double, ptr %16, align 8, !tbaa !11
  %117 = load double, ptr %23, align 8, !tbaa !11
  %118 = fmul double %116, %117
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = load i32, ptr %21, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  store double %118, ptr %122, align 8, !tbaa !11
  br label %155

123:                                              ; preds = %88
  %124 = load double, ptr %16, align 8, !tbaa !11
  %125 = load double, ptr %17, align 8, !tbaa !11
  %126 = fdiv double %124, %125
  store double %126, ptr %19, align 8, !tbaa !11
  %127 = load double, ptr %19, align 8, !tbaa !11
  %128 = load double, ptr %19, align 8, !tbaa !11
  %129 = call double @llvm.fmuladd.f64(double %127, double %128, double 1.000000e+00)
  %130 = call double @sqrt(double noundef %129) #4
  store double %130, ptr %23, align 8, !tbaa !11
  %131 = load double, ptr %23, align 8, !tbaa !11
  %132 = fdiv double 1.000000e+00, %131
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = load i32, ptr %22, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds double, ptr %133, i64 %135
  store double %132, ptr %136, align 8, !tbaa !11
  %137 = load double, ptr %19, align 8, !tbaa !11
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load i32, ptr %22, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %138, i64 %140
  %142 = load double, ptr %141, align 8, !tbaa !11
  %143 = fmul double %137, %142
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  %145 = load i32, ptr %20, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds double, ptr %144, i64 %146
  store double %143, ptr %147, align 8, !tbaa !11
  %148 = load double, ptr %17, align 8, !tbaa !11
  %149 = load double, ptr %23, align 8, !tbaa !11
  %150 = fmul double %148, %149
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load i32, ptr %21, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %151, i64 %153
  store double %150, ptr %154, align 8, !tbaa !11
  br label %155

155:                                              ; preds = %123, %91
  br label %156

156:                                              ; preds = %155, %57
  br label %157

157:                                              ; preds = %156, %49
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = load i32, ptr %20, align 4, !tbaa !9
  %161 = add nsw i32 %160, %159
  store i32 %161, ptr %20, align 4, !tbaa !9
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = load i32, ptr %22, align 4, !tbaa !9
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr %22, align 4, !tbaa !9
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %168 = load i32, ptr %21, align 4, !tbaa !9
  %169 = add nsw i32 %168, %167
  store i32 %169, ptr %21, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %157
  %171 = load i32, ptr %18, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %18, align 4, !tbaa !9
  br label %32, !llvm.loop !13

173:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, 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 4, ptr %15) #4
  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: nounwind
declare double @sqrt(double noundef) #2

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

; 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 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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(argmem: readwrite) uwtable
define dso_local void @dlargv_(ptr nocapture noundef readonly %0, ptr nocapture noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef readonly %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %5, i64 -8
  %9 = getelementptr inbounds i8, ptr %3, i64 -8
  %10 = getelementptr inbounds i8, ptr %1, i64 -8
  %11 = load i32, ptr %0, align 4, !tbaa !5
  %.not71 = icmp slt i32 %11, 1
  br i1 %.not71, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %12 = load i32, ptr %6, align 4, !tbaa !5
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %13 to i64
  %16 = sext i32 %14 to i64
  %17 = sext i32 %12 to i64
  br label %18

18:                                               ; preds = %.lr.ph, %52
  %indvars.iv78 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next79, %52 ]
  %indvars.iv76 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next77, %52 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %.06772 = phi i32 [ 1, %.lr.ph ], [ %53, %52 ]
  %19 = getelementptr inbounds double, ptr %10, i64 %indvars.iv76
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds double, ptr %9, i64 %indvars.iv
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = fcmp oeq double %22, 0.000000e+00
  br i1 %23, label %24, label %26

24:                                               ; preds = %18
  %25 = getelementptr inbounds double, ptr %8, i64 %indvars.iv78
  store double 1.000000e+00, ptr %25, align 8, !tbaa !9
  br label %52

26:                                               ; preds = %18
  %27 = fcmp oeq double %20, 0.000000e+00
  br i1 %27, label %28, label %30

28:                                               ; preds = %26
  %29 = getelementptr inbounds double, ptr %8, i64 %indvars.iv78
  store double 0.000000e+00, ptr %29, align 8, !tbaa !9
  store double 1.000000e+00, ptr %21, align 8, !tbaa !9
  store double %22, ptr %19, align 8, !tbaa !9
  br label %52

30:                                               ; preds = %26
  %31 = fcmp oge double %20, 0.000000e+00
  %32 = fneg double %20
  %33 = select i1 %31, double %20, double %32
  %34 = fcmp oge double %22, 0.000000e+00
  %35 = fneg double %22
  %36 = select i1 %34, double %22, double %35
  %37 = fcmp ogt double %33, %36
  br i1 %37, label %38, label %45

38:                                               ; preds = %30
  %39 = fdiv double %22, %20
  %40 = tail call double @llvm.fmuladd.f64(double %39, double %39, double 1.000000e+00)
  %sqrt = tail call double @llvm.sqrt.f64(double %40)
  %41 = fdiv double 1.000000e+00, %sqrt
  %42 = getelementptr inbounds double, ptr %8, i64 %indvars.iv78
  store double %41, ptr %42, align 8, !tbaa !9
  %43 = fmul double %39, %41
  store double %43, ptr %21, align 8, !tbaa !9
  %44 = fmul double %20, %sqrt
  store double %44, ptr %19, align 8, !tbaa !9
  br label %52

45:                                               ; preds = %30
  %46 = fdiv double %20, %22
  %47 = tail call double @llvm.fmuladd.f64(double %46, double %46, double 1.000000e+00)
  %sqrt70 = tail call double @llvm.sqrt.f64(double %47)
  %48 = fdiv double 1.000000e+00, %sqrt70
  store double %48, ptr %21, align 8, !tbaa !9
  %49 = fmul double %46, %48
  %50 = getelementptr inbounds double, ptr %8, i64 %indvars.iv78
  store double %49, ptr %50, align 8, !tbaa !9
  %51 = fmul double %22, %sqrt70
  store double %51, ptr %19, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %28, %45, %38, %24
  %indvars.iv.next79 = add nsw i64 %indvars.iv78, %17
  %indvars.iv.next = add nsw i64 %indvars.iv, %15
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, %16
  %53 = add nuw i32 %.06772, 1
  %exitcond.not = icmp eq i32 %.06772, %11
  br i1 %exitcond.not, label %._crit_edge, label %18, !llvm.loop !11

._crit_edge:                                      ; preds = %52, %7
  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 double @llvm.sqrt.f64(double) #2

attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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"}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass