; LLVM IR from aspuru-guzik-group/qtorch :: src/main.ll (ZN6qtorch9LineGraph5ResetESt10shared_ptrINS_7NetworkEE)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.32" = type { %"class.std::__shared_ptr.33" }
%"class.std::__shared_ptr.33" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.115" = type { ptr }
%"struct.std::array" = type { [2 x %"class.std::shared_ptr.32"] }
%"class.qtorch::LineGraph" = type { %"class.std::shared_ptr.178", %"class.std::vector.4", %"class.std::vector.181", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.std::shared_ptr.178" = type { %"class.std::__shared_ptr.179" }
%"class.std::__shared_ptr.179" = type { ptr, %"class.std::__shared_count" }
%"class.std::vector.181" = type { %"struct.std::_Vector_base.182" }
%"struct.std::_Vector_base.182" = type { %"struct.std::_Vector_base<std::array<std::shared_ptr<qtorch::Wire>, 2>, std::allocator<std::array<std::shared_ptr<qtorch::Wire>, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<std::shared_ptr<qtorch::Wire>, 2>, std::allocator<std::array<std::shared_ptr<qtorch::Wire>, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<std::shared_ptr<qtorch::Wire>, 2>, std::allocator<std::array<std::shared_ptr<qtorch::Wire>, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<std::shared_ptr<qtorch::Wire>, 2>, std::allocator<std::array<std::shared_ptr<qtorch::Wire>, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.55 = external hidden unnamed_addr constant [20 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS5_SaIS5_EEEES5_ET_SB_SB_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6qtorch4Wire9SetWireIDEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6qtorch9LineGraph5ResetESt10shared_ptrINS_7NetworkEE(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector.14", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector.4", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::shared_ptr.32", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::array", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8
  %21 = call noundef zeroext i1 @_ZSteqIN6qtorch7NetworkEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr null) #5
  br i1 %21, label %22, label %25

22:                                               ; preds = %2
  %23 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 0
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  call void @_ZN6qtorch7Network5ResetEv(ptr noundef nonnull align 8 dereferenceable(380) %24)
  br label %134

25:                                               ; preds = %2
  %26 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 0
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN6qtorch7NetworkEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %1) #5
  %28 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %29 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 2
  call void @_ZNSt6vectorISt5arrayISt10shared_ptrIN6qtorch4WireEELm2EESaIS5_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6qtorch7Network20GetUncontractedNodesEv(ptr noundef nonnull align 8 dereferenceable(380) %30) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %32 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %121, %25
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %125

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %41) #5
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %42) #5
  %44 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6qtorch4Node8GetWiresEv(ptr noundef nonnull align 8 dereferenceable(152) %43)
          to label %45 unwind label %53

45:                                               ; preds = %39
  invoke void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %44)
          to label %46 unwind label %53

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %116, %46
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %51 = icmp ult i64 %49, %50
  br i1 %51, label %57, label %52

52:                                               ; preds = %47
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %120

53:                                               ; preds = %45, %39
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %10, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %11, align 4
  br label %124

57:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %59) #5
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %60) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %61 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  %62 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #5
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %15, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  %65 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #5
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %16, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  %67 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %15, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %16, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8
  %71 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS5_SaIS5_EEEES5_ET_SB_SB_RKT0_(ptr %68, ptr %70, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %72 unwind label %86

72:                                               ; preds = %57
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %14, i32 0, i32 0
  store ptr %71, ptr %73, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %74 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  %75 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #5
  %76 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.115", ptr %17, i32 0, i32 0
  store ptr %75, ptr %76, align 8
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br i1 %77, label %78, label %94

78:                                               ; preds = %72
  %79 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %80 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  %81 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #5
  %82 = trunc i64 %81 to i32
  invoke void @_ZN6qtorch4Wire9SetWireIDEi(ptr noundef nonnull align 8 dereferenceable(44) %79, i32 noundef %82)
          to label %83 unwind label %90

83:                                               ; preds = %78
  %84 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  invoke void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %84, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %85 unwind label %90

85:                                               ; preds = %83
  br label %94

86:                                               ; preds = %57
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %10, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %119

90:                                               ; preds = %83, %78
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %10, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %11, align 4
  br label %119

94:                                               ; preds = %85, %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %108, %94
  %96 = load i32, ptr %18, align 4, !tbaa !9
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %115

100:                                              ; preds = %95
  %101 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  %102 = getelementptr inbounds %"struct.std::array", ptr %19, i32 0, i32 0
  %103 = load i32, ptr %18, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %104) #5
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %102, ptr noundef nonnull align 8 dereferenceable(16) %105) #5
  %106 = getelementptr inbounds %"class.std::shared_ptr.32", ptr %102, i64 1
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  invoke void @_ZNSt6vectorISt5arrayISt10shared_ptrIN6qtorch4WireEELm2EESaIS5_EE9push_backEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %101, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %107 unwind label %111

107:                                              ; preds = %100
  call void @_ZNSt5arrayISt10shared_ptrIN6qtorch4WireEELm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %18, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %18, align 4, !tbaa !9
  br label %95, !llvm.loop !11

111:                                              ; preds = %100
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %10, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %11, align 4
  call void @_ZNSt5arrayISt10shared_ptrIN6qtorch4WireEELm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %119

115:                                              ; preds = %99
  call void @_ZNSt12__shared_ptrIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %12, align 4, !tbaa !9
  br label %47, !llvm.loop !13

119:                                              ; preds = %111, %90, %86
  call void @_ZNSt12__shared_ptrIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %124

120:                                              ; preds = %52
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !9
  br label %34, !llvm.loop !14

124:                                              ; preds = %119, %53
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %139

125:                                              ; preds = %38
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.55)
          to label %127 unwind label %135

127:                                              ; preds = %125
  %128 = getelementptr inbounds %"class.qtorch::LineGraph", ptr %20, i32 0, i32 1
  %129 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #5
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %126, i64 noundef %129)
          to label %131 unwind label %135

131:                                              ; preds = %127
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %133 unwind label %135

133:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %134

134:                                              ; preds = %133, %22
  ret void

135:                                              ; preds = %131, %127, %125
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %10, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %11, align 4
  br label %139

139:                                              ; preds = %135, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %10, align 8
  %142 = load i32, ptr %11, align 4
  %143 = insertvalue { ptr, i32 } poison, ptr %141, 0
  %144 = insertvalue { ptr, i32 } %143, i32 %142, 1
  resume { ptr, i32 } %144
}

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

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

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

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

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


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Node>, std::allocator<std::shared_ptr<qtorch::Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<qtorch::Wire>, std::allocator<std::shared_ptr<qtorch::Wire>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.32" = type { %"class.std::__shared_ptr.33" }
%"class.std::__shared_ptr.33" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.115" = type { ptr }
%"struct.std::array" = type { [2 x %"class.std::shared_ptr.32"] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.55 = external hidden unnamed_addr constant [20 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS5_SaIS5_EEEES5_ET_SB_SB_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6qtorch4Wire9SetWireIDEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6qtorch9LineGraph5ResetESt10shared_ptrINS_7NetworkEE(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.14", align 8
  %4 = alloca %"class.std::vector.4", align 8
  %5 = alloca %"class.std::shared_ptr.32", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.115", align 8
  %8 = alloca %"struct.std::array", align 8
  %9 = tail call noundef zeroext i1 @_ZSteqIN6qtorch7NetworkEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr null) #5
  br i1 %9, label %10, label %12

10:                                               ; preds = %2
  %11 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  tail call void @_ZN6qtorch7Network5ResetEv(ptr noundef nonnull align 8 dereferenceable(380) %11)
  br label %61

12:                                               ; preds = %2
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN6qtorch7NetworkEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZNSt6vectorISt5arrayISt10shared_ptrIN6qtorch4WireEELm2EESaIS5_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %16 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %17 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6qtorch7Network20GetUncontractedNodesEv(ptr noundef nonnull align 8 dereferenceable(380) %16) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %17)
  %18 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %19 = trunc i64 %18 to i32
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph30, label %._crit_edge31

.lr.ph30:                                         ; preds = %12
  %21 = getelementptr inbounds i8, ptr %8, i64 16
  %wide.trip.count = and i64 %18, 2147483647
  br label %23

._crit_edge31:                                    ; preds = %._crit_edge27, %12
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.55)
          to label %55 unwind label %62

23:                                               ; preds = %.lr.ph30, %._crit_edge27
  %indvars.iv37 = phi i64 [ 0, %.lr.ph30 ], [ %indvars.iv.next38, %._crit_edge27 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv37) #5
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  %26 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6qtorch4Node8GetWiresEv(ptr noundef nonnull align 8 dereferenceable(152) %25)
          to label %27 unwind label %29

27:                                               ; preds = %23
  invoke void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %.preheader unwind label %29

.preheader:                                       ; preds = %27
  %28 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %._crit_edge27, label %.lr.ph26

._crit_edge27:                                    ; preds = %._crit_edge, %.preheader
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond40.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
  br i1 %exitcond40.not, label %._crit_edge31, label %23, !llvm.loop !5

29:                                               ; preds = %27, %23
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %54

.lr.ph26:                                         ; preds = %.preheader, %._crit_edge
  %indvars.iv34 = phi i64 [ %indvars.iv.next35, %._crit_edge ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv34) #5
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %32 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %33 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %34 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS5_SaIS5_EEEES5_ET_SB_SB_RKT0_(ptr %32, ptr %33, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %35 unwind label %42

35:                                               ; preds = %.lr.ph26
  store ptr %34, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %36 = call ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  store ptr %36, ptr %7, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPSt10shared_ptrIN6qtorch4WireEESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br i1 %37, label %38, label %46

38:                                               ; preds = %35
  %39 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  %40 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %41 = trunc i64 %40 to i32
  call void @_ZN6qtorch4Wire9SetWireIDEi(ptr noundef nonnull align 8 dereferenceable(44) %39, i32 noundef %41)
  invoke void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %46 unwind label %44

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

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

46:                                               ; preds = %38, %35
  %.not32 = icmp eq i64 %indvars.iv34, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %50, %46
  call void @_ZNSt12__shared_ptrIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %47 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %48 = icmp ugt i64 %47, %indvars.iv.next35
  br i1 %48, label %.lr.ph26, label %._crit_edge27, !llvm.loop !7

.lr.ph:                                           ; preds = %46, %50
  %indvars.iv = phi i64 [ %indvars.iv.next, %50 ], [ 0, %46 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #5
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %49) #5
  call void @_ZNSt10shared_ptrIN6qtorch4WireEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  invoke void @_ZNSt6vectorISt5arrayISt10shared_ptrIN6qtorch4WireEELm2EESaIS5_EE9push_backEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %50 unwind label %51

50:                                               ; preds = %.lr.ph
  call void @_ZNSt5arrayISt10shared_ptrIN6qtorch4WireEELm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv34
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

51:                                               ; preds = %.lr.ph
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt5arrayISt10shared_ptrIN6qtorch4WireEELm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %53

53:                                               ; preds = %51, %44, %42
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %45, %44 ], [ %43, %42 ]
  call void @_ZNSt12__shared_ptrIN6qtorch4WireELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %54

54:                                               ; preds = %53, %29
  %.pn.pn = phi { ptr, i32 } [ %.pn, %53 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %64

55:                                               ; preds = %._crit_edge31
  %56 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6qtorch4WireEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %22, i64 noundef %56)
          to label %58 unwind label %62

58:                                               ; preds = %55
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %60 unwind label %62

60:                                               ; preds = %58
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %61

61:                                               ; preds = %60, %10
  ret void

62:                                               ; preds = %58, %55, %._crit_edge31
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %64

64:                                               ; preds = %62, %54
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %54 ], [ %63, %62 ]
  call void @_ZNSt6vectorISt10shared_ptrIN6qtorch4NodeEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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