; LLVM IR from ChenyangZhang-cs/iMLBench :: MLP/co-run&zero-copy/src/tensor.ll (ZN5clnet4type4LSTM17generate_gradientEPNS_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.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.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<clnet::Tensor *, clnet::Tensor *, std::_Identity<clnet::Tensor *>, std::less<clnet::Tensor *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<clnet::Tensor *, clnet::Tensor *, std::_Identity<clnet::Tensor *>, std::less<clnet::Tensor *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.16 = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.clnet::Tensor" = type { ptr, %"class.std::vector.1", %"class.std::vector", %"class.std::__cxx11::basic_string", %"class.std::vector", i64, ptr, ptr, i64 }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<clnet::Tensor *, std::allocator<clnet::Tensor *>>::_Vector_impl" }
%"struct.std::_Vector_base<clnet::Tensor *, std::allocator<clnet::Tensor *>>::_Vector_impl" = type { %"struct.std::_Vector_base<clnet::Tensor *, std::allocator<clnet::Tensor *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<clnet::Tensor *, std::allocator<clnet::Tensor *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN5clnet20CLNET_TENSOR_GLOBALSE = external dso_local global i64, align 8
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [22 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #0

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5clnet22generate_all_gradientsEPNS_6TensorE(ptr noundef) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5clnet4type15LSTMInitializerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5clnet4type4LSTM17generate_gradientEPNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::set", align 8
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.16, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca i1, align 1
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %25 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 152) #8
  invoke void @_ZN5clnet4back4LSTMC2Ev(ptr noundef nonnull align 8 dereferenceable(152) %25)
          to label %26 unwind label %104

26:                                               ; preds = %2
  store ptr %25, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  %27 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 3
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef @.str.32, ptr noundef nonnull align 8 dereferenceable(32) %27)
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.clnet::Tensor", ptr %28, i32 0, i32 3
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.clnet::Tensor", ptr %31, i32 0, i32 2
  %33 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 2
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef 0) #7
  call void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(8) %34)
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.clnet::Tensor", ptr %35, i32 0, i32 2
  call void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %37 = load i64, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %38 = or i64 %37, 512
  store i64 %38, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %39 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef 1) #7
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  call void @_ZN5clnet22generate_all_gradientsEPNS_6TensorE(ptr noundef %41)
  %42 = load i64, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %43 = xor i64 %42, 512
  store i64 %43, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %44 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef 0) #7
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %46, ptr noundef null)
  store ptr %47, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #7
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #7
  %48 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef 1) #7
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  call void @"_ZNSt8functionIFvPN5clnet6TensorEPvEEC2IZNS0_4type4LSTM17generate_gradientES2_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  %52 = load ptr, ptr %50, align 8, !tbaa !11
  %53 = getelementptr inbounds ptr, ptr %52, i64 5
  %54 = load ptr, ptr %53, align 8
  invoke void %54(ptr noundef nonnull align 8 dereferenceable(144) %50, ptr noundef %10, ptr noundef %51, ptr noundef %11)
          to label %55 unwind label %108

55:                                               ; preds = %26
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.clnet::Tensor", ptr %56, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %58 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 2
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef 0) #7
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %60, ptr noundef %61)
          to label %63 unwind label %112

63:                                               ; preds = %55
  store ptr %62, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %64 unwind label %112

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.clnet::Tensor", ptr %65, i32 0, i32 4
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %67 unwind label %116

67:                                               ; preds = %64
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.clnet::Tensor", ptr %68, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %70 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef 1) #7
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %72, ptr noundef null)
          to label %74 unwind label %120

74:                                               ; preds = %67
  store ptr %73, ptr %14, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %75 unwind label %120

75:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.clnet::Tensor", ptr %76, i32 0, i32 4
  %78 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef 2) #7
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 8 dereferenceable(8) %79)
          to label %80 unwind label %116

80:                                               ; preds = %75
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.clnet::Tensor", ptr %81, i32 0, i32 4
  %83 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 4
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef 0) #7
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %82, ptr noundef nonnull align 8 dereferenceable(8) %84)
          to label %85 unwind label %116

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %86 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 152) #8
          to label %87 unwind label %124

87:                                               ; preds = %85
  store i1 true, ptr %17, align 1
  %88 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 3
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %88, ptr noundef @.str.65)
          to label %89 unwind label %128

89:                                               ; preds = %87
  invoke void @_ZN5clnet4type15LSTMInitializerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152) %86, ptr noundef %16)
          to label %90 unwind label %132

90:                                               ; preds = %89
  store i1 false, ptr %17, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  store ptr %86, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %91 = getelementptr inbounds %"struct.clnet::Tensor", ptr %24, i32 0, i32 2
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef 1) #7
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.clnet::Tensor", ptr %93, i32 0, i32 4
  store ptr %94, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %95 = load ptr, ptr %18, align 8, !tbaa !5
  %96 = call ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #7
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = call ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #7
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  br label %101

101:                                              ; preds = %157, %90
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %102, label %140, label %103

103:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %159

104:                                              ; preds = %2
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %6, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %25, i64 noundef 152) #9
  br label %171

108:                                              ; preds = %26
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  br label %170

112:                                              ; preds = %63, %55
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %6, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %170

116:                                              ; preds = %80, %75, %64
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %6, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %7, align 4
  br label %170

120:                                              ; preds = %74, %67
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %170

124:                                              ; preds = %85
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %6, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %7, align 4
  br label %169

128:                                              ; preds = %87
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %6, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %7, align 4
  br label %136

132:                                              ; preds = %89
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %6, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %136

136:                                              ; preds = %132, %128
  %137 = load i1, ptr %17, align 1
  br i1 %137, label %138, label %139

138:                                              ; preds = %136
  call void @_ZdlPvm(ptr noundef %86, i64 noundef 152) #9
  br label %139

139:                                              ; preds = %138, %136
  br label %169

140:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  store ptr %142, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  %144 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %143, ptr noundef null)
          to label %145 unwind label %152

145:                                              ; preds = %140
  store ptr %144, ptr %22, align 8, !tbaa !5
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %156

148:                                              ; preds = %145
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.clnet::Tensor", ptr %149, i32 0, i32 4
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %150, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %151 unwind label %152

151:                                              ; preds = %148
  br label %156

152:                                              ; preds = %148, %140
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %6, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %169

156:                                              ; preds = %151, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %157

157:                                              ; preds = %156
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %101

159:                                              ; preds = %103
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.clnet::Tensor", ptr %160, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %162, ptr %23, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %161, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %163 unwind label %165

163:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret ptr %164

165:                                              ; preds = %159
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %6, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %169

169:                                              ; preds = %165, %152, %139, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %170

170:                                              ; preds = %169, %120, %116, %112, %108
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %171

171:                                              ; preds = %170, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr %6, align 8
  %174 = load i32, ptr %7, align 4
  %175 = insertvalue { ptr, i32 } poison, ptr %173, 0
  %176 = insertvalue { ptr, i32 } %175, i32 %174, 1
  resume { ptr, i32 } %176
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvPN5clnet6TensorEPvEEC2IZNS0_4type4LSTM17generate_gradientES2_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nobuiltin allocsize(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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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::__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.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<clnet::Tensor *, clnet::Tensor *, std::_Identity<clnet::Tensor *>, std::less<clnet::Tensor *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<clnet::Tensor *, clnet::Tensor *, std::_Identity<clnet::Tensor *>, std::less<clnet::Tensor *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.16 = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZN5clnet20CLNET_TENSOR_GLOBALSE = external dso_local local_unnamed_addr global i64, align 8
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [22 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5clnet22generate_all_gradientsEPNS_6TensorE(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5clnet4type15LSTMInitializerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5clnet4type4LSTM17generate_gradientEPNS_6TensorE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::set", align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.16, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  %16 = tail call noalias noundef nonnull dereferenceable(152) ptr @_Znwm(i64 noundef 152) #7
  invoke void @_ZN5clnet4back4LSTMC2Ev(ptr noundef nonnull align 8 dereferenceable(152) %16)
          to label %17 unwind label %67

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull @.str.32, ptr noundef nonnull align 8 dereferenceable(32) %18)
  %19 = getelementptr inbounds i8, ptr %16, i64 56
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %21 = getelementptr inbounds i8, ptr %16, i64 32
  %22 = getelementptr inbounds i8, ptr %0, i64 32
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 0) #8
  call void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %24 = load i64, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %25 = or i64 %24, 512
  store i64 %25, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %0, i64 88
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 1) #8
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZN5clnet22generate_all_gradientsEPNS_6TensorE(ptr noundef %28)
  %29 = load i64, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  %30 = xor i64 %29, 512
  store i64 %30, ptr @_ZN5clnet20CLNET_TENSOR_GLOBALSE, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 0) #8
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = call noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %32, ptr noundef null)
  store ptr %33, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #8
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 1) #8
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  call void @"_ZNSt8functionIFvPN5clnet6TensorEPvEEC2IZNS0_4type4LSTM17generate_gradientES2_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds i8, ptr %36, i64 40
  %38 = load ptr, ptr %37, align 8
  invoke void %38(ptr noundef nonnull align 8 dereferenceable(144) %35, ptr noundef nonnull %6, ptr noundef %33, ptr noundef nonnull %7)
          to label %39 unwind label %69

39:                                               ; preds = %17
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %40 = getelementptr inbounds i8, ptr %16, i64 88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 0) #8
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %42, ptr noundef nonnull %16)
          to label %44 unwind label %71

44:                                               ; preds = %39
  store ptr %43, ptr %9, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %45 unwind label %71

45:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %46 unwind label %73

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 1) #8
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %48, ptr noundef null)
          to label %50 unwind label %75

50:                                               ; preds = %46
  store ptr %49, ptr %10, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %51 unwind label %75

51:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 2) #8
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(8) %52)
          to label %53 unwind label %73

53:                                               ; preds = %51
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 0) #8
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %55 unwind label %73

55:                                               ; preds = %53
  %56 = invoke noalias noundef nonnull dereferenceable(152) ptr @_Znwm(i64 noundef 152) #7
          to label %57 unwind label %77

57:                                               ; preds = %55
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull @.str.65)
          to label %58 unwind label %79

58:                                               ; preds = %57
  invoke void @_ZN5clnet4type15LSTMInitializerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152) %56, ptr noundef nonnull %11)
          to label %59 unwind label %81

59:                                               ; preds = %58
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 1) #8
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %63 = call ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #8
  store ptr %63, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %64 = call ptr @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #8
  store ptr %64, ptr %13, align 8
  %65 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %65, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %59
  %66 = getelementptr inbounds i8, ptr %56, i64 88
  br label %84

._crit_edge:                                      ; preds = %92, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  store ptr %56, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %95 unwind label %96

67:                                               ; preds = %2
  %68 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %16, i64 noundef 152) #9
  br label %99

69:                                               ; preds = %17
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  br label %98

71:                                               ; preds = %44, %39
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %98

73:                                               ; preds = %53, %51, %45
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %98

75:                                               ; preds = %50, %46
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %98

77:                                               ; preds = %55
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %98

79:                                               ; preds = %57
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %58
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  br label %83

83:                                               ; preds = %79, %81
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @_ZdlPvm(ptr noundef nonnull %56, i64 noundef 152) #9
  br label %98

84:                                               ; preds = %.lr.ph, %92
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  %87 = invoke noundef ptr @_ZN5clnet8GradientEPNS_6TensorES1_(ptr noundef %86, ptr noundef null)
          to label %88 unwind label %90

88:                                               ; preds = %84
  store ptr %87, ptr %14, align 8, !tbaa !5
  %.not = icmp eq ptr %87, null
  br i1 %.not, label %92, label %89

89:                                               ; preds = %88
  invoke void @_ZNSt6vectorIPN5clnet6TensorESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %92 unwind label %90

90:                                               ; preds = %89, %84
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %98

92:                                               ; preds = %89, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %94 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN5clnet6TensorESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %94, label %84, label %._crit_edge

95:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  ret ptr %16

96:                                               ; preds = %._crit_edge
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %98

98:                                               ; preds = %77, %90, %96, %83, %75, %73, %71, %69
  %.pn24.pn = phi { ptr, i32 } [ %74, %73 ], [ %76, %75 ], [ %72, %71 ], [ %70, %69 ], [ %91, %90 ], [ %97, %96 ], [ %.pn, %83 ], [ %78, %77 ]
  call void @_ZNSt3setIPN5clnet6TensorESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %99

99:                                               ; preds = %98, %67
  %.pn24.pn.pn = phi { ptr, i32 } [ %.pn24.pn, %98 ], [ %68, %67 ]
  resume { ptr, i32 } %.pn24.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvPN5clnet6TensorEPvEEC2IZNS0_4type4LSTM17generate_gradientES2_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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


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