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

%"struct.boost::unit_test::output::junit_impl::junit_log_helper" = type <{ %"class.std::__cxx11::list", %"class.std::__cxx11::list", %"class.std::__cxx11::basic_string", %"class.std::vector.45", i8, [7 x i8] }>
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.45" = type { %"struct.std::_Vector_base.46" }
%"struct.std::_Vector_base.46" = type { %"struct.std::_Vector_base<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry, std::allocator<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry, std::allocator<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry, std::allocator<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry, std::allocator<boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry" = type <{ %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, [3 x i8] }>

@.str.45 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [57 x i8], align 1
@__PRETTY_FUNCTION__._ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE = external hidden unnamed_addr constant [108 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %10 = call noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208) %9)
  store ptr %10, ptr %7, align 8, !tbaa !5
  %11 = load ptr, ptr %7, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.boost::unit_test::output::junit_impl::junit_log_helper", ptr %11, i32 0, i32 4
  %13 = load i8, ptr %12, align 8, !tbaa !11, !range !26, !noundef !27
  %14 = trunc i8 %13 to i1
  br i1 %14, label %15, label %16

15:                                               ; preds = %3
  store i32 1, ptr %8, align 4
  br label %28

16:                                               ; preds = %3
  %17 = call noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208) %9)
  %18 = getelementptr inbounds %"struct.boost::unit_test::output::junit_impl::junit_log_helper", ptr %17, i32 0, i32 3
  %19 = call noundef nonnull align 8 dereferenceable(101) ptr @_ZNSt6vectorIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %20 = getelementptr inbounds %"struct.boost::unit_test::output::junit_impl::junit_log_helper::assertion_entry", ptr %19, i32 0, i32 4
  %21 = load i8, ptr %20, align 4, !tbaa !28, !range !26, !noundef !27
  %22 = trunc i8 %21 to i1
  %23 = xor i1 %22, true
  br i1 %23, label %24, label %25

24:                                               ; preds = %16
  br label %27

25:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.64, ptr noundef @.str.45, i32 noundef 823, ptr noundef @__PRETTY_FUNCTION__._ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE) #5
  unreachable

26:                                               ; No predecessors!
  br label %27

27:                                               ; preds = %26, %24
  store i32 0, ptr %8, align 4
  br label %28

28:                                               ; preds = %27, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %29 = load i32, ptr %8, align 4
  switch i32 %29, label %31 [
    i32 0, label %30
    i32 1, label %30
  ]

30:                                               ; preds = %28, %28
  ret void

31:                                               ; preds = %28
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN5boost9unit_test9log_levelE", !7, i64 0}
!11 = !{!12, !25, i64 104}
!12 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helperE", !13, i64 0, !13, i64 24, !19, i64 48, !21, i64 80, !25, i64 104}
!13 = !{!"_ZTSNSt7__cxx114listINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !18, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !18, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"_ZTSSt6vectorIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"bool", !7, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!29, !25, i64 100}
!29 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryE", !19, i64 0, !19, i64 32, !19, i64 64, !30, i64 96, !25, i64 100}
!30 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entry11log_entry_tE", !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.45 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [57 x i8], align 1
@__PRETTY_FUNCTION__._ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE = external hidden unnamed_addr constant [108 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #1 align 2 {
  %4 = tail call noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %5 = getelementptr inbounds i8, ptr %4, i64 104
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !23, !noundef !24
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %16, label %8

8:                                                ; preds = %3
  %9 = tail call noundef nonnull align 8 dereferenceable(105) ptr @_ZN5boost9unit_test6output19junit_log_formatter21get_current_log_entryEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %10 = getelementptr inbounds i8, ptr %9, i64 80
  %11 = tail call noundef nonnull align 8 dereferenceable(101) ptr @_ZNSt6vectorIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #3
  %12 = getelementptr inbounds i8, ptr %11, i64 100
  %13 = load i8, ptr %12, align 4, !tbaa !25, !range !23, !noundef !24
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %16

15:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.64, ptr noundef nonnull @.str.45, i32 noundef 823, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5boost9unit_test6output19junit_log_formatter20entry_context_finishERSoNS0_9log_levelE) #4
  unreachable

16:                                               ; preds = %8, %3
  ret void
}

attributes #0 = { 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 #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 }
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, !22, i64 104}
!6 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helperE", !7, i64 0, !7, i64 24, !16, i64 48, !18, i64 80, !22, i64 104}
!7 = !{!"_ZTSNSt7__cxx114listINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEE", !8, i64 0}
!8 = !{!"_ZTSNSt7__cxx1110_List_baseINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEE", !9, i64 0}
!9 = !{!"_ZTSNSt7__cxx1110_List_baseINS_12basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE10_List_implE", !10, i64 0}
!10 = !{!"_ZTSNSt8__detail17_List_node_headerE", !11, i64 0, !15, i64 16}
!11 = !{!"_ZTSNSt8__detail15_List_node_baseE", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !15, i64 8, !13, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!18 = !{!"_ZTSSt6vectorIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryESaIS5_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!22 = !{!"bool", !13, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !22, i64 100}
!26 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entryE", !16, i64 0, !16, i64 32, !16, i64 64, !27, i64 96, !22, i64 100}
!27 = !{!"_ZTSN5boost9unit_test6output10junit_impl16junit_log_helper15assertion_entry11log_entry_tE", !13, i64 0}


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