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

; 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 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [300 x double], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = 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) #4
  store i32 300, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2400, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %12

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

15:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %29

16:                                               ; preds = %12
  %17 = load i32, ptr %8, align 4, !tbaa !5
  %18 = load i32, ptr %8, align 4, !tbaa !5
  %19 = mul nsw i32 %17, %18
  %20 = load i32, ptr %8, align 4, !tbaa !5
  %21 = add nsw i32 %19, %20
  %22 = sitofp i32 %21 to double
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [300 x double], ptr %7, i64 0, i64 %24
  store double %22, ptr %25, align 8, !tbaa !11
  br label %26

26:                                               ; preds = %16
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %8, align 4, !tbaa !5
  br label %12, !llvm.loop !13

29:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %48, %29
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 300
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %51

34:                                               ; preds = %30
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [300 x double], ptr %7, i64 0, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !11
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = load i32, ptr %10, align 4, !tbaa !5
  %41 = mul nsw i32 %39, %40
  %42 = sitofp i32 %41 to double
  %43 = fsub double %38, %42
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = sitofp i32 %44 to double
  %46 = fadd double %45, %43
  %47 = fptosi double %46 to i32
  store i32 %47, ptr %9, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %34
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %10, align 4, !tbaa !5
  br label %30, !llvm.loop !15

51:                                               ; preds = %33
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 44850
  br i1 %53, label %54, label %62

54:                                               ; preds = %51
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %56, i32 noundef %57)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef @.str.2)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %59, i32 noundef 44850)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.3)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %64

62:                                               ; preds = %51
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %64

64:                                               ; preds = %62, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 2400, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %65 = load i32, ptr %3, align 4
  ret i32 %65
}

; 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: 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) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1

; 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 #0 {
  %3 = alloca [300 x double], align 16
  call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %3) #4
  br label %4

4:                                                ; preds = %4, %2
  %indvars.iv = phi i64 [ 0, %2 ], [ %indvars.iv.next.4, %4 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %5 = mul nuw nsw i64 %indvars.iv.next, %indvars.iv
  %6 = trunc nuw i64 %5 to i32
  %7 = uitofp nneg i32 %6 to double
  %8 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv
  store double %7, ptr %8, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %9 = mul nuw nsw i64 %indvars.iv.next.1, %indvars.iv.next
  %10 = trunc nuw i64 %9 to i32
  %11 = uitofp nneg i32 %10 to double
  %12 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next
  store double %11, ptr %12, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %13 = mul nuw nsw i64 %indvars.iv.next.2, %indvars.iv.next.1
  %14 = trunc nuw i64 %13 to i32
  %15 = uitofp nneg i32 %14 to double
  %16 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next.1
  store double %15, ptr %16, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %17 = mul nuw nsw i64 %indvars.iv.next.3, %indvars.iv.next.2
  %18 = trunc nuw i64 %17 to i32
  %19 = uitofp nneg i32 %18 to double
  %20 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next.2
  store double %19, ptr %20, align 8, !tbaa !5
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
  %21 = mul nuw nsw i64 %indvars.iv.next.4, %indvars.iv.next.3
  %22 = trunc nuw i64 %21 to i32
  %23 = uitofp nneg i32 %22 to double
  %24 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next.3
  store double %23, ptr %24, align 8, !tbaa !5
  %exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 300
  br i1 %exitcond.not.4, label %.preheader, label %4, !llvm.loop !9

25:                                               ; preds = %.preheader
  %.not = icmp eq i32 %52, 44850
  br i1 %.not, label %60, label %53

.preheader:                                       ; preds = %4, %.preheader
  %indvars.iv23 = phi i64 [ %indvars.iv.next24.2, %.preheader ], [ 0, %4 ]
  %.01520 = phi i32 [ %52, %.preheader ], [ 0, %4 ]
  %26 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv23
  %27 = load double, ptr %26, align 8, !tbaa !5
  %28 = mul nuw nsw i64 %indvars.iv23, %indvars.iv23
  %29 = trunc nuw i64 %28 to i32
  %30 = uitofp nneg i32 %29 to double
  %31 = fsub double %27, %30
  %32 = sitofp i32 %.01520 to double
  %33 = fadd double %31, %32
  %34 = fptosi double %33 to i32
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %35 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next24
  %36 = load double, ptr %35, align 8, !tbaa !5
  %37 = mul nuw nsw i64 %indvars.iv.next24, %indvars.iv.next24
  %38 = trunc nuw i64 %37 to i32
  %39 = uitofp nneg i32 %38 to double
  %40 = fsub double %36, %39
  %41 = sitofp i32 %34 to double
  %42 = fadd double %40, %41
  %43 = fptosi double %42 to i32
  %indvars.iv.next24.1 = add nuw nsw i64 %indvars.iv23, 2
  %44 = getelementptr inbounds [300 x double], ptr %3, i64 0, i64 %indvars.iv.next24.1
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = mul nuw nsw i64 %indvars.iv.next24.1, %indvars.iv.next24.1
  %47 = trunc nuw i64 %46 to i32
  %48 = uitofp nneg i32 %47 to double
  %49 = fsub double %45, %48
  %50 = sitofp i32 %43 to double
  %51 = fadd double %49, %50
  %52 = fptosi double %51 to i32
  %indvars.iv.next24.2 = add nuw nsw i64 %indvars.iv23, 3
  %exitcond26.not.2 = icmp eq i64 %indvars.iv.next24.2, 300
  br i1 %exitcond26.not.2, label %25, label %.preheader, !llvm.loop !11

53:                                               ; preds = %25
  %54 = 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)
  %55 = 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.1)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %55, i32 noundef %52)
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @.str.2)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %57, i32 noundef 44850)
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.3)
  br label %62

60:                                               ; preds = %25
  %61 = 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.4)
  br label %62

62:                                               ; preds = %60, %53
  %.017 = phi i32 [ 1, %53 ], [ 0, %60 ]
  call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %3) #4
  ret i32 %.017
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass