; LLVM IR from ROCm/aomp :: test/smoke-fails/flang-314750/NPB_FT/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.47 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [32 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_ft_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 i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  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 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %10 = load i8, ptr %4, align 1, !tbaa !9
  %11 = sext i8 %10 to i32
  %12 = icmp eq i32 %11, 83
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i32 64, ptr %5, align 4, !tbaa !10
  store i32 64, ptr %6, align 4, !tbaa !10
  store i32 64, ptr %7, align 4, !tbaa !10
  store i32 6, ptr %9, align 4, !tbaa !10
  br label %60

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

18:                                               ; preds = %14
  store i32 128, ptr %5, align 4, !tbaa !10
  store i32 128, ptr %6, align 4, !tbaa !10
  store i32 32, ptr %7, align 4, !tbaa !10
  store i32 6, ptr %9, align 4, !tbaa !10
  br label %59

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

23:                                               ; preds = %19
  store i32 256, ptr %5, align 4, !tbaa !10
  store i32 256, ptr %6, align 4, !tbaa !10
  store i32 128, ptr %7, align 4, !tbaa !10
  store i32 6, ptr %9, align 4, !tbaa !10
  br label %58

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

28:                                               ; preds = %24
  store i32 512, ptr %5, align 4, !tbaa !10
  store i32 256, ptr %6, align 4, !tbaa !10
  store i32 256, ptr %7, align 4, !tbaa !10
  store i32 20, ptr %9, align 4, !tbaa !10
  br label %57

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

33:                                               ; preds = %29
  store i32 512, ptr %5, align 4, !tbaa !10
  store i32 512, ptr %6, align 4, !tbaa !10
  store i32 512, ptr %7, align 4, !tbaa !10
  store i32 20, ptr %9, align 4, !tbaa !10
  br label %56

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

38:                                               ; preds = %34
  store i32 2048, ptr %5, align 4, !tbaa !10
  store i32 1024, ptr %6, align 4, !tbaa !10
  store i32 1024, ptr %7, align 4, !tbaa !10
  store i32 25, ptr %9, align 4, !tbaa !10
  br label %55

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

43:                                               ; preds = %39
  store i32 4096, ptr %5, align 4, !tbaa !10
  store i32 2048, ptr %6, align 4, !tbaa !10
  store i32 2048, ptr %7, align 4, !tbaa !10
  store i32 25, ptr %9, align 4, !tbaa !10
  br label %54

44:                                               ; preds = %39
  %45 = load i8, ptr %4, align 1, !tbaa !9
  %46 = sext i8 %45 to i32
  %47 = icmp eq i32 %46, 70
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  store i32 8192, ptr %5, align 4, !tbaa !10
  store i32 4096, ptr %6, align 4, !tbaa !10
  store i32 4096, ptr %7, align 4, !tbaa !10
  store i32 25, ptr %9, align 4, !tbaa !10
  br label %53

49:                                               ; preds = %44
  %50 = load i8, ptr %4, align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.69, i32 noundef %51)
  call void @exit(i32 noundef 1) #6
  unreachable

53:                                               ; preds = %48
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54, %38
  br label %56

56:                                               ; preds = %55, %33
  br label %57

57:                                               ; preds = %56, %28
  br label %58

58:                                               ; preds = %57, %23
  br label %59

59:                                               ; preds = %58, %18
  br label %60

60:                                               ; preds = %59, %13
  %61 = load i32, ptr %5, align 4, !tbaa !10
  store i32 %61, ptr %8, align 4, !tbaa !10
  %62 = load i32, ptr %6, align 4, !tbaa !10
  %63 = load i32, ptr %8, align 4, !tbaa !10
  %64 = icmp sgt i32 %62, %63
  br i1 %64, label %65, label %67

65:                                               ; preds = %60
  %66 = load i32, ptr %6, align 4, !tbaa !10
  store i32 %66, ptr %8, align 4, !tbaa !10
  br label %67

67:                                               ; preds = %65, %60
  %68 = load i32, ptr %7, align 4, !tbaa !10
  %69 = load i32, ptr %8, align 4, !tbaa !10
  %70 = icmp sgt i32 %68, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %67
  %72 = load i32, ptr %7, align 4, !tbaa !10
  store i32 %72, ptr %8, align 4, !tbaa !10
  br label %73

73:                                               ; preds = %71, %67
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.118, ptr noundef @.str.47) #5
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !10
  %78 = load i32, ptr %6, align 4, !tbaa !10
  %79 = load i32, ptr %7, align 4, !tbaa !10
  %80 = load i32, ptr %8, align 4, !tbaa !10
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.119, ptr noundef @.str.47, i32 noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %80) #5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !10
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.120, ptr noundef @.str.47, i32 noundef %83) #5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.78, ptr noundef @.str.47) #5
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i32, ptr %8, align 4, !tbaa !10
  %89 = icmp sgt i32 %88, 1024
  %90 = zext i1 %89 to i64
  %91 = select i1 %89, ptr @.str.80, ptr @.str.81
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.79, ptr noundef @.str.47, ptr noundef %91) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, 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.47 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.118 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [32 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_ft_info(ptr nocapture noundef %0, i8 noundef signext %1) local_unnamed_addr #2 {
  switch i8 %1, label %10 [
    i8 83, label %13
    i8 87, label %3
    i8 65, label %4
    i8 66, label %5
    i8 67, label %6
    i8 68, label %7
    i8 69, label %8
    i8 70, label %9
  ]

3:                                                ; preds = %2
  br label %13

4:                                                ; preds = %2
  br label %13

5:                                                ; preds = %2
  br label %13

6:                                                ; preds = %2
  br label %13

7:                                                ; preds = %2
  br label %13

8:                                                ; preds = %2
  br label %13

9:                                                ; preds = %2
  br label %13

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

13:                                               ; preds = %2, %3, %5, %7, %9, %8, %6, %4
  %.029 = phi i32 [ 128, %3 ], [ 256, %4 ], [ 512, %5 ], [ 512, %6 ], [ 2048, %7 ], [ 4096, %8 ], [ 8192, %9 ], [ 64, %2 ]
  %.028 = phi i32 [ 128, %3 ], [ 256, %4 ], [ 256, %5 ], [ 512, %6 ], [ 1024, %7 ], [ 2048, %8 ], [ 4096, %9 ], [ 64, %2 ]
  %.027 = phi i32 [ 32, %3 ], [ 128, %4 ], [ 256, %5 ], [ 512, %6 ], [ 1024, %7 ], [ 2048, %8 ], [ 4096, %9 ], [ 64, %2 ]
  %.0 = phi i32 [ 6, %3 ], [ 6, %4 ], [ 20, %5 ], [ 20, %6 ], [ 25, %7 ], [ 25, %8 ], [ 25, %9 ], [ 6, %2 ]
  %spec.select = tail call i32 @llvm.umax.i32(i32 %.028, i32 %.029)
  %.1 = tail call i32 @llvm.umax.i32(i32 %.027, i32 %spec.select)
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.118, ptr noundef nonnull @.str.47) #5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.119, ptr noundef nonnull @.str.47, i32 noundef %.029, i32 noundef %.028, i32 noundef %.027, i32 noundef %.1) #5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.120, ptr noundef nonnull @.str.47, i32 noundef %.0) #5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.78, ptr noundef nonnull @.str.47) #5
  %18 = icmp ugt i32 %.1, 1024
  %19 = select i1 %18, ptr @.str.80, ptr @.str.81
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.79, ptr noundef nonnull @.str.47, ptr noundef nonnull %19) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn nounwind }
attributes #5 = { 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass