; LLVM IR from flashlight/flashlight :: flashlight/fl/dataset (TensorDataset)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.fl::TensorDataset" = 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<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 }

@_ZTVN2fl13TensorDatasetE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [35 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl13TensorDatasetC2ERKSt6vectorINS_6TensorESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @_ZN2fl7DatasetC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN2fl13TensorDatasetE, i32 0, i32 0, i32 2), ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 1
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIN2fl6TensorESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %17 unwind label %24

17:                                               ; preds = %2
  %18 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 2
  store i64 0, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 1
  %20 = call noundef zeroext i1 @_ZNKSt6vectorIN2fl6TensorESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  br i1 %20, label %21, label %36

21:                                               ; preds = %17
  %22 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef @.str)
          to label %23 unwind label %28

23:                                               ; preds = %21
  invoke void @__cxa_throw(ptr %22, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #7
          to label %93 unwind label %32

24:                                               ; preds = %2
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %5, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %6, align 4
  br label %87

28:                                               ; preds = %21
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %5, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %6, align 4
  call void @__cxa_free_exception(ptr %22) #6
  br label %86

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %5, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %6, align 4
  br label %86

36:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %37 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 1
  store ptr %37, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #6
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  br label %44

44:                                               ; preds = %78, %36
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN2fl6TensorESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %45, label %47, label %46

46:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %85

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  store ptr %48, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = invoke noundef i32 @_ZNK2fl6Tensor4ndimEv(ptr noundef nonnull align 8 dereferenceable(16) %49)
          to label %51 unwind label %57

51:                                               ; preds = %47
  store i32 %50, ptr %11, align 4, !tbaa !19
  %52 = load i32, ptr %11, align 4, !tbaa !19
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %65

54:                                               ; preds = %51
  %55 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef @.str.1)
          to label %56 unwind label %61

56:                                               ; preds = %54
  invoke void @__cxa_throw(ptr %55, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #7
          to label %93 unwind label %57

57:                                               ; preds = %56, %47
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  br label %84

61:                                               ; preds = %54
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %5, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %6, align 4
  call void @__cxa_free_exception(ptr %55) #6
  br label %84

65:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %66 = load i32, ptr %11, align 4, !tbaa !19
  %67 = sub nsw i32 %66, 1
  store i32 %67, ptr %12, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i32, ptr %12, align 4, !tbaa !19
  %70 = sext i32 %69 to i64
  %71 = invoke noundef i64 @_ZNK2fl6Tensor3dimEm(ptr noundef nonnull align 8 dereferenceable(16) %68, i64 noundef %70)
          to label %72 unwind label %80

72:                                               ; preds = %65
  store i64 %71, ptr %13, align 8, !tbaa !21
  %73 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 2
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %75 unwind label %80

75:                                               ; preds = %72
  %76 = load i64, ptr %74, align 8, !tbaa !21
  %77 = getelementptr inbounds %"class.fl::TensorDataset", ptr %14, i32 0, i32 2
  store i64 %76, ptr %77, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %78

78:                                               ; preds = %75
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %44

80:                                               ; preds = %72, %65
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %5, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %84

84:                                               ; preds = %80, %61, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %86

85:                                               ; preds = %46
  ret void

86:                                               ; preds = %84, %32, %28
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  br label %87

87:                                               ; preds = %86, %24
  call void @_ZN2fl7DatasetD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %5, align 8
  %90 = load i32, ptr %6, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92

93:                                               ; preds = %56, %23
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN2fl6TensorESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

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

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

declare noundef i32 @_ZNK2fl6Tensor4ndimEv(ptr noundef nonnull align 8 dereferenceable(16)) #4

declare noundef i64 @_ZNK2fl6Tensor3dimEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 "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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !18, i64 32}
!12 = !{!"_ZTSN2fl13TensorDatasetE", !13, i64 0, !14, i64 8, !18, i64 32}
!13 = !{!"_ZTSN2fl7DatasetE"}
!14 = !{!"_ZTSSt6vectorIN2fl6TensorESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIN2fl6TensorESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN2fl6TensorESaIS1_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN2fl6TensorESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!18, !18, 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.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZTVN2fl13TensorDatasetE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [35 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl13TensorDatasetC2ERKSt6vectorINS_6TensorESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i64, align 8
  tail call void @_ZN2fl7DatasetC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTVN2fl13TensorDatasetE, i64 16), ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  invoke void @_ZNSt6vectorIN2fl6TensorESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %7 unwind label %13

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 0, ptr %8, align 8, !tbaa !8
  %9 = tail call noundef zeroext i1 @_ZNKSt6vectorIN2fl6TensorESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br i1 %9, label %10, label %19

10:                                               ; preds = %7
  %11 = tail call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull @.str)
          to label %12 unwind label %15

12:                                               ; preds = %10
  invoke void @__cxa_throw(ptr nonnull %11, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #7
          to label %46 unwind label %17

13:                                               ; preds = %2
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %45

15:                                               ; preds = %10
  %16 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %11) #6
  br label %44

17:                                               ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %44

19:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %20 = tail call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  store ptr %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %21 = tail call ptr @_ZNSt6vectorIN2fl6TensorESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  store ptr %21, ptr %4, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN2fl6TensorESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br i1 %22, label %.lr.ph, label %._crit_edge

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

.lr.ph:                                           ; preds = %19, %36
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %24 = invoke noundef i32 @_ZNK2fl6Tensor4ndimEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %25 unwind label %.loopexit

25:                                               ; preds = %.lr.ph
  %26 = icmp eq i32 %24, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %25
  %28 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull @.str.1)
          to label %29 unwind label %30

29:                                               ; preds = %27
  invoke void @__cxa_throw(ptr nonnull %28, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #7
          to label %46 unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %43

.loopexit.split-lp:                               ; preds = %29
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %43

30:                                               ; preds = %27
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %28) #6
  br label %43

32:                                               ; preds = %25
  %33 = add nsw i32 %24, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %34 = sext i32 %33 to i64
  %35 = invoke noundef i64 @_ZNK2fl6Tensor3dimEm(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %34)
          to label %36 unwind label %41

36:                                               ; preds = %32
  store i64 %35, ptr %5, align 8, !tbaa !18
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %38 = load i64, ptr %37, align 8, !tbaa !18
  store i64 %38, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN2fl6TensorESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN2fl6TensorESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br i1 %40, label %.lr.ph, label %._crit_edge

41:                                               ; preds = %32
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %43

43:                                               ; preds = %.loopexit, %.loopexit.split-lp, %41, %30
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %42, %41 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %44

44:                                               ; preds = %43, %17, %15
  %.pn15 = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ], [ %.pn, %43 ]
  call void @_ZNSt6vectorIN2fl6TensorESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %45

45:                                               ; preds = %44, %13
  %.pn15.pn = phi { ptr, i32 } [ %.pn15, %44 ], [ %14, %13 ]
  call void @_ZN2fl7DatasetD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  resume { ptr, i32 } %.pn15.pn

46:                                               ; preds = %29, %12
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN2fl6TensorESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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

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

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

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

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

declare noundef i32 @_ZNK2fl6Tensor4ndimEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

declare noundef i64 @_ZNK2fl6Tensor3dimEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !17, i64 32}
!9 = !{!"_ZTSN2fl13TensorDatasetE", !10, i64 0, !11, i64 8, !17, i64 32}
!10 = !{!"_ZTSN2fl7DatasetE"}
!11 = !{!"_ZTSSt6vectorIN2fl6TensorESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN2fl6TensorESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN2fl6TensorESaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN2fl6TensorESaIS1_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !16, i64 0}
!16 = !{!"omnipotent char", !7, i64 0}
!17 = !{!"long", !16, i64 0}
!18 = !{!17, !17, i64 0}


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