; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/BLAS/TESTING (dblat1)

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

%struct.anon = type { i64, i64, i64, i64, i64, i64 }
%struct.cilist = type { i64, i64, i64, ptr, i64 }

@combla_ = external dso_local global %struct.anon, align 8
@c__1 = external hidden global i64, align 8
@stest_.io___99 = external hidden global %struct.cilist, align 8
@stest_.io___100 = external hidden global %struct.cilist, align 8
@stest_.io___101 = external hidden global %struct.cilist, align 8

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

declare i64 @s_wsfe(ptr noundef) #1

declare i64 @e_wsfe() #1

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

declare i64 @do_fio(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @stest_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i64, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds double, ptr %19, i32 -1
  store ptr %20, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds double, ptr %21, i32 -1
  store ptr %22, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds double, ptr %23, i32 -1
  store ptr %24, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i64, ptr %25, align 8, !tbaa !9
  store i64 %26, ptr %11, align 8, !tbaa !9
  store i64 1, ptr %17, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %116, %5
  %28 = load i64, ptr %17, align 8, !tbaa !9
  %29 = load i64, ptr %11, align 8, !tbaa !9
  %30 = icmp sle i64 %28, %29
  br i1 %30, label %31, label %119

31:                                               ; preds = %27
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i64, ptr %17, align 8, !tbaa !9
  %34 = getelementptr inbounds double, ptr %32, i64 %33
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %17, align 8, !tbaa !9
  %38 = getelementptr inbounds double, ptr %36, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = fsub double %35, %39
  store double %40, ptr %18, align 8, !tbaa !11
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load i64, ptr %17, 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 %12, align 8, !tbaa !11
  %45 = load double, ptr %12, align 8, !tbaa !11
  %46 = fcmp oge double %45, 0.000000e+00
  br i1 %46, label %47, label %49

47:                                               ; preds = %31
  %48 = load double, ptr %12, align 8, !tbaa !11
  br label %52

49:                                               ; preds = %31
  %50 = load double, ptr %12, align 8, !tbaa !11
  %51 = fneg double %50
  br label %52

52:                                               ; preds = %49, %47
  %53 = phi double [ %48, %47 ], [ %51, %49 ]
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = load double, ptr %18, align 8, !tbaa !11
  %57 = fmul double %55, %56
  store double %57, ptr %13, align 8, !tbaa !11
  %58 = load double, ptr %13, align 8, !tbaa !11
  %59 = fcmp oge double %58, 0.000000e+00
  br i1 %59, label %60, label %62

60:                                               ; preds = %52
  %61 = load double, ptr %13, align 8, !tbaa !11
  br label %65

62:                                               ; preds = %52
  %63 = load double, ptr %13, align 8, !tbaa !11
  %64 = fneg double %63
  br label %65

65:                                               ; preds = %62, %60
  %66 = phi double [ %61, %60 ], [ %64, %62 ]
  %67 = fadd double %53, %66
  store double %67, ptr %15, align 8, !tbaa !11
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load i64, ptr %17, align 8, !tbaa !9
  %70 = getelementptr inbounds double, ptr %68, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !11
  store double %71, ptr %14, align 8, !tbaa !11
  %72 = load double, ptr %14, align 8, !tbaa !11
  %73 = fcmp oge double %72, 0.000000e+00
  br i1 %73, label %74, label %76

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

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

79:                                               ; preds = %76, %74
  %80 = phi double [ %75, %74 ], [ %78, %76 ]
  store double %80, ptr %16, align 8, !tbaa !11
  %81 = call double @sdiff_(ptr noundef %15, ptr noundef %16)
  %82 = fcmp oeq double %81, 0.000000e+00
  br i1 %82, label %83, label %84

83:                                               ; preds = %79
  br label %115

84:                                               ; preds = %79
  %85 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !13
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  br label %93

88:                                               ; preds = %84
  store i64 0, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !13
  %89 = call i64 @s_wsfe(ptr noundef @stest_.io___99)
  %90 = call i64 @e_wsfe()
  %91 = call i64 @s_wsfe(ptr noundef @stest_.io___100)
  %92 = call i64 @e_wsfe()
  br label %93

93:                                               ; preds = %88, %87
  %94 = call i64 @s_wsfe(ptr noundef @stest_.io___101)
  %95 = call i64 @do_fio(ptr noundef @c__1, ptr noundef @combla_, i64 noundef 8)
  %96 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 1), i64 noundef 8)
  %97 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 2), i64 noundef 8)
  %98 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 3), i64 noundef 8)
  %99 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 4), i64 noundef 8)
  %100 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %17, i64 noundef 8)
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load i64, ptr %17, align 8, !tbaa !9
  %103 = getelementptr inbounds double, ptr %101, i64 %102
  %104 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %103, i64 noundef 8)
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = load i64, ptr %17, align 8, !tbaa !9
  %107 = getelementptr inbounds double, ptr %105, i64 %106
  %108 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %107, i64 noundef 8)
  %109 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %18, i64 noundef 8)
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load i64, ptr %17, align 8, !tbaa !9
  %112 = getelementptr inbounds double, ptr %110, i64 %111
  %113 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %112, i64 noundef 8)
  %114 = call i64 @e_wsfe()
  br label %115

115:                                              ; preds = %93, %83
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %17, align 8, !tbaa !9
  %118 = add nsw i64 %117, 1
  store i64 %118, ptr %17, align 8, !tbaa !9
  br label %27, !llvm.loop !15

119:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  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 8, ptr %11) #3
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local double @sdiff_(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 40}
!14 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%struct.anon = type { i64, i64, i64, i64, i64, i64 }
%struct.cilist = type { i64, i64, i64, ptr, i64 }

@combla_ = external dso_local global %struct.anon, align 8
@c__1 = external hidden global i64, align 8
@stest_.io___99 = external hidden global %struct.cilist, align 8
@stest_.io___100 = external hidden global %struct.cilist, align 8
@stest_.io___101 = external hidden global %struct.cilist, align 8

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

declare i64 @s_wsfe(ptr noundef) local_unnamed_addr #1

declare i64 @e_wsfe() local_unnamed_addr #1

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

declare i64 @do_fio(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @stest_(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #2 {
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %10 = getelementptr inbounds i8, ptr %3, i64 -8
  %11 = getelementptr inbounds i8, ptr %2, i64 -8
  %12 = getelementptr inbounds i8, ptr %1, i64 -8
  %13 = load i64, ptr %0, align 8, !tbaa !5
  store i64 1, ptr %8, align 8, !tbaa !5
  %.not22 = icmp slt i64 %13, 1
  br i1 %.not22, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5, %59
  %storemerge23 = phi i64 [ %61, %59 ], [ 1, %5 ]
  %14 = getelementptr inbounds double, ptr %12, i64 %storemerge23
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds double, ptr %11, i64 %storemerge23
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = fsub double %15, %17
  store double %18, ptr %9, align 8, !tbaa !9
  %19 = getelementptr inbounds double, ptr %10, i64 %storemerge23
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = load double, ptr %4, align 8, !tbaa !9
  %22 = fmul double %18, %21
  %23 = insertelement <2 x double> poison, double %20, i64 0
  %24 = insertelement <2 x double> %23, double %22, i64 1
  %25 = fcmp oge <2 x double> %24, zeroinitializer
  %26 = fneg <2 x double> %24
  %27 = select <2 x i1> %25, <2 x double> %24, <2 x double> %26
  %28 = extractelement <2 x double> %27, i64 0
  %shift = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %29 = fadd <2 x double> %27, %shift
  %30 = extractelement <2 x double> %29, i64 0
  store double %30, ptr %6, align 8, !tbaa !9
  store double %28, ptr %7, align 8, !tbaa !9
  %31 = call double @sdiff_(ptr noundef nonnull %6, ptr noundef nonnull %7)
  %32 = fcmp oeq double %31, 0.000000e+00
  br i1 %32, label %59, label %33

33:                                               ; preds = %.lr.ph
  %34 = load i64, ptr getelementptr inbounds (i8, ptr @combla_, i64 40), align 8, !tbaa !11
  %.not21 = icmp eq i64 %34, 0
  br i1 %.not21, label %40, label %35

35:                                               ; preds = %33
  store i64 0, ptr getelementptr inbounds (i8, ptr @combla_, i64 40), align 8, !tbaa !11
  %36 = call i64 @s_wsfe(ptr noundef nonnull @stest_.io___99) #3
  %37 = call i64 @e_wsfe() #3
  %38 = call i64 @s_wsfe(ptr noundef nonnull @stest_.io___100) #3
  %39 = call i64 @e_wsfe() #3
  br label %40

40:                                               ; preds = %33, %35
  %41 = call i64 @s_wsfe(ptr noundef nonnull @stest_.io___101) #3
  %42 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull @combla_, i64 noundef 8) #3
  %43 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 8), i64 noundef 8) #3
  %44 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 16), i64 noundef 8) #3
  %45 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 24), i64 noundef 8) #3
  %46 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 32), i64 noundef 8) #3
  %47 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %8, i64 noundef 8) #3
  %48 = load i64, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds double, ptr %12, i64 %48
  %50 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %49, i64 noundef 8) #3
  %51 = load i64, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %11, i64 %51
  %53 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %52, i64 noundef 8) #3
  %54 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %9, i64 noundef 8) #3
  %55 = load i64, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds double, ptr %10, i64 %55
  %57 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %56, i64 noundef 8) #3
  %58 = call i64 @e_wsfe() #3
  br label %59

59:                                               ; preds = %40, %.lr.ph
  %60 = load i64, ptr %8, align 8, !tbaa !5
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr %8, align 8, !tbaa !5
  %.not.not = icmp slt i64 %60, %13
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %59, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local double @sdiff_(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { 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 #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 = !{!"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 = !{!12, !6, i64 40}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass