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

; 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___51 = external hidden global %struct.cilist, align 8
@stest_.io___52 = external hidden global %struct.cilist, align 8
@stest_.io___53 = 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 float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca i64, align 8
  %18 = alloca float, align 4
  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 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds float, 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 float, 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 float, 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 = %121, %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 %124

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

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

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

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

61:                                               ; preds = %52
  %62 = load float, ptr %13, align 4, !tbaa !11
  br label %66

63:                                               ; preds = %52
  %64 = load float, ptr %13, align 4, !tbaa !11
  %65 = fneg float %64
  br label %66

66:                                               ; preds = %63, %61
  %67 = phi float [ %62, %61 ], [ %65, %63 ]
  %68 = fpext float %67 to double
  %69 = fadd double %54, %68
  %70 = fptrunc double %69 to float
  store float %70, ptr %15, align 4, !tbaa !11
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = load i64, ptr %17, align 8, !tbaa !9
  %73 = getelementptr inbounds float, ptr %71, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !11
  store float %74, ptr %14, align 4, !tbaa !11
  %75 = load float, ptr %14, align 4, !tbaa !11
  %76 = fcmp oge float %75, 0.000000e+00
  br i1 %76, label %77, label %79

77:                                               ; preds = %66
  %78 = load float, ptr %14, align 4, !tbaa !11
  br label %82

79:                                               ; preds = %66
  %80 = load float, ptr %14, align 4, !tbaa !11
  %81 = fneg float %80
  br label %82

82:                                               ; preds = %79, %77
  %83 = phi float [ %78, %77 ], [ %81, %79 ]
  %84 = fpext float %83 to double
  %85 = fptrunc double %84 to float
  store float %85, ptr %16, align 4, !tbaa !11
  %86 = call double @sdiff_(ptr noundef %15, ptr noundef %16)
  %87 = fcmp oeq double %86, 0.000000e+00
  br i1 %87, label %88, label %89

88:                                               ; preds = %82
  br label %120

89:                                               ; preds = %82
  %90 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !13
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  br label %98

93:                                               ; preds = %89
  store i64 0, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !13
  %94 = call i64 @s_wsfe(ptr noundef @stest_.io___51)
  %95 = call i64 @e_wsfe()
  %96 = call i64 @s_wsfe(ptr noundef @stest_.io___52)
  %97 = call i64 @e_wsfe()
  br label %98

98:                                               ; preds = %93, %92
  %99 = call i64 @s_wsfe(ptr noundef @stest_.io___53)
  %100 = call i64 @do_fio(ptr noundef @c__1, ptr noundef @combla_, i64 noundef 8)
  %101 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 1), i64 noundef 8)
  %102 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 2), i64 noundef 8)
  %103 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 3), i64 noundef 8)
  %104 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 4), i64 noundef 8)
  %105 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %17, i64 noundef 8)
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = load i64, ptr %17, align 8, !tbaa !9
  %108 = getelementptr inbounds float, ptr %106, i64 %107
  %109 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %108, i64 noundef 4)
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = load i64, ptr %17, align 8, !tbaa !9
  %112 = getelementptr inbounds float, ptr %110, i64 %111
  %113 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %112, i64 noundef 4)
  %114 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %18, i64 noundef 4)
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i64, ptr %17, align 8, !tbaa !9
  %117 = getelementptr inbounds float, ptr %115, i64 %116
  %118 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %117, i64 noundef 4)
  %119 = call i64 @e_wsfe()
  br label %120

120:                                              ; preds = %98, %88
  br label %121

121:                                              ; preds = %120
  %122 = load i64, ptr %17, align 8, !tbaa !9
  %123 = add nsw i64 %122, 1
  store i64 %123, ptr %17, align 8, !tbaa !9
  br label %27, !llvm.loop !15

124:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"float", !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___51 = external hidden global %struct.cilist, align 8
@stest_.io___52 = external hidden global %struct.cilist, align 8
@stest_.io___53 = 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 float, align 4
  %7 = alloca float, align 4
  %8 = alloca i64, align 8
  %9 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  %10 = getelementptr inbounds i8, ptr %3, i64 -4
  %11 = getelementptr inbounds i8, ptr %2, i64 -4
  %12 = getelementptr inbounds i8, ptr %1, i64 -4
  %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 float, ptr %12, i64 %storemerge23
  %15 = load float, ptr %14, align 4, !tbaa !9
  %16 = getelementptr inbounds float, ptr %11, i64 %storemerge23
  %17 = load float, ptr %16, align 4, !tbaa !9
  %18 = fsub float %15, %17
  store float %18, ptr %9, align 4, !tbaa !9
  %19 = getelementptr inbounds float, ptr %10, i64 %storemerge23
  %20 = load float, ptr %19, align 4, !tbaa !9
  %21 = load float, ptr %4, align 4, !tbaa !9
  %22 = fmul float %18, %21
  %23 = insertelement <2 x float> poison, float %20, i64 0
  %24 = insertelement <2 x float> %23, float %22, i64 1
  %25 = fcmp oge <2 x float> %24, zeroinitializer
  %26 = fneg <2 x float> %24
  %27 = select <2 x i1> %25, <2 x float> %24, <2 x float> %26
  %28 = extractelement <2 x float> %27, i64 0
  %shift = shufflevector <2 x float> %27, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %29 = fadd <2 x float> %27, %shift
  %30 = extractelement <2 x float> %29, i64 0
  store float %30, ptr %6, align 4, !tbaa !9
  store float %28, ptr %7, align 4, !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___51) #3
  %37 = call i64 @e_wsfe() #3
  %38 = call i64 @s_wsfe(ptr noundef nonnull @stest_.io___52) #3
  %39 = call i64 @e_wsfe() #3
  br label %40

40:                                               ; preds = %33, %35
  %41 = call i64 @s_wsfe(ptr noundef nonnull @stest_.io___53) #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 float, ptr %12, i64 %48
  %50 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %49, i64 noundef 4) #3
  %51 = load i64, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds float, ptr %11, i64 %51
  %53 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %52, i64 noundef 4) #3
  %54 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %9, i64 noundef 4) #3
  %55 = load i64, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds float, ptr %10, i64 %55
  %57 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %56, i64 noundef 4) #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 4, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"float", !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