; LLVM IR from ROCm/aomp :: test/hip-openmp/aomp_hip_launch_test (test_omp)

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

@A = external dso_local global [100 x i32], align 16
@B = external dso_local global [100 x i32], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %17, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 100
  br i1 %7, label %9, label %8

8:                                                ; preds = %5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %20

9:                                                ; preds = %5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %11
  store i32 0, ptr %12, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %15
  store i32 %13, ptr %16, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %9
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %2, align 4, !tbaa !5
  br label %5, !llvm.loop !9

20:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %33, %20
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 100
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %36

25:                                               ; preds = %21
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  br label %33

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

36:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %54, %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = icmp slt i32 %38, 100
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %57

41:                                               ; preds = %37
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %45, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  br label %53

52:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 18, ptr noundef @__PRETTY_FUNCTION__.main) #5
  unreachable

53:                                               ; preds = %51
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %4, align 4, !tbaa !5
  br label %37, !llvm.loop !12

57:                                               ; preds = %40
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  ret i32 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

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 = { 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 = { "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 }
attributes #5 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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

@A = external dso_local local_unnamed_addr global [100 x i32], align 16
@B = external dso_local local_unnamed_addr global [100 x i32], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
vector.ph:
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr @B, align 16, !tbaa !5
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr getelementptr inbounds (i8, ptr @B, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, ptr getelementptr inbounds (i8, ptr @B, i64 32), align 16, !tbaa !5
  store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, ptr getelementptr inbounds (i8, ptr @B, i64 48), align 16, !tbaa !5
  store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, ptr getelementptr inbounds (i8, ptr @B, i64 64), align 16, !tbaa !5
  store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, ptr getelementptr inbounds (i8, ptr @B, i64 80), align 16, !tbaa !5
  store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, ptr getelementptr inbounds (i8, ptr @B, i64 96), align 16, !tbaa !5
  store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, ptr getelementptr inbounds (i8, ptr @B, i64 112), align 16, !tbaa !5
  store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, ptr getelementptr inbounds (i8, ptr @B, i64 128), align 16, !tbaa !5
  store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, ptr getelementptr inbounds (i8, ptr @B, i64 144), align 16, !tbaa !5
  store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, ptr getelementptr inbounds (i8, ptr @B, i64 160), align 16, !tbaa !5
  store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, ptr getelementptr inbounds (i8, ptr @B, i64 176), align 16, !tbaa !5
  store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, ptr getelementptr inbounds (i8, ptr @B, i64 192), align 16, !tbaa !5
  store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, ptr getelementptr inbounds (i8, ptr @B, i64 208), align 16, !tbaa !5
  store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, ptr getelementptr inbounds (i8, ptr @B, i64 224), align 16, !tbaa !5
  store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, ptr getelementptr inbounds (i8, ptr @B, i64 240), align 16, !tbaa !5
  store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, ptr getelementptr inbounds (i8, ptr @B, i64 256), align 16, !tbaa !5
  store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, ptr getelementptr inbounds (i8, ptr @B, i64 272), align 16, !tbaa !5
  store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, ptr getelementptr inbounds (i8, ptr @B, i64 288), align 16, !tbaa !5
  store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, ptr getelementptr inbounds (i8, ptr @B, i64 304), align 16, !tbaa !5
  store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, ptr getelementptr inbounds (i8, ptr @B, i64 320), align 16, !tbaa !5
  store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, ptr getelementptr inbounds (i8, ptr @B, i64 336), align 16, !tbaa !5
  store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, ptr getelementptr inbounds (i8, ptr @B, i64 352), align 16, !tbaa !5
  store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, ptr getelementptr inbounds (i8, ptr @B, i64 368), align 16, !tbaa !5
  store i32 96, ptr getelementptr inbounds (i8, ptr @B, i64 384), align 16, !tbaa !5
  store i32 97, ptr getelementptr inbounds (i8, ptr @B, i64 388), align 4, !tbaa !5
  store i32 98, ptr getelementptr inbounds (i8, ptr @B, i64 392), align 8, !tbaa !5
  store i32 99, ptr getelementptr inbounds (i8, ptr @B, i64 396), align 4, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @A, ptr noundef nonnull align 16 dereferenceable(400) @B, i64 400, i1 false), !tbaa !5
  br label %.preheader

.preheader.1:                                     ; preds = %.preheader
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %0 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %indvars.iv.next24
  %1 = load i32, ptr %0, align 4, !tbaa !5
  %2 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %indvars.iv.next24
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = icmp eq i32 %1, %3
  br i1 %4, label %.preheader.2, label %28

.preheader.2:                                     ; preds = %.preheader.1
  %indvars.iv.next24.1 = add nuw nsw i64 %indvars.iv23, 2
  %5 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %indvars.iv.next24.1
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %indvars.iv.next24.1
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp eq i32 %6, %8
  br i1 %9, label %.preheader.3, label %28

.preheader.3:                                     ; preds = %.preheader.2
  %indvars.iv.next24.2 = add nuw nsw i64 %indvars.iv23, 3
  %10 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %indvars.iv.next24.2
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %indvars.iv.next24.2
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp eq i32 %11, %13
  br i1 %14, label %.preheader.4, label %28

.preheader.4:                                     ; preds = %.preheader.3
  %indvars.iv.next24.3 = add nuw nsw i64 %indvars.iv23, 4
  %15 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %indvars.iv.next24.3
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %indvars.iv.next24.3
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp eq i32 %16, %18
  br i1 %19, label %20, label %28

20:                                               ; preds = %.preheader.4
  %indvars.iv.next24.4 = add nuw nsw i64 %indvars.iv23, 5
  %exitcond26.not.4 = icmp eq i64 %indvars.iv.next24.4, 100
  br i1 %exitcond26.not.4, label %21, label %.preheader, !llvm.loop !9

21:                                               ; preds = %20
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  ret i32 0

.preheader:                                       ; preds = %20, %vector.ph
  %indvars.iv23 = phi i64 [ 0, %vector.ph ], [ %indvars.iv.next24.4, %20 ]
  %23 = getelementptr inbounds [100 x i32], ptr @A, i64 0, i64 %indvars.iv23
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = getelementptr inbounds [100 x i32], ptr @B, i64 0, i64 %indvars.iv23
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp eq i32 %24, %26
  br i1 %27, label %.preheader.1, label %28

28:                                               ; preds = %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 18, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #4
  unreachable
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass