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

; 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::shared_ptr.178" = type { %"class.std::__shared_ptr.179" }
%"class.std::__shared_ptr.179" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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.qtorch::ContractionTools" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::complex", %"class.std::vector.186", %"class.std::random_device", %"class.std::shared_ptr.178", %"class.std::mersenne_twister_engine", i8, i32 }
%"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] }
%"class.std::complex" = type { { double, double } }
%"class.std::vector.186" = type { %"struct.std::_Vector_base.187" }
%"struct.std::_Vector_base.187" = type { %"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::random_device" = type { %union.anon.191 }
%union.anon.191 = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"class.std::allocator" = type { i8 }

@.str.105 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [25 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.178") align 8, ptr noundef nonnull align 8 dereferenceable(10128), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.178") align 8, ptr noundef nonnull align 8 dereferenceable(10128), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z27simpleReduceAndContractTestRSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(248) %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::basic_ofstream", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.qtorch::ContractionTools", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca %"class.std::shared_ptr.178", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator", align 1
  %16 = alloca %"class.std::shared_ptr.178", align 8
  %17 = alloca %"class.std::complex", align 8
  %18 = alloca %"class.std::complex", align 8
  %19 = alloca %"class.qtorch::ContractionTools", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator", align 1
  %24 = alloca %"class.std::shared_ptr.178", align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.std::allocator", align 1
  %27 = alloca %"class.std::shared_ptr.178", align 8
  %28 = alloca %"class.std::complex", align 8
  %29 = alloca %"class.std::complex", align 8
  %30 = alloca %"class.qtorch::ContractionTools", align 8
  %31 = alloca %"class.std::__cxx11::basic_string", align 8
  %32 = alloca %"class.std::allocator", align 1
  %33 = alloca %"class.std::__cxx11::basic_string", align 8
  %34 = alloca %"class.std::allocator", align 1
  %35 = alloca %"class.std::shared_ptr.178", align 8
  %36 = alloca %"class.std::__cxx11::basic_string", align 8
  %37 = alloca %"class.std::allocator", align 1
  %38 = alloca %"class.std::shared_ptr.178", align 8
  %39 = alloca %"class.std::complex", align 8
  %40 = alloca %"class.std::complex", align 8
  %41 = alloca %"class.qtorch::ContractionTools", align 8
  %42 = alloca %"class.std::__cxx11::basic_string", align 8
  %43 = alloca %"class.std::allocator", align 1
  %44 = alloca %"class.std::__cxx11::basic_string", align 8
  %45 = alloca %"class.std::allocator", align 1
  %46 = alloca %"class.std::shared_ptr.178", align 8
  %47 = alloca %"class.std::__cxx11::basic_string", align 8
  %48 = alloca %"class.std::allocator", align 1
  %49 = alloca %"class.std::shared_ptr.178", align 8
  %50 = alloca %"class.std::complex", align 8
  %51 = alloca %"class.std::complex", align 8
  %52 = alloca %"class.std::__cxx11::basic_string", align 8
  %53 = alloca %"class.std::allocator", align 1
  %54 = alloca %"class.std::__cxx11::basic_string", align 8
  %55 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef @.str.105)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #6
  store i8 1, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 512, ptr %5) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %5, ptr noundef @.str.106, i32 noundef 16)
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.107)
          to label %61 unwind label %103

61:                                               ; preds = %1
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %5)
          to label %62 unwind label %103

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 10128, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %63 unwind label %107

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %64 unwind label %111

64:                                               ; preds = %63
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %8, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 8)
          to label %65 unwind label %115

65:                                               ; preds = %64
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %66 unwind label %121

66:                                               ; preds = %65
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %13, ptr noundef nonnull align 8 dereferenceable(10128) %8, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %67 unwind label %125

67:                                               ; preds = %66
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %16, ptr noundef nonnull align 8 dereferenceable(10128) %8, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %68 unwind label %130

68:                                               ; preds = %67
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %69 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %8) #6
  %70 = getelementptr inbounds %"class.std::complex", ptr %17, i32 0, i32 0
  %71 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 0
  %72 = extractvalue { double, double } %69, 0
  store double %72, ptr %71, align 8
  %73 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 1
  %74 = extractvalue { double, double } %69, 1
  store double %74, ptr %73, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %75 = invoke noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %76 unwind label %134

76:                                               ; preds = %68
  %77 = fadd double %75, 6.207050e-01
  %78 = invoke noundef double @_ZSt3absd(double noundef %77)
          to label %79 unwind label %134

79:                                               ; preds = %76
  %80 = fcmp ogt double %78, 0x3EB0C6F7A0B5ED8D
  br i1 %80, label %93, label %81

81:                                               ; preds = %79
  %82 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %8) #6
  %83 = getelementptr inbounds %"class.std::complex", ptr %18, i32 0, i32 0
  %84 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 0
  %85 = extractvalue { double, double } %82, 0
  store double %85, ptr %84, align 8
  %86 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 1
  %87 = extractvalue { double, double } %82, 1
  store double %87, ptr %86, align 8
  %88 = invoke noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %89 unwind label %138

89:                                               ; preds = %81
  %90 = invoke noundef double @_ZSt3absd(double noundef %88)
          to label %91 unwind label %138

91:                                               ; preds = %89
  %92 = fcmp ogt double %90, 1.000000e-05
  br label %93

93:                                               ; preds = %91, %79
  %94 = phi i1 [ true, %79 ], [ %92, %91 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br i1 %94, label %95, label %143

95:                                               ; preds = %93
  store i8 0, ptr %3, align 1, !tbaa !9
  %96 = load i32, ptr %4, align 4, !tbaa !11
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !11
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef @.str.110)
          to label %100 unwind label %130

100:                                              ; preds = %95
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %102 unwind label %130

102:                                              ; preds = %100
  br label %143

103:                                              ; preds = %61, %1
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %6, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %7, align 4
  br label %427

107:                                              ; preds = %62
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %6, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %7, align 4
  br label %120

111:                                              ; preds = %63
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %6, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %7, align 4
  br label %119

115:                                              ; preds = %64
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %6, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %119

119:                                              ; preds = %115, %111
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %120

120:                                              ; preds = %119, %107
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  br label %426

121:                                              ; preds = %65
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %6, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %7, align 4
  br label %129

125:                                              ; preds = %66
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %6, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %129

129:                                              ; preds = %125, %121
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %425

130:                                              ; preds = %146, %144, %143, %100, %95, %67
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %6, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %7, align 4
  br label %425

134:                                              ; preds = %76, %68
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %6, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %7, align 4
  br label %142

138:                                              ; preds = %89, %81
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %6, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %142

142:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %425

143:                                              ; preds = %102, %93
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %5, ptr noundef @.str.106, i32 noundef 16)
          to label %144 unwind label %130

144:                                              ; preds = %143
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.111)
          to label %146 unwind label %130

146:                                              ; preds = %144
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %5)
          to label %147 unwind label %130

147:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 10128, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %148 unwind label %188

148:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %149 unwind label %192

149:                                              ; preds = %148
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %19, ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %22, i32 noundef 8)
          to label %150 unwind label %196

150:                                              ; preds = %149
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %151 unwind label %202

151:                                              ; preds = %150
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %24, ptr noundef nonnull align 8 dereferenceable(10128) %19, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %152 unwind label %206

152:                                              ; preds = %151
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %27, ptr noundef nonnull align 8 dereferenceable(10128) %19, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %153 unwind label %211

153:                                              ; preds = %152
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %154 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %19) #6
  %155 = getelementptr inbounds %"class.std::complex", ptr %28, i32 0, i32 0
  %156 = getelementptr inbounds { double, double }, ptr %155, i32 0, i32 0
  %157 = extractvalue { double, double } %154, 0
  store double %157, ptr %156, align 8
  %158 = getelementptr inbounds { double, double }, ptr %155, i32 0, i32 1
  %159 = extractvalue { double, double } %154, 1
  store double %159, ptr %158, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  %160 = invoke noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %161 unwind label %215

161:                                              ; preds = %153
  %162 = fadd double %160, 6.207050e-01
  %163 = invoke noundef double @_ZSt3absd(double noundef %162)
          to label %164 unwind label %215

164:                                              ; preds = %161
  %165 = fcmp ogt double %163, 0x3EB0C6F7A0B5ED8D
  br i1 %165, label %178, label %166

166:                                              ; preds = %164
  %167 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %19) #6
  %168 = getelementptr inbounds %"class.std::complex", ptr %29, i32 0, i32 0
  %169 = getelementptr inbounds { double, double }, ptr %168, i32 0, i32 0
  %170 = extractvalue { double, double } %167, 0
  store double %170, ptr %169, align 8
  %171 = getelementptr inbounds { double, double }, ptr %168, i32 0, i32 1
  %172 = extractvalue { double, double } %167, 1
  store double %172, ptr %171, align 8
  %173 = invoke noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %29)
          to label %174 unwind label %219

174:                                              ; preds = %166
  %175 = invoke noundef double @_ZSt3absd(double noundef %173)
          to label %176 unwind label %219

176:                                              ; preds = %174
  %177 = fcmp ogt double %175, 1.000000e-05
  br label %178

178:                                              ; preds = %176, %164
  %179 = phi i1 [ true, %164 ], [ %177, %176 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br i1 %179, label %180, label %224

180:                                              ; preds = %178
  store i8 0, ptr %3, align 1, !tbaa !9
  %181 = load i32, ptr %4, align 4, !tbaa !11
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %4, align 4, !tbaa !11
  %183 = load ptr, ptr %2, align 8, !tbaa !5
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @.str.112)
          to label %185 unwind label %211

185:                                              ; preds = %180
  %186 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %184, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %187 unwind label %211

187:                                              ; preds = %185
  br label %224

188:                                              ; preds = %147
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %6, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %7, align 4
  br label %201

192:                                              ; preds = %148
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %6, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %7, align 4
  br label %200

196:                                              ; preds = %149
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %6, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  br label %200

200:                                              ; preds = %196, %192
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %201

201:                                              ; preds = %200, %188
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  br label %424

202:                                              ; preds = %150
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %6, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %7, align 4
  br label %210

206:                                              ; preds = %151
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %6, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  br label %210

210:                                              ; preds = %206, %202
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  br label %423

211:                                              ; preds = %227, %225, %224, %185, %180, %152
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %6, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %7, align 4
  br label %423

215:                                              ; preds = %161, %153
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %6, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %7, align 4
  br label %223

219:                                              ; preds = %174, %166
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %6, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  br label %223

223:                                              ; preds = %219, %215
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %423

224:                                              ; preds = %187, %178
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %5, ptr noundef @.str.106, i32 noundef 16)
          to label %225 unwind label %211

225:                                              ; preds = %224
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.113)
          to label %227 unwind label %211

227:                                              ; preds = %225
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %5)
          to label %228 unwind label %211

228:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 10128, ptr %30) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %32)
          to label %229 unwind label %269

229:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 32, ptr %33) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %33, ptr noundef @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %34)
          to label %230 unwind label %273

230:                                              ; preds = %229
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %30, ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef nonnull align 8 dereferenceable(32) %33, i32 noundef 8)
          to label %231 unwind label %277

231:                                              ; preds = %230
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %37)
          to label %232 unwind label %283

232:                                              ; preds = %231
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %35, ptr noundef nonnull align 8 dereferenceable(10128) %30, ptr noundef nonnull align 8 dereferenceable(32) %36)
          to label %233 unwind label %287

233:                                              ; preds = %232
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %35) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %38, ptr noundef nonnull align 8 dereferenceable(10128) %30, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %234 unwind label %292

234:                                              ; preds = %233
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %38) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #6
  %235 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %30) #6
  %236 = getelementptr inbounds %"class.std::complex", ptr %39, i32 0, i32 0
  %237 = getelementptr inbounds { double, double }, ptr %236, i32 0, i32 0
  %238 = extractvalue { double, double } %235, 0
  store double %238, ptr %237, align 8
  %239 = getelementptr inbounds { double, double }, ptr %236, i32 0, i32 1
  %240 = extractvalue { double, double } %235, 1
  store double %240, ptr %239, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #6
  %241 = invoke noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %39)
          to label %242 unwind label %296

242:                                              ; preds = %234
  %243 = fadd double %241, 0x3FE916E371540032
  %244 = invoke noundef double @_ZSt3absd(double noundef %243)
          to label %245 unwind label %296

245:                                              ; preds = %242
  %246 = fcmp ogt double %244, 0x3EB0C6F7A0B5ED8D
  br i1 %246, label %259, label %247

247:                                              ; preds = %245
  %248 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %30) #6
  %249 = getelementptr inbounds %"class.std::complex", ptr %40, i32 0, i32 0
  %250 = getelementptr inbounds { double, double }, ptr %249, i32 0, i32 0
  %251 = extractvalue { double, double } %248, 0
  store double %251, ptr %250, align 8
  %252 = getelementptr inbounds { double, double }, ptr %249, i32 0, i32 1
  %253 = extractvalue { double, double } %248, 1
  store double %253, ptr %252, align 8
  %254 = invoke noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %40)
          to label %255 unwind label %300

255:                                              ; preds = %247
  %256 = invoke noundef double @_ZSt3absd(double noundef %254)
          to label %257 unwind label %300

257:                                              ; preds = %255
  %258 = fcmp ogt double %256, 1.000000e-05
  br label %259

259:                                              ; preds = %257, %245
  %260 = phi i1 [ true, %245 ], [ %258, %257 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #6
  br i1 %260, label %261, label %305

261:                                              ; preds = %259
  store i8 0, ptr %3, align 1, !tbaa !9
  %262 = load i32, ptr %4, align 4, !tbaa !11
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %4, align 4, !tbaa !11
  %264 = load ptr, ptr %2, align 8, !tbaa !5
  %265 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %264, ptr noundef @.str.114)
          to label %266 unwind label %292

266:                                              ; preds = %261
  %267 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %265, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %268 unwind label %292

268:                                              ; preds = %266
  br label %305

269:                                              ; preds = %228
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %6, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %7, align 4
  br label %282

273:                                              ; preds = %229
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %6, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %7, align 4
  br label %281

277:                                              ; preds = %230
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %6, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #6
  br label %281

281:                                              ; preds = %277, %273
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  br label %282

282:                                              ; preds = %281, %269
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  br label %422

283:                                              ; preds = %231
  %284 = landingpad { ptr, i32 }
          cleanup
  %285 = extractvalue { ptr, i32 } %284, 0
  store ptr %285, ptr %6, align 8
  %286 = extractvalue { ptr, i32 } %284, 1
  store i32 %286, ptr %7, align 4
  br label %291

287:                                              ; preds = %232
  %288 = landingpad { ptr, i32 }
          cleanup
  %289 = extractvalue { ptr, i32 } %288, 0
  store ptr %289, ptr %6, align 8
  %290 = extractvalue { ptr, i32 } %288, 1
  store i32 %290, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #6
  br label %291

291:                                              ; preds = %287, %283
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #6
  br label %421

292:                                              ; preds = %308, %306, %305, %266, %261, %233
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %6, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %7, align 4
  br label %421

296:                                              ; preds = %242, %234
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %6, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %7, align 4
  br label %304

300:                                              ; preds = %255, %247
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %6, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #6
  br label %304

304:                                              ; preds = %300, %296
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #6
  br label %421

305:                                              ; preds = %268, %259
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %5, ptr noundef @.str.106, i32 noundef 16)
          to label %306 unwind label %292

306:                                              ; preds = %305
  %307 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.113)
          to label %308 unwind label %292

308:                                              ; preds = %306
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %5)
          to label %309 unwind label %292

309:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 10128, ptr %41) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %42) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %43)
          to label %310 unwind label %350

310:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 32, ptr %44) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %45) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %45) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %44, ptr noundef @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %45)
          to label %311 unwind label %354

311:                                              ; preds = %310
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %41, ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef nonnull align 8 dereferenceable(32) %44, i32 noundef 8)
          to label %312 unwind label %358

312:                                              ; preds = %311
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %44) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %45) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %44) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %42) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %47) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %48) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %48)
          to label %313 unwind label %364

313:                                              ; preds = %312
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %46, ptr noundef nonnull align 8 dereferenceable(10128) %41, ptr noundef nonnull align 8 dereferenceable(32) %47)
          to label %314 unwind label %368

314:                                              ; preds = %313
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %46) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %47) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.178") align 8 %49, ptr noundef nonnull align 8 dereferenceable(10128) %41, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %315 unwind label %373

315:                                              ; preds = %314
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %49) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %50) #6
  %316 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %41) #6
  %317 = getelementptr inbounds %"class.std::complex", ptr %50, i32 0, i32 0
  %318 = getelementptr inbounds { double, double }, ptr %317, i32 0, i32 0
  %319 = extractvalue { double, double } %316, 0
  store double %319, ptr %318, align 8
  %320 = getelementptr inbounds { double, double }, ptr %317, i32 0, i32 1
  %321 = extractvalue { double, double } %316, 1
  store double %321, ptr %320, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %51) #6
  %322 = invoke noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %50)
          to label %323 unwind label %377

323:                                              ; preds = %315
  %324 = fadd double %322, 0x3FE916E371540032
  %325 = invoke noundef double @_ZSt3absd(double noundef %324)
          to label %326 unwind label %377

326:                                              ; preds = %323
  %327 = fcmp ogt double %325, 0x3EB0C6F7A0B5ED8D
  br i1 %327, label %340, label %328

328:                                              ; preds = %326
  %329 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %41) #6
  %330 = getelementptr inbounds %"class.std::complex", ptr %51, i32 0, i32 0
  %331 = getelementptr inbounds { double, double }, ptr %330, i32 0, i32 0
  %332 = extractvalue { double, double } %329, 0
  store double %332, ptr %331, align 8
  %333 = getelementptr inbounds { double, double }, ptr %330, i32 0, i32 1
  %334 = extractvalue { double, double } %329, 1
  store double %334, ptr %333, align 8
  %335 = invoke noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %51)
          to label %336 unwind label %381

336:                                              ; preds = %328
  %337 = invoke noundef double @_ZSt3absd(double noundef %335)
          to label %338 unwind label %381

338:                                              ; preds = %336
  %339 = fcmp ogt double %337, 1.000000e-05
  br label %340

340:                                              ; preds = %338, %326
  %341 = phi i1 [ true, %326 ], [ %339, %338 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #6
  br i1 %341, label %342, label %386

342:                                              ; preds = %340
  store i8 0, ptr %3, align 1, !tbaa !9
  %343 = load i32, ptr %4, align 4, !tbaa !11
  %344 = add nsw i32 %343, 1
  store i32 %344, ptr %4, align 4, !tbaa !11
  %345 = load ptr, ptr %2, align 8, !tbaa !5
  %346 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %345, ptr noundef @.str.115)
          to label %347 unwind label %373

347:                                              ; preds = %342
  %348 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %346, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %349 unwind label %373

349:                                              ; preds = %347
  br label %386

350:                                              ; preds = %309
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %6, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %7, align 4
  br label %363

354:                                              ; preds = %310
  %355 = landingpad { ptr, i32 }
          cleanup
  %356 = extractvalue { ptr, i32 } %355, 0
  store ptr %356, ptr %6, align 8
  %357 = extractvalue { ptr, i32 } %355, 1
  store i32 %357, ptr %7, align 4
  br label %362

358:                                              ; preds = %311
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %6, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %44) #6
  br label %362

362:                                              ; preds = %358, %354
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %45) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %44) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #6
  br label %363

363:                                              ; preds = %362, %350
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %42) #6
  br label %420

364:                                              ; preds = %312
  %365 = landingpad { ptr, i32 }
          cleanup
  %366 = extractvalue { ptr, i32 } %365, 0
  store ptr %366, ptr %6, align 8
  %367 = extractvalue { ptr, i32 } %365, 1
  store i32 %367, ptr %7, align 4
  br label %372

368:                                              ; preds = %313
  %369 = landingpad { ptr, i32 }
          cleanup
  %370 = extractvalue { ptr, i32 } %369, 0
  store ptr %370, ptr %6, align 8
  %371 = extractvalue { ptr, i32 } %369, 1
  store i32 %371, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #6
  br label %372

372:                                              ; preds = %368, %364
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %47) #6
  br label %419

373:                                              ; preds = %392, %389, %386, %347, %342, %314
  %374 = landingpad { ptr, i32 }
          cleanup
  %375 = extractvalue { ptr, i32 } %374, 0
  store ptr %375, ptr %6, align 8
  %376 = extractvalue { ptr, i32 } %374, 1
  store i32 %376, ptr %7, align 4
  br label %419

377:                                              ; preds = %323, %315
  %378 = landingpad { ptr, i32 }
          cleanup
  %379 = extractvalue { ptr, i32 } %378, 0
  store ptr %379, ptr %6, align 8
  %380 = extractvalue { ptr, i32 } %378, 1
  store i32 %380, ptr %7, align 4
  br label %385

381:                                              ; preds = %336, %328
  %382 = landingpad { ptr, i32 }
          cleanup
  %383 = extractvalue { ptr, i32 } %382, 0
  store ptr %383, ptr %6, align 8
  %384 = extractvalue { ptr, i32 } %382, 1
  store i32 %384, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #6
  br label %385

385:                                              ; preds = %381, %377
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #6
  br label %419

386:                                              ; preds = %349, %340
  %387 = load ptr, ptr %2, align 8, !tbaa !5
  %388 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %387, ptr noundef @.str.116)
          to label %389 unwind label %373

389:                                              ; preds = %386
  %390 = load i32, ptr %4, align 4, !tbaa !11
  %391 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %388, i32 noundef %390)
          to label %392 unwind label %373

392:                                              ; preds = %389
  %393 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %391, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %394 unwind label %373

394:                                              ; preds = %392
  call void @llvm.lifetime.start.p0(i64 32, ptr %52) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %53) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %53) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %52, ptr noundef @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %53)
          to label %395 unwind label %401

395:                                              ; preds = %394
  invoke void @_Z10removeFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %52)
          to label %396 unwind label %405

396:                                              ; preds = %395
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %52) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %53) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %53) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %52) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %54) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %55) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %55) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %54, ptr noundef @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %55)
          to label %397 unwind label %410

397:                                              ; preds = %396
  invoke void @_Z10removeFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %54)
          to label %398 unwind label %414

398:                                              ; preds = %397
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %54) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %55) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %55) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %54) #6
  %399 = load i8, ptr %3, align 1, !tbaa !9, !range !13, !noundef !14
  %400 = trunc i8 %399 to i1
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %41) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr %41) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %30) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr %30) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %19) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr %19) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %8) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr %8) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %5) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  ret i1 %400

401:                                              ; preds = %394
  %402 = landingpad { ptr, i32 }
          cleanup
  %403 = extractvalue { ptr, i32 } %402, 0
  store ptr %403, ptr %6, align 8
  %404 = extractvalue { ptr, i32 } %402, 1
  store i32 %404, ptr %7, align 4
  br label %409

405:                                              ; preds = %395
  %406 = landingpad { ptr, i32 }
          cleanup
  %407 = extractvalue { ptr, i32 } %406, 0
  store ptr %407, ptr %6, align 8
  %408 = extractvalue { ptr, i32 } %406, 1
  store i32 %408, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %52) #6
  br label %409

409:                                              ; preds = %405, %401
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %53) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %53) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %52) #6
  br label %419

410:                                              ; preds = %396
  %411 = landingpad { ptr, i32 }
          cleanup
  %412 = extractvalue { ptr, i32 } %411, 0
  store ptr %412, ptr %6, align 8
  %413 = extractvalue { ptr, i32 } %411, 1
  store i32 %413, ptr %7, align 4
  br label %418

414:                                              ; preds = %397
  %415 = landingpad { ptr, i32 }
          cleanup
  %416 = extractvalue { ptr, i32 } %415, 0
  store ptr %416, ptr %6, align 8
  %417 = extractvalue { ptr, i32 } %415, 1
  store i32 %417, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %54) #6
  br label %418

418:                                              ; preds = %414, %410
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %55) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %55) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %54) #6
  br label %419

419:                                              ; preds = %418, %409, %385, %373, %372
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %41) #6
  br label %420

420:                                              ; preds = %419, %363
  call void @llvm.lifetime.end.p0(i64 10128, ptr %41) #6
  br label %421

421:                                              ; preds = %420, %304, %292, %291
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %30) #6
  br label %422

422:                                              ; preds = %421, %282
  call void @llvm.lifetime.end.p0(i64 10128, ptr %30) #6
  br label %423

423:                                              ; preds = %422, %223, %211, %210
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %19) #6
  br label %424

424:                                              ; preds = %423, %201
  call void @llvm.lifetime.end.p0(i64 10128, ptr %19) #6
  br label %425

425:                                              ; preds = %424, %142, %130, %129
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %8) #6
  br label %426

426:                                              ; preds = %425, %120
  call void @llvm.lifetime.end.p0(i64 10128, ptr %8) #6
  br label %427

427:                                              ; preds = %426, %103
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %5) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  br label %428

428:                                              ; preds = %427
  %429 = load ptr, ptr %6, align 8
  %430 = load i32, ptr %7, align 4
  %431 = insertvalue { ptr, i32 } poison, ptr %429, 0
  %432 = insertvalue { ptr, i32 } %431, i32 %430, 1
  resume { ptr, i32 } %432
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #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 = { "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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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::shared_ptr.178" = type { %"class.std::__shared_ptr.179" }
%"class.std::__shared_ptr.179" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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.qtorch::ContractionTools" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::complex", %"class.std::vector.186", %"class.std::random_device", %"class.std::shared_ptr.178", %"class.std::mersenne_twister_engine", i8, i32 }
%"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] }
%"class.std::complex" = type { { double, double } }
%"class.std::vector.186" = type { %"struct.std::_Vector_base.187" }
%"struct.std::_Vector_base.187" = type { %"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>, std::allocator<std::shared_ptr<std::vector<std::shared_ptr<qtorch::Node>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::random_device" = type { %union.anon.191 }
%union.anon.191 = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"class.std::allocator" = type { i8 }

@.str.105 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [25 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.178") align 8, ptr noundef nonnull align 8 dereferenceable(10128), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.178") align 8, ptr noundef nonnull align 8 dereferenceable(10128), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z27simpleReduceAndContractTestRSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(248) %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::basic_ofstream", align 8
  %3 = alloca %"class.qtorch::ContractionTools", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::shared_ptr.178", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::shared_ptr.178", align 8
  %12 = alloca %"class.std::complex", align 8
  %13 = alloca %"class.std::complex", align 8
  %14 = alloca %"class.qtorch::ContractionTools", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator", align 1
  %19 = alloca %"class.std::shared_ptr.178", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca %"class.std::shared_ptr.178", align 8
  %23 = alloca %"class.std::complex", align 8
  %24 = alloca %"class.std::complex", align 8
  %25 = alloca %"class.qtorch::ContractionTools", align 8
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.std::allocator", align 1
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca %"class.std::shared_ptr.178", align 8
  %31 = alloca %"class.std::__cxx11::basic_string", align 8
  %32 = alloca %"class.std::allocator", align 1
  %33 = alloca %"class.std::shared_ptr.178", align 8
  %34 = alloca %"class.std::complex", align 8
  %35 = alloca %"class.std::complex", align 8
  %36 = alloca %"class.qtorch::ContractionTools", align 8
  %37 = alloca %"class.std::__cxx11::basic_string", align 8
  %38 = alloca %"class.std::allocator", align 1
  %39 = alloca %"class.std::__cxx11::basic_string", align 8
  %40 = alloca %"class.std::allocator", align 1
  %41 = alloca %"class.std::shared_ptr.178", align 8
  %42 = alloca %"class.std::__cxx11::basic_string", align 8
  %43 = alloca %"class.std::allocator", align 1
  %44 = alloca %"class.std::shared_ptr.178", align 8
  %45 = alloca %"class.std::complex", align 8
  %46 = alloca %"class.std::complex", align 8
  %47 = alloca %"class.std::__cxx11::basic_string", align 8
  %48 = alloca %"class.std::allocator", align 1
  %49 = alloca %"class.std::__cxx11::basic_string", align 8
  %50 = alloca %"class.std::allocator", align 1
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.105)
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.106, i32 noundef 16)
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.107)
          to label %55 unwind label %83

55:                                               ; preds = %1
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %2)
          to label %56 unwind label %83

56:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 10128, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %57 unwind label %85

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %58 unwind label %87

58:                                               ; preds = %57
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %3, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef 8)
          to label %59 unwind label %89

59:                                               ; preds = %58
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %60 unwind label %93

60:                                               ; preds = %59
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %8, ptr noundef nonnull align 8 dereferenceable(10128) %3, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %61 unwind label %95

61:                                               ; preds = %60
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %11, ptr noundef nonnull align 8 dereferenceable(10128) %3, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %62 unwind label %98

62:                                               ; preds = %61
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %63 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %3) #6
  %64 = extractvalue { double, double } %63, 0
  store double %64, ptr %12, align 8
  %65 = getelementptr inbounds i8, ptr %12, i64 8
  %66 = extractvalue { double, double } %63, 1
  store double %66, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %67 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %68 = fadd double %67, 6.207050e-01
  %69 = call noundef double @_ZSt3absd(double noundef %68)
  %70 = fcmp ogt double %69, 0x3EB0C6F7A0B5ED8D
  br i1 %70, label %.critedge, label %71

71:                                               ; preds = %62
  %72 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %3) #6
  %73 = extractvalue { double, double } %72, 0
  store double %73, ptr %13, align 8
  %74 = getelementptr inbounds i8, ptr %13, i64 8
  %75 = extractvalue { double, double } %72, 1
  store double %75, ptr %74, align 8
  %76 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %77 = call noundef double @_ZSt3absd(double noundef %76)
  %78 = fcmp ogt double %77, 1.000000e-05
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br i1 %78, label %79, label %100

.critedge:                                        ; preds = %62
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %79

79:                                               ; preds = %.critedge, %71
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.110)
          to label %81 unwind label %98

81:                                               ; preds = %79
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %100 unwind label %98

83:                                               ; preds = %55, %1
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %270

85:                                               ; preds = %56
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %92

87:                                               ; preds = %57
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %91

89:                                               ; preds = %58
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %91

91:                                               ; preds = %89, %87
  %.pn = phi { ptr, i32 } [ %90, %89 ], [ %88, %87 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %92

92:                                               ; preds = %91, %85
  %.pn.pn = phi { ptr, i32 } [ %.pn, %91 ], [ %86, %85 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %269

93:                                               ; preds = %59
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %60
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %97

97:                                               ; preds = %95, %93
  %.pn52 = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br label %268

98:                                               ; preds = %103, %101, %100, %81, %79, %61
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %268

100:                                              ; preds = %81, %71
  %.046 = phi i1 [ false, %81 ], [ true, %71 ]
  %.042 = phi i32 [ 1, %81 ], [ 0, %71 ]
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.106, i32 noundef 16)
          to label %101 unwind label %98

101:                                              ; preds = %100
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.111)
          to label %103 unwind label %98

103:                                              ; preds = %101
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %2)
          to label %104 unwind label %98

104:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 10128, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %105 unwind label %132

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %106 unwind label %134

106:                                              ; preds = %105
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %14, ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %17, i32 noundef 8)
          to label %107 unwind label %136

107:                                              ; preds = %106
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %108 unwind label %140

108:                                              ; preds = %107
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %19, ptr noundef nonnull align 8 dereferenceable(10128) %14, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %109 unwind label %142

109:                                              ; preds = %108
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %22, ptr noundef nonnull align 8 dereferenceable(10128) %14, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %110 unwind label %145

110:                                              ; preds = %109
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #6
  %111 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %14) #6
  %112 = extractvalue { double, double } %111, 0
  store double %112, ptr %23, align 8
  %113 = getelementptr inbounds i8, ptr %23, i64 8
  %114 = extractvalue { double, double } %111, 1
  store double %114, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #6
  %115 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %116 = fadd double %115, 6.207050e-01
  %117 = call noundef double @_ZSt3absd(double noundef %116)
  %118 = fcmp ogt double %117, 0x3EB0C6F7A0B5ED8D
  br i1 %118, label %.critedge2, label %119

119:                                              ; preds = %110
  %120 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %14) #6
  %121 = extractvalue { double, double } %120, 0
  store double %121, ptr %24, align 8
  %122 = getelementptr inbounds i8, ptr %24, i64 8
  %123 = extractvalue { double, double } %120, 1
  store double %123, ptr %122, align 8
  %124 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %125 = call noundef double @_ZSt3absd(double noundef %124)
  %126 = fcmp ogt double %125, 1.000000e-05
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #6
  br i1 %126, label %127, label %147

.critedge2:                                       ; preds = %110
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #6
  br label %127

127:                                              ; preds = %.critedge2, %119
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.112)
          to label %129 unwind label %145

129:                                              ; preds = %127
  %130 = add nuw nsw i32 %.042, 1
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %147 unwind label %145

132:                                              ; preds = %104
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %139

134:                                              ; preds = %105
  %135 = landingpad { ptr, i32 }
          cleanup
  br label %138

136:                                              ; preds = %106
  %137 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  br label %138

138:                                              ; preds = %136, %134
  %.pn54 = phi { ptr, i32 } [ %137, %136 ], [ %135, %134 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %139

139:                                              ; preds = %138, %132
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %138 ], [ %133, %132 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  br label %267

140:                                              ; preds = %107
  %141 = landingpad { ptr, i32 }
          cleanup
  br label %144

142:                                              ; preds = %108
  %143 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %144

144:                                              ; preds = %142, %140
  %.pn57 = phi { ptr, i32 } [ %143, %142 ], [ %141, %140 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #6
  br label %266

145:                                              ; preds = %150, %148, %147, %129, %127, %109
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %266

147:                                              ; preds = %129, %119
  %.147 = phi i1 [ false, %129 ], [ %.046, %119 ]
  %.143 = phi i32 [ %130, %129 ], [ %.042, %119 ]
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.106, i32 noundef 16)
          to label %148 unwind label %145

148:                                              ; preds = %147
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.113)
          to label %150 unwind label %145

150:                                              ; preds = %148
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %2)
          to label %151 unwind label %145

151:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 10128, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %26) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %27) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %152 unwind label %179

152:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %28) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef nonnull @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %153 unwind label %181

153:                                              ; preds = %152
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %25, ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef 8)
          to label %154 unwind label %183

154:                                              ; preds = %153
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %31) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %32) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef nonnull @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %32)
          to label %155 unwind label %187

155:                                              ; preds = %154
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %30, ptr noundef nonnull align 8 dereferenceable(10128) %25, ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %156 unwind label %189

156:                                              ; preds = %155
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %32) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %31) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %33, ptr noundef nonnull align 8 dereferenceable(10128) %25, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %157 unwind label %192

157:                                              ; preds = %156
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %33) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %34) #6
  %158 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %25) #6
  %159 = extractvalue { double, double } %158, 0
  store double %159, ptr %34, align 8
  %160 = getelementptr inbounds i8, ptr %34, i64 8
  %161 = extractvalue { double, double } %158, 1
  store double %161, ptr %160, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %35) #6
  %162 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %163 = fadd double %162, 0x3FE916E371540032
  %164 = call noundef double @_ZSt3absd(double noundef %163)
  %165 = fcmp ogt double %164, 0x3EB0C6F7A0B5ED8D
  br i1 %165, label %.critedge4, label %166

166:                                              ; preds = %157
  %167 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %25) #6
  %168 = extractvalue { double, double } %167, 0
  store double %168, ptr %35, align 8
  %169 = getelementptr inbounds i8, ptr %35, i64 8
  %170 = extractvalue { double, double } %167, 1
  store double %170, ptr %169, align 8
  %171 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %35)
  %172 = call noundef double @_ZSt3absd(double noundef %171)
  %173 = fcmp ogt double %172, 1.000000e-05
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %35) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %34) #6
  br i1 %173, label %174, label %194

.critedge4:                                       ; preds = %157
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %35) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %34) #6
  br label %174

174:                                              ; preds = %.critedge4, %166
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.114)
          to label %176 unwind label %192

176:                                              ; preds = %174
  %177 = add nuw nsw i32 %.143, 1
  %178 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %194 unwind label %192

179:                                              ; preds = %151
  %180 = landingpad { ptr, i32 }
          cleanup
  br label %186

181:                                              ; preds = %152
  %182 = landingpad { ptr, i32 }
          cleanup
  br label %185

183:                                              ; preds = %153
  %184 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  br label %185

185:                                              ; preds = %183, %181
  %.pn59 = phi { ptr, i32 } [ %184, %183 ], [ %182, %181 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #6
  br label %186

186:                                              ; preds = %185, %179
  %.pn59.pn = phi { ptr, i32 } [ %.pn59, %185 ], [ %180, %179 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #6
  br label %265

187:                                              ; preds = %154
  %188 = landingpad { ptr, i32 }
          cleanup
  br label %191

189:                                              ; preds = %155
  %190 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  br label %191

191:                                              ; preds = %189, %187
  %.pn62 = phi { ptr, i32 } [ %190, %189 ], [ %188, %187 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %32) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %31) #6
  br label %264

192:                                              ; preds = %197, %195, %194, %176, %174, %156
  %193 = landingpad { ptr, i32 }
          cleanup
  br label %264

194:                                              ; preds = %176, %166
  %.248 = phi i1 [ false, %176 ], [ %.147, %166 ]
  %.244 = phi i32 [ %177, %176 ], [ %.143, %166 ]
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.106, i32 noundef 16)
          to label %195 unwind label %192

195:                                              ; preds = %194
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.113)
          to label %197 unwind label %192

197:                                              ; preds = %195
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %2)
          to label %198 unwind label %192

198:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 10128, ptr nonnull %36) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %37) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %38) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull @.str.108, ptr noundef nonnull align 1 dereferenceable(1) %38)
          to label %199 unwind label %226

199:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %39) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %40) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %40)
          to label %200 unwind label %228

200:                                              ; preds = %199
  invoke void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128) %36, ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull align 8 dereferenceable(32) %39, i32 noundef 8)
          to label %201 unwind label %230

201:                                              ; preds = %200
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %39) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %40) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %39) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %38) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %37) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %42) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %43) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef nonnull @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %43)
          to label %202 unwind label %234

202:                                              ; preds = %201
  invoke void @_ZNK6qtorch16ContractionTools30ReduceAndPrintCircuitToTWGraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %41, ptr noundef nonnull align 8 dereferenceable(10128) %36, ptr noundef nonnull align 8 dereferenceable(32) %42)
          to label %203 unwind label %236

203:                                              ; preds = %202
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %41) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %43) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %42) #6
  invoke void @_ZN6qtorch16ContractionTools8ContractENS_15ContractionTypeEii(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.178") align 8 %44, ptr noundef nonnull align 8 dereferenceable(10128) %36, i32 noundef 0, i32 noundef 1, i32 noundef 1)
          to label %204 unwind label %239

204:                                              ; preds = %203
  call void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %44) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %45) #6
  %205 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %36) #6
  %206 = extractvalue { double, double } %205, 0
  store double %206, ptr %45, align 8
  %207 = getelementptr inbounds i8, ptr %45, i64 8
  %208 = extractvalue { double, double } %205, 1
  store double %208, ptr %207, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %46) #6
  %209 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %210 = fadd double %209, 0x3FE916E371540032
  %211 = call noundef double @_ZSt3absd(double noundef %210)
  %212 = fcmp ogt double %211, 0x3EB0C6F7A0B5ED8D
  br i1 %212, label %.critedge6, label %213

213:                                              ; preds = %204
  %214 = call { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128) %36) #6
  %215 = extractvalue { double, double } %214, 0
  store double %215, ptr %46, align 8
  %216 = getelementptr inbounds i8, ptr %46, i64 8
  %217 = extractvalue { double, double } %214, 1
  store double %217, ptr %216, align 8
  %218 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %46)
  %219 = call noundef double @_ZSt3absd(double noundef %218)
  %220 = fcmp ogt double %219, 1.000000e-05
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %46) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %45) #6
  br i1 %220, label %221, label %241

.critedge6:                                       ; preds = %204
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %46) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %45) #6
  br label %221

221:                                              ; preds = %.critedge6, %213
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.115)
          to label %223 unwind label %239

223:                                              ; preds = %221
  %224 = add nuw nsw i32 %.244, 1
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %241 unwind label %239

226:                                              ; preds = %198
  %227 = landingpad { ptr, i32 }
          cleanup
  br label %233

228:                                              ; preds = %199
  %229 = landingpad { ptr, i32 }
          cleanup
  br label %232

230:                                              ; preds = %200
  %231 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %39) #6
  br label %232

232:                                              ; preds = %230, %228
  %.pn64 = phi { ptr, i32 } [ %231, %230 ], [ %229, %228 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %40) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %39) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #6
  br label %233

233:                                              ; preds = %232, %226
  %.pn64.pn = phi { ptr, i32 } [ %.pn64, %232 ], [ %227, %226 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %38) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %37) #6
  br label %263

234:                                              ; preds = %201
  %235 = landingpad { ptr, i32 }
          cleanup
  br label %238

236:                                              ; preds = %202
  %237 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #6
  br label %238

238:                                              ; preds = %236, %234
  %.pn67 = phi { ptr, i32 } [ %237, %236 ], [ %235, %234 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %43) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %43) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %42) #6
  br label %262

239:                                              ; preds = %245, %243, %241, %223, %221, %203
  %240 = landingpad { ptr, i32 }
          cleanup
  br label %262

241:                                              ; preds = %223, %213
  %.349 = phi i1 [ false, %223 ], [ %.248, %213 ]
  %.345 = phi i32 [ %224, %223 ], [ %.244, %213 ]
  %242 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull @.str.116)
          to label %243 unwind label %239

243:                                              ; preds = %241
  %244 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %242, i32 noundef %.345)
          to label %245 unwind label %239

245:                                              ; preds = %243
  %246 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %244, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %247 unwind label %239

247:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %47) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %48) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef nonnull @.str.106, ptr noundef nonnull align 1 dereferenceable(1) %48)
          to label %248 unwind label %252

248:                                              ; preds = %247
  invoke void @_Z10removeFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %47)
          to label %249 unwind label %254

249:                                              ; preds = %248
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %48) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %47) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %49) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %50) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %50) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %49, ptr noundef nonnull @.str.109, ptr noundef nonnull align 1 dereferenceable(1) %50)
          to label %250 unwind label %257

250:                                              ; preds = %249
  invoke void @_Z10removeFileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %49)
          to label %251 unwind label %259

251:                                              ; preds = %250
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %49) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %50) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %50) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %49) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %36) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %36) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %25) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %25) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %14) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %14) #6
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %3) #6
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %3) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  ret i1 %.349

252:                                              ; preds = %247
  %253 = landingpad { ptr, i32 }
          cleanup
  br label %256

254:                                              ; preds = %248
  %255 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #6
  br label %256

256:                                              ; preds = %254, %252
  %.pn69 = phi { ptr, i32 } [ %255, %254 ], [ %253, %252 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %48) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %47) #6
  br label %262

257:                                              ; preds = %249
  %258 = landingpad { ptr, i32 }
          cleanup
  br label %261

259:                                              ; preds = %250
  %260 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %49) #6
  br label %261

261:                                              ; preds = %259, %257
  %.pn71 = phi { ptr, i32 } [ %260, %259 ], [ %258, %257 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %50) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %50) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %49) #6
  br label %262

262:                                              ; preds = %261, %256, %239, %238
  %.pn71.pn = phi { ptr, i32 } [ %.pn71, %261 ], [ %.pn69, %256 ], [ %240, %239 ], [ %.pn67, %238 ]
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %36) #6
  br label %263

263:                                              ; preds = %262, %233
  %.pn71.pn.pn = phi { ptr, i32 } [ %.pn71.pn, %262 ], [ %.pn64.pn, %233 ]
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %36) #6
  br label %264

264:                                              ; preds = %263, %192, %191
  %.pn71.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn, %263 ], [ %193, %192 ], [ %.pn62, %191 ]
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %25) #6
  br label %265

265:                                              ; preds = %264, %186
  %.pn71.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn, %264 ], [ %.pn59.pn, %186 ]
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %25) #6
  br label %266

266:                                              ; preds = %265, %145, %144
  %.pn71.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn.pn, %265 ], [ %146, %145 ], [ %.pn57, %144 ]
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %14) #6
  br label %267

267:                                              ; preds = %266, %139
  %.pn71.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn.pn.pn, %266 ], [ %.pn54.pn, %139 ]
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %14) #6
  br label %268

268:                                              ; preds = %267, %98, %97
  %.pn71.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn.pn.pn.pn, %267 ], [ %99, %98 ], [ %.pn52, %97 ]
  call void @_ZN6qtorch16ContractionToolsD2Ev(ptr noundef nonnull align 8 dereferenceable(10128) %3) #6
  br label %269

269:                                              ; preds = %268, %92
  %.pn71.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn.pn.pn.pn.pn, %268 ], [ %.pn.pn, %92 ]
  call void @llvm.lifetime.end.p0(i64 10128, ptr nonnull %3) #6
  br label %270

270:                                              ; preds = %269, %83
  %.pn71.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn.pn.pn.pn.pn.pn.pn, %269 ], [ %84, %83 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn71.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6qtorch16ContractionToolsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_i(ptr noundef nonnull align 8 dereferenceable(10128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZN6qtorch16ContractionTools11GetFinalValEv(ptr noundef nonnull align 8 dereferenceable(10128)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN6qtorch7NetworkELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) 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 = { "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 = { 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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass