; LLVM IR from NVIDIA/DALI :: dali/c_api_2 (pipeline)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::optional.252" = type { %"struct.std::_Optional_base.253" }
%"struct.std::_Optional_base.253" = type { %"struct.std::_Optional_payload.255" }
%"struct.std::_Optional_payload.255" = type { %"struct.std::_Optional_payload_base.base.257", [7 x i8] }
%"struct.std::_Optional_payload_base.base.257" = type <{ %"union.std::_Optional_payload_base<std::basic_string_view<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::basic_string_view<char>>::_Storage" = type { %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"class.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>
%"class.std::__exception_ptr::exception_ptr" = type { ptr }

@.str.23 = external hidden unnamed_addr constant [27 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali5c_api9ToPointerEP13_DALIPipeline(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api15PipelineWrapper9FeedInputESt17basic_string_viewIcSt11char_traitsIcEEPKNS0_11ITensorListESt8optionalIS5_E19_DALIFeedInputFlagsNS_11AccessOrderE(ptr noundef nonnull align 8 dereferenceable(32), i64, ptr, ptr noundef, ptr noundef byval(%"class.std::optional.252") align 8, i32 noundef, ptr noundef byval(%"class.dali::AccessOrder") align 8) #1 align 2

declare noundef i32 @_ZN4dali5c_api9CheckInitEv() #2

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

declare ptr @__cxa_begin_catch(ptr)

declare noundef i32 @_ZN4dali5c_api11HandleErrorENSt15__exception_ptr13exception_ptrE(ptr noundef) #2

; Function Attrs: nounwind
declare void @_ZSt17current_exceptionv(ptr dead_on_unwind writable sret(%"class.std::__exception_ptr::exception_ptr") align 8) #4

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

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api12CheckNotNullIKcEEvPT_St17basic_string_viewIcSt11char_traitsIcEE(ptr noundef, i64, ptr) #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @daliPipelineFeedInput(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) #1 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.std::basic_string_view", align 8
  %20 = alloca %"class.std::basic_string_view", align 8
  %21 = alloca %"class.std::optional.252", align 8
  %22 = alloca %"class.dali::AccessOrder", align 8
  %23 = alloca %"class.std::__exception_ptr::exception_ptr", align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %24 = invoke noundef i32 @_ZN4dali5c_api9CheckInitEv()
          to label %25 unwind label %30

25:                                               ; preds = %6
  store i32 %24, ptr %14, align 4, !tbaa !11
  %26 = load i32, ptr %14, align 4, !tbaa !11
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %34

28:                                               ; preds = %25
  %29 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %29, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %36

30:                                               ; preds = %6
  %31 = landingpad { ptr, i32 }
          catch ptr null
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %15, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %73

34:                                               ; preds = %25
  br label %35

35:                                               ; preds = %34
  store i32 0, ptr %17, align 4
  br label %36

36:                                               ; preds = %35, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  %37 = load i32, ptr %17, align 4
  switch i32 %37, label %94 [
    i32 0, label %38
    i32 1, label %84
  ]

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = invoke noundef ptr @_ZN4dali5c_api9ToPointerEP13_DALIPipeline(ptr noundef %39)
          to label %41 unwind label %69

41:                                               ; preds = %38
  store ptr %40, ptr %18, align 8, !tbaa !5
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef @.str.23) #8
  %43 = getelementptr inbounds { i64, ptr }, ptr %19, i32 0, i32 0
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds { i64, ptr }, ptr %19, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8
  invoke void @_ZN4dali5c_api12CheckNotNullIKcEEvPT_St17basic_string_viewIcSt11char_traitsIcEE(ptr noundef %42, i64 %44, ptr %46)
          to label %47 unwind label %69

47:                                               ; preds = %41
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef %49) #8
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = invoke noundef ptr @_ZN4dali5c_api9ToPointerEP15_DALITensorList(ptr noundef %50)
          to label %52 unwind label %69

52:                                               ; preds = %47
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN4dali5c_api16ToOptionalStringEPKc(ptr dead_on_unwind writable sret(%"class.std::optional.252") align 8 %21, ptr noundef %53)
          to label %54 unwind label %69

54:                                               ; preds = %52
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %62

58:                                               ; preds = %54
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  invoke void @_ZN4dali11AccessOrderC1EP11CUstream_st(ptr noundef nonnull align 8 dereferenceable(12) %22, ptr noundef %60)
          to label %61 unwind label %69

61:                                               ; preds = %58
  br label %63

62:                                               ; preds = %54
  call void @llvm.memset.p0.i64(ptr align 8 %22, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %22) #8
  br label %63

63:                                               ; preds = %62, %61
  %64 = getelementptr inbounds { i64, ptr }, ptr %20, i32 0, i32 0
  %65 = load i64, ptr %64, align 8
  %66 = getelementptr inbounds { i64, ptr }, ptr %20, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8
  invoke void @_ZN4dali5c_api15PipelineWrapper9FeedInputESt17basic_string_viewIcSt11char_traitsIcEEPKNS0_11ITensorListESt8optionalIS5_E19_DALIFeedInputFlagsNS_11AccessOrderE(ptr noundef nonnull align 8 dereferenceable(32) %48, i64 %65, ptr %67, ptr noundef %51, ptr noundef byval(%"class.std::optional.252") align 8 %21, i32 noundef %55, ptr noundef byval(%"class.dali::AccessOrder") align 8 %22)
          to label %68 unwind label %69

68:                                               ; preds = %63
  store i32 0, ptr %7, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %84

69:                                               ; preds = %63, %58, %52, %47, %41, %38
  %70 = landingpad { ptr, i32 }
          catch ptr null
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %15, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %73

73:                                               ; preds = %69, %30
  %74 = load ptr, ptr %15, align 8
  %75 = call ptr @__cxa_begin_catch(ptr %74) #8
  call void @_ZSt17current_exceptionv(ptr dead_on_unwind writable sret(%"class.std::__exception_ptr::exception_ptr") align 8 %23) #8
  %76 = invoke noundef i32 @_ZN4dali5c_api11HandleErrorENSt15__exception_ptr13exception_ptrE(ptr noundef %23)
          to label %77 unwind label %78

77:                                               ; preds = %73
  store i32 %76, ptr %7, align 4
  call void @_ZNSt15__exception_ptr13exception_ptrD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #8
  store i32 1, ptr %17, align 4
  call void @__cxa_end_catch()
  br label %84

78:                                               ; preds = %73
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %15, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %16, align 4
  call void @_ZNSt15__exception_ptr13exception_ptrD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #8
  invoke void @__cxa_end_catch()
          to label %82 unwind label %91

82:                                               ; preds = %78
  br label %86

83:                                               ; No predecessors!
  unreachable

84:                                               ; preds = %77, %68, %36
  %85 = load i32, ptr %7, align 4
  ret i32 %85

86:                                               ; preds = %82
  %87 = load ptr, ptr %15, align 8
  %88 = load i32, ptr %16, align 4
  %89 = insertvalue { ptr, i32 } poison, ptr %87, 0
  %90 = insertvalue { ptr, i32 } %89, i32 %88, 1
  resume { ptr, i32 } %90

91:                                               ; preds = %78
  %92 = landingpad { ptr, i32 }
          catch ptr null
  %93 = extractvalue { ptr, i32 } %92, 0
  call void @__clang_call_terminate(ptr %93) #9
  unreachable

94:                                               ; preds = %36
  unreachable
}

declare noundef ptr @_ZN4dali5c_api9ToPointerEP15_DALITensorList(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4dali5c_api16ToOptionalStringEPKc(ptr dead_on_unwind noalias writable sret(%"class.std::optional.252") align 8, ptr noundef) #3

declare void @_ZN4dali11AccessOrderC1EP11CUstream_st(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) unnamed_addr #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 #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 = { noinline noreturn nounwind uwtable "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 = { nounwind }
attributes #9 = { 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 = !{!"_ZTS19_DALIFeedInputFlags", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS12daliResult_t", !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.std::optional.252" = type { %"struct.std::_Optional_base.253" }
%"struct.std::_Optional_base.253" = type { %"struct.std::_Optional_payload.255" }
%"struct.std::_Optional_payload.255" = type { %"struct.std::_Optional_payload_base.base.257", [7 x i8] }
%"struct.std::_Optional_payload_base.base.257" = type <{ %"union.std::_Optional_payload_base<std::basic_string_view<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::basic_string_view<char>>::_Storage" = type { %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"class.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>
%"class.std::__exception_ptr::exception_ptr" = type { ptr }

@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali5c_api9ToPointerEP13_DALIPipeline(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api15PipelineWrapper9FeedInputESt17basic_string_viewIcSt11char_traitsIcEEPKNS0_11ITensorListESt8optionalIS5_E19_DALIFeedInputFlagsNS_11AccessOrderE(ptr noundef nonnull align 8 dereferenceable(32), i64, ptr, ptr noundef, ptr noundef byval(%"class.std::optional.252") align 8, i32 noundef, ptr noundef byval(%"class.dali::AccessOrder") align 8) local_unnamed_addr #0 align 2

declare noundef i32 @_ZN4dali5c_api9CheckInitEv() local_unnamed_addr #1

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare noundef i32 @_ZN4dali5c_api11HandleErrorENSt15__exception_ptr13exception_ptrE(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZSt17current_exceptionv(ptr dead_on_unwind writable sret(%"class.std::__exception_ptr::exception_ptr") align 8) local_unnamed_addr #3

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

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api12CheckNotNullIKcEEvPT_St17basic_string_viewIcSt11char_traitsIcEE(ptr noundef, i64, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @daliPipelineFeedInput(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef readonly %5) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::basic_string_view", align 8
  %8 = alloca %"class.std::basic_string_view", align 8
  %9 = alloca %"class.std::optional.252", align 8
  %10 = alloca %"class.dali::AccessOrder", align 8
  %11 = alloca %"class.std::__exception_ptr::exception_ptr", align 8
  %12 = invoke noundef i32 @_ZN4dali5c_api9CheckInitEv()
          to label %13 unwind label %14

13:                                               ; preds = %6
  %.not.not = icmp eq i32 %12, 0
  br i1 %.not.not, label %16, label %40

14:                                               ; preds = %6
  %15 = landingpad { ptr, i32 }
          catch ptr null
  br label %34

16:                                               ; preds = %13
  %17 = invoke noundef ptr @_ZN4dali5c_api9ToPointerEP13_DALIPipeline(ptr noundef %0)
          to label %18 unwind label %32

18:                                               ; preds = %16
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef @.str.23) #7
  %19 = load i64, ptr %7, align 8
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  %21 = load ptr, ptr %20, align 8
  invoke void @_ZN4dali5c_api12CheckNotNullIKcEEvPT_St17basic_string_viewIcSt11char_traitsIcEE(ptr noundef %1, i64 %19, ptr %21)
          to label %22 unwind label %32

22:                                               ; preds = %18
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %1) #7
  %23 = invoke noundef ptr @_ZN4dali5c_api9ToPointerEP15_DALITensorList(ptr noundef %2)
          to label %24 unwind label %32

24:                                               ; preds = %22
  call void @_ZN4dali5c_api16ToOptionalStringEPKc(ptr dead_on_unwind nonnull writable sret(%"class.std::optional.252") align 8 %9, ptr noundef %3)
  %.not17 = icmp eq ptr %5, null
  br i1 %.not17, label %27, label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN4dali11AccessOrderC1EP11CUstream_st(ptr noundef nonnull align 8 dereferenceable(12) %10, ptr noundef %26)
          to label %28 unwind label %32

27:                                               ; preds = %24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %10, i8 0, i64 16, i1 false)
  call void @_ZN4dali11AccessOrderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %10) #7
  br label %28

28:                                               ; preds = %25, %27
  %29 = load i64, ptr %8, align 8
  %30 = getelementptr inbounds i8, ptr %8, i64 8
  %31 = load ptr, ptr %30, align 8
  invoke void @_ZN4dali5c_api15PipelineWrapper9FeedInputESt17basic_string_viewIcSt11char_traitsIcEEPKNS0_11ITensorListESt8optionalIS5_E19_DALIFeedInputFlagsNS_11AccessOrderE(ptr noundef nonnull align 8 dereferenceable(32) %17, i64 %29, ptr %31, ptr noundef %23, ptr noundef nonnull byval(%"class.std::optional.252") align 8 %9, i32 noundef %4, ptr noundef nonnull byval(%"class.dali::AccessOrder") align 8 %10)
          to label %40 unwind label %32

32:                                               ; preds = %28, %25, %22, %18, %16
  %33 = landingpad { ptr, i32 }
          catch ptr null
  br label %34

34:                                               ; preds = %32, %14
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %15, %14 ]
  %.016 = extractvalue { ptr, i32 } %.pn, 0
  %35 = call ptr @__cxa_begin_catch(ptr %.016) #7
  call void @_ZSt17current_exceptionv(ptr dead_on_unwind nonnull writable sret(%"class.std::__exception_ptr::exception_ptr") align 8 %11) #7
  %36 = invoke noundef i32 @_ZN4dali5c_api11HandleErrorENSt15__exception_ptr13exception_ptrE(ptr noundef nonnull %11)
          to label %37 unwind label %38

37:                                               ; preds = %34
  call void @_ZNSt15__exception_ptr13exception_ptrD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @__cxa_end_catch()
  br label %40

38:                                               ; preds = %34
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__exception_ptr13exception_ptrD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  invoke void @__cxa_end_catch()
          to label %41 unwind label %42

40:                                               ; preds = %13, %28, %37
  %.1 = phi i32 [ %12, %13 ], [ %36, %37 ], [ 0, %28 ]
  ret i32 %.1

41:                                               ; preds = %38
  resume { ptr, i32 } %39

42:                                               ; preds = %38
  %43 = landingpad { ptr, i32 }
          catch ptr null
  %44 = extractvalue { ptr, i32 } %43, 0
  call void @__clang_call_terminate(ptr %44) #8
  unreachable
}

declare noundef ptr @_ZN4dali5c_api9ToPointerEP15_DALITensorList(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4dali5c_api16ToOptionalStringEPKc(ptr dead_on_unwind noalias writable sret(%"class.std::optional.252") align 8, ptr noundef) local_unnamed_addr #2

declare void @_ZN4dali11AccessOrderC1EP11CUstream_st(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) unnamed_addr #1

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

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

attributes #0 = { 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 #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 = { 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 #4 = { 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 #5 = { noinline noreturn nounwind uwtable "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { 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"}


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