; LLVM IR from tangjz/acm-icpc :: codeforces/1408G.ll (Z5solvev)

; 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"

%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr }
%class.anon.2 = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.4" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.4" = type { ptr }
%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::pair.10" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@_ZZ5solvevE3dis = external hidden global [2001 x [2001 x i32]], align 16
@_ZZ5solvevE3seq = external hidden global [2000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3seq = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3dsu = external hidden global [2001 x i32], align 16
@_ZZ5solvevE4cntE = external hidden global [2001 x i32], align 16
@_ZZ5solvevE3rep = external hidden global [4003 x i32], align 16
@_ZZ5solvevE2sz = external hidden global [4003 x i32], align 16
@_ZZ5solvevE1e = external hidden global [4003 x %"class.std::vector"], align 16
@_ZGVZ5solvevE1e = external hidden global i64, align 8
@__dso_handle = external hidden global i8
@_ZZ5solvevE2dp = external hidden global [4003 x [2001 x i32]], align 16
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair.0", align 4
  %10 = alloca { i64, i32 }, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::function", align 8
  %14 = alloca %class.anon, align 8
  %15 = alloca %class.anon.2, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::tuple", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::unordered_set", align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair.10", align 8
  %25 = alloca ptr, align 8
  %26 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %27 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  %32 = load atomic i8, ptr @_ZGVZ5solvevE3seq acquire, align 8
  %33 = icmp eq i8 %32, 0
  br i1 %33, label %34, label %44, !prof !9

34:                                               ; preds = %0
  %35 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ5solvevE3seq) #4
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %44

37:                                               ; preds = %34
  br label %38

38:                                               ; preds = %40, %37
  %39 = phi ptr [ @_ZZ5solvevE3seq, %37 ], [ %41, %40 ]
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %39)
          to label %40 unwind label %51

40:                                               ; preds = %38
  %41 = getelementptr inbounds %"struct.std::pair", ptr %39, i64 1
  %42 = icmp eq ptr %41, getelementptr inbounds (%"struct.std::pair", ptr @_ZZ5solvevE3seq, i64 2000001)
  br i1 %42, label %43, label %38

43:                                               ; preds = %40
  call void @__cxa_guard_release(ptr @_ZGVZ5solvevE3seq) #4
  br label %44

44:                                               ; preds = %43, %34, %0
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %92, %44
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %55, label %50

50:                                               ; preds = %46
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %95

51:                                               ; preds = %38
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %3, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %4, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ5solvevE3seq) #4
  br label %311

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

56:                                               ; preds = %88, %55
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %91

61:                                               ; preds = %56
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [2001 x [2001 x i32]], ptr @_ZZ5solvevE3dis, i64 0, i64 %63
  %65 = getelementptr inbounds [2001 x i32], ptr %64, i64 0, i64 0
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %68)
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %73, label %87

73:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #4
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2001 x [2001 x i32]], ptr @_ZZ5solvevE3dis, i64 0, i64 %75
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2001 x i32], ptr %76, i64 0, i64 %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %80 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %80, ptr %9, align 4
  %81 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store { i64, i32 } %81, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %10, i64 12, i1 false)
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %2, align 4, !tbaa !5
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds [2000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3seq, i64 0, i64 %84
  %86 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12) %85, ptr noundef nonnull align 4 dereferenceable(12) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #4
  br label %87

87:                                               ; preds = %73, %61
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %56, !llvm.loop !10

91:                                               ; preds = %60
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !12

95:                                               ; preds = %50
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %"struct.std::pair", ptr @_ZZ5solvevE3seq, i64 %97
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef @_ZZ5solvevE3seq, ptr noundef %98)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %99 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %99, ptr %11, align 4, !tbaa !5
  %100 = load atomic i8, ptr @_ZGVZ5solvevE1e acquire, align 8
  %101 = icmp eq i8 %100, 0
  br i1 %101, label %102, label %112, !prof !9

102:                                              ; preds = %95
  %103 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ5solvevE1e) #4
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %112

105:                                              ; preds = %102
  br label %106

106:                                              ; preds = %106, %105
  %107 = phi ptr [ @_ZZ5solvevE1e, %105 ], [ %108, %106 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %107) #4
  %108 = getelementptr inbounds %"class.std::vector", ptr %107, i64 1
  %109 = icmp eq ptr %108, getelementptr inbounds (%"class.std::vector", ptr @_ZZ5solvevE1e, i64 4003)
  br i1 %109, label %110, label %106

110:                                              ; preds = %106
  %111 = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #4
  call void @__cxa_guard_release(ptr @_ZGVZ5solvevE1e) #4
  br label %112

112:                                              ; preds = %110, %102, %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %132, %112
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %135

118:                                              ; preds = %113
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %120
  store i32 -1, ptr %121, align 4, !tbaa !5
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE4cntE, i64 0, i64 %123
  store i32 0, ptr %124, align 4, !tbaa !5
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %127
  store i32 %125, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %130
  store i32 1, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %118
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %12, align 4, !tbaa !5
  br label %113, !llvm.loop !13

135:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %136 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 0
  store ptr %13, ptr %136, align 8, !tbaa !14
  call void @"_ZNSt8functionIFiiEEC2IZ5solvevE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %137 = getelementptr inbounds %class.anon.2, ptr %15, i32 0, i32 0
  store ptr %13, ptr %137, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %252, %135
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = load i32, ptr %2, align 4, !tbaa !5
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %258

143:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [2000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3seq, i64 0, i64 %145
  %147 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #4
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %19, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18) #4
  %148 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(8) %147) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = load i32, ptr %18, align 4, !tbaa !5
  invoke void @"_ZZ5solvevENK3$_1clEii"(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef %149, i32 noundef %150)
          to label %151 unwind label %171

151:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = invoke noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef %152)
          to label %154 unwind label %175

154:                                              ; preds = %151
  store i32 %153, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %155 = load i32, ptr %20, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sub nsw i32 0, %158
  store i32 %159, ptr %21, align 4, !tbaa !5
  %160 = load i32, ptr %20, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE4cntE, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr %21, align 4, !tbaa !5
  %165 = load i32, ptr %21, align 4, !tbaa !5
  %166 = sub nsw i32 %165, 1
  %167 = mul nsw i32 %164, %166
  %168 = sdiv i32 %167, 2
  %169 = icmp ne i32 %163, %168
  br i1 %169, label %170, label %179

170:                                              ; preds = %154
  store i32 13, ptr %6, align 4
  br label %249

171:                                              ; preds = %143
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %3, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %4, align 4
  br label %257

175:                                              ; preds = %151
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %3, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %4, align 4
  br label %256

179:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 56, ptr %22) #4
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %22) #4
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %181
  store i32 0, ptr %182, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %218, %179
  %184 = load i32, ptr %23, align 4, !tbaa !5
  %185 = load i32, ptr %1, align 4, !tbaa !5
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %183
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %221

188:                                              ; preds = %183
  %189 = load i32, ptr %23, align 4, !tbaa !5
  %190 = invoke noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef %189)
          to label %191 unwind label %213

191:                                              ; preds = %188
  %192 = load i32, ptr %20, align 4, !tbaa !5
  %193 = icmp eq i32 %190, %192
  br i1 %193, label %194, label %217

194:                                              ; preds = %191
  %195 = load i32, ptr %23, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %196
  %198 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %22, ptr noundef nonnull align 4 dereferenceable(4) %197)
          to label %199 unwind label %213

199:                                              ; preds = %194
  %200 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 0
  %201 = extractvalue { ptr, i8 } %198, 0
  store ptr %201, ptr %200, align 8
  %202 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 1
  %203 = extractvalue { ptr, i8 } %198, 1
  store i8 %203, ptr %202, align 8
  %204 = load i32, ptr %11, align 4, !tbaa !5
  %205 = load i32, ptr %23, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %206
  store i32 %204, ptr %207, align 4, !tbaa !5
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %210, align 4, !tbaa !5
  br label %217

213:                                              ; preds = %194, %188
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %3, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %255

217:                                              ; preds = %199, %191
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %23, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %23, align 4, !tbaa !5
  br label %183, !llvm.loop !16

221:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  store ptr %22, ptr %25, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %222 = load ptr, ptr %25, align 8, !tbaa !14
  %223 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %222) #4
  %224 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %26, i32 0, i32 0
  %225 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %224, i32 0, i32 0
  store ptr %223, ptr %225, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %226 = load ptr, ptr %25, align 8, !tbaa !14
  %227 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %226) #4
  %228 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %27, i32 0, i32 0
  %229 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %228, i32 0, i32 0
  store ptr %227, ptr %229, align 8
  br label %230

230:                                              ; preds = %240, %221
  %231 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #4
  br i1 %231, label %233, label %232

232:                                              ; preds = %230
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %246

233:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %234 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #4
  %235 = load i32, ptr %234, align 4, !tbaa !5
  store i32 %235, ptr %28, align 4, !tbaa !5
  %236 = load i32, ptr %11, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [4003 x %"class.std::vector"], ptr @_ZZ5solvevE1e, i64 0, i64 %237
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %238, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %239 unwind label %242

239:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  br label %240

240:                                              ; preds = %239
  %241 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #4
  br label %230

242:                                              ; preds = %233
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %3, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %255

246:                                              ; preds = %232
  %247 = load i32, ptr %11, align 4, !tbaa !5
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %11, align 4, !tbaa !5
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %22) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %22) #4
  store i32 0, ptr %6, align 4
  br label %249

249:                                              ; preds = %246, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %250 = load i32, ptr %6, align 4
  switch i32 %250, label %317 [
    i32 0, label %251
    i32 13, label %252
  ]

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251, %249
  %253 = load i32, ptr %16, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %16, align 4, !tbaa !5
  br label %138, !llvm.loop !17

255:                                              ; preds = %242, %213
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %22) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %256

256:                                              ; preds = %255, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %257

257:                                              ; preds = %256, %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %310

258:                                              ; preds = %142
  %259 = load i32, ptr %11, align 4, !tbaa !5
  %260 = sub nsw i32 %259, 1
  invoke void @_Z3dfsiPiPSt6vectorIiSaIiEEPA2001_i(i32 noundef %260, ptr noundef @_ZZ5solvevE2sz, ptr noundef @_ZZ5solvevE1e, ptr noundef @_ZZ5solvevE2dp)
          to label %261 unwind label %267

261:                                              ; preds = %258
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  store i32 1, ptr %29, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %289, %261
  %263 = load i32, ptr %29, align 4, !tbaa !5
  %264 = load i32, ptr %1, align 4, !tbaa !5
  %265 = icmp sle i32 %263, %264
  br i1 %265, label %271, label %266

266:                                              ; preds = %262
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  br label %296

267:                                              ; preds = %258
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %3, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %4, align 4
  br label %310

271:                                              ; preds = %262
  %272 = load i32, ptr %11, align 4, !tbaa !5
  %273 = sub nsw i32 %272, 1
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [4003 x [2001 x i32]], ptr @_ZZ5solvevE2dp, i64 0, i64 %274
  %276 = load i32, ptr %29, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [2001 x i32], ptr %275, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = load i32, ptr %29, align 4, !tbaa !5
  %281 = load i32, ptr %1, align 4, !tbaa !5
  %282 = icmp eq i32 %280, %281
  %283 = zext i1 %282 to i64
  %284 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %283
  %285 = load i8, ptr %284, align 1, !tbaa !18
  %286 = sext i8 %285 to i32
  %287 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %279, i32 noundef %286)
          to label %288 unwind label %292

288:                                              ; preds = %271
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %29, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %29, align 4, !tbaa !5
  br label %262, !llvm.loop !19

292:                                              ; preds = %271
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %3, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  br label %310

296:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %297

297:                                              ; preds = %306, %296
  %298 = load i32, ptr %30, align 4, !tbaa !5
  %299 = load i32, ptr %11, align 4, !tbaa !5
  %300 = icmp slt i32 %298, %299
  br i1 %300, label %302, label %301

301:                                              ; preds = %297
  store i32 22, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %309

302:                                              ; preds = %297
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #4
  call void @llvm.memset.p0.i64(ptr align 8 %31, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #4
  %303 = load i32, ptr %30, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [4003 x %"class.std::vector"], ptr @_ZZ5solvevE1e, i64 0, i64 %304
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %305) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #4
  br label %306

306:                                              ; preds = %302
  %307 = load i32, ptr %30, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %30, align 4, !tbaa !5
  br label %297, !llvm.loop !20

309:                                              ; preds = %301
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void

310:                                              ; preds = %292, %267, %257
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %311

311:                                              ; preds = %310, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %312

312:                                              ; preds = %311
  %313 = load ptr, ptr %3, align 8
  %314 = load i32, ptr %4, align 4
  %315 = insertvalue { ptr, i32 } poison, ptr %313, 0
  %316 = insertvalue { ptr, i32 } %315, i32 %314, 1
  resume { ptr, i32 } %316

317:                                              ; preds = %249
  unreachable
}

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #4

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #4

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef, ptr noundef) #7

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #8 section ".text.startup"

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

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEii"(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #5

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

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

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"branch_weights", i32 1, i32 1048575}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}


; 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"

%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr }
%class.anon.2 = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.4" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.4" = type { ptr }
%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@_ZZ5solvevE3dis = external hidden global [2001 x [2001 x i32]], align 16
@_ZZ5solvevE3seq = external hidden global [2000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3seq = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3dsu = external hidden local_unnamed_addr global [2001 x i32], align 16
@_ZZ5solvevE4cntE = external hidden local_unnamed_addr global [2001 x i32], align 16
@_ZZ5solvevE3rep = external hidden global [4003 x i32], align 16
@_ZZ5solvevE2sz = external hidden global [4003 x i32], align 16
@_ZZ5solvevE1e = external hidden global [4003 x %"class.std::vector"], align 16
@_ZGVZ5solvevE1e = external hidden global i64, align 8
@__dso_handle = external hidden global i8
@_ZZ5solvevE2dp = external hidden global [4003 x [2001 x i32]], align 16
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.0", align 8
  %6 = alloca %"class.std::function", align 8
  %7 = alloca %class.anon, align 8
  %8 = alloca %class.anon.2, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::tuple", align 8
  %12 = alloca %"class.std::unordered_set", align 8
  %13 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %14 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %17 = load atomic i8, ptr @_ZGVZ5solvevE3seq acquire, align 8
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %19, label %24, !prof !5

19:                                               ; preds = %0
  %20 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ5solvevE3seq) #9
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %24, label %.preheader79

.preheader79:                                     ; preds = %19, %21
  %.idx = phi i64 [ %.add, %21 ], [ 0, %19 ]
  %.ptr = getelementptr inbounds i8, ptr @_ZZ5solvevE3seq, i64 %.idx
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %.ptr)
          to label %21 unwind label %33

21:                                               ; preds = %.preheader79
  %.add = add nuw nsw i64 %.idx, 12
  %22 = icmp eq i64 %.add, 24000012
  br i1 %22, label %23, label %.preheader79

23:                                               ; preds = %21
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ5solvevE3seq) #9
  br label %24

24:                                               ; preds = %23, %19, %0
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  store i32 0, ptr %2, align 4, !tbaa !6
  %26 = load i32, ptr %1, align 4, !tbaa !6
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph88.split.preheader, label %._crit_edge89

.lr.ph88.split.preheader:                         ; preds = %24
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %.lr.ph88.split

._crit_edge89:                                    ; preds = %._crit_edge, %24
  %.044.lcssa = phi i32 [ 0, %24 ], [ %.1.lcssa, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %28 = sext i32 %.044.lcssa to i64
  %29 = getelementptr inbounds %"struct.std::pair", ptr @_ZZ5solvevE3seq, i64 %28
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef nonnull @_ZZ5solvevE3seq, ptr noundef nonnull %29)
  %30 = load i32, ptr %1, align 4, !tbaa !6
  %31 = load atomic i8, ptr @_ZGVZ5solvevE1e acquire, align 8
  %32 = icmp eq i8 %31, 0
  br i1 %32, label %66, label %71, !prof !5

33:                                               ; preds = %.preheader79
  %34 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZ5solvevE3seq) #9
  br label %160

.lr.ph88.split:                                   ; preds = %.lr.ph88.split.preheader, %._crit_edge
  %35 = phi i32 [ %38, %._crit_edge ], [ %26, %.lr.ph88.split.preheader ]
  %36 = phi i32 [ %40, %._crit_edge ], [ 0, %.lr.ph88.split.preheader ]
  %.04486 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %.lr.ph88.split.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !6
  %37 = icmp sgt i32 %35, 0
  br i1 %37, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %61
  %.pre131 = load i32, ptr %2, align 4, !tbaa !6
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph88.split
  %38 = phi i32 [ %35, %.lr.ph88.split ], [ %64, %._crit_edge.loopexit ]
  %39 = phi i32 [ %36, %.lr.ph88.split ], [ %.pre131, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.04486, %.lr.ph88.split ], [ %.2, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !6
  %41 = icmp slt i32 %40, %38
  br i1 %41, label %.lr.ph88.split, label %._crit_edge89, !llvm.loop !10

.lr.ph:                                           ; preds = %.lr.ph88.split, %61
  %.185 = phi i32 [ %.2, %61 ], [ %.04486, %.lr.ph88.split ]
  %storemerge7684 = phi i32 [ %63, %61 ], [ 0, %.lr.ph88.split ]
  %42 = load i32, ptr %2, align 4, !tbaa !6
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2001 x [2001 x i32]], ptr @_ZZ5solvevE3dis, i64 0, i64 %43
  %45 = sext i32 %storemerge7684 to i64
  %46 = getelementptr inbounds i32, ptr %44, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %46)
  %48 = load i32, ptr %2, align 4, !tbaa !6
  %49 = load i32, ptr %3, align 4, !tbaa !6
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %61

51:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #9
  %52 = sext i32 %48 to i64
  %53 = sext i32 %49 to i64
  %54 = getelementptr inbounds [2001 x [2001 x i32]], ptr @_ZZ5solvevE3dis, i64 0, i64 %52, i64 %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %55 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %55, ptr %5, align 8
  %56 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %.fca.0.extract = extractvalue { i64, i32 } %56, 0
  %.fca.1.extract = extractvalue { i64, i32 } %56, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %57 = add nsw i32 %.185, 1
  %58 = sext i32 %.185 to i64
  %59 = getelementptr inbounds [2000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3seq, i64 0, i64 %58
  %60 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12) %59, ptr noundef nonnull align 4 dereferenceable(12) %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  %.pre = load i32, ptr %3, align 4, !tbaa !6
  br label %61

61:                                               ; preds = %.lr.ph, %51
  %62 = phi i32 [ %.pre, %51 ], [ %49, %.lr.ph ]
  %.2 = phi i32 [ %57, %51 ], [ %.185, %.lr.ph ]
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !6
  %64 = load i32, ptr %1, align 4, !tbaa !6
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !13

66:                                               ; preds = %._crit_edge89
  %67 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ5solvevE1e) #9
  %.not63 = icmp eq i32 %67, 0
  br i1 %.not63, label %71, label %.preheader78

.preheader78:                                     ; preds = %66, %.preheader78
  %.idx64 = phi i64 [ %.add65, %.preheader78 ], [ 0, %66 ]
  %.ptr66 = getelementptr inbounds i8, ptr @_ZZ5solvevE1e, i64 %.idx64
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr66) #9
  %.add65 = add nuw nsw i64 %.idx64, 24
  %68 = icmp eq i64 %.add65, 96072
  br i1 %68, label %69, label %.preheader78

69:                                               ; preds = %.preheader78
  %70 = call i32 @__cxa_atexit(ptr nonnull @__cxx_global_array_dtor, ptr null, ptr nonnull @__dso_handle) #9
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ5solvevE1e) #9
  br label %71

71:                                               ; preds = %69, %66, %._crit_edge89
  %72 = icmp sgt i32 %30, 0
  br i1 %72, label %.lr.ph93.preheader, label %._crit_edge94

.lr.ph93.preheader:                               ; preds = %71
  %73 = zext nneg i32 %30 to i64
  %74 = shl nuw nsw i64 %73, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE3dsu, i8 -1, i64 %74, i1 false), !tbaa !6
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE4cntE, i8 0, i64 %74, i1 false), !tbaa !6
  %min.iters.check = icmp ult i32 %30, 8
  br i1 %min.iters.check, label %.lr.ph93.preheader133, label %vector.ph

.lr.ph93.preheader133:                            ; preds = %middle.block, %.lr.ph93.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph93.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph93

vector.ph:                                        ; preds = %.lr.ph93.preheader
  %n.vec = and i64 %73, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %75 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %index
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  store <4 x i32> %vec.ind, ptr %75, align 16, !tbaa !6
  store <4 x i32> %step.add, ptr %76, align 16, !tbaa !6
  %77 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %index
  %78 = getelementptr inbounds i8, ptr %77, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %77, align 16, !tbaa !6
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %78, align 16, !tbaa !6
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %79 = icmp eq i64 %index.next, %n.vec
  br i1 %79, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %73
  br i1 %cmp.n, label %._crit_edge94, label %.lr.ph93.preheader133

._crit_edge94:                                    ; preds = %.lr.ph93, %middle.block, %71
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  store ptr %6, ptr %7, align 8, !tbaa !17
  call void @"_ZNSt8functionIFiiEEC2IZ5solvevE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store ptr %6, ptr %8, align 8, !tbaa !17
  %80 = icmp sgt i32 %.044.lcssa, 0
  br i1 %80, label %.lr.ph105.preheader, label %._crit_edge106

.lr.ph105.preheader:                              ; preds = %._crit_edge94
  %wide.trip.count121 = zext nneg i32 %.044.lcssa to i64
  br label %.lr.ph105

.lr.ph93:                                         ; preds = %.lr.ph93.preheader133, %.lr.ph93
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph93 ], [ %indvars.iv.ph, %.lr.ph93.preheader133 ]
  %81 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %indvars.iv
  %82 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %82, ptr %81, align 4, !tbaa !6
  %83 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %indvars.iv
  store i32 1, ptr %83, align 4, !tbaa !6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %73
  br i1 %exitcond.not, label %._crit_edge94, label %.lr.ph93, !llvm.loop !19

._crit_edge106:                                   ; preds = %139, %._crit_edge94
  %.054.lcssa = phi i32 [ %30, %._crit_edge94 ], [ %.155, %139 ]
  %84 = add nsw i32 %.054.lcssa, -1
  invoke void @_Z3dfsiPiPSt6vectorIiSaIiEEPA2001_i(i32 noundef %84, ptr noundef nonnull @_ZZ5solvevE2sz, ptr noundef nonnull @_ZZ5solvevE1e, ptr noundef nonnull @_ZZ5solvevE2dp)
          to label %.preheader77 unwind label %143

.preheader77:                                     ; preds = %._crit_edge106
  %85 = load i32, ptr %1, align 4, !tbaa !6
  %.not68108 = icmp slt i32 %85, 1
  br i1 %.not68108, label %.preheader, label %.lr.ph110

.lr.ph110:                                        ; preds = %.preheader77
  %86 = sext i32 %84 to i64
  br label %145

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %139
  %indvars.iv118 = phi i64 [ 0, %.lr.ph105.preheader ], [ %indvars.iv.next119, %139 ]
  %.054103 = phi i32 [ %30, %.lr.ph105.preheader ], [ %.155, %139 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  %87 = getelementptr inbounds [2000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv118, i32 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #9
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 8 %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #9
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(8) %87) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #9
  %89 = load i32, ptr %9, align 4, !tbaa !6
  %90 = load i32, ptr %10, align 4, !tbaa !6
  invoke void @"_ZZ5solvevENK3$_1clEii"(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %89, i32 noundef %90)
          to label %91 unwind label %101

91:                                               ; preds = %.lr.ph105
  %92 = load i32, ptr %9, align 4, !tbaa !6
  %93 = invoke noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %92)
          to label %94 unwind label %103

94:                                               ; preds = %91
  %95 = sext i32 %93 to i64
  %96 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !6
  %98 = getelementptr inbounds [2001 x i32], ptr @_ZZ5solvevE4cntE, i64 0, i64 %95
  %99 = load i32, ptr %98, align 4, !tbaa !6
  %.neg = add i32 %97, 1
  %.neg69 = mul i32 %.neg, %97
  %100 = sdiv i32 %.neg69, 2
  %.not70 = icmp eq i32 %99, %100
  br i1 %.not70, label %105, label %139

101:                                              ; preds = %.lr.ph105
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %141

103:                                              ; preds = %91
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %141

105:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #9
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #9
  %106 = sext i32 %.054103 to i64
  %107 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE2sz, i64 0, i64 %106
  store i32 0, ptr %107, align 4, !tbaa !6
  %108 = load i32, ptr %1, align 4, !tbaa !6
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %.lr.ph97, label %._crit_edge98

._crit_edge98:                                    ; preds = %126, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %110 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %12) #9
  store ptr %110, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  %111 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %12) #9
  store ptr %111, ptr %14, align 8
  %112 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  br i1 %112, label %.lr.ph100, label %._crit_edge101

.lr.ph100:                                        ; preds = %._crit_edge98
  %113 = getelementptr inbounds [4003 x %"class.std::vector"], ptr @_ZZ5solvevE1e, i64 0, i64 %106
  br label %131

.lr.ph97:                                         ; preds = %105, %126
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %126 ], [ 0, %105 ]
  %114 = trunc nuw nsw i64 %indvars.iv115 to i32
  %115 = invoke noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %114)
          to label %116 unwind label %124

116:                                              ; preds = %.lr.ph97
  %117 = icmp eq i32 %115, %93
  br i1 %117, label %118, label %126

118:                                              ; preds = %116
  %119 = getelementptr inbounds [4003 x i32], ptr @_ZZ5solvevE3rep, i64 0, i64 %indvars.iv115
  %120 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 4 dereferenceable(4) %119)
          to label %121 unwind label %124

121:                                              ; preds = %118
  store i32 %.054103, ptr %119, align 4, !tbaa !6
  %122 = load i32, ptr %107, align 4, !tbaa !6
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %107, align 4, !tbaa !6
  br label %126

124:                                              ; preds = %118, %.lr.ph97
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %140

126:                                              ; preds = %116, %121
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %127 = load i32, ptr %1, align 4, !tbaa !6
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next116, %128
  br i1 %129, label %.lr.ph97, label %._crit_edge98, !llvm.loop !20

._crit_edge101:                                   ; preds = %134, %._crit_edge98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  %130 = add nsw i32 %.054103, 1
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #9
  br label %139

131:                                              ; preds = %.lr.ph100, %134
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  %133 = load i32, ptr %132, align 4, !tbaa !6
  store i32 %133, ptr %15, align 4, !tbaa !6
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %113, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %134 unwind label %137

134:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  %136 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  br i1 %136, label %131, label %._crit_edge101

137:                                              ; preds = %131
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %140

139:                                              ; preds = %94, %._crit_edge101
  %.155 = phi i32 [ %130, %._crit_edge101 ], [ %.054103, %94 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %._crit_edge106, label %.lr.ph105, !llvm.loop !21

140:                                              ; preds = %137, %124
  %.pn = phi { ptr, i32 } [ %125, %124 ], [ %138, %137 ]
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #9
  br label %141

141:                                              ; preds = %103, %140, %101
  %.pn.pn.pn = phi { ptr, i32 } [ %102, %101 ], [ %.pn, %140 ], [ %104, %103 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %159

.preheader:                                       ; preds = %145, %.preheader77
  %142 = icmp sgt i32 %.054.lcssa, 0
  br i1 %142, label %.lr.ph112.preheader, label %._crit_edge113

.lr.ph112.preheader:                              ; preds = %.preheader
  %wide.trip.count129 = zext nneg i32 %.054.lcssa to i64
  br label %.lr.ph112

143:                                              ; preds = %._crit_edge106
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %159

145:                                              ; preds = %.lr.ph110, %145
  %indvars.iv123 = phi i64 [ 1, %.lr.ph110 ], [ %indvars.iv.next124, %145 ]
  %146 = phi i32 [ %85, %.lr.ph110 ], [ %156, %145 ]
  %147 = getelementptr inbounds [4003 x [2001 x i32]], ptr @_ZZ5solvevE2dp, i64 0, i64 %86, i64 %indvars.iv123
  %148 = load i32, ptr %147, align 4, !tbaa !6
  %149 = zext i32 %146 to i64
  %150 = icmp eq i64 %indvars.iv123, %149
  %151 = zext i1 %150 to i64
  %152 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !22
  %154 = sext i8 %153 to i32
  %155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %148, i32 noundef %154)
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %156 = load i32, ptr %1, align 4, !tbaa !6
  %157 = sext i32 %156 to i64
  %.not68.not = icmp slt i64 %indvars.iv123, %157
  br i1 %.not68.not, label %145, label %.preheader, !llvm.loop !23

._crit_edge113:                                   ; preds = %.lr.ph112, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret void

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %.lr.ph112
  %indvars.iv126 = phi i64 [ 0, %.lr.ph112.preheader ], [ %indvars.iv.next127, %.lr.ph112 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %16, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #9
  %158 = getelementptr inbounds [4003 x %"class.std::vector"], ptr @_ZZ5solvevE1e, i64 0, i64 %indvars.iv126
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %158) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #9
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count129
  br i1 %exitcond130.not, label %._crit_edge113, label %.lr.ph112, !llvm.loop !24

159:                                              ; preds = %143, %141
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %141 ], [ %144, %143 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  br label %160

160:                                              ; preds = %159, %33
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %159 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #7 section ".text.startup"

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEii"(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNKSt8functionIFiiEEclEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { 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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !8, i64 0}
!19 = distinct !{!19, !11, !16, !15}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = !{!8, !8, i64 0}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass