; LLVM IR from flashlight/flashlight :: flashlight/fl/dataset/MergeDataset.ll (ZNK2fl12MergeDataset3getEl)

; 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::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl" }
%"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl" = type { %"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.6" = type { ptr }
%"class.std::move_iterator" = type { %"class.__gnu_cxx::__normal_iterator.6" }
%"class.fl::MergeDataset" = type { %"class.fl::Dataset", %"class.std::vector", i64 }
%"class.fl::Dataset" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<const fl::Dataset>, std::allocator<std::shared_ptr<const fl::Dataset>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<const fl::Dataset>, std::allocator<std::shared_ptr<const fl::Dataset>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<const fl::Dataset>, std::allocator<std::shared_ptr<const fl::Dataset>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<const fl::Dataset>, std::allocator<std::shared_ptr<const fl::Dataset>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; 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
define dso_local void @_ZNK2fl12MergeDataset3getEl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector.0", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.6", align 8
  %17 = alloca %"class.std::move_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.6", align 8
  %19 = alloca %"class.std::move_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.6", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.6", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %22 = load ptr, ptr %5, align 8
  %23 = load i64, ptr %6, align 8, !tbaa !9
  call void @_ZNK2fl7Dataset16checkIndexBoundsEl(ptr noundef nonnull align 8 dereferenceable(8) %22, i64 noundef %23)
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %24 = getelementptr inbounds %"class.fl::MergeDataset", ptr %22, i32 0, i32 1
  store ptr %24, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = call ptr @_ZNKSt6vectorISt10shared_ptrIKN2fl7DatasetEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %9, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = call ptr @_ZNKSt6vectorISt10shared_ptrIKN2fl7DatasetEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %10, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  br label %31

31:                                               ; preds = %96, %3
  %32 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESG_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br i1 %32, label %34, label %33

33:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %99

34:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  store ptr %35, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %6, align 8, !tbaa !9
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIKN2fl7DatasetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %37) #5
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds ptr, ptr %39, i64 0
  %41 = load ptr, ptr %40, align 8
  %42 = invoke noundef i64 %41(ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %43 unwind label %82

43:                                               ; preds = %34
  %44 = icmp slt i64 %36, %42
  br i1 %44, label %45, label %95

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = call noundef ptr @_ZNKSt19__shared_ptr_accessIKN2fl7DatasetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %46) #5
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %47, align 8, !tbaa !11
  %50 = getelementptr inbounds ptr, ptr %49, i64 1
  %51 = load ptr, ptr %50, align 8
  invoke void %51(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %14, ptr noundef nonnull align 8 dereferenceable(8) %47, i64 noundef %48)
          to label %52 unwind label %86

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %53 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %16, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN2fl6TensorESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %55 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %18, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %18, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = invoke ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr %58)
          to label %60 unwind label %90

60:                                               ; preds = %52
  %61 = getelementptr inbounds %"class.std::move_iterator", ptr %17, i32 0, i32 0
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %61, i32 0, i32 0
  store ptr %59, ptr %62, align 8
  %63 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %20, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %20, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8
  %67 = invoke ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr %66)
          to label %68 unwind label %90

68:                                               ; preds = %60
  %69 = getelementptr inbounds %"class.std::move_iterator", ptr %19, i32 0, i32 0
  %70 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %69, i32 0, i32 0
  store ptr %67, ptr %70, align 8
  %71 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %15, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8
  %73 = getelementptr inbounds %"class.std::move_iterator", ptr %17, i32 0, i32 0
  %74 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr inbounds %"class.std::move_iterator", ptr %19, i32 0, i32 0
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8
  %79 = invoke ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE6insertISt13move_iteratorIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEEvEES9_NS7_IPKS1_S3_EET_SE_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %72, ptr %75, ptr %78)
          to label %80 unwind label %90

80:                                               ; preds = %68
  %81 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.6", ptr %21, i32 0, i32 0
  store ptr %79, ptr %81, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %95

82:                                               ; preds = %34
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %12, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %13, align 4
  br label %98

86:                                               ; preds = %45
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %12, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %13, align 4
  br label %94

90:                                               ; preds = %68, %60, %52
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %12, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  br label %94

94:                                               ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %98

95:                                               ; preds = %80, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %96

96:                                               ; preds = %95
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %31

98:                                               ; preds = %94, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %103

99:                                               ; preds = %33
  store i1 true, ptr %7, align 1
  %100 = load i1, ptr %7, align 1
  br i1 %100, label %102, label %101

101:                                              ; preds = %99
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %102

102:                                              ; preds = %101, %99
  ret void

103:                                              ; preds = %98
  %104 = load ptr, ptr %12, align 8
  %105 = load i32, ptr %13, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2fl7Dataset16checkIndexBoundsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESG_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl" }
%"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl" = type { %"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fl::Tensor, std::allocator<fl::Tensor>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.6" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIKN2fl7DatasetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; 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 uwtable
define dso_local void @_ZNK2fl12MergeDataset3getEl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.6", align 8
  tail call void @_ZNK2fl7Dataset16checkIndexBoundsEl(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %2)
  tail call void @_ZNSt6vectorIN2fl6TensorESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %10 = tail call ptr @_ZNKSt6vectorISt10shared_ptrIKN2fl7DatasetEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  store ptr %10, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %11 = tail call ptr @_ZNKSt6vectorISt10shared_ptrIKN2fl7DatasetEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  store ptr %11, ptr %5, align 8
  %12 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESG_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %43, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void

.lr.ph:                                           ; preds = %3, %43
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %14 = call noundef ptr @_ZNKSt19__shared_ptr_accessIKN2fl7DatasetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = load ptr, ptr %15, align 8
  %17 = invoke noundef i64 %16(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %18 unwind label %36

18:                                               ; preds = %.lr.ph
  %19 = icmp sgt i64 %17, %2
  br i1 %19, label %20, label %43

20:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessIKN2fl7DatasetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load ptr, ptr %23, align 8
  invoke void %24(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %2)
          to label %25 unwind label %38

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %26 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %26, ptr %8, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN2fl6TensorESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %27 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %28 = invoke ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr %27)
          to label %29 unwind label %40

29:                                               ; preds = %25
  %30 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %31 = invoke ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr %30)
          to label %32 unwind label %40

32:                                               ; preds = %29
  %33 = load ptr, ptr %7, align 8
  %34 = invoke ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE6insertISt13move_iteratorIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEEvEES9_NS7_IPKS1_S3_EET_SE_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %33, ptr %28, ptr %31)
          to label %35 unwind label %40

35:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %43

36:                                               ; preds = %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %46

38:                                               ; preds = %20
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %32, %29, %25
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %46

43:                                               ; preds = %35, %18
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESG_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %45, label %.lr.ph, label %._crit_edge

46:                                               ; preds = %42, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2fl7Dataset16checkIndexBoundsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESG_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt18make_move_iteratorIN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS3_SaIS3_EEEEESt13move_iteratorIT_ESA_(ptr) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIKN2fl7DatasetEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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