; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/LAPACK (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 i32 @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 i64, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i64, align 8
  %19 = alloca double, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %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 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, 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 i64 1, ptr %21, align 8, !tbaa !9
  store i64 1, ptr %22, align 8, !tbaa !9
  store i64 1, ptr %20, align 8, !tbaa !9
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load i64, ptr %30, align 8, !tbaa !9
  store i64 %31, ptr %15, align 8, !tbaa !9
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %156, %7
  %33 = load i64, ptr %18, align 8, !tbaa !9
  %34 = load i64, ptr %15, align 8, !tbaa !9
  %35 = icmp sle i64 %33, %34
  br i1 %35, label %36, label %159

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

47:                                               ; preds = %36
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = load i64, ptr %20, align 8, !tbaa !9
  %50 = getelementptr inbounds double, ptr %48, i64 %49
  store double 1.000000e+00, ptr %50, align 8, !tbaa !11
  br label %143

51:                                               ; preds = %36
  %52 = load double, ptr %16, align 8, !tbaa !11
  %53 = fcmp oeq double %52, 0.000000e+00
  br i1 %53, label %54, label %65

54:                                               ; preds = %51
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = load i64, ptr %20, align 8, !tbaa !9
  %57 = getelementptr inbounds double, ptr %55, i64 %56
  store double 0.000000e+00, ptr %57, align 8, !tbaa !11
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i64, ptr %22, align 8, !tbaa !9
  %60 = getelementptr inbounds double, ptr %58, i64 %59
  store double 1.000000e+00, ptr %60, align 8, !tbaa !11
  %61 = load double, ptr %17, align 8, !tbaa !11
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = load i64, ptr %21, align 8, !tbaa !9
  %64 = getelementptr inbounds double, ptr %62, i64 %63
  store double %61, ptr %64, align 8, !tbaa !11
  br label %142

65:                                               ; preds = %51
  %66 = load double, ptr %16, align 8, !tbaa !11
  %67 = fcmp oge double %66, 0.000000e+00
  br i1 %67, label %68, label %70

68:                                               ; preds = %65
  %69 = load double, ptr %16, align 8, !tbaa !11
  br label %73

70:                                               ; preds = %65
  %71 = load double, ptr %16, align 8, !tbaa !11
  %72 = fneg double %71
  br label %73

73:                                               ; preds = %70, %68
  %74 = phi double [ %69, %68 ], [ %72, %70 ]
  %75 = load double, ptr %17, align 8, !tbaa !11
  %76 = fcmp oge double %75, 0.000000e+00
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = load double, ptr %17, align 8, !tbaa !11
  br label %82

79:                                               ; preds = %73
  %80 = load double, ptr %17, align 8, !tbaa !11
  %81 = fneg double %80
  br label %82

82:                                               ; preds = %79, %77
  %83 = phi double [ %78, %77 ], [ %81, %79 ]
  %84 = fcmp ogt double %74, %83
  br i1 %84, label %85, label %113

85:                                               ; preds = %82
  %86 = load double, ptr %17, align 8, !tbaa !11
  %87 = load double, ptr %16, align 8, !tbaa !11
  %88 = fdiv double %86, %87
  store double %88, ptr %19, align 8, !tbaa !11
  %89 = load double, ptr %19, align 8, !tbaa !11
  %90 = load double, ptr %19, align 8, !tbaa !11
  %91 = call double @llvm.fmuladd.f64(double %89, double %90, double 1.000000e+00)
  %92 = call double @sqrt(double noundef %91) #4
  store double %92, ptr %23, align 8, !tbaa !11
  %93 = load double, ptr %23, align 8, !tbaa !11
  %94 = fdiv double 1.000000e+00, %93
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = load i64, ptr %20, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  store double %94, ptr %97, align 8, !tbaa !11
  %98 = load double, ptr %19, align 8, !tbaa !11
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load i64, ptr %20, align 8, !tbaa !9
  %101 = getelementptr inbounds double, ptr %99, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = fmul double %98, %102
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = load i64, ptr %22, align 8, !tbaa !9
  %106 = getelementptr inbounds double, ptr %104, i64 %105
  store double %103, ptr %106, align 8, !tbaa !11
  %107 = load double, ptr %16, align 8, !tbaa !11
  %108 = load double, ptr %23, align 8, !tbaa !11
  %109 = fmul double %107, %108
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load i64, ptr %21, align 8, !tbaa !9
  %112 = getelementptr inbounds double, ptr %110, i64 %111
  store double %109, ptr %112, align 8, !tbaa !11
  br label %141

113:                                              ; preds = %82
  %114 = load double, ptr %16, align 8, !tbaa !11
  %115 = load double, ptr %17, align 8, !tbaa !11
  %116 = fdiv double %114, %115
  store double %116, ptr %19, align 8, !tbaa !11
  %117 = load double, ptr %19, align 8, !tbaa !11
  %118 = load double, ptr %19, align 8, !tbaa !11
  %119 = call double @llvm.fmuladd.f64(double %117, double %118, double 1.000000e+00)
  %120 = call double @sqrt(double noundef %119) #4
  store double %120, ptr %23, align 8, !tbaa !11
  %121 = load double, ptr %23, align 8, !tbaa !11
  %122 = fdiv double 1.000000e+00, %121
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = load i64, ptr %22, align 8, !tbaa !9
  %125 = getelementptr inbounds double, ptr %123, i64 %124
  store double %122, ptr %125, align 8, !tbaa !11
  %126 = load double, ptr %19, align 8, !tbaa !11
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = load i64, ptr %22, align 8, !tbaa !9
  %129 = getelementptr inbounds double, ptr %127, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = fmul double %126, %130
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = load i64, ptr %20, align 8, !tbaa !9
  %134 = getelementptr inbounds double, ptr %132, i64 %133
  store double %131, ptr %134, align 8, !tbaa !11
  %135 = load double, ptr %17, align 8, !tbaa !11
  %136 = load double, ptr %23, align 8, !tbaa !11
  %137 = fmul double %135, %136
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load i64, ptr %21, align 8, !tbaa !9
  %140 = getelementptr inbounds double, ptr %138, i64 %139
  store double %137, ptr %140, align 8, !tbaa !11
  br label %141

141:                                              ; preds = %113, %85
  br label %142

142:                                              ; preds = %141, %54
  br label %143

143:                                              ; preds = %142, %47
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = load i64, ptr %144, align 8, !tbaa !9
  %146 = load i64, ptr %20, align 8, !tbaa !9
  %147 = add nsw i64 %146, %145
  store i64 %147, ptr %20, align 8, !tbaa !9
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = load i64, ptr %22, align 8, !tbaa !9
  %151 = add nsw i64 %150, %149
  store i64 %151, ptr %22, align 8, !tbaa !9
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  %153 = load i64, ptr %152, align 8, !tbaa !9
  %154 = load i64, ptr %21, align 8, !tbaa !9
  %155 = add nsw i64 %154, %153
  store i64 %155, ptr %21, align 8, !tbaa !9
  br label %156

156:                                              ; preds = %143
  %157 = load i64, ptr %18, align 8, !tbaa !9
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %18, align 8, !tbaa !9
  br label %32, !llvm.loop !13

159:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  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
  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: 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 = !{!"long", !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 noundef i32 @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 i64, ptr %0, align 8, !tbaa !5
  %.not71 = icmp slt i64 %11, 1
  br i1 %.not71, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %12 = load i64, ptr %6, align 8, !tbaa !5
  %13 = load i64, ptr %4, align 8, !tbaa !5
  %14 = load i64, ptr %2, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %.lr.ph, %49
  %.075 = phi i64 [ 1, %.lr.ph ], [ %51, %49 ]
  %.06574 = phi i64 [ 1, %.lr.ph ], [ %52, %49 ]
  %.06673 = phi i64 [ 1, %.lr.ph ], [ %50, %49 ]
  %.06772 = phi i64 [ 1, %.lr.ph ], [ %53, %49 ]
  %16 = getelementptr inbounds double, ptr %10, i64 %.06574
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds double, ptr %9, i64 %.075
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = fcmp oeq double %19, 0.000000e+00
  br i1 %20, label %21, label %23

21:                                               ; preds = %15
  %22 = getelementptr inbounds double, ptr %8, i64 %.06673
  store double 1.000000e+00, ptr %22, align 8, !tbaa !9
  br label %49

23:                                               ; preds = %15
  %24 = fcmp oeq double %17, 0.000000e+00
  br i1 %24, label %25, label %27

25:                                               ; preds = %23
  %26 = getelementptr inbounds double, ptr %8, i64 %.06673
  store double 0.000000e+00, ptr %26, align 8, !tbaa !9
  store double 1.000000e+00, ptr %18, align 8, !tbaa !9
  store double %19, ptr %16, align 8, !tbaa !9
  br label %49

27:                                               ; preds = %23
  %28 = fcmp oge double %17, 0.000000e+00
  %29 = fneg double %17
  %30 = select i1 %28, double %17, double %29
  %31 = fcmp oge double %19, 0.000000e+00
  %32 = fneg double %19
  %33 = select i1 %31, double %19, double %32
  %34 = fcmp ogt double %30, %33
  br i1 %34, label %35, label %42

35:                                               ; preds = %27
  %36 = fdiv double %19, %17
  %37 = tail call double @llvm.fmuladd.f64(double %36, double %36, double 1.000000e+00)
  %sqrt = tail call double @llvm.sqrt.f64(double %37)
  %38 = fdiv double 1.000000e+00, %sqrt
  %39 = getelementptr inbounds double, ptr %8, i64 %.06673
  store double %38, ptr %39, align 8, !tbaa !9
  %40 = fmul double %36, %38
  store double %40, ptr %18, align 8, !tbaa !9
  %41 = fmul double %17, %sqrt
  store double %41, ptr %16, align 8, !tbaa !9
  br label %49

42:                                               ; preds = %27
  %43 = fdiv double %17, %19
  %44 = tail call double @llvm.fmuladd.f64(double %43, double %43, double 1.000000e+00)
  %sqrt70 = tail call double @llvm.sqrt.f64(double %44)
  %45 = fdiv double 1.000000e+00, %sqrt70
  store double %45, ptr %18, align 8, !tbaa !9
  %46 = fmul double %43, %45
  %47 = getelementptr inbounds double, ptr %8, i64 %.06673
  store double %46, ptr %47, align 8, !tbaa !9
  %48 = fmul double %19, %sqrt70
  store double %48, ptr %16, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %25, %42, %35, %21
  %50 = add nsw i64 %12, %.06673
  %51 = add nsw i64 %13, %.075
  %52 = add nsw i64 %14, %.06574
  %53 = add nuw i64 %.06772, 1
  %exitcond.not = icmp eq i64 %.06772, %11
  br i1 %exitcond.not, label %._crit_edge, label %15, !llvm.loop !11

._crit_edge:                                      ; preds = %49, %7
  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: 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 = !{!"long", !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