; 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.47 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.111 = 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

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 %54

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 %53

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 %52

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 %51

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 %50

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 %49

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 %48

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

48:                                               ; preds = %43
  br label %49

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

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

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

52:                                               ; preds = %51, %23
  br label %53

53:                                               ; preds = %52, %18
  br label %54

54:                                               ; preds = %53, %13
  %55 = load i32, ptr %5, align 4, !tbaa !10
  store i32 %55, ptr %8, align 4, !tbaa !10
  %56 = load i32, ptr %6, align 4, !tbaa !10
  %57 = load i32, ptr %8, align 4, !tbaa !10
  %58 = icmp sgt i32 %56, %57
  br i1 %58, label %59, label %61

59:                                               ; preds = %54
  %60 = load i32, ptr %6, align 4, !tbaa !10
  store i32 %60, ptr %8, align 4, !tbaa !10
  br label %61

61:                                               ; preds = %59, %54
  %62 = load i32, ptr %7, 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 = %61
  %66 = load i32, ptr %7, align 4, !tbaa !10
  store i32 %66, ptr %8, align 4, !tbaa !10
  br label %67

67:                                               ; preds = %65, %61
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !10
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.104, i32 noundef %69) #5
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !10
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.105, i32 noundef %72) #5
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load i32, ptr %7, align 4, !tbaa !10
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.106, i32 noundef %75) #5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = load i32, ptr %8, align 4, !tbaa !10
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.107, i32 noundef %78) #5
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !10
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.47, i32 noundef %81) #5
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load i32, ptr %5, align 4, !tbaa !10
  %85 = add nsw i32 %84, 1
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.108, i32 noundef %85) #5
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !10
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.109, i32 noundef %88) #5
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = load i32, ptr %5, align 4, !tbaa !10
  %92 = sext i32 %91 to i64
  %93 = load i32, ptr %6, align 4, !tbaa !10
  %94 = sext i32 %93 to i64
  %95 = mul i64 %92, %94
  %96 = load i32, ptr %7, align 4, !tbaa !10
  %97 = sext i32 %96 to i64
  %98 = mul i64 %95, %97
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.110, i64 noundef %98) #5
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load i32, ptr %5, align 4, !tbaa !10
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr %6, align 4, !tbaa !10
  %105 = sext i32 %104 to i64
  %106 = mul i64 %103, %105
  %107 = load i32, ptr %7, align 4, !tbaa !10
  %108 = sext i32 %107 to i64
  %109 = mul i64 %106, %108
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.111, i64 noundef %109) #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 [27 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [29 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 %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.66, i32 noundef %10)
  tail call void @exit(i32 noundef 1) #4
  unreachable

12:                                               ; preds = %2, %3, %5, %7, %8, %6, %4
  %.039 = phi i32 [ 128, %3 ], [ 256, %4 ], [ 512, %5 ], [ 512, %6 ], [ 2048, %7 ], [ 4096, %8 ], [ 64, %2 ]
  %.038 = phi i32 [ 128, %3 ], [ 256, %4 ], [ 256, %5 ], [ 512, %6 ], [ 1024, %7 ], [ 2048, %8 ], [ 64, %2 ]
  %.037 = phi i32 [ 32, %3 ], [ 128, %4 ], [ 256, %5 ], [ 512, %6 ], [ 1024, %7 ], [ 2048, %8 ], [ 64, %2 ]
  %.0 = phi i32 [ 6, %3 ], [ 6, %4 ], [ 20, %5 ], [ 20, %6 ], [ 25, %7 ], [ 25, %8 ], [ 6, %2 ]
  %spec.select = tail call i32 @llvm.umax.i32(i32 %.038, i32 %.039)
  %.1 = tail call i32 @llvm.umax.i32(i32 %.037, i32 %spec.select)
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.104, i32 noundef %.039) #5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.105, i32 noundef %.038) #5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.106, i32 noundef %.037) #5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.107, i32 noundef %.1) #5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.47, i32 noundef %.0) #5
  %18 = or disjoint i32 %.039, 1
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.108, i32 noundef %18) #5
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.109, i32 noundef %.038) #5
  %narrow = mul nuw nsw i32 %.038, %.039
  %21 = zext nneg i32 %narrow to i64
  %22 = zext nneg i32 %.037 to i64
  %23 = mul nuw nsw i64 %21, %22
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.110, i64 noundef %23) #5
  %narrow41 = mul nuw nsw i32 %18, %.038
  %25 = zext nneg i32 %narrow41 to i64
  %26 = mul nuw nsw i64 %25, %22
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.111, i64 noundef %26) #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,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass