; LLVM IR from AdaptiveCpp/AdaptiveCpp :: src/runtime/dag_submitted_ops.ll (ZN7hipsycl2rt17dag_submitted_ops9get_groupEm)

; 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.sbo::small_vector.18" = type { %"class.std::vector.19" }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" = type { %"struct.sbo::small_buffer_vector_allocator.base.22", %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" }
%"struct.sbo::small_buffer_vector_allocator.base.22" = type { [128 x i8], i8, i8 }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::lock_guard" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.hipsycl::rt::dag_submitted_ops" = type { %"class.std::vector", %"class.std::mutex", %"class.hipsycl::rt::worker_thread" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, std::allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, std::allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, std::allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, std::allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.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::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 }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN7hipsycl2rt17dag_submitted_ops9get_groupEm = external hidden unnamed_addr constant [67 x i8], align 1

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: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

declare noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384)) #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN7hipsycl2rt8dag_nodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(132) ptr @_ZN7hipsycl2rt8dag_node19get_execution_hintsEv(ptr noundef nonnull align 8 dereferenceable(384)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7hipsycl2rt15execution_hints8get_hintINS0_5hints10node_groupETnNSt9enable_ifIXsr3stdE12is_base_of_vINS3_14execution_hintET_EEiE4typeELi0EEEPKS7_v(ptr noundef nonnull align 8 dereferenceable(132)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7hipsycl2rt17dag_submitted_ops9get_groupEm(ptr dead_on_unwind noalias writable sret(%"class.sbo::small_vector.18") align 8 %0, ptr noundef nonnull align 8 dereferenceable(248) %1, i64 noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::lock_guard", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %16 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZN3sbo12small_vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEELm8EEC2Ev(ptr noundef nonnull align 8 dereferenceable(160) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %17 = getelementptr inbounds %"class.hipsycl::rt::dag_submitted_ops", ptr %16, i32 0, i32 1
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %18 unwind label %29

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %19 = getelementptr inbounds %"class.hipsycl::rt::dag_submitted_ops", ptr %16, i32 0, i32 0
  store ptr %19, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %20 = load ptr, ptr %11, align 8, !tbaa !5
  %21 = call ptr @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %22 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %21, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = call ptr @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  br label %26

26:                                               ; preds = %67, %18
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %27, label %33, label %28

28:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %70

29:                                               ; preds = %3
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  br label %72

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @_ZNSt10shared_ptrIN7hipsycl2rt8dag_nodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %34) #6
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  %36 = invoke noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384) %35)
          to label %37 unwind label %40

37:                                               ; preds = %33
  br i1 %36, label %38, label %39

38:                                               ; preds = %37
  br label %45

39:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 126, ptr noundef @__PRETTY_FUNCTION__._ZN7hipsycl2rt17dag_submitted_ops9get_groupEm) #7
  unreachable

40:                                               ; preds = %33
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %9, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %10, align 4
  br label %69

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %46 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  %47 = invoke noundef nonnull align 8 dereferenceable(132) ptr @_ZN7hipsycl2rt8dag_node19get_execution_hintsEv(ptr noundef nonnull align 8 dereferenceable(384) %46)
          to label %48 unwind label %61

48:                                               ; preds = %45
  %49 = invoke noundef ptr @_ZNK7hipsycl2rt15execution_hints8get_hintINS0_5hints10node_groupETnNSt9enable_ifIXsr3stdE12is_base_of_vINS3_14execution_hintET_EEiE4typeELi0EEEPKS7_v(ptr noundef nonnull align 8 dereferenceable(132) %47)
          to label %50 unwind label %61

50:                                               ; preds = %48
  store ptr %49, ptr %15, align 8, !tbaa !5
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %66

53:                                               ; preds = %50
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = invoke noundef i64 @_ZNK7hipsycl2rt5hints10node_group6get_idEv(ptr noundef nonnull align 8 dereferenceable(16) %54)
          to label %56 unwind label %61

56:                                               ; preds = %53
  %57 = load i64, ptr %6, align 8, !tbaa !9
  %58 = icmp eq i64 %55, %57
  br i1 %58, label %59, label %65

59:                                               ; preds = %56
  invoke void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %60 unwind label %61

60:                                               ; preds = %59
  br label %65

61:                                               ; preds = %59, %53, %48, %45
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %9, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %69

65:                                               ; preds = %60, %56
  br label %66

66:                                               ; preds = %65, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %67

67:                                               ; preds = %66
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %26

69:                                               ; preds = %61, %40
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %72

70:                                               ; preds = %28
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  store i1 true, ptr %7, align 1
  %71 = load i1, ptr %7, align 1
  br i1 %71, label %74, label %73

72:                                               ; preds = %69, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %0) #6
  br label %75

73:                                               ; preds = %70
  call void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %0) #6
  br label %74

74:                                               ; preds = %73, %70
  ret void

75:                                               ; preds = %72
  %76 = load ptr, ptr %9, align 8
  %77 = load i32, ptr %10, align 4
  %78 = insertvalue { ptr, i32 } poison, ptr %76, 0
  %79 = insertvalue { ptr, i32 } %78, i32 %77, 1
  resume { ptr, i32 } %79
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #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 = { "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 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"long", !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"

%"class.sbo::small_vector.18" = type { %"class.std::vector.19" }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl" = type { %"struct.sbo::small_buffer_vector_allocator.base.22", %"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" }
%"struct.sbo::small_buffer_vector_allocator.base.22" = type { [128 x i8], i8, i8 }
%"struct.std::_Vector_base<std::shared_ptr<hipsycl::rt::dag_node>, sbo::small_buffer_vector_allocator<std::shared_ptr<hipsycl::rt::dag_node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::lock_guard" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN7hipsycl2rt17dag_submitted_ops9get_groupEm = external hidden unnamed_addr constant [67 x i8], align 1

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 uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN7hipsycl2rt8dag_nodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(132) ptr @_ZN7hipsycl2rt8dag_node19get_execution_hintsEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7hipsycl2rt17dag_submitted_ops9get_groupEm(ptr dead_on_unwind noalias nonnull writable sret(%"class.sbo::small_vector.18") align 8 %0, ptr noundef nonnull align 8 dereferenceable(248) %1, i64 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::lock_guard", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.std::shared_ptr", align 8
  tail call void @_ZN3sbo12small_vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEELm8EEC2Ev(ptr noundef nonnull align 8 dereferenceable(160) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %8)
          to label %9 unwind label %13

9:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %10 = call ptr @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %10, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %11 = call ptr @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %11, ptr %6, align 8
  %12 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %34, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void

13:                                               ; preds = %3
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %38

.lr.ph:                                           ; preds = %9, %34
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @_ZNSt10shared_ptrIN7hipsycl2rt8dag_nodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  %16 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %17 = invoke noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384) %16)
          to label %18 unwind label %20

18:                                               ; preds = %.lr.ph
  br i1 %17, label %22, label %19

19:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 126, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7hipsycl2rt17dag_submitted_ops9get_groupEm) #7
  unreachable

20:                                               ; preds = %.lr.ph
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %37

22:                                               ; preds = %18
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %24 = invoke noundef nonnull align 8 dereferenceable(132) ptr @_ZN7hipsycl2rt8dag_node19get_execution_hintsEv(ptr noundef nonnull align 8 dereferenceable(384) %23)
          to label %25 unwind label %32

25:                                               ; preds = %22
  %26 = invoke noundef ptr @_ZNK7hipsycl2rt15execution_hints8get_hintINS0_5hints10node_groupETnNSt9enable_ifIXsr3stdE12is_base_of_vINS3_14execution_hintET_EEiE4typeELi0EEEPKS7_v(ptr noundef nonnull align 8 dereferenceable(132) %24)
          to label %27 unwind label %32

27:                                               ; preds = %25
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %34, label %28

28:                                               ; preds = %27
  %29 = call noundef i64 @_ZNK7hipsycl2rt5hints10node_group6get_idEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
  %30 = icmp eq i64 %29, %2
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  invoke void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %34 unwind label %32

32:                                               ; preds = %31, %25, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %37

34:                                               ; preds = %28, %31, %27
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrIN7hipsycl2rt8dag_nodeEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %36, label %.lr.ph, label %._crit_edge

37:                                               ; preds = %32, %20
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %21, %20 ]
  call void @_ZNSt12__shared_ptrIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %38

38:                                               ; preds = %37, %13
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %0) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN7hipsycl2rt8dag_nodeEEN3sbo29small_buffer_vector_allocatorIS4_Lm8ES4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(160)) 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 = { "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 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass