; LLVM IR from NVIDIA/DALI :: dali/c_api_2/data_objects.ll (ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement)

; 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::c_api::RefCountedPtr.12" = type { ptr }
%struct._DALIBufferPlacement = type { i32, i32, i8 }
%"class.std::shared_ptr.13" = type { %"class.std::__shared_ptr.14" }
%"class.std::__shared_ptr.14" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.dali::c_api::RefCountedPtr.24" = type { ptr }
%"class.std::shared_ptr.25" = type { %"class.std::__shared_ptr.26" }
%"class.std::__shared_ptr.26" = type { ptr, %"class.std::__shared_count" }
%"class.dali::c_api::RefCountedPtr.34" = type { ptr }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement = external hidden unnamed_addr constant [90 x i8], align 1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali5c_api8ValidateERK20_DALIBufferPlacement(ptr noundef nonnull align 4 dereferenceable(12)) #1

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

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) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.12") align 8 %0, i64 %1, i8 %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %struct._DALIBufferPlacement, align 4
  %6 = alloca { i64, i8 }, align 4
  %7 = alloca %"class.std::shared_ptr.13", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.dali::c_api::RefCountedPtr.24", align 8
  %11 = alloca %"class.std::shared_ptr.13", align 8
  %12 = alloca %"class.std::shared_ptr.25", align 8
  %13 = alloca %"class.dali::c_api::RefCountedPtr.34", align 8
  %14 = alloca %"class.std::shared_ptr.25", align 8
  store ptr %0, ptr %4, align 8
  %15 = getelementptr inbounds { i64, i8 }, ptr %6, i32 0, i32 0
  store i64 %1, ptr %15, align 4
  %16 = getelementptr inbounds { i64, i8 }, ptr %6, i32 0, i32 1
  store i8 %2, ptr %16, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %6, i64 12, i1 false)
  call void @_ZN4dali5c_api8ValidateERK20_DALIBufferPlacement(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %17 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 0
  %18 = load i32, ptr %17, align 4, !tbaa !5
  switch i32 %18, label %64 [
    i32 0, label %19
    i32 1, label %44
  ]

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  call void @_ZSt11make_sharedIN4dali10TensorListINS0_10CPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.13") align 8 %7)
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  %21 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 2
  %22 = load i8, ptr %21, align 4, !tbaa !12, !range !13, !noundef !14
  %23 = trunc i8 %22 to i1
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304) %20, i1 noundef zeroext %23)
          to label %24 unwind label %33

24:                                               ; preds = %19
  %25 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 2
  %26 = load i8, ptr %25, align 4, !tbaa !12, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %37

28:                                               ; preds = %24
  %29 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  %30 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !15
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304) %29, i32 noundef %31)
          to label %32 unwind label %33

32:                                               ; preds = %28
  br label %37

33:                                               ; preds = %28, %19
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %8, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %9, align 4
  br label %43

37:                                               ; preds = %32, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @_ZNSt10shared_ptrIN4dali10TensorListINS0_10CPUBackendEEEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  invoke void @_ZN4dali5c_api4WrapINS_10CPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind writable sret(%"class.dali::c_api::RefCountedPtr.24") align 8 %10, ptr noundef %11)
          to label %38 unwind label %39

38:                                               ; preds = %37
  call void @_ZN4dali5c_api13RefCountedPtrINS0_11ITensorListEEC2INS0_17TensorListWrapperINS_10CPUBackendEEETnNSt9enable_ifIXsr3stdE16is_convertible_vIPT_PS2_EEiE4typeELi0EEEONS1_IS9_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZN4dali5c_api13RefCountedPtrINS0_17TensorListWrapperINS_10CPUBackendEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  br label %65

39:                                               ; preds = %37
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %8, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %43

43:                                               ; preds = %39, %33
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  br label %66

44:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @_ZSt11make_sharedIN4dali10TensorListINS0_10GPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.25") align 8 %12)
  %45 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  %46 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 2
  %47 = load i8, ptr %46, align 4, !tbaa !12, !range !13, !noundef !14
  %48 = trunc i8 %47 to i1
  invoke void @_ZN4dali10TensorListINS_10GPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304) %45, i1 noundef zeroext %48)
          to label %49 unwind label %55

49:                                               ; preds = %44
  %50 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  %51 = getelementptr inbounds %struct._DALIBufferPlacement, ptr %5, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !15
  invoke void @_ZN4dali10TensorListINS_10GPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304) %50, i32 noundef %52)
          to label %53 unwind label %55

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @_ZNSt10shared_ptrIN4dali10TensorListINS0_10GPUBackendEEEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  invoke void @_ZN4dali5c_api4WrapINS_10GPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind writable sret(%"class.dali::c_api::RefCountedPtr.34") align 8 %13, ptr noundef %14)
          to label %54 unwind label %59

54:                                               ; preds = %53
  call void @_ZN4dali5c_api13RefCountedPtrINS0_11ITensorListEEC2INS0_17TensorListWrapperINS_10GPUBackendEEETnNSt9enable_ifIXsr3stdE16is_convertible_vIPT_PS2_EEiE4typeELi0EEEONS1_IS9_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @_ZN4dali5c_api13RefCountedPtrINS0_17TensorListWrapperINS_10GPUBackendEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %65

55:                                               ; preds = %49, %44
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %8, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %9, align 4
  br label %63

59:                                               ; preds = %53
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %8, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %63

63:                                               ; preds = %59, %55
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %66

64:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 64, ptr noundef @__PRETTY_FUNCTION__._ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement) #8
  unreachable

65:                                               ; preds = %54, %38
  ret void

66:                                               ; preds = %63, %43
  %67 = load ptr, ptr %8, align 8
  %68 = load i32, ptr %9, align 4
  %69 = insertvalue { ptr, i32 } poison, ptr %67, 0
  %70 = insertvalue { ptr, i32 } %69, i32 %68, 1
  resume { ptr, i32 } %70
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN4dali10TensorListINS0_10CPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.13") align 8) #1

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304), i1 noundef zeroext) #6

declare void @_ZN4dali10TensorListINS_10CPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304), i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api4WrapINS_10CPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.24") align 8, ptr noundef) #4

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN4dali10TensorListINS0_10GPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.25") align 8) #1

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

declare void @_ZN4dali10TensorListINS_10GPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304), i1 noundef zeroext) #6

declare void @_ZN4dali10TensorListINS_10GPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304), i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api4WrapINS_10GPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.34") align 8, ptr noundef) #4

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

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

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 = { "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 = { 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, !7, i64 0}
!6 = !{!"_ZTS20_DALIBufferPlacement", !7, i64 0, !10, i64 4, !11, i64 8}
!7 = !{!"_ZTS19daliStorageDevice_t", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !11, i64 8}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !10, i64 4}


; 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::c_api::RefCountedPtr.12" = type { ptr }
%struct._DALIBufferPlacement = type { i32, i32, i8 }
%"class.std::shared_ptr.13" = type { %"class.std::__shared_ptr.14" }
%"class.std::__shared_ptr.14" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.dali::c_api::RefCountedPtr.24" = type { ptr }
%"class.std::shared_ptr.25" = type { %"class.std::__shared_ptr.26" }
%"class.std::__shared_ptr.26" = type { ptr, %"class.std::__shared_count" }
%"class.dali::c_api::RefCountedPtr.34" = type { ptr }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali5c_api8ValidateERK20_DALIBufferPlacement(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.12") align 8 %0, i64 %1, i8 %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct._DALIBufferPlacement, align 8
  %5 = alloca %"class.std::shared_ptr.13", align 8
  %6 = alloca %"class.dali::c_api::RefCountedPtr.24", align 8
  %7 = alloca %"class.std::shared_ptr.13", align 8
  %8 = alloca %"class.std::shared_ptr.25", align 8
  %9 = alloca %"class.dali::c_api::RefCountedPtr.34", align 8
  %10 = alloca %"class.std::shared_ptr.25", align 8
  store i64 %1, ptr %4, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i8 %2, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZN4dali5c_api8ValidateERK20_DALIBufferPlacement(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %11 = load i32, ptr %4, align 8, !tbaa !5
  switch i32 %11, label %45 [
    i32 0, label %12
    i32 1, label %30
  ]

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @_ZSt11make_sharedIN4dali10TensorListINS0_10CPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.13") align 8 %5)
  %13 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %14 = load i8, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !12, !range !13, !noundef !14
  %15 = trunc nuw i8 %14 to i1
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304) %13, i1 noundef zeroext %15)
          to label %16 unwind label %23

16:                                               ; preds = %12
  %17 = load i8, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !12, !range !13, !noundef !14
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %19, label %25

19:                                               ; preds = %16
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %21 = getelementptr inbounds i8, ptr %4, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !15
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304) %20, i32 noundef %22)
          to label %25 unwind label %23

23:                                               ; preds = %19, %12
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %29

25:                                               ; preds = %19, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZNSt10shared_ptrIN4dali10TensorListINS0_10CPUBackendEEEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  invoke void @_ZN4dali5c_api4WrapINS_10CPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind nonnull writable sret(%"class.dali::c_api::RefCountedPtr.24") align 8 %6, ptr noundef nonnull %7)
          to label %26 unwind label %27

26:                                               ; preds = %25
  call void @_ZN4dali5c_api13RefCountedPtrINS0_11ITensorListEEC2INS0_17TensorListWrapperINS_10CPUBackendEEETnNSt9enable_ifIXsr3stdE16is_convertible_vIPT_PS2_EEiE4typeELi0EEEONS1_IS9_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @_ZN4dali5c_api13RefCountedPtrINS0_17TensorListWrapperINS_10CPUBackendEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %46

27:                                               ; preds = %25
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %29

29:                                               ; preds = %27, %23
  %.pn5 = phi { ptr, i32 } [ %28, %27 ], [ %24, %23 ]
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10CPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %47

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @_ZSt11make_sharedIN4dali10TensorListINS0_10GPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.25") align 8 %8)
  %31 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  %32 = load i8, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !12, !range !13, !noundef !14
  %33 = trunc nuw i8 %32 to i1
  invoke void @_ZN4dali10TensorListINS_10GPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304) %31, i1 noundef zeroext %33)
          to label %34 unwind label %40

34:                                               ; preds = %30
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  %36 = getelementptr inbounds i8, ptr %4, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !15
  invoke void @_ZN4dali10TensorListINS_10GPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304) %35, i32 noundef %37)
          to label %38 unwind label %40

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt10shared_ptrIN4dali10TensorListINS0_10GPUBackendEEEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  invoke void @_ZN4dali5c_api4WrapINS_10GPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind nonnull writable sret(%"class.dali::c_api::RefCountedPtr.34") align 8 %9, ptr noundef nonnull %10)
          to label %39 unwind label %42

39:                                               ; preds = %38
  call void @_ZN4dali5c_api13RefCountedPtrINS0_11ITensorListEEC2INS0_17TensorListWrapperINS_10GPUBackendEEETnNSt9enable_ifIXsr3stdE16is_convertible_vIPT_PS2_EEiE4typeELi0EEEONS1_IS9_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @_ZN4dali5c_api13RefCountedPtrINS0_17TensorListWrapperINS_10GPUBackendEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %46

40:                                               ; preds = %34, %30
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %38
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @_ZNSt12__shared_ptrIN4dali10TensorListINS0_10GPUBackendEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %47

45:                                               ; preds = %3
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 64, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali5c_api11ITensorList6CreateE20_DALIBufferPlacement) #7
  unreachable

46:                                               ; preds = %39, %26
  ret void

47:                                               ; preds = %44, %29
  %.pn.pn = phi { ptr, i32 } [ %.pn, %44 ], [ %.pn5, %29 ]
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN4dali10TensorListINS0_10CPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.13") align 8) local_unnamed_addr #0

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304), i1 noundef zeroext) local_unnamed_addr #5

declare void @_ZN4dali10TensorListINS_10CPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304), i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api4WrapINS_10CPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.24") align 8, ptr noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN4dali10TensorListINS0_10GPUBackendEEEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.25") align 8) local_unnamed_addr #0

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

declare void @_ZN4dali10TensorListINS_10GPUBackendEE10set_pinnedEb(ptr noundef nonnull align 8 dereferenceable(304), i1 noundef zeroext) local_unnamed_addr #5

declare void @_ZN4dali10TensorListINS_10GPUBackendEE13set_device_idEi(ptr noundef nonnull align 8 dereferenceable(304), i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali5c_api4WrapINS_10GPUBackendEEENS0_13RefCountedPtrINS0_17TensorListWrapperIT_EEEESt10shared_ptrINS_10TensorListIS5_EEE(ptr dead_on_unwind noalias writable sret(%"class.dali::c_api::RefCountedPtr.34") align 8, ptr noundef) local_unnamed_addr #3

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 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 = { "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, !7, i64 0}
!6 = !{!"_ZTS20_DALIBufferPlacement", !7, i64 0, !10, i64 4, !11, i64 8}
!7 = !{!"_ZTS19daliStorageDevice_t", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !11, i64 8}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !10, i64 4}


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