; 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
@.str = external hidden unnamed_addr constant [1 x i8], align 1
@c__1 = external hidden global i64, align 8
@check0_.ds1 = external hidden global [8 x double], align 16
@check0_.datrue = external hidden global [8 x double], align 16
@check0_.dbtrue = external hidden global [8 x double], align 16
@check0_.da1 = external hidden global [8 x double], align 16
@check0_.db1 = external hidden global [8 x double], align 16
@check0_.dc1 = external hidden global [8 x double], align 16
@check0_.io___18 = external hidden global %struct.cilist, align 8
@c__9 = external hidden global i64, align 8
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @check0_(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store double 0x3FFAAAAAAAAAAAAB, ptr @check0_.dbtrue, align 16, !tbaa !9
  store double 0xBFFAAAAAAAAAAAAB, ptr getelementptr inbounds ([8 x double], ptr @check0_.dbtrue, i64 0, i64 2), align 16, !tbaa !9
  store double 0x3FFAAAAAAAAAAAAB, ptr getelementptr inbounds ([8 x double], ptr @check0_.dbtrue, i64 0, i64 4), align 16, !tbaa !9
  store i64 1, ptr %3, align 8, !tbaa !11
  br label %8

8:                                                ; preds = %67, %1
  %9 = load i64, ptr %3, align 8, !tbaa !11
  %10 = icmp sle i64 %9, 8
  br i1 %10, label %11, label %70

11:                                               ; preds = %8
  %12 = load i64, ptr %3, align 8, !tbaa !11
  store i64 %12, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 1), align 8, !tbaa !13
  %13 = load i64, ptr @combla_, align 8, !tbaa !15
  %14 = icmp eq i64 %13, 3
  br i1 %14, label %15, label %61

15:                                               ; preds = %11
  %16 = load i64, ptr %3, align 8, !tbaa !11
  %17 = icmp sgt i64 %16, 8
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  br label %71

19:                                               ; preds = %15
  %20 = load i64, ptr %3, align 8, !tbaa !11
  %21 = sub nsw i64 %20, 1
  %22 = getelementptr inbounds [8 x double], ptr @check0_.da1, i64 0, i64 %21
  %23 = load double, ptr %22, align 8, !tbaa !9
  store double %23, ptr %4, align 8, !tbaa !9
  %24 = load i64, ptr %3, align 8, !tbaa !11
  %25 = sub nsw i64 %24, 1
  %26 = getelementptr inbounds [8 x double], ptr @check0_.db1, i64 0, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !9
  store double %27, ptr %5, align 8, !tbaa !9
  %28 = call i32 @f2c_drotg(ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %29 = load i64, ptr %3, align 8, !tbaa !11
  %30 = sub nsw i64 %29, 1
  %31 = getelementptr inbounds [8 x double], ptr @check0_.datrue, i64 0, i64 %30
  %32 = load i64, ptr %3, align 8, !tbaa !11
  %33 = sub nsw i64 %32, 1
  %34 = getelementptr inbounds [8 x double], ptr @check0_.datrue, i64 0, i64 %33
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = call i32 @stest1_(ptr noundef %4, ptr noundef %31, ptr noundef %34, ptr noundef %35)
  %37 = load i64, ptr %3, align 8, !tbaa !11
  %38 = sub nsw i64 %37, 1
  %39 = getelementptr inbounds [8 x double], ptr @check0_.dbtrue, i64 0, i64 %38
  %40 = load i64, ptr %3, align 8, !tbaa !11
  %41 = sub nsw i64 %40, 1
  %42 = getelementptr inbounds [8 x double], ptr @check0_.dbtrue, i64 0, i64 %41
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = call i32 @stest1_(ptr noundef %5, ptr noundef %39, ptr noundef %42, ptr noundef %43)
  %45 = load i64, ptr %3, align 8, !tbaa !11
  %46 = sub nsw i64 %45, 1
  %47 = getelementptr inbounds [8 x double], ptr @check0_.dc1, i64 0, i64 %46
  %48 = load i64, ptr %3, align 8, !tbaa !11
  %49 = sub nsw i64 %48, 1
  %50 = getelementptr inbounds [8 x double], ptr @check0_.dc1, i64 0, i64 %49
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = call i32 @stest1_(ptr noundef %6, ptr noundef %47, ptr noundef %50, ptr noundef %51)
  %53 = load i64, ptr %3, align 8, !tbaa !11
  %54 = sub nsw i64 %53, 1
  %55 = getelementptr inbounds [8 x double], ptr @check0_.ds1, i64 0, i64 %54
  %56 = load i64, ptr %3, align 8, !tbaa !11
  %57 = sub nsw i64 %56, 1
  %58 = getelementptr inbounds [8 x double], ptr @check0_.ds1, i64 0, i64 %57
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = call i32 @stest1_(ptr noundef %7, ptr noundef %55, ptr noundef %58, ptr noundef %59)
  br label %66

61:                                               ; preds = %11
  %62 = call i64 @s_wsle(ptr noundef @check0_.io___18)
  %63 = call i64 @do_lio(ptr noundef @c__9, ptr noundef @c__1, ptr noundef @.str.1, i64 noundef 28)
  %64 = call i64 @e_wsle()
  %65 = call i32 @s_stop(ptr noundef @.str, i64 noundef 0)
  br label %66

66:                                               ; preds = %61, %19
  br label %67

67:                                               ; preds = %66
  %68 = load i64, ptr %3, align 8, !tbaa !11
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %3, align 8, !tbaa !11
  br label %8, !llvm.loop !16

70:                                               ; preds = %8
  br label %71

71:                                               ; preds = %70, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i32 0
}

declare i32 @s_stop(ptr noundef, i64 noundef) #2

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

declare i32 @f2c_drotg(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @stest1_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i64 @s_wsle(ptr noundef) #2

declare i64 @do_lio(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #2

declare i64 @e_wsle() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!15 = !{!14, !12, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"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 local_unnamed_addr global %struct.anon, align 8
@.str = external hidden unnamed_addr constant [1 x i8], align 1
@c__1 = external hidden global i64, align 8
@check0_.ds1 = external hidden global [8 x double], align 16
@check0_.datrue = external hidden global [8 x double], align 16
@check0_.dbtrue = external hidden global [8 x double], align 16
@check0_.da1 = external hidden local_unnamed_addr global [8 x double], align 16
@check0_.db1 = external hidden local_unnamed_addr global [8 x double], align 16
@check0_.dc1 = external hidden global [8 x double], align 16
@check0_.io___18 = external hidden global %struct.cilist, align 8
@c__9 = external hidden global i64, align 8
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @check0_(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store double 0x3FFAAAAAAAAAAAAB, ptr @check0_.dbtrue, align 16, !tbaa !5
  store double 0xBFFAAAAAAAAAAAAB, ptr getelementptr inbounds (i8, ptr @check0_.dbtrue, i64 16), align 16, !tbaa !5
  store double 0x3FFAAAAAAAAAAAAB, ptr getelementptr inbounds (i8, ptr @check0_.dbtrue, i64 32), align 16, !tbaa !5
  br label %6

6:                                                ; preds = %1, %29
  %.017 = phi i64 [ 1, %1 ], [ %30, %29 ]
  store i64 %.017, ptr getelementptr inbounds (i8, ptr @combla_, i64 8), align 8, !tbaa !9
  %7 = load i64, ptr @combla_, align 8, !tbaa !12
  %8 = icmp eq i64 %7, 3
  br i1 %8, label %9, label %24

9:                                                ; preds = %6
  %10 = add nsw i64 %.017, -1
  %11 = getelementptr inbounds [8 x double], ptr @check0_.da1, i64 0, i64 %10
  %12 = load double, ptr %11, align 8, !tbaa !5
  store double %12, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds [8 x double], ptr @check0_.db1, i64 0, i64 %10
  %14 = load double, ptr %13, align 8, !tbaa !5
  store double %14, ptr %3, align 8, !tbaa !5
  %15 = call i32 @f2c_drotg(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5) #3
  %16 = getelementptr inbounds [8 x double], ptr @check0_.datrue, i64 0, i64 %10
  %17 = call i32 @stest1_(ptr noundef nonnull %2, ptr noundef nonnull %16, ptr noundef nonnull %16, ptr noundef %0)
  %18 = getelementptr inbounds [8 x double], ptr @check0_.dbtrue, i64 0, i64 %10
  %19 = call i32 @stest1_(ptr noundef nonnull %3, ptr noundef nonnull %18, ptr noundef nonnull %18, ptr noundef %0)
  %20 = getelementptr inbounds [8 x double], ptr @check0_.dc1, i64 0, i64 %10
  %21 = call i32 @stest1_(ptr noundef nonnull %4, ptr noundef nonnull %20, ptr noundef nonnull %20, ptr noundef %0)
  %22 = getelementptr inbounds [8 x double], ptr @check0_.ds1, i64 0, i64 %10
  %23 = call i32 @stest1_(ptr noundef nonnull %5, ptr noundef nonnull %22, ptr noundef nonnull %22, ptr noundef %0)
  br label %29

24:                                               ; preds = %6
  %25 = call i64 @s_wsle(ptr noundef nonnull @check0_.io___18) #3
  %26 = call i64 @do_lio(ptr noundef nonnull @c__9, ptr noundef nonnull @c__1, ptr noundef nonnull @.str.1, i64 noundef 28) #3
  %27 = call i64 @e_wsle() #3
  %28 = call i32 @s_stop(ptr noundef nonnull @.str, i64 noundef 0) #3
  br label %29

29:                                               ; preds = %9, %24
  %30 = add nuw nsw i64 %.017, 1
  %exitcond.not = icmp eq i64 %30, 9
  br i1 %exitcond.not, label %31, label %6, !llvm.loop !13

31:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i32 0
}

declare i32 @s_stop(ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare i32 @f2c_drotg(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @stest1_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @s_wsle(ptr noundef) local_unnamed_addr #2

declare i64 @do_lio(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i64 @e_wsle() local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass