; LLVM IR from AdaptiveCpp/AdaptiveCpp :: src/runtime/ocl/ocl_queue.ll (ZN7hipsycl2rt9ocl_queue21register_submitted_opEN2cl5EventE)

; 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::shared_ptr.119" = type { %"class.std::__shared_ptr.120" }
%"class.std::__shared_ptr.120" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.hipsycl::rt::device_id" = type { %"struct.hipsycl::rt::backend_descriptor", i32 }
%"struct.hipsycl::rt::backend_descriptor" = type { i32, i32, i32 }
%"class.hipsycl::rt::ocl_queue" = type { %"class.hipsycl::rt::inorder_queue", ptr, i64, %"class.cl::CommandQueue", %"class.hipsycl::rt::ocl_sscp_code_object_invoker", %"class.hipsycl::rt::worker_thread", %"class.std::shared_ptr", %"struct.hipsycl::rt::ocl_queue::protected_state", %"class.hipsycl::common::spin_lock", %"class.hipsycl::glue::jit::cxx_argument_mapper", %"class.hipsycl::rt::kernel_configuration", %"class.std::unordered_map" }
%"class.hipsycl::rt::inorder_queue" = type { ptr }
%"class.cl::CommandQueue" = type { %"class.cl::detail::Wrapper" }
%"class.cl::detail::Wrapper" = type { ptr }
%"class.hipsycl::rt::ocl_sscp_code_object_invoker" = type { %"class.hipsycl::rt::sscp_code_object_invoker", ptr }
%"class.hipsycl::rt::sscp_code_object_invoker" = type { ptr }
%"class.hipsycl::rt::worker_thread" = type { %"class.std::thread", %"struct.std::atomic", %"class.std::condition_variable", %"class.std::mutex", %"class.std::queue" }
%"class.std::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"struct.hipsycl::rt::ocl_queue::protected_state" = type { %"class.std::shared_ptr.0", %"class.std::mutex" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.hipsycl::common::spin_lock" = type { %"struct.std::atomic_flag" }
%"struct.std::atomic_flag" = type { %"struct.std::__atomic_flag_base" }
%"struct.std::__atomic_flag_base" = type { i8 }
%"class.hipsycl::glue::jit::cxx_argument_mapper" = type { i8, %"class.std::vector", %"class.std::vector.6" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.hipsycl::rt::kernel_configuration" = type { %"class.std::vector.11", %"class.std::vector.16", %"class.std::vector.21", %"class.std::vector.26", %"class.std::vector.6", %"class.std::vector.31", %"struct.std::array" }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<hipsycl::rt::kernel_build_flag, std::allocator<hipsycl::rt::kernel_build_flag>>::_Vector_impl" }
%"struct.std::_Vector_base<hipsycl::rt::kernel_build_flag, std::allocator<hipsycl::rt::kernel_build_flag>>::_Vector_impl" = type { %"struct.std::_Vector_base<hipsycl::rt::kernel_build_flag, std::allocator<hipsycl::rt::kernel_build_flag>>::_Vector_impl_data" }
%"struct.std::_Vector_base<hipsycl::rt::kernel_build_flag, std::allocator<hipsycl::rt::kernel_build_flag>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>, std::allocator<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>, std::allocator<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>, std::allocator<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>, std::allocator<std::pair<hipsycl::rt::kernel_build_option, hipsycl::rt::kernel_configuration::int_or_string>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<std::pair<int, unsigned long>, std::allocator<std::pair<int, unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, unsigned long>, std::allocator<std::pair<int, unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, unsigned long>, std::allocator<std::pair<int, unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, unsigned long>, std::allocator<std::pair<int, unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.26" = type { %"struct.std::_Vector_base.27" }
%"struct.std::_Vector_base.27" = type { %"struct.std::_Vector_base<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>, std::allocator<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>>>::_Vector_impl" }
%"struct.std::_Vector_base<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>, std::allocator<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>, std::allocator<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>, std::allocator<hipsycl::glue::sscp::__acpp_sscp_emit_param_type_annotation_fcall_specialized_config<const hipsycl::glue::sscp::fcall_specialized_config *>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::array" = type { [2 x i64] }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

declare i32 @__gxx_personality_v0(...)

; 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
define dso_local void @_ZN7hipsycl2rt9ocl_queue21register_submitted_opEN2cl5EventE(ptr noundef nonnull align 8 dereferenceable(584) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::shared_ptr.119", align 8
  %6 = alloca %"class.hipsycl::rt::device_id", align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %"class.hipsycl::rt::ocl_queue", ptr %9, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  %11 = getelementptr inbounds %"class.hipsycl::rt::ocl_queue", ptr %9, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.hipsycl::rt::ocl_queue", ptr %9, i32 0, i32 2
  %14 = load i64, ptr %13, align 8, !tbaa !78
  %15 = load ptr, ptr %12, align 8, !tbaa !79
  %16 = getelementptr inbounds ptr, ptr %15, i64 3
  %17 = load ptr, ptr %16, align 8
  %18 = call { i64, i64 } %17(ptr noundef nonnull align 8 dereferenceable(60) %12, i64 noundef %14)
  %19 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %20 = extractvalue { i64, i64 } %18, 0
  store i64 %20, ptr %19, align 4
  %21 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %22 = extractvalue { i64, i64 } %18, 1
  store i64 %22, ptr %21, align 4
  call void @_ZSt11make_sharedIN7hipsycl2rt14ocl_node_eventEJNS1_9device_idERN2cl5EventEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES9_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.119") align 8 %5, ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %1)
  invoke void @_ZN7hipsycl2rt9ocl_queue15protected_state21set_most_recent_eventISt10shared_ptrINS0_14ocl_node_eventEEEEvRKT_(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %23 unwind label %24

23:                                               ; preds = %2
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  ret void

24:                                               ; preds = %2
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %7, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  br label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %7, align 8
  %30 = load i32, ptr %8, align 4
  %31 = insertvalue { ptr, i32 } poison, ptr %29, 0
  %32 = insertvalue { ptr, i32 } %31, i32 %30, 1
  resume { ptr, i32 } %32
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN7hipsycl2rt14ocl_node_eventEJNS1_9device_idERN2cl5EventEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES9_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.119") align 8, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 = { 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 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 }

!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, !6, i64 8}
!10 = !{!"_ZTSN7hipsycl2rt9ocl_queueE", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !15, i64 32, !17, i64 48, !33, i64 232, !36, i64 248, !39, i64 304, !42, i64 312, !51, i64 368, !73, i64 528}
!11 = !{!"_ZTSN7hipsycl2rt13inorder_queueE"}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN2cl12CommandQueueE", !14, i64 0}
!14 = !{!"_ZTSN2cl6detail7WrapperIP17_cl_command_queueEE", !6, i64 0}
!15 = !{!"_ZTSN7hipsycl2rt28ocl_sscp_code_object_invokerE", !16, i64 0, !6, i64 8}
!16 = !{!"_ZTSN7hipsycl2rt24sscp_code_object_invokerE"}
!17 = !{!"_ZTSN7hipsycl2rt13worker_threadE", !18, i64 0, !20, i64 8, !23, i64 16, !25, i64 64, !27, i64 104}
!18 = !{!"_ZTSSt6thread", !19, i64 0}
!19 = !{!"_ZTSNSt6thread2idE", !12, i64 0}
!20 = !{!"_ZTSSt6atomicIbE", !21, i64 0}
!21 = !{!"_ZTSSt13__atomic_baseIbE", !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSSt18condition_variable", !24, i64 0}
!24 = !{!"_ZTSSt9__condvar", !7, i64 0}
!25 = !{!"_ZTSSt5mutex", !26, i64 0}
!26 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!27 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !28, i64 0}
!28 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !31, i64 0}
!31 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !12, i64 8, !32, i64 16, !32, i64 48}
!32 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!33 = !{!"_ZTSSt10shared_ptrIN7hipsycl2rt12kernel_cacheEE", !34, i64 0}
!34 = !{!"_ZTSSt12__shared_ptrIN7hipsycl2rt12kernel_cacheELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !35, i64 8}
!35 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!36 = !{!"_ZTSN7hipsycl2rt9ocl_queue15protected_stateE", !37, i64 0, !25, i64 16}
!37 = !{!"_ZTSSt10shared_ptrIN7hipsycl2rt14dag_node_eventEE", !38, i64 0}
!38 = !{!"_ZTSSt12__shared_ptrIN7hipsycl2rt14dag_node_eventELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !35, i64 8}
!39 = !{!"_ZTSN7hipsycl6common9spin_lockE", !40, i64 0}
!40 = !{!"_ZTSSt11atomic_flag", !41, i64 0}
!41 = !{!"_ZTSSt18__atomic_flag_base", !22, i64 0}
!42 = !{!"_ZTSN7hipsycl4glue3jit19cxx_argument_mapperE", !22, i64 0, !43, i64 8, !47, i64 32}
!43 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{!"_ZTSSt6vectorImSaImEE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseImSaImEE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!51 = !{!"_ZTSN7hipsycl2rt20kernel_configurationE", !52, i64 0, !56, i64 24, !60, i64 48, !64, i64 72, !47, i64 96, !68, i64 120, !72, i64 144}
!52 = !{!"_ZTSSt6vectorIN7hipsycl2rt17kernel_build_flagESaIS2_EE", !53, i64 0}
!53 = !{!"_ZTSSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE12_Vector_implE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!"_ZTSSt6vectorISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE", !57, i64 0}
!57 = !{!"_ZTSSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE12_Vector_implE", !59, i64 0}
!59 = !{!"_ZTSNSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!60 = !{!"_ZTSSt6vectorISt4pairIimESaIS1_EE", !61, i64 0}
!61 = !{!"_ZTSSt12_Vector_baseISt4pairIimESaIS1_EE", !62, i64 0}
!62 = !{!"_ZTSNSt12_Vector_baseISt4pairIimESaIS1_EE12_Vector_implE", !63, i64 0}
!63 = !{!"_ZTSNSt12_Vector_baseISt4pairIimESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!64 = !{!"_ZTSSt6vectorIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE", !65, i64 0}
!65 = !{!"_ZTSSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE", !66, i64 0}
!66 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE12_Vector_implE", !67, i64 0}
!67 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!68 = !{!"_ZTSSt6vectorISt4pairIiiESaIS1_EE", !69, i64 0}
!69 = !{!"_ZTSSt12_Vector_baseISt4pairIiiESaIS1_EE", !70, i64 0}
!70 = !{!"_ZTSNSt12_Vector_baseISt4pairIiiESaIS1_EE12_Vector_implE", !71, i64 0}
!71 = !{!"_ZTSNSt12_Vector_baseISt4pairIiiESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!72 = !{!"_ZTSSt5arrayImLm2EE", !7, i64 0}
!73 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_mEEE", !74, i64 0}
!74 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_mESaIS8_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !12, i64 8, !75, i64 16, !12, i64 24, !76, i64 32, !6, i64 48}
!75 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!76 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !77, i64 0, !12, i64 8}
!77 = !{!"float", !7, i64 0}
!78 = !{!10, !12, i64 16}
!79 = !{!80, !80, i64 0}
!80 = !{!"vtable pointer", !8, 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"

%"class.std::shared_ptr.119" = type { %"class.std::__shared_ptr.120" }
%"class.std::__shared_ptr.120" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.hipsycl::rt::device_id" = type { %"struct.hipsycl::rt::backend_descriptor", i32 }
%"struct.hipsycl::rt::backend_descriptor" = type { i32, i32, i32 }

declare i32 @__gxx_personality_v0(...)

; 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
define dso_local void @_ZN7hipsycl2rt9ocl_queue21register_submitted_opEN2cl5EventE(ptr noundef nonnull align 8 dereferenceable(584) %0, ptr noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr.119", align 8
  %4 = alloca %"class.hipsycl::rt::device_id", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 248
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load i64, ptr %8, align 8, !tbaa !77
  %10 = load ptr, ptr %7, align 8, !tbaa !78
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load ptr, ptr %11, align 8
  %13 = tail call { i64, i64 } %12(ptr noundef nonnull align 8 dereferenceable(60) %7, i64 noundef %9)
  %14 = extractvalue { i64, i64 } %13, 0
  store i64 %14, ptr %4, align 8
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = extractvalue { i64, i64 } %13, 1
  store i64 %16, ptr %15, align 8
  call void @_ZSt11make_sharedIN7hipsycl2rt14ocl_node_eventEJNS1_9device_idERN2cl5EventEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES9_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.119") align 8 %3, ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %1)
  invoke void @_ZN7hipsycl2rt9ocl_queue15protected_state21set_most_recent_eventISt10shared_ptrINS0_14ocl_node_eventEEEEvRKT_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %17 unwind label %18

17:                                               ; preds = %2
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret void

18:                                               ; preds = %2
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  resume { ptr, i32 } %19
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN7hipsycl2rt14ocl_node_eventEJNS1_9device_idERN2cl5EventEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES9_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.119") align 8, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN7hipsycl2rt14ocl_node_eventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 = { 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 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 }

!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, !8, i64 8}
!6 = !{!"_ZTSN7hipsycl2rt9ocl_queueE", !7, i64 0, !8, i64 8, !11, i64 16, !12, i64 24, !14, i64 32, !16, i64 48, !32, i64 232, !35, i64 248, !38, i64 304, !41, i64 312, !50, i64 368, !72, i64 528}
!7 = !{!"_ZTSN7hipsycl2rt13inorder_queueE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"_ZTSN2cl12CommandQueueE", !13, i64 0}
!13 = !{!"_ZTSN2cl6detail7WrapperIP17_cl_command_queueEE", !8, i64 0}
!14 = !{!"_ZTSN7hipsycl2rt28ocl_sscp_code_object_invokerE", !15, i64 0, !8, i64 8}
!15 = !{!"_ZTSN7hipsycl2rt24sscp_code_object_invokerE"}
!16 = !{!"_ZTSN7hipsycl2rt13worker_threadE", !17, i64 0, !19, i64 8, !22, i64 16, !24, i64 64, !26, i64 104}
!17 = !{!"_ZTSSt6thread", !18, i64 0}
!18 = !{!"_ZTSNSt6thread2idE", !11, i64 0}
!19 = !{!"_ZTSSt6atomicIbE", !20, i64 0}
!20 = !{!"_ZTSSt13__atomic_baseIbE", !21, i64 0}
!21 = !{!"bool", !9, i64 0}
!22 = !{!"_ZTSSt18condition_variable", !23, i64 0}
!23 = !{!"_ZTSSt9__condvar", !9, i64 0}
!24 = !{!"_ZTSSt5mutex", !25, i64 0}
!25 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!26 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !27, i64 0}
!27 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !30, i64 0}
!30 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !8, i64 0, !11, i64 8, !31, i64 16, !31, i64 48}
!31 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!32 = !{!"_ZTSSt10shared_ptrIN7hipsycl2rt12kernel_cacheEE", !33, i64 0}
!33 = !{!"_ZTSSt12__shared_ptrIN7hipsycl2rt12kernel_cacheELN9__gnu_cxx12_Lock_policyE2EE", !8, i64 0, !34, i64 8}
!34 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !8, i64 0}
!35 = !{!"_ZTSN7hipsycl2rt9ocl_queue15protected_stateE", !36, i64 0, !24, i64 16}
!36 = !{!"_ZTSSt10shared_ptrIN7hipsycl2rt14dag_node_eventEE", !37, i64 0}
!37 = !{!"_ZTSSt12__shared_ptrIN7hipsycl2rt14dag_node_eventELN9__gnu_cxx12_Lock_policyE2EE", !8, i64 0, !34, i64 8}
!38 = !{!"_ZTSN7hipsycl6common9spin_lockE", !39, i64 0}
!39 = !{!"_ZTSSt11atomic_flag", !40, i64 0}
!40 = !{!"_ZTSSt18__atomic_flag_base", !21, i64 0}
!41 = !{!"_ZTSN7hipsycl4glue3jit19cxx_argument_mapperE", !21, i64 0, !42, i64 8, !46, i64 32}
!42 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !43, i64 0}
!43 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!46 = !{!"_ZTSSt6vectorImSaImEE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseImSaImEE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!50 = !{!"_ZTSN7hipsycl2rt20kernel_configurationE", !51, i64 0, !55, i64 24, !59, i64 48, !63, i64 72, !46, i64 96, !67, i64 120, !71, i64 144}
!51 = !{!"_ZTSSt6vectorIN7hipsycl2rt17kernel_build_flagESaIS2_EE", !52, i64 0}
!52 = !{!"_ZTSSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE12_Vector_implE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl2rt17kernel_build_flagESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!55 = !{!"_ZTSSt6vectorISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE", !56, i64 0}
!56 = !{!"_ZTSSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE", !57, i64 0}
!57 = !{!"_ZTSNSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE12_Vector_implE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseISt4pairIN7hipsycl2rt19kernel_build_optionENS2_20kernel_configuration13int_or_stringEESaIS6_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!59 = !{!"_ZTSSt6vectorISt4pairIimESaIS1_EE", !60, i64 0}
!60 = !{!"_ZTSSt12_Vector_baseISt4pairIimESaIS1_EE", !61, i64 0}
!61 = !{!"_ZTSNSt12_Vector_baseISt4pairIimESaIS1_EE12_Vector_implE", !62, i64 0}
!62 = !{!"_ZTSNSt12_Vector_baseISt4pairIimESaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!63 = !{!"_ZTSSt6vectorIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE", !64, i64 0}
!64 = !{!"_ZTSSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE", !65, i64 0}
!65 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE12_Vector_implE", !66, i64 0}
!66 = !{!"_ZTSNSt12_Vector_baseIN7hipsycl4glue4sscp63__acpp_sscp_emit_param_type_annotation_fcall_specialized_configIPKNS2_24fcall_specialized_configEEESaIS7_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!67 = !{!"_ZTSSt6vectorISt4pairIiiESaIS1_EE", !68, i64 0}
!68 = !{!"_ZTSSt12_Vector_baseISt4pairIiiESaIS1_EE", !69, i64 0}
!69 = !{!"_ZTSNSt12_Vector_baseISt4pairIiiESaIS1_EE12_Vector_implE", !70, i64 0}
!70 = !{!"_ZTSNSt12_Vector_baseISt4pairIiiESaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!71 = !{!"_ZTSSt5arrayImLm2EE", !9, i64 0}
!72 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_mEEE", !73, i64 0}
!73 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_mESaIS8_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb1ELb0ELb1EEEE", !8, i64 0, !11, i64 8, !74, i64 16, !11, i64 24, !75, i64 32, !8, i64 48}
!74 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !8, i64 0}
!75 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !76, i64 0, !11, i64 8}
!76 = !{!"float", !9, i64 0}
!77 = !{!6, !11, i64 16}
!78 = !{!79, !79, i64 0}
!79 = !{!"vtable pointer", !10, i64 0}


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