; LLVM IR from ROCm/aomp :: test/smoke-fails/clang-298140/NPB_LU/sys (setparams)

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

@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [7 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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local void @write_bt_info(ptr noundef %0, i8 noundef signext %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %8 = load i8, ptr %4, align 1, !tbaa !9
  %9 = sext i8 %8 to i32
  %10 = icmp eq i32 %9, 83
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  store i32 12, ptr %5, align 4, !tbaa !10
  store ptr @.str.49, ptr %7, align 8, !tbaa !5
  store i32 60, ptr %6, align 4, !tbaa !10
  br label %52

12:                                               ; preds = %2
  %13 = load i8, ptr %4, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = icmp eq i32 %14, 87
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  store i32 24, ptr %5, align 4, !tbaa !10
  store ptr @.str.50, ptr %7, align 8, !tbaa !5
  store i32 200, ptr %6, align 4, !tbaa !10
  br label %51

17:                                               ; preds = %12
  %18 = load i8, ptr %4, align 1, !tbaa !9
  %19 = sext i8 %18 to i32
  %20 = icmp eq i32 %19, 65
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  store i32 64, ptr %5, align 4, !tbaa !10
  store ptr @.str.50, ptr %7, align 8, !tbaa !5
  store i32 200, ptr %6, align 4, !tbaa !10
  br label %50

22:                                               ; preds = %17
  %23 = load i8, ptr %4, align 1, !tbaa !9
  %24 = sext i8 %23 to i32
  %25 = icmp eq i32 %24, 66
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  store i32 102, ptr %5, align 4, !tbaa !10
  store ptr @.str.51, ptr %7, align 8, !tbaa !5
  store i32 200, ptr %6, align 4, !tbaa !10
  br label %49

27:                                               ; preds = %22
  %28 = load i8, ptr %4, align 1, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = icmp eq i32 %29, 67
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  store i32 162, ptr %5, align 4, !tbaa !10
  store ptr @.str.44, ptr %7, align 8, !tbaa !5
  store i32 200, ptr %6, align 4, !tbaa !10
  br label %48

32:                                               ; preds = %27
  %33 = load i8, ptr %4, align 1, !tbaa !9
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, 68
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  store i32 408, ptr %5, align 4, !tbaa !10
  store ptr @.str.52, ptr %7, align 8, !tbaa !5
  store i32 250, ptr %6, align 4, !tbaa !10
  br label %47

37:                                               ; preds = %32
  %38 = load i8, ptr %4, align 1, !tbaa !9
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 69
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  store i32 1020, ptr %5, align 4, !tbaa !10
  store ptr @.str.53, ptr %7, align 8, !tbaa !5
  store i32 250, ptr %6, align 4, !tbaa !10
  br label %46

42:                                               ; preds = %37
  %43 = load i8, ptr %4, align 1, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.45, i32 noundef %44)
  call void @exit(i32 noundef 1) #6
  unreachable

46:                                               ; preds = %41
  br label %47

47:                                               ; preds = %46, %36
  br label %48

48:                                               ; preds = %47, %31
  br label %49

49:                                               ; preds = %48, %26
  br label %50

50:                                               ; preds = %49, %21
  br label %51

51:                                               ; preds = %50, %16
  br label %52

52:                                               ; preds = %51, %11
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !10
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.46, i32 noundef %54) #5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !10
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.47, i32 noundef %57) #5
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.48, ptr noundef %60) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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 = { noreturn 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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}


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

@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @write_bt_info(ptr nocapture noundef %0, i8 noundef signext %1) local_unnamed_addr #2 {
  switch i8 %1, label %9 [
    i8 83, label %12
    i8 87, label %3
    i8 65, label %4
    i8 66, label %5
    i8 67, label %6
    i8 68, label %7
    i8 69, label %8
  ]

3:                                                ; preds = %2
  br label %12

4:                                                ; preds = %2
  br label %12

5:                                                ; preds = %2
  br label %12

6:                                                ; preds = %2
  br label %12

7:                                                ; preds = %2
  br label %12

8:                                                ; preds = %2
  br label %12

9:                                                ; preds = %2
  %10 = sext i8 %1 to i32
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.45, i32 noundef %10)
  tail call void @exit(i32 noundef 1) #3
  unreachable

12:                                               ; preds = %2, %3, %5, %7, %8, %6, %4
  %.014 = phi i32 [ 24, %3 ], [ 64, %4 ], [ 102, %5 ], [ 162, %6 ], [ 408, %7 ], [ 1020, %8 ], [ 12, %2 ]
  %.013 = phi i32 [ 200, %3 ], [ 200, %4 ], [ 200, %5 ], [ 200, %6 ], [ 250, %7 ], [ 250, %8 ], [ 60, %2 ]
  %.0 = phi ptr [ @.str.50, %3 ], [ @.str.50, %4 ], [ @.str.51, %5 ], [ @.str.44, %6 ], [ @.str.52, %7 ], [ @.str.53, %8 ], [ @.str.49, %2 ]
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.46, i32 noundef %.014) #4
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.47, i32 noundef %.013) #4
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.48, ptr noundef nonnull %.0) #4
  ret void
}

attributes #0 = { nofree 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 #1 = { noreturn 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 #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 = { noreturn nounwind }
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)"}


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