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

; 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"

%struct._DALIPipelineIODesc = type { ptr, i32, %struct.anon.174, i32, i32, ptr }
%struct.anon.174 = type { i8, [3 x i8] }
%"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.dali::c_api::PipelineWrapper" = type { %"class.std::unique_ptr", %"class.std::vector" }
%"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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::basic_string_view<char>, std::allocator<std::basic_string_view<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::basic_string_view<char>, std::allocator<std::basic_string_view<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::basic_string_view<char>, std::allocator<std::basic_string_view<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::basic_string_view<char>, std::allocator<std::basic_string_view<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.dali::PipelineOutputDesc" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i32, %"class.dali::TensorLayout", [4 x i8] }>
%"class.dali::TensorLayout" = type { [16 x i8] }

@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTISt12out_of_range = external constant ptr
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@__const._ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi.desc = external hidden unnamed_addr constant %struct._DALIPipelineIODesc, align 8

; 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

declare void @_ZNSt12out_of_rangeC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt12out_of_rangeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNKR4dali8Pipeline12output_descsEv(ptr noundef nonnull align 8 dereferenceable(1024)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi(ptr dead_on_unwind noalias writable sret(%struct._DALIPipelineIODesc) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i1, align 1
  %13 = alloca ptr, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !9
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %15 = getelementptr inbounds %"class.dali::c_api::PipelineWrapper", ptr %14, i32 0, i32 0
  %16 = call noundef ptr @_ZNKSt10unique_ptrIN4dali8PipelineESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKR4dali8Pipeline12output_descsEv(ptr noundef nonnull align 8 dereferenceable(1024) %16)
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNKSt6vectorIN4dali18PipelineOutputDescESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %7, align 4, !tbaa !9
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %27, label %23

23:                                               ; preds = %3
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = icmp sge i32 %24, %25
  br i1 %26, label %27, label %45

27:                                               ; preds = %23, %3
  store i1 true, ptr %12, align 1
  %28 = call ptr @__cxa_allocate_exception(i64 16) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = sub nsw i32 %29, 1
  store i32 %30, ptr %9, align 4, !tbaa !9
  invoke void @_ZN4dali11make_stringIJA18_ciA38_ciA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 1 dereferenceable(18) @.str.16, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(38) @.str.17, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 1 dereferenceable(3) @.str.8)
          to label %31 unwind label %33

31:                                               ; preds = %27
  invoke void @_ZNSt12out_of_rangeC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %32 unwind label %37

32:                                               ; preds = %31
  store i1 false, ptr %12, align 1
  invoke void @__cxa_throw(ptr %28, ptr @_ZTISt12out_of_range, ptr @_ZNSt12out_of_rangeD1Ev) #7
          to label %98 unwind label %37

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %10, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %11, align 4
  br label %41

37:                                               ; preds = %32, %31
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %10, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %41

41:                                               ; preds = %37, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  %42 = load i1, ptr %12, align 1
  br i1 %42, label %43, label %44

43:                                               ; preds = %41
  call void @__cxa_free_exception(ptr %28) #6
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %93

45:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(60) ptr @_ZNKSt6vectorIN4dali18PipelineOutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %48) #6
  store ptr %49, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 @__const._ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi.desc, i64 32, i1 false)
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 1
  store i32 %52, ptr %53, align 8, !tbaa !19
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !23
  %57 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 3
  store i32 %56, ptr %57, align 8, !tbaa !24
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 4, !tbaa !23
  %61 = icmp ne i32 %60, -1
  %62 = zext i1 %61 to i32
  %63 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 2
  %64 = trunc i32 %62 to i8
  %65 = load i8, ptr %63, align 4
  %66 = and i8 %64, 1
  %67 = and i8 %65, -2
  %68 = or i8 %67, %66
  store i8 %68, ptr %63, align 4
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %69, i32 0, i32 0
  %71 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %70) #6
  %72 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 0
  store ptr %71, ptr %72, align 8, !tbaa !25
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 8, !tbaa !26
  %76 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 4
  store i32 %75, ptr %76, align 4, !tbaa !27
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %77, i32 0, i32 3
  %79 = load i32, ptr %78, align 8, !tbaa !26
  %80 = icmp sge i32 %79, 0
  %81 = zext i1 %80 to i32
  %82 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 2
  %83 = trunc i32 %81 to i8
  %84 = load i8, ptr %82, align 4
  %85 = and i8 %83, 1
  %86 = shl i8 %85, 1
  %87 = and i8 %84, -3
  %88 = or i8 %87, %86
  store i8 %88, ptr %82, align 4
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.dali::PipelineOutputDesc", ptr %89, i32 0, i32 4
  %91 = call noundef ptr @_ZNK4dali12TensorLayout5c_strEv(ptr noundef nonnull align 1 dereferenceable(16) %90) #6
  %92 = getelementptr inbounds %struct._DALIPipelineIODesc, ptr %0, i32 0, i32 5
  store ptr %91, ptr %92, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  ret void

93:                                               ; preds = %44
  %94 = load ptr, ptr %10, align 8
  %95 = load i32, ptr %11, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97

98:                                               ; preds = %32
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11make_stringIJA18_ciA38_ciA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 1 dereferenceable(18), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(38), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(3)) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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, !16, i64 32}
!12 = !{!"_ZTSN4dali18PipelineOutputDescE", !13, i64 0, !16, i64 32, !17, i64 36, !10, i64 40, !18, i64 44}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN4dali13StorageDeviceE", !7, i64 0}
!17 = !{!"_ZTS13_DALIDataType", !7, i64 0}
!18 = !{!"_ZTSN4dali12TensorLayoutE", !7, i64 0}
!19 = !{!20, !21, i64 8}
!20 = !{!"_ZTS19_DALIPipelineIODesc", !6, i64 0, !21, i64 8, !22, i64 12, !17, i64 16, !10, i64 20, !6, i64 24}
!21 = !{!"_ZTS19daliStorageDevice_t", !7, i64 0}
!22 = !{!"_ZTSN19_DALIPipelineIODescUt_E", !10, i64 0, !10, i64 0}
!23 = !{!12, !17, i64 36}
!24 = !{!20, !17, i64 16}
!25 = !{!20, !6, i64 0}
!26 = !{!12, !10, i64 40}
!27 = !{!20, !10, i64 20}
!28 = !{!20, !6, i64 24}


; 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"

%struct._DALIPipelineIODesc = type { ptr, i32, %struct.anon.174, i32, i32, ptr }
%struct.anon.174 = type { i8, [3 x i8] }
%"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] }

@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTISt12out_of_range = external constant ptr
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@__const._ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi.desc = external hidden unnamed_addr constant %struct._DALIPipelineIODesc, align 8

; Function Attrs: mustprogress 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

declare void @_ZNSt12out_of_rangeC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt12out_of_rangeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNKR4dali8Pipeline12output_descsEv(ptr noundef nonnull align 8 dereferenceable(1024)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi(ptr dead_on_unwind noalias nocapture writable sret(%struct._DALIPipelineIODesc) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca i32, align 4
  store i32 %2, ptr %4, align 4, !tbaa !5
  %7 = tail call noundef ptr @_ZNKSt10unique_ptrIN4dali8PipelineESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  %8 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKR4dali8Pipeline12output_descsEv(ptr noundef nonnull align 8 dereferenceable(1024) %7)
  %9 = tail call noundef i64 @_ZNKSt6vectorIN4dali18PipelineOutputDescESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %10 = trunc i64 %9 to i32
  %11 = icmp sgt i32 %2, -1
  %.not = icmp sgt i32 %10, %2
  %or.cond = and i1 %11, %.not
  br i1 %or.cond, label %23, label %12

12:                                               ; preds = %3
  %13 = tail call ptr @__cxa_allocate_exception(i64 16) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %14 = add nsw i32 %10, -1
  store i32 %14, ptr %6, align 4, !tbaa !5
  invoke void @_ZN4dali11make_stringIJA18_ciA38_ciA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 1 dereferenceable(18) @.str.16, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(38) @.str.17, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 1 dereferenceable(3) @.str.8)
          to label %15 unwind label %.thread

15:                                               ; preds = %12
  invoke void @_ZNSt12out_of_rangeC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %17 unwind label %.thread22

.thread22:                                        ; preds = %15
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %21

17:                                               ; preds = %15
  invoke void @__cxa_throw(ptr nonnull %13, ptr nonnull @_ZTISt12out_of_range, ptr nonnull @_ZNSt12out_of_rangeD1Ev) #7
          to label %48 unwind label %19

.thread:                                          ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %21

19:                                               ; preds = %17
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %22

21:                                               ; preds = %.thread22, %.thread
  %.pn21 = phi { ptr, i32 } [ %18, %.thread ], [ %16, %.thread22 ]
  call void @__cxa_free_exception(ptr %13) #6
  br label %22

22:                                               ; preds = %19, %21
  %.pn20 = phi { ptr, i32 } [ %.pn21, %21 ], [ %20, %19 ]
  resume { ptr, i32 } %.pn20

23:                                               ; preds = %3
  %24 = zext nneg i32 %2 to i64
  %25 = tail call noundef nonnull align 8 dereferenceable(60) ptr @_ZNKSt6vectorIN4dali18PipelineOutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %24) #6
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @__const._ZNKR4dali5c_api15PipelineWrapper13GetOutputDescEi.desc, i64 32, i1 false)
  %26 = getelementptr inbounds i8, ptr %25, i64 32
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %27, ptr %28, align 8, !tbaa !18
  %29 = getelementptr inbounds i8, ptr %25, i64 36
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %30, ptr %31, align 8, !tbaa !23
  %32 = icmp ne i32 %30, -1
  %33 = getelementptr inbounds i8, ptr %0, i64 12
  %34 = zext i1 %32 to i8
  %35 = load i8, ptr %33, align 4
  %36 = and i8 %35, -4
  %37 = or disjoint i8 %36, %34
  %38 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  store ptr %38, ptr %0, align 8, !tbaa !24
  %39 = getelementptr inbounds i8, ptr %25, i64 40
  %40 = load i32, ptr %39, align 8, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %40, ptr %41, align 4, !tbaa !26
  %42 = icmp sgt i32 %40, -1
  %43 = select i1 %42, i8 2, i8 0
  %44 = or disjoint i8 %43, %37
  store i8 %44, ptr %33, align 4
  %45 = getelementptr inbounds i8, ptr %25, i64 44
  %46 = tail call noundef ptr @_ZNK4dali12TensorLayout5c_strEv(ptr noundef nonnull align 1 dereferenceable(16) %45) #6
  %47 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %46, ptr %47, align 8, !tbaa !27
  ret void

48:                                               ; preds = %17
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11make_stringIJA18_ciA38_ciA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 1 dereferenceable(18), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(38), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(3)) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 32}
!10 = !{!"_ZTSN4dali18PipelineOutputDescE", !11, i64 0, !15, i64 32, !16, i64 36, !6, i64 40, !17, i64 44}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN4dali13StorageDeviceE", !7, i64 0}
!16 = !{!"_ZTS13_DALIDataType", !7, i64 0}
!17 = !{!"_ZTSN4dali12TensorLayoutE", !7, i64 0}
!18 = !{!19, !20, i64 8}
!19 = !{!"_ZTS19_DALIPipelineIODesc", !13, i64 0, !20, i64 8, !21, i64 12, !16, i64 16, !6, i64 20, !13, i64 24}
!20 = !{!"_ZTS19daliStorageDevice_t", !7, i64 0}
!21 = !{!"_ZTSN19_DALIPipelineIODescUt_E", !6, i64 0, !6, i64 0}
!22 = !{!10, !16, i64 36}
!23 = !{!19, !16, i64 16}
!24 = !{!19, !13, i64 0}
!25 = !{!10, !6, i64 40}
!26 = !{!19, !6, i64 20}
!27 = !{!19, !13, i64 24}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass