; 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
@itest1_.io___60 = external hidden global %struct.cilist, align 8
@itest1_.io___61 = external hidden global %struct.cilist, align 8
@itest1_.io___63 = 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 @itest1_(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = load i64, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = icmp eq i64 %7, %9
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  br label %39

12:                                               ; preds = %2
  %13 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !11
  %14 = icmp ne i64 %13, 0
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  br label %21

16:                                               ; preds = %12
  store i64 0, ptr getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 5), align 8, !tbaa !11
  %17 = call i64 @s_wsfe(ptr noundef @itest1_.io___60)
  %18 = call i64 @e_wsfe()
  %19 = call i64 @s_wsfe(ptr noundef @itest1_.io___61)
  %20 = call i64 @e_wsfe()
  br label %21

21:                                               ; preds = %16, %15
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = sub nsw i64 %23, %25
  store i64 %26, ptr %5, align 8, !tbaa !9
  %27 = call i64 @s_wsfe(ptr noundef @itest1_.io___63)
  %28 = call i64 @do_fio(ptr noundef @c__1, ptr noundef @combla_, i64 noundef 8)
  %29 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 1), i64 noundef 8)
  %30 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 2), i64 noundef 8)
  %31 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 3), i64 noundef 8)
  %32 = call i64 @do_fio(ptr noundef @c__1, ptr noundef getelementptr inbounds (%struct.anon, ptr @combla_, i32 0, i32 4), i64 noundef 8)
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %33, i64 noundef 8)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %35, i64 noundef 8)
  %37 = call i64 @do_fio(ptr noundef @c__1, ptr noundef %5, i64 noundef 8)
  %38 = call i64 @e_wsfe()
  br label %39

39:                                               ; preds = %21, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret i32 0
}

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, !10, i64 40}
!12 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}


; 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
@itest1_.io___60 = external hidden global %struct.cilist, align 8
@itest1_.io___61 = external hidden global %struct.cilist, align 8
@itest1_.io___63 = 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 @itest1_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = load i64, ptr %0, align 8, !tbaa !5
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = icmp eq i64 %4, %5
  br i1 %6, label %28, label %7

7:                                                ; preds = %2
  %8 = load i64, ptr getelementptr inbounds (i8, ptr @combla_, i64 40), align 8, !tbaa !9
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %14, label %9

9:                                                ; preds = %7
  store i64 0, ptr getelementptr inbounds (i8, ptr @combla_, i64 40), align 8, !tbaa !9
  %10 = tail call i64 @s_wsfe(ptr noundef nonnull @itest1_.io___60) #3
  %11 = tail call i64 @e_wsfe() #3
  %12 = tail call i64 @s_wsfe(ptr noundef nonnull @itest1_.io___61) #3
  %13 = tail call i64 @e_wsfe() #3
  %.pre = load i64, ptr %0, align 8, !tbaa !5
  %.pre6 = load i64, ptr %1, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %7, %9
  %15 = phi i64 [ %5, %7 ], [ %.pre6, %9 ]
  %16 = phi i64 [ %4, %7 ], [ %.pre, %9 ]
  %17 = sub nsw i64 %16, %15
  store i64 %17, ptr %3, align 8, !tbaa !5
  %18 = tail call i64 @s_wsfe(ptr noundef nonnull @itest1_.io___63) #3
  %19 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull @combla_, i64 noundef 8) #3
  %20 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 8), i64 noundef 8) #3
  %21 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 16), i64 noundef 8) #3
  %22 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 24), i64 noundef 8) #3
  %23 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull getelementptr inbounds (i8, ptr @combla_, i64 32), i64 noundef 8) #3
  %24 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %0, i64 noundef 8) #3
  %25 = tail call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %1, i64 noundef 8) #3
  %26 = call i64 @do_fio(ptr noundef nonnull @c__1, ptr noundef nonnull %3, i64 noundef 8) #3
  %27 = call i64 @e_wsfe() #3
  br label %28

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

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, !6, i64 40}
!10 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass