; LLVM IR from flashlight/flashlight :: flashlight/fl/meter/AverageValueMeter.ll (ZN2fl17AverageValueMeter3addERKNS_6TensorE)

; 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.fl::Tensor" = type { ptr, %"class.std::unique_ptr" }
%"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.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.fl::AverageValueMeter" = type { double, double, double, double }

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl17AverageValueMeter3addERKNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.fl::Tensor", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.fl::Tensor", align 8
  %12 = alloca %"class.fl::Tensor", align 8
  %13 = alloca %"class.std::vector", 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 @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noundef i64 @_ZNK2fl6Tensor8elementsEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %17 = uitofp i64 %16 to double
  store double %17, ptr %5, align 8, !tbaa !9
  %18 = load double, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 2
  %20 = load double, ptr %19, align 8, !tbaa !11
  %21 = fadd double %20, %18
  store double %21, ptr %19, align 8, !tbaa !11
  %22 = load double, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 3
  %24 = load double, ptr %23, align 8, !tbaa !13
  %25 = fadd double %24, %22
  store double %25, ptr %23, align 8, !tbaa !13
  %26 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 2
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = fcmp oeq double %27, 0.000000e+00
  br i1 %28, label %29, label %30

29:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %64

30:                                               ; preds = %2
  %31 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 0
  %32 = load double, ptr %31, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  invoke void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(24) %8, i1 noundef zeroext false)
          to label %34 unwind label %67

34:                                               ; preds = %30
  %35 = invoke noundef double @_ZNK2fl6Tensor8asScalarIdEET_v(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %36 unwind label %71

36:                                               ; preds = %34
  %37 = load double, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 0
  %39 = load double, ptr %38, align 8, !tbaa !14
  %40 = fneg double %37
  %41 = call double @llvm.fmuladd.f64(double %40, double %39, double %35)
  %42 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 2
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = fdiv double %41, %43
  %45 = fadd double %32, %44
  %46 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 0
  store double %45, ptr %46, align 8, !tbaa !14
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  %47 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 1
  %48 = load double, ptr %47, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN2flmlERKNS_6TensorES2_(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(16) %50)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  invoke void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(24) %13, i1 noundef zeroext false)
          to label %51 unwind label %76

51:                                               ; preds = %36
  %52 = invoke noundef double @_ZNK2fl6Tensor8asScalarIdEET_v(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %53 unwind label %80

53:                                               ; preds = %51
  %54 = load double, ptr %5, align 8, !tbaa !9
  %55 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 1
  %56 = load double, ptr %55, align 8, !tbaa !15
  %57 = fneg double %54
  %58 = call double @llvm.fmuladd.f64(double %57, double %56, double %52)
  %59 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 2
  %60 = load double, ptr %59, align 8, !tbaa !11
  %61 = fdiv double %58, %60
  %62 = fadd double %48, %61
  %63 = getelementptr inbounds %"class.fl::AverageValueMeter", ptr %14, i32 0, i32 1
  store double %62, ptr %63, align 8, !tbaa !15
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  store i32 0, ptr %6, align 4
  br label %64

64:                                               ; preds = %53, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %65 = load i32, ptr %6, align 4
  switch i32 %65, label %91 [
    i32 0, label %66
    i32 1, label %66
  ]

66:                                               ; preds = %64, %64
  ret void

67:                                               ; preds = %30
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  br label %75

71:                                               ; preds = %34
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %9, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %10, align 4
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  br label %85

76:                                               ; preds = %36
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  br label %84

80:                                               ; preds = %51
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %9, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %10, align 4
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  br label %84

84:                                               ; preds = %80, %76
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %85

85:                                               ; preds = %84, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %86

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

91:                                               ; preds = %64
  unreachable
}

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

declare noundef i64 @_ZNK2fl6Tensor8elementsEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

declare void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare void @_ZN2flmlERKNS_6TensorES2_(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { nocallback nofree nosync 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #7 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTSN2fl17AverageValueMeterE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!12, !10, i64 24}
!14 = !{!12, !10, i64 0}
!15 = !{!12, !10, i64 8}


; 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.fl::Tensor" = type { ptr, %"class.std::unique_ptr" }
%"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.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl17AverageValueMeter3addERKNS_6TensorE(ptr nocapture noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.fl::Tensor", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.fl::Tensor", align 8
  %6 = alloca %"class.fl::Tensor", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = tail call noundef i64 @_ZNK2fl6Tensor8elementsEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %9 = uitofp i64 %8 to double
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load <2 x double>, ptr %10, align 8, !tbaa !5
  %12 = insertelement <2 x double> poison, double %9, i64 0
  %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
  %14 = fadd <2 x double> %11, %13
  store <2 x double> %14, ptr %10, align 8, !tbaa !5
  %15 = extractelement <2 x double> %14, i64 0
  %16 = fcmp oeq double %15, 0.000000e+00
  br i1 %16, label %38, label %17

17:                                               ; preds = %2
  %18 = load double, ptr %0, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  invoke void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind nonnull writable sret(%"class.fl::Tensor") align 8 %3, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(24) %4, i1 noundef zeroext false)
          to label %19 unwind label %39

19:                                               ; preds = %17
  %20 = invoke noundef double @_ZNK2fl6Tensor8asScalarIdEET_v(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %21 unwind label %41

21:                                               ; preds = %19
  %22 = load double, ptr %0, align 8, !tbaa !9
  %23 = fneg double %9
  %24 = call double @llvm.fmuladd.f64(double %23, double %22, double %20)
  %25 = load double, ptr %10, align 8, !tbaa !11
  %26 = fdiv double %24, %25
  %27 = fadd double %18, %26
  store double %27, ptr %0, align 8, !tbaa !9
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  %29 = load double, ptr %28, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @_ZN2flmlERKNS_6TensorES2_(ptr dead_on_unwind nonnull writable sret(%"class.fl::Tensor") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  invoke void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind nonnull writable sret(%"class.fl::Tensor") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(24) %7, i1 noundef zeroext false)
          to label %30 unwind label %44

30:                                               ; preds = %21
  %31 = invoke noundef double @_ZNK2fl6Tensor8asScalarIdEET_v(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %32 unwind label %46

32:                                               ; preds = %30
  %33 = load double, ptr %28, align 8, !tbaa !12
  %34 = call double @llvm.fmuladd.f64(double %23, double %33, double %31)
  %35 = load double, ptr %10, align 8, !tbaa !11
  %36 = fdiv double %34, %35
  %37 = fadd double %29, %36
  store double %37, ptr %28, align 8, !tbaa !12
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %38

38:                                               ; preds = %2, %32
  ret void

39:                                               ; preds = %17
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %43

41:                                               ; preds = %19
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  br label %43

43:                                               ; preds = %41, %39
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %40, %39 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  br label %49

44:                                               ; preds = %21
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %30
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  br label %48

48:                                               ; preds = %46, %44
  %.pn14 = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @_ZN2fl6TensorD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %49

49:                                               ; preds = %48, %43
  %.pn14.pn = phi { ptr, i32 } [ %.pn14, %48 ], [ %.pn, %43 ]
  resume { ptr, i32 } %.pn14.pn
}

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

declare noundef i64 @_ZNK2fl6Tensor8elementsEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

declare void @_ZN2fl3sumERKNS_6TensorERKSt6vectorIiSaIiEEb(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) local_unnamed_addr #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare void @_ZN2flmlERKNS_6TensorES2_(ptr dead_on_unwind writable sret(%"class.fl::Tensor") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { mustprogress nocallback nofree nosync 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #7 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN2fl17AverageValueMeterE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!10, !6, i64 16}
!12 = !{!10, !6, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass