; LLVM IR from AdaptiveCpp/AdaptiveCpp :: src/runtime (multi_queue_executor)

; 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.hipsycl::rt::device_id" = type { %"struct.hipsycl::rt::backend_descriptor", i32 }
%"struct.hipsycl::rt::backend_descriptor" = type { i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator.66" = type { ptr }
%"class.hipsycl::rt::multi_queue_executor" = type <{ %"class.hipsycl::rt::backend_executor", %"class.std::vector", %"class.std::vector.0", i32, [4 x i8] }>
%"class.hipsycl::rt::backend_executor" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<hipsycl::rt::multi_queue_executor::per_device_data, std::allocator<hipsycl::rt::multi_queue_executor::per_device_data>>::_Vector_impl" }
%"struct.std::_Vector_base<hipsycl::rt::multi_queue_executor::per_device_data, std::allocator<hipsycl::rt::multi_queue_executor::per_device_data>>::_Vector_impl" = type { %"struct.std::_Vector_base<hipsycl::rt::multi_queue_executor::per_device_data, std::allocator<hipsycl::rt::multi_queue_executor::per_device_data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<hipsycl::rt::multi_queue_executor::per_device_data, std::allocator<hipsycl::rt::multi_queue_executor::per_device_data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<hipsycl::rt::inorder_queue *, std::allocator<hipsycl::rt::inorder_queue *>>::_Vector_impl" }
%"struct.std::_Vector_base<hipsycl::rt::inorder_queue *, std::allocator<hipsycl::rt::inorder_queue *>>::_Vector_impl" = type { %"struct.std::_Vector_base<hipsycl::rt::inorder_queue *, std::allocator<hipsycl::rt::inorder_queue *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<hipsycl::rt::inorder_queue *, std::allocator<hipsycl::rt::inorder_queue *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.hipsycl::rt::multi_queue_executor::per_device_data" = type { %"struct.hipsycl::rt::backend_execution_lane_range", %"struct.hipsycl::rt::backend_execution_lane_range", %"class.std::vector.7", %"class.hipsycl::rt::moving_statistics" }
%"struct.hipsycl::rt::backend_execution_lane_range" = type { i64, i64 }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<std::unique_ptr<hipsycl::rt::inorder_executor>, std::allocator<std::unique_ptr<hipsycl::rt::inorder_executor>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<hipsycl::rt::inorder_executor>, std::allocator<std::unique_ptr<hipsycl::rt::inorder_executor>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<hipsycl::rt::inorder_executor>, std::allocator<std::unique_ptr<hipsycl::rt::inorder_executor>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<hipsycl::rt::inorder_executor>, std::allocator<std::unique_ptr<hipsycl::rt::inorder_executor>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.hipsycl::rt::moving_statistics" = type { i64, i64, i64, %"class.std::vector.12" }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<hipsycl::rt::moving_statistics::submission, std::allocator<hipsycl::rt::moving_statistics::submission>>::_Vector_impl" }
%"struct.std::_Vector_base<hipsycl::rt::moving_statistics::submission, std::allocator<hipsycl::rt::moving_statistics::submission>>::_Vector_impl" = type { %"struct.std::_Vector_base<hipsycl::rt::moving_statistics::submission, std::allocator<hipsycl::rt::moving_statistics::submission>>::_Vector_impl_data" }
%"struct.std::_Vector_base<hipsycl::rt::moving_statistics::submission, std::allocator<hipsycl::rt::moving_statistics::submission>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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

declare noundef i32 @_ZNK7hipsycl2rt9device_id6get_idEv(ptr noundef nonnull align 4 dereferenceable(16)) #1

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

; 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)) #1

declare { i64, i64 } @_ZNK7hipsycl2rt8dag_node19get_assigned_deviceEv(ptr noundef nonnull align 8 dereferenceable(384)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_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_cxxneIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7hipsycl2rt20multi_queue_executor24find_assigned_lane_indexERKSt10shared_ptrINS0_8dag_nodeEERm(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #4 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.hipsycl::rt::device_id", align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.66", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.66", align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  %19 = call noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384) %18)
  br i1 %19, label %21, label %20

20:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %68

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  %24 = call { i64, i64 } @_ZNK7hipsycl2rt8dag_node19get_assigned_deviceEv(ptr noundef nonnull align 8 dereferenceable(384) %23)
  %25 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %26 = extractvalue { i64, i64 } %24, 0
  store i64 %26, ptr %25, align 4
  %27 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %28 = extractvalue { i64, i64 } %24, 1
  store i64 %28, ptr %27, align 4
  %29 = call noundef i32 @_ZNK7hipsycl2rt9device_id6get_idEv(ptr noundef nonnull align 4 dereferenceable(16) %9)
  %30 = sext i32 %29 to i64
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  store i64 %30, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %31 = getelementptr inbounds %"class.hipsycl::rt::multi_queue_executor", ptr %16, i32 0, i32 1
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN7hipsycl2rt20multi_queue_executor15per_device_dataESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %32) #5
  %34 = getelementptr inbounds %"struct.hipsycl::rt::multi_queue_executor::per_device_data", ptr %33, i32 0, i32 2
  store ptr %34, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = call ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.66", ptr %12, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = call ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #5
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.66", ptr %13, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  br label %41

41:                                               ; preds = %62, %21
  %42 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %42, label %44, label %43

43:                                               ; preds = %41
  store i32 2, ptr %14, align 4
  br label %64

44:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  store ptr %45, ptr %15, align 8, !tbaa !5
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = call noundef ptr @_ZNKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %47, align 8, !tbaa !11
  %50 = getelementptr inbounds ptr, ptr %49, i64 5
  %51 = load ptr, ptr %50, align 8
  %52 = call noundef zeroext i1 %51(ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 8 dereferenceable(16) %48)
  br i1 %52, label %53, label %56

53:                                               ; preds = %44
  %54 = load i64, ptr %10, align 8, !tbaa !9
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %54, ptr %55, align 8, !tbaa !9
  store i1 true, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %59

56:                                               ; preds = %44
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = add i64 %57, 1
  store i64 %58, ptr %10, align 8, !tbaa !9
  store i32 0, ptr %14, align 4
  br label %59

59:                                               ; preds = %56, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %60 = load i32, ptr %14, align 4
  switch i32 %60, label %64 [
    i32 0, label %61
  ]

61:                                               ; preds = %59
  br label %62

62:                                               ; preds = %61
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %41

64:                                               ; preds = %59, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %65 = load i32, ptr %14, align 4
  switch i32 %65, label %67 [
    i32 2, label %66
  ]

66:                                               ; preds = %64
  store i1 false, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %67

67:                                               ; preds = %66, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %68

68:                                               ; preds = %67, %20
  %69 = load i1, ptr %4, align 1
  ret i1 %69
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { 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 #5 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"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.hipsycl::rt::device_id" = type { %"struct.hipsycl::rt::backend_descriptor", i32 }
%"struct.hipsycl::rt::backend_descriptor" = type { i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator.66" = type { ptr }

; 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

declare noundef i32 @_ZNK7hipsycl2rt9device_id6get_idEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1

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

; 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 #1

declare { i64, i64 } @_ZNK7hipsycl2rt8dag_node19get_assigned_deviceEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_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_cxxneIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7hipsycl2rt20multi_queue_executor24find_assigned_lane_indexERKSt10shared_ptrINS0_8dag_nodeEERm(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2) local_unnamed_addr #4 align 2 {
  %4 = alloca %"class.hipsycl::rt::device_id", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.66", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.66", align 8
  %7 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %8 = tail call noundef zeroext i1 @_ZNK7hipsycl2rt8dag_node12is_submittedEv(ptr noundef nonnull align 8 dereferenceable(384) %7)
  br i1 %8, label %9, label %34

9:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %10 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN7hipsycl2rt8dag_nodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %11 = tail call { i64, i64 } @_ZNK7hipsycl2rt8dag_node19get_assigned_deviceEv(ptr noundef nonnull align 8 dereferenceable(384) %10)
  %12 = extractvalue { i64, i64 } %11, 0
  store i64 %12, ptr %4, align 8
  %13 = getelementptr inbounds i8, ptr %4, i64 8
  %14 = extractvalue { i64, i64 } %11, 1
  store i64 %14, ptr %13, align 8
  %15 = call noundef i32 @_ZNK7hipsycl2rt9device_id6get_idEv(ptr noundef nonnull align 4 dereferenceable(16) %4)
  %16 = sext i32 %15 to i64
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNKSt6vectorIN7hipsycl2rt20multi_queue_executor15per_device_dataESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %16) #5
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = call ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %20, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %21 = call ptr @_ZNKSt6vectorISt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS3_EESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %21, ptr %6, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %22, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %9, %29
  %.01620 = phi i64 [ %30, %29 ], [ 0, %9 ]
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %24 = call noundef ptr @_ZNKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 40
  %27 = load ptr, ptr %26, align 8
  %28 = call noundef zeroext i1 %27(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br i1 %28, label %33, label %29

29:                                               ; preds = %.lr.ph
  %30 = add i64 %.01620, 1
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %32 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10unique_ptrIN7hipsycl2rt16inorder_executorESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %32, label %.lr.ph, label %.critedge

33:                                               ; preds = %.lr.ph
  store i64 %.01620, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %34

.critedge:                                        ; preds = %29, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %34

34:                                               ; preds = %33, %.critedge, %3
  %.4 = phi i1 [ false, %3 ], [ false, %.critedge ], [ true, %33 ]
  ret i1 %.4
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


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