; 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.27 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [185 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [188 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [56 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: nounwind uwtable
define dso_local void @write_info(i32 noundef %0, i8 noundef signext %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %6 = call noalias ptr @fopen(ptr noundef @.str.27, ptr noundef @.str.33)
  store ptr %6, ptr %5, align 8, !tbaa !10
  %7 = load ptr, ptr %5, align 8, !tbaa !10
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %11

9:                                                ; preds = %2
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, ptr noundef @.str.27)
  call void @exit(i32 noundef 1) #6
  unreachable

11:                                               ; preds = %2
  %12 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %12, label %34 [
    i32 0, label %13
    i32 1, label %13
    i32 4, label %13
    i32 3, label %13
    i32 2, label %13
    i32 6, label %13
    i32 7, label %13
    i32 8, label %13
    i32 5, label %20
    i32 9, label %27
  ]

13:                                               ; preds = %11, %11, %11, %11, %11, %11, %11, %11
  %14 = load ptr, ptr %5, align 8, !tbaa !10
  %15 = load i8, ptr %4, align 1, !tbaa !9
  %16 = sext i8 %15 to i32
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef @.str.29, i32 noundef %16) #5
  %18 = load ptr, ptr %5, align 8, !tbaa !10
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.35) #5
  br label %37

20:                                               ; preds = %11
  %21 = load ptr, ptr %5, align 8, !tbaa !10
  %22 = load i8, ptr %4, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.31, i32 noundef %23) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !10
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.36) #5
  br label %37

27:                                               ; preds = %11
  %28 = load ptr, ptr %5, align 8, !tbaa !10
  %29 = load i8, ptr %4, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.31, i32 noundef %30) #5
  %32 = load ptr, ptr %5, align 8, !tbaa !10
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.37) #5
  br label %37

34:                                               ; preds = %11
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, i32 noundef %35)
  call void @exit(i32 noundef 1) #6
  unreachable

37:                                               ; preds = %27, %20, %13
  %38 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %38, label %69 [
    i32 0, label %39
    i32 1, label %42
    i32 9, label %45
    i32 2, label %48
    i32 3, label %51
    i32 5, label %54
    i32 4, label %57
    i32 6, label %60
    i32 7, label %63
    i32 8, label %66
  ]

39:                                               ; preds = %37
  %40 = load ptr, ptr %5, align 8, !tbaa !10
  %41 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_sp_info(ptr noundef %40, i8 noundef signext %41)
  br label %72

42:                                               ; preds = %37
  %43 = load ptr, ptr %5, align 8, !tbaa !10
  %44 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_bt_info(ptr noundef %43, i8 noundef signext %44)
  br label %72

45:                                               ; preds = %37
  %46 = load ptr, ptr %5, align 8, !tbaa !10
  %47 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_dc_info(ptr noundef %46, i8 noundef signext %47)
  br label %72

48:                                               ; preds = %37
  %49 = load ptr, ptr %5, align 8, !tbaa !10
  %50 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_lu_info(ptr noundef %49, i8 noundef signext %50)
  br label %72

51:                                               ; preds = %37
  %52 = load ptr, ptr %5, align 8, !tbaa !10
  %53 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_mg_info(ptr noundef %52, i8 noundef signext %53)
  br label %72

54:                                               ; preds = %37
  %55 = load ptr, ptr %5, align 8, !tbaa !10
  %56 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_is_info(ptr noundef %55, i8 noundef signext %56)
  br label %72

57:                                               ; preds = %37
  %58 = load ptr, ptr %5, align 8, !tbaa !10
  %59 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_ft_info(ptr noundef %58, i8 noundef signext %59)
  br label %72

60:                                               ; preds = %37
  %61 = load ptr, ptr %5, align 8, !tbaa !10
  %62 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_ep_info(ptr noundef %61, i8 noundef signext %62)
  br label %72

63:                                               ; preds = %37
  %64 = load ptr, ptr %5, align 8, !tbaa !10
  %65 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_cg_info(ptr noundef %64, i8 noundef signext %65)
  br label %72

66:                                               ; preds = %37
  %67 = load ptr, ptr %5, align 8, !tbaa !10
  %68 = load i8, ptr %4, align 1, !tbaa !9
  call void @write_ua_info(ptr noundef %67, i8 noundef signext %68)
  br label %72

69:                                               ; preds = %37
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, i32 noundef %70)
  call void @exit(i32 noundef 1) #6
  unreachable

72:                                               ; preds = %66, %63, %60, %57, %54, %51, %48, %45, %42, %39
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = load ptr, ptr %5, align 8, !tbaa !10
  call void @write_convertdouble_info(i32 noundef %73, ptr noundef %74)
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !10
  call void @write_compiler_info(i32 noundef %75, ptr noundef %76)
  %77 = load ptr, ptr %5, align 8, !tbaa !10
  %78 = call i32 @fclose(ptr noundef %77)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare i32 @fclose(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @write_sp_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_bt_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_dc_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_lu_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_mg_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_is_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_ft_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_ep_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_cg_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_ua_info(ptr noundef, i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_convertdouble_info(i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @write_compiler_info(i32 noundef, ptr noundef) #3

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 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 #4 = { 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 #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 = !{!"int", !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 = !{!"any pointer", !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.27 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [185 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [188 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [56 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: nounwind uwtable
define dso_local void @write_info(i32 noundef %0, i8 noundef signext %1) local_unnamed_addr #2 {
  %3 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.33)
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %7

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, ptr noundef nonnull @.str.27)
  tail call void @exit(i32 noundef 1) #3
  unreachable

7:                                                ; preds = %2
  switch i32 %0, label %14 [
    i32 0, label %16
    i32 1, label %16
    i32 4, label %16
    i32 3, label %16
    i32 2, label %16
    i32 6, label %16
    i32 7, label %16
    i32 8, label %16
    i32 5, label %.thread38
    i32 9, label %.thread
  ]

.thread38:                                        ; preds = %7
  %8 = sext i8 %1 to i32
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.31, i32 noundef %8) #4
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.36) #4
  br label %24

.thread:                                          ; preds = %7
  %11 = sext i8 %1 to i32
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.31, i32 noundef %11) #4
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.37) #4
  tail call void @write_dc_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

14:                                               ; preds = %7
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38, i32 noundef %0)
  tail call void @exit(i32 noundef 1) #3
  unreachable

16:                                               ; preds = %7, %7, %7, %7, %7, %7, %7, %7
  %17 = sext i8 %1 to i32
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.29, i32 noundef %17) #4
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.35) #4
  switch i32 %0, label %default.unreachable [
    i32 0, label %20
    i32 1, label %21
    i32 8, label %28
    i32 2, label %22
    i32 3, label %23
    i32 5, label %24
    i32 4, label %25
    i32 6, label %26
    i32 7, label %27
  ]

20:                                               ; preds = %16
  tail call void @write_sp_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

21:                                               ; preds = %16
  tail call void @write_bt_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

22:                                               ; preds = %16
  tail call void @write_lu_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

23:                                               ; preds = %16
  tail call void @write_mg_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

24:                                               ; preds = %.thread38, %16
  tail call void @write_is_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

25:                                               ; preds = %16
  tail call void @write_ft_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

26:                                               ; preds = %16
  tail call void @write_ep_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

27:                                               ; preds = %16
  tail call void @write_cg_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

28:                                               ; preds = %16
  tail call void @write_ua_info(ptr noundef nonnull %3, i8 noundef signext %1)
  br label %29

default.unreachable:                              ; preds = %16
  unreachable

29:                                               ; preds = %28, %27, %26, %25, %24, %23, %22, %.thread, %21, %20
  tail call void @write_convertdouble_info(i32 noundef %0, ptr noundef nonnull %3)
  tail call void @write_compiler_info(i32 noundef %0, ptr noundef nonnull %3)
  %30 = tail call i32 @fclose(ptr noundef nonnull %3)
  ret void
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @write_sp_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_bt_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_dc_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_lu_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_mg_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_is_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_ft_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_ep_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_cg_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_ua_info(ptr noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_convertdouble_info(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @write_compiler_info(i32 noundef, ptr noundef) local_unnamed_addr #2

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: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass