; LLVM IR from NVIDIA/DALI :: dali/pipeline/executor/executor2 (exec_node_task)

; 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.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>
%"class.dali::exec2::ExecNodeTask" = type { ptr, ptr, %"struct.dali::exec2::WorkspaceParams", %"class.std::unique_ptr", %"class.dali::CUDASharedEvent" }
%"struct.dali::exec2::WorkspaceParams" = type <{ ptr, %"class.std::shared_ptr", i32, [4 x i8] }>
%"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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.2" }
%"struct.std::_Head_base.2" = type { ptr }
%"class.dali::CUDASharedEvent" = type { %"class.std::shared_ptr.3" }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.dali::exec2::ExecNode" = type { %"class.dali::SmallVector.13", %"class.dali::SmallVector.18", %"class.std::shared_ptr.23", %"class.std::shared_ptr.23", %"class.std::unique_ptr.26", %"struct.dali::exec2::ExecEnv", %"class.std::__cxx11::basic_string", i32, i8, i8, i8, %"class.std::shared_ptr.34", %"class.std::shared_ptr.34", %"class.std::shared_ptr.34", %"class.std::unique_ptr", i8, %"class.dali::CUDASharedEvent", %"class.std::any" }
%"class.dali::SmallVector.13" = type { %union.anon.16, i64 }
%union.anon.16 = type { %struct.anon.17, [48 x i8] }
%struct.anon.17 = type { ptr, i64 }
%"class.dali::SmallVector.18" = type { %union.anon.21, i64 }
%union.anon.21 = type { %struct.anon.22, [176 x i8] }
%struct.anon.22 = type { ptr, i64 }
%"class.std::shared_ptr.23" = type { %"class.std::__shared_ptr.24" }
%"class.std::__shared_ptr.24" = type { ptr, %"class.std::__shared_count" }
%"class.std::unique_ptr.26" = type { %"struct.std::__uniq_ptr_data.27" }
%"struct.std::__uniq_ptr_data.27" = type { %"class.std::__uniq_ptr_impl.28" }
%"class.std::__uniq_ptr_impl.28" = type { %"class.std::tuple.29" }
%"class.std::tuple.29" = type { %"struct.std::_Tuple_impl.30" }
%"struct.std::_Tuple_impl.30" = type { %"struct.std::_Head_base.33" }
%"struct.std::_Head_base.33" = type { ptr }
%"struct.dali::exec2::ExecEnv" = type { ptr, %"class.dali::AccessOrder" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::shared_ptr.34" = type { %"class.std::__shared_ptr.35" }
%"class.std::__shared_ptr.35" = type { ptr, %"class.std::__shared_count" }
%"class.std::any" = type { ptr, %"union.std::any::_Storage" }
%"union.std::any::_Storage" = type { ptr }
%"struct.dali::exec2::ExecOutputDesc" = type <{ %"class.dali::SmallVector.155", i32, i8, i8, [2 x i8] }>
%"class.dali::SmallVector.155" = type { %union.anon.156, i64 }
%union.anon.156 = type { %struct.anon.157, [16 x i8] }
%struct.anon.157 = type { ptr, i64 }
%"struct.dali::exec2::ExecEdge" = type <{ ptr, ptr, i32, i32, i32, i8, [3 x i8] }>

@.str.8 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [56 x i8], align 1
@__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi = external hidden unnamed_addr constant [65 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(46) ptr @_ZN4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EEixEl(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
define dso_local { ptr, i32 } @_ZNK4dali5exec26OpTask20OutputConsumerStreamEi(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %1) #6 align 2 {
  %3 = alloca %"class.dali::AccessOrder", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.dali::AccessOrder", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.dali::AccessOrder", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  %12 = load i32, ptr %5, align 4, !tbaa !9
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds %"class.dali::exec2::ExecNodeTask", ptr %11, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %"class.dali::exec2::ExecNode", ptr %15, i32 0, i32 1
  %17 = call noundef i64 @_ZNK4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(200) %16)
  %18 = icmp ult i64 %13, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  br label %22

20:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.8, i32 noundef 416, ptr noundef @__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi) #8
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %23 = getelementptr inbounds %"class.dali::exec2::ExecNodeTask", ptr %11, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds %"class.dali::exec2::ExecNode", ptr %24, i32 0, i32 1
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZN4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EEixEl(ptr noundef nonnull align 8 dereferenceable(200) %25, i64 noundef %27)
  %29 = getelementptr inbounds %"struct.dali::exec2::ExecOutputDesc", ptr %28, i32 0, i32 0
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noundef zeroext i1 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %30)
  br i1 %31, label %32, label %33

32:                                               ; preds = %22
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #9
  store i32 1, ptr %7, align 4
  br label %78

33:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #9
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  store i64 0, ptr %9, align 8, !tbaa !26
  br label %34

34:                                               ; preds = %62, %33
  %35 = load i64, ptr %9, align 8, !tbaa !26
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef i64 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %36)
  %38 = icmp ult i64 %35, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 2, ptr %7, align 4
  br label %65

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #9
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load i64, ptr %9, align 8, !tbaa !26
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EEixEl(ptr noundef nonnull align 8 dereferenceable(40) %41, i64 noundef %42)
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.dali::exec2::ExecEdge", ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !28
  %47 = getelementptr inbounds %"class.dali::exec2::ExecNode", ptr %46, i32 0, i32 5
  %48 = getelementptr inbounds %"struct.dali::exec2::ExecEnv", ptr %47, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %48, i64 16, i1 false), !tbaa.struct !32
  %49 = call noundef zeroext i1 @_ZNK4dali11AccessOrder9is_deviceEv(ptr noundef nonnull align 8 dereferenceable(12) %10) #9
  br i1 %49, label %50, label %58

50:                                               ; preds = %40
  %51 = call noundef zeroext i1 @_ZNK4dali11AccessOrdercvbEv(ptr noundef nonnull align 8 dereferenceable(12) %8) #9
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %10, i64 12, i1 false), !tbaa.struct !32
  br label %57

53:                                               ; preds = %50
  %54 = call noundef zeroext i1 @_ZNK4dali11AccessOrderneERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %10, ptr noundef nonnull align 8 dereferenceable(12) %8) #9
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #9
  store i32 1, ptr %7, align 4
  br label %59

56:                                               ; preds = %53
  br label %57

57:                                               ; preds = %56, %52
  br label %58

58:                                               ; preds = %57, %40
  store i32 0, ptr %7, align 4
  br label %59

59:                                               ; preds = %58, %55
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #9
  %60 = load i32, ptr %7, align 4
  switch i32 %60, label %65 [
    i32 0, label %61
  ]

61:                                               ; preds = %59
  br label %62

62:                                               ; preds = %61
  %63 = load i64, ptr %9, align 8, !tbaa !26
  %64 = add i64 %63, 1
  store i64 %64, ptr %9, align 8, !tbaa !26
  br label %34, !llvm.loop !33

65:                                               ; preds = %59, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  %66 = load i32, ptr %7, align 4
  switch i32 %66, label %77 [
    i32 2, label %67
  ]

67:                                               ; preds = %65
  %68 = call noundef zeroext i1 @_ZNK4dali11AccessOrdercvbEv(ptr noundef nonnull align 8 dereferenceable(12) %8) #9
  br i1 %68, label %69, label %71

69:                                               ; preds = %67
  %70 = call noundef zeroext i1 @_ZNK4dali11AccessOrder9is_deviceEv(ptr noundef nonnull align 8 dereferenceable(12) %8) #9
  br label %71

71:                                               ; preds = %69, %67
  %72 = phi i1 [ true, %67 ], [ %70, %69 ]
  br i1 %72, label %73, label %74

73:                                               ; preds = %71
  br label %76

74:                                               ; preds = %71
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.8, i32 noundef 431, ptr noundef @__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi) #8
  unreachable

75:                                               ; No predecessors!
  br label %76

76:                                               ; preds = %75, %73
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !32
  store i32 1, ptr %7, align 4
  br label %77

77:                                               ; preds = %76, %65
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  br label %78

78:                                               ; preds = %77, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %79 = load { ptr, i32 }, ptr %3, align 8
  ret { ptr, i32 } %79
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EEixEl(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN4dali5exec212ExecNodeTaskE", !6, i64 0, !6, i64 8, !13, i64 16, !17, i64 48, !23, i64 56}
!13 = !{!"_ZTSN4dali5exec215WorkspaceParamsE", !6, i64 0, !14, i64 8, !10, i64 24}
!14 = !{!"_ZTSSt10shared_ptrIN4dali13IterationDataEE", !15, i64 0}
!15 = !{!"_ZTSSt12__shared_ptrIN4dali13IterationDataELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !16, i64 8}
!16 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIN4dali9WorkspaceESt14default_deleteIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali9WorkspaceESt14default_deleteIS1_ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIN4dali9WorkspaceESt14default_deleteIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPN4dali9WorkspaceESt14default_deleteIS1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali9WorkspaceESt14default_deleteIS1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EPN4dali9WorkspaceELb0EE", !6, i64 0}
!23 = !{!"_ZTSN4dali15CUDASharedEventE", !24, i64 0}
!24 = !{!"_ZTSSt10shared_ptrIvE", !25, i64 0}
!25 = !{!"_ZTSSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !16, i64 8}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!29, !6, i64 8}
!29 = !{!"_ZTSN4dali5exec28ExecEdgeE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !30, i64 24, !31, i64 28}
!30 = !{!"_ZTSN4dali13StorageDeviceE", !7, i64 0}
!31 = !{!"bool", !7, i64 0}
!32 = !{i64 0, i64 8, !5, i64 8, i64 4, !9}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; 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.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>

@.str.8 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [56 x i8], align 1
@__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi = external hidden unnamed_addr constant [65 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(46) ptr @_ZN4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EEixEl(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
define dso_local { ptr, i32 } @_ZNK4dali5exec26OpTask20OutputConsumerStreamEi(ptr nocapture noundef nonnull readonly align 8 dereferenceable(112) %0, i32 noundef %1) local_unnamed_addr #6 align 2 {
  %3 = alloca %"class.dali::AccessOrder", align 8
  %4 = alloca %"class.dali::AccessOrder", align 8
  %5 = alloca %"class.dali::AccessOrder", align 8
  %6 = sext i32 %1 to i64
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 72
  %10 = tail call noundef i64 @_ZNK4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(200) %9)
  %11 = icmp ugt i64 %10, %6
  br i1 %11, label %13, label %12

12:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.8, i32 noundef 416, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi) #8
  unreachable

13:                                               ; preds = %2
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 72
  %16 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZN4dali11SmallVectorINS_5exec214ExecOutputDescELm4ESaIS2_EEixEl(ptr noundef nonnull align 8 dereferenceable(200) %15, i64 noundef %6)
  %17 = tail call noundef zeroext i1 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  br i1 %17, label %18, label %19

18:                                               ; preds = %13
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #9
  br label %40

19:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #9
  %20 = call noundef i64 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  %.not17.not = icmp eq i64 %20, 0
  br i1 %.not17.not, label %.critedge16, label %.lr.ph

.lr.ph:                                           ; preds = %19, %32
  %.018 = phi i64 [ %33, %32 ], [ 0, %19 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EEixEl(ptr noundef nonnull align 8 dereferenceable(40) %16, i64 noundef %.018)
  %22 = load ptr, ptr %21, align 8, !tbaa !24
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %24, i64 320
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %25, i64 16, i1 false), !tbaa.struct !29
  %26 = call noundef zeroext i1 @_ZNK4dali11AccessOrder9is_deviceEv(ptr noundef nonnull align 8 dereferenceable(12) %5) #9
  br i1 %26, label %27, label %32

27:                                               ; preds = %.lr.ph
  %28 = call noundef zeroext i1 @_ZNK4dali11AccessOrdercvbEv(ptr noundef nonnull align 8 dereferenceable(12) %4) #9
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(12) %5, i64 12, i1 false), !tbaa.struct !29
  br label %32

30:                                               ; preds = %27
  %31 = call noundef zeroext i1 @_ZNK4dali11AccessOrderneERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 8 dereferenceable(12) %4) #9
  br i1 %31, label %.critedge14, label %32

.critedge14:                                      ; preds = %30
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  br label %39

32:                                               ; preds = %.lr.ph, %30, %29
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  %33 = add nuw i64 %.018, 1
  %34 = call noundef i64 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  %.not = icmp ult i64 %33, %34
  br i1 %.not, label %.lr.ph, label %.critedge16, !llvm.loop !31

.critedge16:                                      ; preds = %32, %19
  %35 = call noundef zeroext i1 @_ZNK4dali11AccessOrdercvbEv(ptr noundef nonnull align 8 dereferenceable(12) %4) #9
  br i1 %35, label %36, label %.critedge

36:                                               ; preds = %.critedge16
  %37 = call noundef zeroext i1 @_ZNK4dali11AccessOrder9is_deviceEv(ptr noundef nonnull align 8 dereferenceable(12) %4) #9
  br i1 %37, label %.critedge, label %38

38:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.8, i32 noundef 431, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK4dali5exec26OpTask20OutputConsumerStreamEi) #8
  unreachable

.critedge:                                        ; preds = %.critedge16, %36
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4, i64 16, i1 false), !tbaa.struct !29
  br label %39

39:                                               ; preds = %.critedge14, %.critedge
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  br label %40

40:                                               ; preds = %39, %18
  %.fca.0.load = load ptr, ptr %3, align 8
  %.fca.0.insert = insertvalue { ptr, i32 } poison, ptr %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %3, i64 8
  %.fca.1.load = load i32, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { ptr, i32 } %.fca.0.insert, i32 %.fca.1.load, 1
  ret { ptr, i32 } %.fca.1.insert
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali11SmallVectorIPNS_5exec28ExecEdgeELm4ESaIS3_EEixEl(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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, !7, i64 8}
!6 = !{!"_ZTSN4dali5exec212ExecNodeTaskE", !7, i64 0, !7, i64 8, !10, i64 16, !15, i64 48, !21, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4dali5exec215WorkspaceParamsE", !7, i64 0, !11, i64 8, !14, i64 24}
!11 = !{!"_ZTSSt10shared_ptrIN4dali13IterationDataEE", !12, i64 0}
!12 = !{!"_ZTSSt12__shared_ptrIN4dali13IterationDataELN9__gnu_cxx12_Lock_policyE2EE", !7, i64 0, !13, i64 8}
!13 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !7, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"_ZTSSt10unique_ptrIN4dali9WorkspaceESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali9WorkspaceESt14default_deleteIS1_ELb1ELb1EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_implIN4dali9WorkspaceESt14default_deleteIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt5tupleIJPN4dali9WorkspaceESt14default_deleteIS1_EEE", !19, i64 0}
!19 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali9WorkspaceESt14default_deleteIS1_EEE", !20, i64 0}
!20 = !{!"_ZTSSt10_Head_baseILm0EPN4dali9WorkspaceELb0EE", !7, i64 0}
!21 = !{!"_ZTSN4dali15CUDASharedEventE", !22, i64 0}
!22 = !{!"_ZTSSt10shared_ptrIvE", !23, i64 0}
!23 = !{!"_ZTSSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EE", !7, i64 0, !13, i64 8}
!24 = !{!7, !7, i64 0}
!25 = !{!26, !7, i64 8}
!26 = !{!"_ZTSN4dali5exec28ExecEdgeE", !7, i64 0, !7, i64 8, !14, i64 16, !14, i64 20, !27, i64 24, !28, i64 28}
!27 = !{!"_ZTSN4dali13StorageDeviceE", !8, i64 0}
!28 = !{!"bool", !8, i64 0}
!29 = !{i64 0, i64 8, !24, i64 8, i64 4, !30}
!30 = !{!14, !14, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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