; LLVM IR from AdaptiveCpp/AdaptiveCpp :: tests/pcuda (pcuda_test_suite)

; 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.boost::unit_test::framework::state" = type { ptr, %"class.std::vector.100", i64, %"class.std::map.105", i64, i64, i8, %"class.std::set", %"class.std::vector.115", i32, %"class.std::set.120", %"class.boost::execution_monitor", %"class.std::map.126", %"class.boost::unit_test::runtime_config::stream_holder" }
%"class.std::vector.100" = type { %"struct.std::_Vector_base.101" }
%"struct.std::_Vector_base.101" = type { %"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map.105" = type { %"class.std::_Rb_tree.106" }
%"class.std::_Rb_tree.106" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, boost::unit_test::test_unit *>, std::_Select1st<std::pair<const unsigned long, boost::unit_test::test_unit *>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, boost::unit_test::test_unit *>, std::_Select1st<std::pair<const unsigned long, boost::unit_test::test_unit *>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.110" }
%"class.std::_Rb_tree.110" = type { %"struct.std::_Rb_tree<boost::unit_test::test_observer *, boost::unit_test::test_observer *, std::_Identity<boost::unit_test::test_observer *>, boost::unit_test::framework::state::priority_order>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::test_observer *, boost::unit_test::test_observer *, std::_Identity<boost::unit_test::test_observer *>, boost::unit_test::framework::state::priority_order>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.115" = type { %"struct.std::_Vector_base.116" }
%"struct.std::_Vector_base.116" = type { %"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set.120" = type { %"class.std::_Rb_tree.121" }
%"class.std::_Rb_tree.121" = type { %"struct.std::_Rb_tree<boost::unit_test::global_fixture *, boost::unit_test::global_fixture *, std::_Identity<boost::unit_test::global_fixture *>, std::less<boost::unit_test::global_fixture *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::global_fixture *, boost::unit_test::global_fixture *, std::_Identity<boost::unit_test::global_fixture *>, std::less<boost::unit_test::global_fixture *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.boost::execution_monitor" = type { %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.22", %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.20", %"class.boost::shared_ptr.99", %"class.boost::scoped_array" }
%"class.boost::unit_test::readwrite_property.22" = type { %"class.boost::unit_test::class_property" }
%"class.boost::unit_test::class_property" = type { i64 }
%"class.boost::unit_test::readwrite_property.97" = type { %"class.boost::unit_test::class_property.98" }
%"class.boost::unit_test::class_property.98" = type { i8 }
%"class.boost::unit_test::readwrite_property.20" = type { %"class.boost::unit_test::class_property.21" }
%"class.boost::unit_test::class_property.21" = type { i32 }
%"class.boost::shared_ptr.99" = type { ptr, %"class.boost::detail::shared_count" }
%"class.boost::detail::shared_count" = type { ptr }
%"class.boost::scoped_array" = type { ptr }
%"class.std::map.126" = type { %"class.std::_Rb_tree.127" }
%"class.std::_Rb_tree.127" = type { %"struct.std::_Rb_tree<boost::unit_test::output_format, std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>, std::_Select1st<std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>>, std::less<boost::unit_test::output_format>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::output_format, std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>, std::_Select1st<std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>>, std::less<boost::unit_test::output_format>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.boost::unit_test::runtime_config::stream_holder" = type { %"class.boost::shared_ptr.132", ptr }
%"class.boost::shared_ptr.132" = type { ptr, %"class.boost::detail::shared_count" }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(400) ptr @_ZN5boost9unit_test9framework17master_test_suiteEv() #1

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv() #1

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(384) ptr @_ZN5boost9unit_test9framework23current_auto_test_suiteEPNS0_10test_suiteEb(ptr noundef %0, i1 noundef zeroext %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = zext i1 %1 to i8
  store i8 %6, ptr %4, align 1, !tbaa !9
  %7 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %8 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %7, i32 0, i32 1
  %9 = call noundef zeroext i1 @_ZNKSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  br i1 %9, label %10, label %14

10:                                               ; preds = %2
  %11 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %12 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %13 = call noundef nonnull align 8 dereferenceable(400) ptr @_ZN5boost9unit_test9framework17master_test_suiteEv()
  store ptr %13, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %14

14:                                               ; preds = %10, %2
  %15 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %16 = trunc i8 %15 to i1
  br i1 %16, label %20, label %17

17:                                               ; preds = %14
  %18 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %19 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %18, i32 0, i32 1
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #3
  br label %27

20:                                               ; preds = %14
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %25 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %24, i32 0, i32 1
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br label %26

26:                                               ; preds = %23, %20
  br label %27

27:                                               ; preds = %26, %17
  %28 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %29 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %28, i32 0, i32 1
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #3
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  ret ptr %31
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!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"

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(400) ptr @_ZN5boost9unit_test9framework17master_test_suiteEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(384) ptr @_ZN5boost9unit_test9framework23current_auto_test_suiteEPNS0_10test_suiteEb(ptr noundef %0, i1 noundef zeroext %1) local_unnamed_addr #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %6 = getelementptr inbounds i8, ptr %5, i64 8
  %7 = tail call noundef zeroext i1 @_ZNKSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  br i1 %7, label %8, label %12

8:                                                ; preds = %2
  %9 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %11 = tail call noundef nonnull align 8 dereferenceable(400) ptr @_ZN5boost9unit_test9framework17master_test_suiteEv()
  store ptr %11, ptr %4, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %12

12:                                               ; preds = %8, %2
  br i1 %1, label %16, label %13

13:                                               ; preds = %12
  %14 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  br label %20

16:                                               ; preds = %12
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %20, label %17

17:                                               ; preds = %16
  %18 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  call void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br label %20

20:                                               ; preds = %16, %17, %13
  %21 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  ret ptr %24
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5boost9unit_test10test_suiteESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass