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

; 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 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [195 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @print_results(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, double noundef %6, double noundef %7, ptr noundef %8, i32 noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18) #0 {
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca [16 x i8], align 16
  %40 = alloca i32, align 4
  store ptr %0, ptr %20, align 8, !tbaa !5
  store i8 %1, ptr %21, align 1, !tbaa !9
  store i32 %2, ptr %22, align 4, !tbaa !10
  store i32 %3, ptr %23, align 4, !tbaa !10
  store i32 %4, ptr %24, align 4, !tbaa !10
  store i32 %5, ptr %25, align 4, !tbaa !10
  store double %6, ptr %26, align 8, !tbaa !12
  store double %7, ptr %27, align 8, !tbaa !12
  store ptr %8, ptr %28, align 8, !tbaa !5
  store i32 %9, ptr %29, align 4, !tbaa !10
  store ptr %10, ptr %30, align 8, !tbaa !5
  store ptr %11, ptr %31, align 8, !tbaa !5
  store ptr %12, ptr %32, align 8, !tbaa !5
  store ptr %13, ptr %33, align 8, !tbaa !5
  store ptr %14, ptr %34, align 8, !tbaa !5
  store ptr %15, ptr %35, align 8, !tbaa !5
  store ptr %16, ptr %36, align 8, !tbaa !5
  store ptr %17, ptr %37, align 8, !tbaa !5
  store ptr %18, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #4
  %41 = load ptr, ptr %20, align 8, !tbaa !5
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %41)
  %43 = load i8, ptr %21, align 1, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %44)
  %46 = load i32, ptr %23, align 4, !tbaa !10
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %92

48:                                               ; preds = %19
  %49 = load i32, ptr %24, align 4, !tbaa !10
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %92

51:                                               ; preds = %48
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 0
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 69
  br i1 %56, label %57, label %88

57:                                               ; preds = %51
  %58 = load ptr, ptr %20, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 80
  br i1 %62, label %63, label %88

63:                                               ; preds = %57
  %64 = getelementptr inbounds [16 x i8], ptr %39, i64 0, i64 0
  %65 = load i32, ptr %22, align 4, !tbaa !10
  %66 = sitofp i32 %65 to double
  %67 = call double @pow(double noundef 2.000000e+00, double noundef %66) #4
  %68 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %64, ptr noundef @.str.2, double noundef %67) #4
  store i32 14, ptr %40, align 4, !tbaa !10
  %69 = load i32, ptr %40, align 4, !tbaa !10
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [16 x i8], ptr %39, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = sext i8 %72 to i32
  %74 = icmp eq i32 %73, 46
  br i1 %74, label %75, label %81

75:                                               ; preds = %63
  %76 = load i32, ptr %40, align 4, !tbaa !10
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [16 x i8], ptr %39, i64 0, i64 %77
  store i8 32, ptr %78, align 1, !tbaa !9
  %79 = load i32, ptr %40, align 4, !tbaa !10
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %40, align 4, !tbaa !10
  br label %81

81:                                               ; preds = %75, %63
  %82 = load i32, ptr %40, align 4, !tbaa !10
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [16 x i8], ptr %39, i64 0, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !9
  %86 = getelementptr inbounds [16 x i8], ptr %39, i64 0, i64 0
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %86)
  br label %91

88:                                               ; preds = %57, %51
  %89 = load i32, ptr %22, align 4, !tbaa !10
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %89)
  br label %91

91:                                               ; preds = %88, %81
  br label %97

92:                                               ; preds = %48, %19
  %93 = load i32, ptr %22, align 4, !tbaa !10
  %94 = load i32, ptr %23, align 4, !tbaa !10
  %95 = load i32, ptr %24, align 4, !tbaa !10
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %93, i32 noundef %94, i32 noundef %95)
  br label %97

97:                                               ; preds = %92, %91
  %98 = load i32, ptr %25, align 4, !tbaa !10
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %98)
  %100 = load double, ptr %26, align 8, !tbaa !12
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %100)
  %102 = load double, ptr %27, align 8, !tbaa !12
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, double noundef %102)
  %104 = load ptr, ptr %28, align 8, !tbaa !5
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %104)
  %106 = load i32, ptr %29, align 4, !tbaa !10
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %97
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef @.str.11)
  br label %112

110:                                              ; preds = %97
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef @.str.12)
  br label %112

112:                                              ; preds = %110, %108
  %113 = load ptr, ptr %30, align 8, !tbaa !5
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, ptr noundef %113)
  %115 = load ptr, ptr %31, align 8, !tbaa !5
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef %115)
  %117 = load ptr, ptr %32, align 8, !tbaa !5
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef %117)
  %119 = load ptr, ptr %33, align 8, !tbaa !5
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %119)
  %121 = load ptr, ptr %34, align 8, !tbaa !5
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %121)
  %123 = load ptr, ptr %35, align 8, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %123)
  %125 = load ptr, ptr %36, align 8, !tbaa !5
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, ptr noundef %125)
  %127 = load ptr, ptr %37, align 8, !tbaa !5
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, ptr noundef %127)
  %129 = load ptr, ptr %38, align 8, !tbaa !5
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %129)
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #4
  ret void
}

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

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

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 }

!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}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !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 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [195 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_results(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, double noundef %6, double noundef %7, ptr noundef %8, i32 noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18) local_unnamed_addr #0 {
  %20 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #4
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %0)
  %22 = sext i8 %1 to i32
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22)
  %24 = or i32 %4, %3
  %or.cond = icmp eq i32 %24, 0
  %.0.sroa.gep = getelementptr inbounds i8, ptr %20, i64 14
  %.0.sroa.gep29 = getelementptr inbounds i8, ptr %20, i64 15
  br i1 %or.cond, label %25, label %41

25:                                               ; preds = %19
  %26 = load i8, ptr %0, align 1, !tbaa !5
  %27 = icmp eq i8 %26, 69
  br i1 %27, label %28, label %39

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 1
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = icmp eq i8 %30, 80
  br i1 %31, label %32, label %39

32:                                               ; preds = %28
  %ldexp = tail call double @ldexp(double 1.000000e+00, i32 %2) #4
  %33 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %ldexp) #4
  %34 = load i8, ptr %.0.sroa.gep, align 2, !tbaa !5
  %35 = icmp eq i8 %34, 46
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  store i8 32, ptr %.0.sroa.gep, align 2, !tbaa !5
  br label %37

37:                                               ; preds = %36, %32
  %.0.sroa.phi = phi ptr [ %.0.sroa.gep, %36 ], [ %.0.sroa.gep29, %32 ]
  store i8 0, ptr %.0.sroa.phi, align 1, !tbaa !5
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %20)
  br label %43

39:                                               ; preds = %28, %25
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %2)
  br label %43

41:                                               ; preds = %19
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %2, i32 noundef %3, i32 noundef %4)
  br label %43

43:                                               ; preds = %37, %39, %41
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %5)
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %6)
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, double noundef %7)
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef %8)
  %.not = icmp eq i32 %9, 0
  %.str.12..str.11 = select i1 %.not, ptr @.str.12, ptr @.str.11
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull %.str.12..str.11)
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, ptr noundef %10)
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef %11)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef %12)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %13)
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef %14)
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef %15)
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef %16)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %17)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef %18)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #4
  ret void
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) local_unnamed_addr #3

attributes #0 = { nofree 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree willreturn }
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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


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