; LLVM IR from ROCm/aomp :: test/LLNL/openmp5.0-tests (test_noncontiguous_update)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z2bcPiii(ptr noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10bc_offloadPiii(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5checkPiii(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10printarrayPii(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 9, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %11 = call noalias noundef nonnull ptr @_Znam(i64 noundef 484) #7
  store ptr %11, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %37, %2
  %13 = load i32, ptr %8, align 4, !tbaa !5
  %14 = icmp sle i32 %13, 9
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %40

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %33, %16
  %18 = load i32, ptr %10, align 4, !tbaa !5
  %19 = icmp sle i32 %18, 9
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %36

21:                                               ; preds = %17
  %22 = load i32, ptr %8, align 4, !tbaa !5
  %23 = mul nsw i32 %22, 10
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %25 = add nsw i32 %23, %24
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = mul nsw i32 11, %28
  %30 = add nsw i32 %27, %29
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %26, i64 %31
  store i32 %25, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %21
  %34 = load i32, ptr %10, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %10, align 4, !tbaa !5
  br label %17, !llvm.loop !11

36:                                               ; preds = %20
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %8, align 4, !tbaa !5
  br label %12, !llvm.loop !13

40:                                               ; preds = %15
  %41 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z10printarrayPii(ptr noundef %41, i32 noundef 9)
  %42 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z2bcPiii(ptr noundef %42, i32 noundef 9, i32 noundef -1)
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z10printarrayPii(ptr noundef %43, i32 noundef 9)
  %44 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z10bc_offloadPiii(ptr noundef %44, i32 noundef 9, i32 noundef -2)
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = call noundef i32 @_Z5checkPiii(ptr noundef %45, i32 noundef 9, i32 noundef -2)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %40
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z10printarrayPii(ptr noundef %50, i32 noundef 9)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %53

51:                                               ; preds = %40
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %53

53:                                               ; preds = %51, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %54 = load i32, ptr %3, align 4
  ret i32 %54
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

attributes #0 = { mustprogress 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 = { mustprogress 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 = { inlinehint mustprogress 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 = { mustprogress norecurse 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 = { nobuiltin allocsize(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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z2bcPiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10bc_offloadPiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5checkPiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10printarrayPii(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #3 {
.preheader:
  %2 = tail call noalias noundef nonnull dereferenceable(484) ptr @_Znam(i64 noundef 484) #5
  %3 = getelementptr inbounds i8, ptr %2, i64 48
  %4 = getelementptr inbounds i8, ptr %2, i64 92
  %5 = getelementptr inbounds i8, ptr %2, i64 136
  %6 = getelementptr inbounds i8, ptr %2, i64 180
  %7 = getelementptr inbounds i8, ptr %2, i64 224
  %8 = getelementptr inbounds i8, ptr %2, i64 268
  %9 = getelementptr inbounds i8, ptr %2, i64 312
  %10 = getelementptr inbounds i8, ptr %2, i64 356
  %11 = getelementptr inbounds i8, ptr %2, i64 400
  store <4 x i32> <i32 11, i32 21, i32 31, i32 41>, ptr %3, align 4, !tbaa !5
  store <4 x i32> <i32 12, i32 22, i32 32, i32 42>, ptr %4, align 4, !tbaa !5
  store <4 x i32> <i32 13, i32 23, i32 33, i32 43>, ptr %5, align 4, !tbaa !5
  store <4 x i32> <i32 14, i32 24, i32 34, i32 44>, ptr %6, align 4, !tbaa !5
  store <4 x i32> <i32 15, i32 25, i32 35, i32 45>, ptr %7, align 4, !tbaa !5
  store <4 x i32> <i32 16, i32 26, i32 36, i32 46>, ptr %8, align 4, !tbaa !5
  store <4 x i32> <i32 17, i32 27, i32 37, i32 47>, ptr %9, align 4, !tbaa !5
  store <4 x i32> <i32 18, i32 28, i32 38, i32 48>, ptr %10, align 4, !tbaa !5
  store <4 x i32> <i32 19, i32 29, i32 39, i32 49>, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %2, i64 64
  %13 = getelementptr inbounds i8, ptr %2, i64 108
  %14 = getelementptr inbounds i8, ptr %2, i64 152
  %15 = getelementptr inbounds i8, ptr %2, i64 196
  %16 = getelementptr inbounds i8, ptr %2, i64 240
  %17 = getelementptr inbounds i8, ptr %2, i64 284
  %18 = getelementptr inbounds i8, ptr %2, i64 328
  %19 = getelementptr inbounds i8, ptr %2, i64 372
  %20 = getelementptr inbounds i8, ptr %2, i64 416
  store <4 x i32> <i32 51, i32 61, i32 71, i32 81>, ptr %12, align 4, !tbaa !5
  store <4 x i32> <i32 52, i32 62, i32 72, i32 82>, ptr %13, align 4, !tbaa !5
  store <4 x i32> <i32 53, i32 63, i32 73, i32 83>, ptr %14, align 4, !tbaa !5
  store <4 x i32> <i32 54, i32 64, i32 74, i32 84>, ptr %15, align 4, !tbaa !5
  store <4 x i32> <i32 55, i32 65, i32 75, i32 85>, ptr %16, align 4, !tbaa !5
  store <4 x i32> <i32 56, i32 66, i32 76, i32 86>, ptr %17, align 4, !tbaa !5
  store <4 x i32> <i32 57, i32 67, i32 77, i32 87>, ptr %18, align 4, !tbaa !5
  store <4 x i32> <i32 58, i32 68, i32 78, i32 88>, ptr %19, align 4, !tbaa !5
  store <4 x i32> <i32 59, i32 69, i32 79, i32 89>, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %2, i64 80
  store i32 91, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %2, i64 124
  store i32 92, ptr %22, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %2, i64 168
  store i32 93, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %2, i64 212
  store i32 94, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %2, i64 256
  store i32 95, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %2, i64 300
  store i32 96, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %2, i64 344
  store i32 97, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %2, i64 388
  store i32 98, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %2, i64 432
  store i32 99, ptr %29, align 4, !tbaa !5
  tail call void @_Z10printarrayPii(ptr noundef nonnull %2, i32 noundef 9)
  tail call void @_Z2bcPiii(ptr noundef nonnull %2, i32 noundef 9, i32 noundef -1)
  tail call void @_Z10printarrayPii(ptr noundef nonnull %2, i32 noundef 9)
  tail call void @_Z10bc_offloadPiii(ptr noundef nonnull %2, i32 noundef 9, i32 noundef -2)
  %30 = tail call noundef i32 @_Z5checkPiii(ptr noundef nonnull %2, i32 noundef 9, i32 noundef -2)
  %.not = icmp eq i32 %30, 0
  br i1 %.not, label %33, label %31

31:                                               ; preds = %.preheader
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  tail call void @_Z10printarrayPii(ptr noundef nonnull %2, i32 noundef 9)
  br label %35

33:                                               ; preds = %.preheader
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br label %35

35:                                               ; preds = %33, %31
  %.016 = phi i32 [ 1, %31 ], [ 0, %33 ]
  ret i32 %.016
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress 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 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 #2 = { inlinehint mustprogress 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 = { mustprogress norecurse 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 = { nobuiltin allocsize(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 = { builtin allocsize(0) }

!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++ TBAA"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass