; LLVM IR from eyangch/competitive-programming :: Codeforces/1350 (e)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue.3" = type { %"class.std::deque.4" }
%"class.std::deque.4" = type { %"class.std::_Deque_base.5" }
%"class.std::_Deque_base.5" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.9", %"struct.std::_Deque_iterator.9" }
%"struct.std::_Deque_iterator.9" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.10" = type { %"struct.std::pair", i64 }

@b = external dso_local global [1000 x [1000 x i8]], align 16
@sec = external dso_local global [1000 x [1000 x i64]], align 16
@dist = external dso_local global [1000 x [1000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::queue", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::queue.3", align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i64, align 8
  %24 = alloca %"struct.std::pair", align 8
  %25 = alloca i64, align 8
  %26 = alloca %"struct.std::pair", align 8
  %27 = alloca i64, align 8
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca i64, align 8
  %30 = alloca %"struct.std::pair.10", align 8
  %31 = alloca %"struct.std::pair", align 8
  %32 = alloca i32, align 4
  %33 = alloca i64, align 8
  %34 = alloca %"struct.std::pair.10", align 8
  %35 = alloca %"struct.std::pair", align 8
  %36 = alloca i32, align 4
  %37 = alloca i64, align 8
  %38 = alloca %"struct.std::pair.10", align 8
  %39 = alloca %"struct.std::pair", align 8
  %40 = alloca i32, align 4
  %41 = alloca i64, align 8
  %42 = alloca %"struct.std::pair.10", align 8
  %43 = alloca %"struct.std::pair", align 8
  %44 = alloca i32, align 4
  %45 = alloca i64, align 8
  %46 = alloca %"struct.std::pair.10", align 8
  %47 = alloca i64, align 8
  %48 = alloca i64, align 8
  %49 = alloca i64, align 8
  %50 = alloca %"struct.std::pair.10", align 8
  %51 = alloca %"struct.std::pair", align 8
  %52 = alloca i64, align 8
  %53 = alloca i64, align 8
  %54 = alloca %"struct.std::pair.10", align 8
  %55 = alloca %"struct.std::pair", align 8
  %56 = alloca i64, align 8
  %57 = alloca i64, align 8
  %58 = alloca %"struct.std::pair.10", align 8
  %59 = alloca %"struct.std::pair", align 8
  %60 = alloca i64, align 8
  %61 = alloca i64, align 8
  %62 = alloca %"struct.std::pair.10", align 8
  %63 = alloca %"struct.std::pair", align 8
  %64 = alloca i64, align 8
  %65 = alloca i64, align 8
  %66 = alloca i32, align 4
  %67 = alloca i64, align 8
  %68 = alloca i64, align 8
  %69 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %70 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %71 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %72 = getelementptr i8, ptr %71, i64 -24
  %73 = load i64, ptr %72, align 8
  %74 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %73
  %75 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %74, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %77, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %79

79:                                               ; preds = %121, %0
  %80 = load i32, ptr %5, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = load i64, ptr %2, align 8, !tbaa !11
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  %86 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %87 unwind label %94

87:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %113, %87
  %89 = load i32, ptr %10, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr %3, align 8, !tbaa !11
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %98, label %93

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

94:                                               ; preds = %85
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %124

98:                                               ; preds = %88
  %99 = load i32, ptr %10, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %100)
          to label %102 unwind label %116

102:                                              ; preds = %98
  %103 = load i8, ptr %101, align 1, !tbaa !13
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 49
  %106 = load i32, ptr %5, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %107
  %109 = load i32, ptr %10, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1000 x i8], ptr %108, i64 0, i64 %110
  %112 = zext i1 %105 to i8
  store i8 %112, ptr %111, align 1, !tbaa !14
  br label %113

113:                                              ; preds = %102
  %114 = load i32, ptr %10, align 4, !tbaa !8
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %10, align 4, !tbaa !8
  br label %88, !llvm.loop !16

116:                                              ; preds = %98
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %8, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %124

120:                                              ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %5, align 4, !tbaa !8
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !8
  br label %79, !llvm.loop !18

124:                                              ; preds = %116, %94
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %532

125:                                              ; preds = %84
  %126 = load i64, ptr %2, align 8, !tbaa !11
  %127 = sub nsw i64 %126, 1
  %128 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %127
  %129 = getelementptr inbounds [1000 x i64], ptr %128, i64 0, i64 0
  %130 = load i64, ptr %3, align 8, !tbaa !11
  %131 = getelementptr inbounds i64, ptr %129, i64 %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !8
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @sec, ptr noundef %131, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  %132 = load i64, ptr %2, align 8, !tbaa !11
  %133 = sub nsw i64 %132, 1
  %134 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %133
  %135 = getelementptr inbounds [1000 x i64], ptr %134, i64 0, i64 0
  %136 = load i64, ptr %3, align 8, !tbaa !11
  %137 = getelementptr inbounds i64, ptr %135, i64 %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !8
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @dist, ptr noundef %137, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #8
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %138

138:                                              ; preds = %347, %125
  %139 = load i32, ptr %14, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = load i64, ptr %2, align 8, !tbaa !11
  %142 = icmp slt i64 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %350

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %145

145:                                              ; preds = %340, %144
  %146 = load i32, ptr %15, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = load i64, ptr %3, align 8, !tbaa !11
  %149 = icmp slt i64 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %346

151:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #8
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %152 unwind label %206

152:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  invoke void @_ZNSt4pairIxxEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %153 unwind label %210

153:                                              ; preds = %152
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %154 unwind label %210

154:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store i64 0, ptr %18, align 8, !tbaa !11
  br label %155

155:                                              ; preds = %247, %245, %154
  %156 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %157 unwind label %214

157:                                              ; preds = %155
  %158 = xor i1 %156, true
  br i1 %158, label %159, label %266

159:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %160 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %161 unwind label %218

161:                                              ; preds = %159
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %160, i64 16, i1 false)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %162 unwind label %218

162:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %163 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %164 = load i64, ptr %163, align 8, !tbaa !19
  store i64 %164, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %165 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %166 = load i64, ptr %165, align 8, !tbaa !21
  store i64 %166, ptr %21, align 8, !tbaa !11
  %167 = load i64, ptr %20, align 8, !tbaa !11
  %168 = icmp slt i64 %167, 0
  br i1 %168, label %205, label %169

169:                                              ; preds = %162
  %170 = load i64, ptr %20, align 8, !tbaa !11
  %171 = load i64, ptr %2, align 8, !tbaa !11
  %172 = icmp sge i64 %170, %171
  br i1 %172, label %205, label %173

173:                                              ; preds = %169
  %174 = load i64, ptr %21, align 8, !tbaa !11
  %175 = icmp slt i64 %174, 0
  br i1 %175, label %205, label %176

176:                                              ; preds = %173
  %177 = load i64, ptr %21, align 8, !tbaa !11
  %178 = load i64, ptr %3, align 8, !tbaa !11
  %179 = icmp sge i64 %177, %178
  br i1 %179, label %205, label %180

180:                                              ; preds = %176
  %181 = load i64, ptr %20, align 8, !tbaa !11
  %182 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %181
  %183 = load i64, ptr %21, align 8, !tbaa !11
  %184 = getelementptr inbounds [1000 x i8], ptr %182, i64 0, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !14, !range !22, !noundef !23
  %186 = trunc i8 %185 to i1
  %187 = zext i1 %186 to i32
  %188 = load i32, ptr %14, align 4, !tbaa !8
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %189
  %191 = load i32, ptr %15, align 4, !tbaa !8
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1000 x i8], ptr %190, i64 0, i64 %192
  %194 = load i8, ptr %193, align 1, !tbaa !14, !range !22, !noundef !23
  %195 = trunc i8 %194 to i1
  %196 = zext i1 %195 to i32
  %197 = icmp ne i32 %187, %196
  br i1 %197, label %205, label %198

198:                                              ; preds = %180
  %199 = load i64, ptr %20, align 8, !tbaa !11
  %200 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %199
  %201 = load i64, ptr %21, align 8, !tbaa !11
  %202 = getelementptr inbounds [1000 x i64], ptr %200, i64 0, i64 %201
  %203 = load i64, ptr %202, align 8, !tbaa !11
  %204 = icmp ne i64 %203, -1
  br i1 %204, label %205, label %222

205:                                              ; preds = %198, %180, %176, %173, %169, %162
  store i32 14, ptr %6, align 4
  br label %245, !llvm.loop !24

206:                                              ; preds = %151
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %8, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %9, align 4
  br label %345

210:                                              ; preds = %153, %152
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %8, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %344

214:                                              ; preds = %155
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %8, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %9, align 4
  br label %343

218:                                              ; preds = %161, %159
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %8, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %9, align 4
  br label %265

222:                                              ; preds = %198
  %223 = load i64, ptr %20, align 8, !tbaa !11
  %224 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %223
  %225 = load i64, ptr %21, align 8, !tbaa !11
  %226 = getelementptr inbounds [1000 x i64], ptr %224, i64 0, i64 %225
  store i64 0, ptr %226, align 8, !tbaa !11
  %227 = load i64, ptr %18, align 8, !tbaa !11
  %228 = add nsw i64 %227, 1
  store i64 %228, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %229 = load i64, ptr %20, align 8, !tbaa !11
  %230 = add nsw i64 %229, 1
  store i64 %230, ptr %23, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %231 unwind label %248

231:                                              ; preds = %222
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %232 unwind label %248

232:                                              ; preds = %231
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %233 = load i64, ptr %20, align 8, !tbaa !11
  %234 = sub nsw i64 %233, 1
  store i64 %234, ptr %25, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %235 unwind label %252

235:                                              ; preds = %232
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %236 unwind label %252

236:                                              ; preds = %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %237 = load i64, ptr %21, align 8, !tbaa !11
  %238 = add nsw i64 %237, 1
  store i64 %238, ptr %27, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %239 unwind label %256

239:                                              ; preds = %236
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %240 unwind label %256

240:                                              ; preds = %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %241 = load i64, ptr %21, align 8, !tbaa !11
  %242 = sub nsw i64 %241, 1
  store i64 %242, ptr %29, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %243 unwind label %260

243:                                              ; preds = %240
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %244 unwind label %260

244:                                              ; preds = %243
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  store i32 0, ptr %6, align 4
  br label %245

245:                                              ; preds = %244, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  %246 = load i32, ptr %6, align 4
  switch i32 %246, label %538 [
    i32 0, label %247
    i32 14, label %155
  ]

247:                                              ; preds = %245
  br label %155, !llvm.loop !24

248:                                              ; preds = %231, %222
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %8, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  br label %264

252:                                              ; preds = %235, %232
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %8, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  br label %264

256:                                              ; preds = %239, %236
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %8, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  br label %264

260:                                              ; preds = %243, %240
  %261 = landingpad { ptr, i32 }
          cleanup
  %262 = extractvalue { ptr, i32 } %261, 0
  store ptr %262, ptr %8, align 8
  %263 = extractvalue { ptr, i32 } %261, 1
  store i32 %263, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  br label %264

264:                                              ; preds = %260, %256, %252, %248
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %265

265:                                              ; preds = %264, %218
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  br label %343

266:                                              ; preds = %157
  %267 = load i64, ptr %18, align 8, !tbaa !11
  %268 = icmp eq i64 %267, 1
  br i1 %268, label %269, label %282

269:                                              ; preds = %266
  %270 = load i32, ptr %14, align 4, !tbaa !8
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %271
  %273 = load i32, ptr %15, align 4, !tbaa !8
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [1000 x i64], ptr %272, i64 0, i64 %274
  store i64 -1, ptr %275, align 8, !tbaa !11
  %276 = load i32, ptr %14, align 4, !tbaa !8
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %277
  %279 = load i32, ptr %15, align 4, !tbaa !8
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [1000 x i64], ptr %278, i64 0, i64 %280
  store i64 9223372036854775807, ptr %281, align 8, !tbaa !11
  br label %339

282:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %283 = load i32, ptr %14, align 4, !tbaa !8
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %32, align 4, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %285 unwind label %303

285:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  store i64 1, ptr %33, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %30, ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %286 unwind label %307

286:                                              ; preds = %285
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %287 unwind label %307

287:                                              ; preds = %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %288 = load i32, ptr %14, align 4, !tbaa !8
  %289 = sub nsw i32 %288, 1
  store i32 %289, ptr %36, align 4, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %290 unwind label %312

290:                                              ; preds = %287
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  store i64 1, ptr %37, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %34, ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %291 unwind label %316

291:                                              ; preds = %290
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %34)
          to label %292 unwind label %316

292:                                              ; preds = %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %38) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  %293 = load i32, ptr %15, align 4, !tbaa !8
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %40, align 4, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %40)
          to label %295 unwind label %321

295:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  store i64 1, ptr %41, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %38, ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %296 unwind label %325

296:                                              ; preds = %295
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %38)
          to label %297 unwind label %325

297:                                              ; preds = %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %298 = load i32, ptr %15, align 4, !tbaa !8
  %299 = sub nsw i32 %298, 1
  store i32 %299, ptr %44, align 4, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %44)
          to label %300 unwind label %330

300:                                              ; preds = %297
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  store i64 1, ptr %45, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %42, ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %301 unwind label %334

301:                                              ; preds = %300
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %42)
          to label %302 unwind label %334

302:                                              ; preds = %301
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #8
  br label %339

303:                                              ; preds = %282
  %304 = landingpad { ptr, i32 }
          cleanup
  %305 = extractvalue { ptr, i32 } %304, 0
  store ptr %305, ptr %8, align 8
  %306 = extractvalue { ptr, i32 } %304, 1
  store i32 %306, ptr %9, align 4
  br label %311

307:                                              ; preds = %286, %285
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %8, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %311

311:                                              ; preds = %307, %303
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  br label %343

312:                                              ; preds = %287
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %8, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %9, align 4
  br label %320

316:                                              ; preds = %291, %290
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %8, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %320

320:                                              ; preds = %316, %312
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #8
  br label %343

321:                                              ; preds = %292
  %322 = landingpad { ptr, i32 }
          cleanup
  %323 = extractvalue { ptr, i32 } %322, 0
  store ptr %323, ptr %8, align 8
  %324 = extractvalue { ptr, i32 } %322, 1
  store i32 %324, ptr %9, align 4
  br label %329

325:                                              ; preds = %296, %295
  %326 = landingpad { ptr, i32 }
          cleanup
  %327 = extractvalue { ptr, i32 } %326, 0
  store ptr %327, ptr %8, align 8
  %328 = extractvalue { ptr, i32 } %326, 1
  store i32 %328, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %329

329:                                              ; preds = %325, %321
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %38) #8
  br label %343

330:                                              ; preds = %297
  %331 = landingpad { ptr, i32 }
          cleanup
  %332 = extractvalue { ptr, i32 } %331, 0
  store ptr %332, ptr %8, align 8
  %333 = extractvalue { ptr, i32 } %331, 1
  store i32 %333, ptr %9, align 4
  br label %338

334:                                              ; preds = %301, %300
  %335 = landingpad { ptr, i32 }
          cleanup
  %336 = extractvalue { ptr, i32 } %335, 0
  store ptr %336, ptr %8, align 8
  %337 = extractvalue { ptr, i32 } %335, 1
  store i32 %337, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  br label %338

338:                                              ; preds = %334, %330
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #8
  br label %343

339:                                              ; preds = %302, %269
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #8
  br label %340

340:                                              ; preds = %339
  %341 = load i32, ptr %15, align 4, !tbaa !8
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %15, align 4, !tbaa !8
  br label %145, !llvm.loop !25

343:                                              ; preds = %338, %329, %320, %311, %265, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %344

344:                                              ; preds = %343, %210
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #8
  br label %345

345:                                              ; preds = %344, %206
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %531

346:                                              ; preds = %150
  br label %347

347:                                              ; preds = %346
  %348 = load i32, ptr %14, align 4, !tbaa !8
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %14, align 4, !tbaa !8
  br label %138, !llvm.loop !26

350:                                              ; preds = %143
  br label %351

351:                                              ; preds = %432, %430, %350
  %352 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %353 unwind label %388

353:                                              ; preds = %351
  %354 = xor i1 %352, true
  br i1 %354, label %355, label %471

355:                                              ; preds = %353
  call void @llvm.lifetime.start.p0(i64 24, ptr %46) #8
  %356 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %357 unwind label %392

357:                                              ; preds = %355
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %46, ptr align 8 %356, i64 24, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %358 unwind label %392

358:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #8
  %359 = getelementptr inbounds %"struct.std::pair.10", ptr %46, i32 0, i32 0
  %360 = getelementptr inbounds %"struct.std::pair", ptr %359, i32 0, i32 0
  %361 = load i64, ptr %360, align 8, !tbaa !27
  store i64 %361, ptr %47, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  %362 = getelementptr inbounds %"struct.std::pair.10", ptr %46, i32 0, i32 0
  %363 = getelementptr inbounds %"struct.std::pair", ptr %362, i32 0, i32 1
  %364 = load i64, ptr %363, align 8, !tbaa !29
  store i64 %364, ptr %48, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #8
  %365 = getelementptr inbounds %"struct.std::pair.10", ptr %46, i32 0, i32 1
  %366 = load i64, ptr %365, align 8, !tbaa !30
  store i64 %366, ptr %49, align 8, !tbaa !11
  %367 = load i64, ptr %47, align 8, !tbaa !11
  %368 = icmp slt i64 %367, 0
  br i1 %368, label %387, label %369

369:                                              ; preds = %358
  %370 = load i64, ptr %47, align 8, !tbaa !11
  %371 = load i64, ptr %2, align 8, !tbaa !11
  %372 = icmp sge i64 %370, %371
  br i1 %372, label %387, label %373

373:                                              ; preds = %369
  %374 = load i64, ptr %48, align 8, !tbaa !11
  %375 = icmp slt i64 %374, 0
  br i1 %375, label %387, label %376

376:                                              ; preds = %373
  %377 = load i64, ptr %48, align 8, !tbaa !11
  %378 = load i64, ptr %3, align 8, !tbaa !11
  %379 = icmp sge i64 %377, %378
  br i1 %379, label %387, label %380

380:                                              ; preds = %376
  %381 = load i64, ptr %47, align 8, !tbaa !11
  %382 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %381
  %383 = load i64, ptr %48, align 8, !tbaa !11
  %384 = getelementptr inbounds [1000 x i64], ptr %382, i64 0, i64 %383
  %385 = load i64, ptr %384, align 8, !tbaa !11
  %386 = icmp ne i64 %385, 9223372036854775807
  br i1 %386, label %387, label %396

387:                                              ; preds = %380, %376, %373, %369, %358
  store i32 16, ptr %6, align 4
  br label %430, !llvm.loop !31

388:                                              ; preds = %351
  %389 = landingpad { ptr, i32 }
          cleanup
  %390 = extractvalue { ptr, i32 } %389, 0
  store ptr %390, ptr %8, align 8
  %391 = extractvalue { ptr, i32 } %389, 1
  store i32 %391, ptr %9, align 4
  br label %531

392:                                              ; preds = %357, %355
  %393 = landingpad { ptr, i32 }
          cleanup
  %394 = extractvalue { ptr, i32 } %393, 0
  store ptr %394, ptr %8, align 8
  %395 = extractvalue { ptr, i32 } %393, 1
  store i32 %395, ptr %9, align 4
  br label %470

396:                                              ; preds = %380
  %397 = load i64, ptr %49, align 8, !tbaa !11
  %398 = load i64, ptr %47, align 8, !tbaa !11
  %399 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %398
  %400 = load i64, ptr %48, align 8, !tbaa !11
  %401 = getelementptr inbounds [1000 x i64], ptr %399, i64 0, i64 %400
  store i64 %397, ptr %401, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %50) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %51) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #8
  %402 = load i64, ptr %47, align 8, !tbaa !11
  %403 = add nsw i64 %402, 1
  store i64 %403, ptr %52, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %404 unwind label %433

404:                                              ; preds = %396
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #8
  %405 = load i64, ptr %49, align 8, !tbaa !11
  %406 = add nsw i64 %405, 1
  store i64 %406, ptr %53, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %50, ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %407 unwind label %437

407:                                              ; preds = %404
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %50)
          to label %408 unwind label %437

408:                                              ; preds = %407
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %50) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %54) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #8
  %409 = load i64, ptr %47, align 8, !tbaa !11
  %410 = sub nsw i64 %409, 1
  store i64 %410, ptr %56, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %411 unwind label %442

411:                                              ; preds = %408
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #8
  %412 = load i64, ptr %49, align 8, !tbaa !11
  %413 = add nsw i64 %412, 1
  store i64 %413, ptr %57, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %54, ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(8) %57)
          to label %414 unwind label %446

414:                                              ; preds = %411
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %54)
          to label %415 unwind label %446

415:                                              ; preds = %414
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %54) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %58) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %59) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #8
  %416 = load i64, ptr %48, align 8, !tbaa !11
  %417 = add nsw i64 %416, 1
  store i64 %417, ptr %60, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull align 8 dereferenceable(8) %60)
          to label %418 unwind label %451

418:                                              ; preds = %415
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #8
  %419 = load i64, ptr %49, align 8, !tbaa !11
  %420 = add nsw i64 %419, 1
  store i64 %420, ptr %61, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %58, ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 8 dereferenceable(8) %61)
          to label %421 unwind label %455

421:                                              ; preds = %418
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %58)
          to label %422 unwind label %455

422:                                              ; preds = %421
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %58) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %62) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %63) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #8
  %423 = load i64, ptr %48, align 8, !tbaa !11
  %424 = sub nsw i64 %423, 1
  store i64 %424, ptr %64, align 8, !tbaa !11
  invoke void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull align 8 dereferenceable(8) %64)
          to label %425 unwind label %460

425:                                              ; preds = %422
  call void @llvm.lifetime.start.p0(i64 8, ptr %65) #8
  %426 = load i64, ptr %49, align 8, !tbaa !11
  %427 = add nsw i64 %426, 1
  store i64 %427, ptr %65, align 8, !tbaa !11
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind writable sret(%"struct.std::pair.10") align 8 %62, ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(8) %65)
          to label %428 unwind label %464

428:                                              ; preds = %425
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(24) %62)
          to label %429 unwind label %464

429:                                              ; preds = %428
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %63) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %62) #8
  store i32 0, ptr %6, align 4
  br label %430

430:                                              ; preds = %429, %387
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #8
  %431 = load i32, ptr %6, align 4
  switch i32 %431, label %538 [
    i32 0, label %432
    i32 16, label %351
  ]

432:                                              ; preds = %430
  br label %351, !llvm.loop !31

433:                                              ; preds = %396
  %434 = landingpad { ptr, i32 }
          cleanup
  %435 = extractvalue { ptr, i32 } %434, 0
  store ptr %435, ptr %8, align 8
  %436 = extractvalue { ptr, i32 } %434, 1
  store i32 %436, ptr %9, align 4
  br label %441

437:                                              ; preds = %407, %404
  %438 = landingpad { ptr, i32 }
          cleanup
  %439 = extractvalue { ptr, i32 } %438, 0
  store ptr %439, ptr %8, align 8
  %440 = extractvalue { ptr, i32 } %438, 1
  store i32 %440, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #8
  br label %441

441:                                              ; preds = %437, %433
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %50) #8
  br label %469

442:                                              ; preds = %408
  %443 = landingpad { ptr, i32 }
          cleanup
  %444 = extractvalue { ptr, i32 } %443, 0
  store ptr %444, ptr %8, align 8
  %445 = extractvalue { ptr, i32 } %443, 1
  store i32 %445, ptr %9, align 4
  br label %450

446:                                              ; preds = %414, %411
  %447 = landingpad { ptr, i32 }
          cleanup
  %448 = extractvalue { ptr, i32 } %447, 0
  store ptr %448, ptr %8, align 8
  %449 = extractvalue { ptr, i32 } %447, 1
  store i32 %449, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #8
  br label %450

450:                                              ; preds = %446, %442
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %54) #8
  br label %469

451:                                              ; preds = %415
  %452 = landingpad { ptr, i32 }
          cleanup
  %453 = extractvalue { ptr, i32 } %452, 0
  store ptr %453, ptr %8, align 8
  %454 = extractvalue { ptr, i32 } %452, 1
  store i32 %454, ptr %9, align 4
  br label %459

455:                                              ; preds = %421, %418
  %456 = landingpad { ptr, i32 }
          cleanup
  %457 = extractvalue { ptr, i32 } %456, 0
  store ptr %457, ptr %8, align 8
  %458 = extractvalue { ptr, i32 } %456, 1
  store i32 %458, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #8
  br label %459

459:                                              ; preds = %455, %451
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %58) #8
  br label %469

460:                                              ; preds = %422
  %461 = landingpad { ptr, i32 }
          cleanup
  %462 = extractvalue { ptr, i32 } %461, 0
  store ptr %462, ptr %8, align 8
  %463 = extractvalue { ptr, i32 } %461, 1
  store i32 %463, ptr %9, align 4
  br label %468

464:                                              ; preds = %428, %425
  %465 = landingpad { ptr, i32 }
          cleanup
  %466 = extractvalue { ptr, i32 } %465, 0
  store ptr %466, ptr %8, align 8
  %467 = extractvalue { ptr, i32 } %465, 1
  store i32 %467, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #8
  br label %468

468:                                              ; preds = %464, %460
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %63) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %62) #8
  br label %469

469:                                              ; preds = %468, %459, %450, %441
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  br label %470

470:                                              ; preds = %469, %392
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #8
  br label %531

471:                                              ; preds = %353
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #8
  store i32 0, ptr %66, align 4, !tbaa !8
  br label %472

472:                                              ; preds = %522, %471
  %473 = load i32, ptr %66, align 4, !tbaa !8
  %474 = sext i32 %473 to i64
  %475 = load i64, ptr %4, align 8, !tbaa !11
  %476 = icmp slt i64 %474, %475
  br i1 %476, label %478, label %477

477:                                              ; preds = %472
  store i32 18, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #8
  br label %529

478:                                              ; preds = %472
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %69) #8
  %479 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %67)
          to label %480 unwind label %525

480:                                              ; preds = %478
  %481 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %479, ptr noundef nonnull align 8 dereferenceable(8) %68)
          to label %482 unwind label %525

482:                                              ; preds = %480
  %483 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %481, ptr noundef nonnull align 8 dereferenceable(8) %69)
          to label %484 unwind label %525

484:                                              ; preds = %482
  %485 = load i64, ptr %67, align 8, !tbaa !11
  %486 = add nsw i64 %485, -1
  store i64 %486, ptr %67, align 8, !tbaa !11
  %487 = load i64, ptr %68, align 8, !tbaa !11
  %488 = add nsw i64 %487, -1
  store i64 %488, ptr %68, align 8, !tbaa !11
  %489 = load i64, ptr %67, align 8, !tbaa !11
  %490 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %489
  %491 = load i64, ptr %68, align 8, !tbaa !11
  %492 = getelementptr inbounds [1000 x i64], ptr %490, i64 0, i64 %491
  %493 = load i64, ptr %492, align 8, !tbaa !11
  %494 = load i64, ptr %69, align 8, !tbaa !11
  %495 = icmp sgt i64 %493, %494
  br i1 %495, label %496, label %498

496:                                              ; preds = %484
  %497 = load i64, ptr %69, align 8, !tbaa !11
  br label %504

498:                                              ; preds = %484
  %499 = load i64, ptr %67, align 8, !tbaa !11
  %500 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %499
  %501 = load i64, ptr %68, align 8, !tbaa !11
  %502 = getelementptr inbounds [1000 x i64], ptr %500, i64 0, i64 %501
  %503 = load i64, ptr %502, align 8, !tbaa !11
  br label %504

504:                                              ; preds = %498, %496
  %505 = phi i64 [ %497, %496 ], [ %503, %498 ]
  %506 = load i64, ptr %69, align 8, !tbaa !11
  %507 = sub nsw i64 %506, %505
  store i64 %507, ptr %69, align 8, !tbaa !11
  %508 = load i64, ptr %69, align 8, !tbaa !11
  %509 = load i64, ptr %67, align 8, !tbaa !11
  %510 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %509
  %511 = load i64, ptr %68, align 8, !tbaa !11
  %512 = getelementptr inbounds [1000 x i8], ptr %510, i64 0, i64 %511
  %513 = load i8, ptr %512, align 1, !tbaa !14, !range !22, !noundef !23
  %514 = trunc i8 %513 to i1
  %515 = zext i1 %514 to i64
  %516 = add nsw i64 %508, %515
  %517 = srem i64 %516, 2
  %518 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %517)
          to label %519 unwind label %525

519:                                              ; preds = %504
  %520 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %518, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %521 unwind label %525

521:                                              ; preds = %519
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #8
  br label %522

522:                                              ; preds = %521
  %523 = load i32, ptr %66, align 4, !tbaa !8
  %524 = add nsw i32 %523, 1
  store i32 %524, ptr %66, align 4, !tbaa !8
  br label %472, !llvm.loop !32

525:                                              ; preds = %519, %504, %482, %480, %478
  %526 = landingpad { ptr, i32 }
          cleanup
  %527 = extractvalue { ptr, i32 } %526, 0
  store ptr %527, ptr %8, align 8
  %528 = extractvalue { ptr, i32 } %526, 1
  store i32 %528, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #8
  br label %531

529:                                              ; preds = %477
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %530 = load i32, ptr %1, align 4
  ret i32 %530

531:                                              ; preds = %525, %470, %388, %345
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #8
  br label %532

532:                                              ; preds = %531, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %533

533:                                              ; preds = %532
  %534 = load ptr, ptr %8, align 8
  %535 = load i32, ptr %9, align 4
  %536 = insertvalue { ptr, i32 } poison, ptr %534, 0
  %537 = insertvalue { ptr, i32 } %536, i32 %535, 1
  resume { ptr, i32 } %537

538:                                              ; preds = %430, %245
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

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

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

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

; 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) #6

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.10") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #5

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

attributes #0 = { mustprogress norecurse 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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !12, i64 0}
!20 = !{!"_ZTSSt4pairIxxE", !12, i64 0, !12, i64 8}
!21 = !{!20, !12, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}
!26 = distinct !{!26, !17}
!27 = !{!28, !12, i64 0}
!28 = !{!"_ZTSSt4pairIS_IxxExE", !20, i64 0, !12, i64 16}
!29 = !{!28, !12, i64 8}
!30 = !{!28, !12, i64 16}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !17}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue.3" = type { %"class.std::deque.4" }
%"class.std::deque.4" = type { %"class.std::_Deque_base.5" }
%"class.std::_Deque_base.5" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.9", %"struct.std::_Deque_iterator.9" }
%"struct.std::_Deque_iterator.9" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.10" = type { %"struct.std::pair", i64 }

@b = external dso_local local_unnamed_addr global [1000 x [1000 x i8]], align 16
@sec = external dso_local global [1000 x [1000 x i64]], align 16
@dist = external dso_local global [1000 x [1000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::queue.3", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::pair.10", align 8
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca %"struct.std::pair.10", align 8
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca i32, align 4
  %29 = alloca i64, align 8
  %30 = alloca %"struct.std::pair.10", align 8
  %31 = alloca %"struct.std::pair", align 8
  %32 = alloca i32, align 4
  %33 = alloca i64, align 8
  %34 = alloca %"struct.std::pair.10", align 8
  %35 = alloca %"struct.std::pair", align 8
  %36 = alloca i32, align 4
  %37 = alloca i64, align 8
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca %"struct.std::pair.10", align 8
  %41 = alloca %"struct.std::pair", align 8
  %42 = alloca i64, align 8
  %43 = alloca i64, align 8
  %44 = alloca %"struct.std::pair.10", align 8
  %45 = alloca %"struct.std::pair", align 8
  %46 = alloca i64, align 8
  %47 = alloca i64, align 8
  %48 = alloca %"struct.std::pair.10", align 8
  %49 = alloca %"struct.std::pair", align 8
  %50 = alloca i64, align 8
  %51 = alloca i64, align 8
  %52 = alloca %"struct.std::pair.10", align 8
  %53 = alloca %"struct.std::pair", align 8
  %54 = alloca i64, align 8
  %55 = alloca i64, align 8
  %56 = alloca i64, align 8
  %57 = alloca i64, align 8
  %58 = alloca i64, align 8
  %59 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %60 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %61 = getelementptr i8, ptr %60, i64 -24
  %62 = load i64, ptr %61, align 8
  %63 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %62
  %64 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %63, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %68 = load i64, ptr %1, align 8, !tbaa !8
  %69 = icmp sgt i64 %68, 0
  br i1 %69, label %.lr.ph73, label %._crit_edge74

._crit_edge74:                                    ; preds = %._crit_edge, %0
  %.lcssa = phi i64 [ %68, %0 ], [ %86, %._crit_edge ]
  %70 = add nsw i64 %.lcssa, -1
  %71 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %70
  %72 = load i64, ptr %2, align 8, !tbaa !8
  %73 = getelementptr inbounds i64, ptr %71, i64 %72
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 -1, ptr %5, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @sec, ptr noundef nonnull %73, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %74 = load i64, ptr %1, align 8, !tbaa !8
  %75 = add nsw i64 %74, -1
  %76 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %75
  %77 = load i64, ptr %2, align 8, !tbaa !8
  %78 = getelementptr inbounds i64, ptr %76, i64 %77
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @dist, ptr noundef nonnull %78, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #8
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !11
  %79 = load i64, ptr %1, align 8, !tbaa !8
  %80 = icmp sgt i64 %79, 0
  %81 = load i64, ptr %2, align 8
  %82 = icmp sgt i64 %81, 0
  %or.cond = select i1 %80, i1 %82, i1 false
  br i1 %or.cond, label %.lr.ph84.split, label %._crit_edge85

.lr.ph73:                                         ; preds = %0, %._crit_edge
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  %83 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %.preheader64 unwind label %88

.preheader64:                                     ; preds = %.lr.ph73
  %84 = load i64, ptr %2, align 8, !tbaa !8
  %85 = icmp sgt i64 %84, 0
  br i1 %85, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader64
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %86 = load i64, ptr %1, align 8, !tbaa !8
  %87 = icmp sgt i64 %86, %indvars.iv.next96
  br i1 %87, label %.lr.ph73, label %._crit_edge74, !llvm.loop !13

88:                                               ; preds = %.lr.ph73
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %266

.lr.ph:                                           ; preds = %.preheader64, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader64 ]
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv)
  %91 = load i8, ptr %90, align 1, !tbaa !15
  %92 = icmp eq i8 %91, 49
  %93 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %indvars.iv95, i64 %indvars.iv
  %94 = zext i1 %92 to i8
  store i8 %94, ptr %93, align 1, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %95 = load i64, ptr %2, align 8, !tbaa !8
  %96 = icmp sgt i64 %95, %indvars.iv.next
  br i1 %96, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge85:                                    ; preds = %._crit_edge82, %._crit_edge74
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %97 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %97, label %.preheader, label %.lr.ph88

.lr.ph84.split:                                   ; preds = %._crit_edge74, %._crit_edge82
  %98 = phi i64 [ %102, %._crit_edge82 ], [ %79, %._crit_edge74 ]
  %99 = phi i32 [ %105, %._crit_edge82 ], [ 0, %._crit_edge74 ]
  %100 = phi i64 [ %104, %._crit_edge82 ], [ %81, %._crit_edge74 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !11
  %101 = icmp sgt i64 %100, 0
  br i1 %101, label %.lr.ph81, label %._crit_edge82

._crit_edge82.loopexit:                           ; preds = %190
  %.pre = load i32, ptr %8, align 4, !tbaa !11
  %.pre104 = load i64, ptr %1, align 8, !tbaa !8
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %._crit_edge82.loopexit, %.lr.ph84.split
  %102 = phi i64 [ %.pre104, %._crit_edge82.loopexit ], [ %98, %.lr.ph84.split ]
  %103 = phi i32 [ %.pre, %._crit_edge82.loopexit ], [ %99, %.lr.ph84.split ]
  %104 = phi i64 [ %194, %._crit_edge82.loopexit ], [ %100, %.lr.ph84.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  %105 = add nsw i32 %103, 1
  store i32 %105, ptr %8, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = icmp sgt i64 %102, %106
  br i1 %107, label %.lr.ph84.split, label %._crit_edge85, !llvm.loop !19

.lr.ph81:                                         ; preds = %.lr.ph84.split, %190
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %10) #8
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %108 unwind label %130

108:                                              ; preds = %.lr.ph81
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  call void @_ZNSt4pairIxxEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %109 unwind label %132

109:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  %110 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  br i1 %110, label %._crit_edge78.thread, label %.lr.ph77

.lr.ph77:                                         ; preds = %109, %147
  %.03375 = phi i64 [ %.134, %147 ], [ 0, %109 ]
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  %.sroa.010.0.copyload = load i64, ptr %111, align 8
  %.sroa.511.0..sroa_idx = getelementptr inbounds i8, ptr %111, i64 8
  %.sroa.511.0.copyload = load i64, ptr %.sroa.511.0..sroa_idx, align 8
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  store i64 %.sroa.010.0.copyload, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  store i64 %.sroa.511.0.copyload, ptr %13, align 8, !tbaa !8
  %112 = icmp slt i64 %.sroa.010.0.copyload, 0
  br i1 %112, label %147, label %113, !llvm.loop !21

113:                                              ; preds = %.lr.ph77
  %114 = load i64, ptr %1, align 8, !tbaa !8
  %115 = icmp slt i64 %.sroa.010.0.copyload, %114
  %116 = icmp sgt i64 %.sroa.511.0.copyload, -1
  %or.cond.not63 = select i1 %115, i1 %116, i1 false
  %117 = load i64, ptr %2, align 8
  %.not45 = icmp slt i64 %.sroa.511.0.copyload, %117
  %or.cond56 = select i1 %or.cond.not63, i1 %.not45, i1 false
  br i1 %or.cond56, label %118, label %147, !llvm.loop !21

118:                                              ; preds = %113
  %119 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %.sroa.010.0.copyload, i64 %.sroa.511.0.copyload
  %120 = load i8, ptr %119, align 1, !tbaa !16, !range !22, !noundef !23
  %121 = load i32, ptr %8, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = load i32, ptr %9, align 4, !tbaa !11
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %122, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !16, !range !22, !noundef !23
  %.not46 = icmp eq i8 %120, %126
  br i1 %.not46, label %127, label %147, !llvm.loop !21

127:                                              ; preds = %118
  %128 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %.sroa.010.0.copyload, i64 %.sroa.511.0.copyload
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %.not47 = icmp eq i64 %129, -1
  br i1 %.not47, label %134, label %147, !llvm.loop !21

130:                                              ; preds = %.lr.ph81
  %131 = landingpad { ptr, i32 }
          cleanup
  br label %197

132:                                              ; preds = %108
  %133 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %196

134:                                              ; preds = %127
  store i64 0, ptr %128, align 8, !tbaa !8
  %135 = add nsw i64 %.03375, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %136 = add nuw nsw i64 %.sroa.010.0.copyload, 1
  store i64 %136, ptr %15, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %13)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %137 unwind label %149

137:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %138 = load i64, ptr %12, align 8, !tbaa !8
  %139 = add nsw i64 %138, -1
  store i64 %139, ptr %17, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %13)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %140 unwind label %151

140:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  %141 = load i64, ptr %13, align 8, !tbaa !8
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %19, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %19)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %143 unwind label %153

143:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #8
  %144 = load i64, ptr %13, align 8, !tbaa !8
  %145 = add nsw i64 %144, -1
  store i64 %145, ptr %21, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %21)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %146 unwind label %155

146:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #8
  br label %147

147:                                              ; preds = %.lr.ph77, %113, %118, %127, %146
  %.134 = phi i64 [ %135, %146 ], [ %.03375, %127 ], [ %.03375, %118 ], [ %.03375, %113 ], [ %.03375, %.lr.ph77 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  %148 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  br i1 %148, label %._crit_edge78, label %.lr.ph77

149:                                              ; preds = %134
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  br label %157

151:                                              ; preds = %137
  %152 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  br label %157

153:                                              ; preds = %140
  %154 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #8
  br label %157

155:                                              ; preds = %143
  %156 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #8
  br label %157

157:                                              ; preds = %155, %153, %151, %149
  %.pn48 = phi { ptr, i32 } [ %156, %155 ], [ %154, %153 ], [ %152, %151 ], [ %150, %149 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %196

._crit_edge78:                                    ; preds = %147
  %158 = icmp eq i64 %.134, 1
  br i1 %158, label %159, label %._crit_edge78.thread

159:                                              ; preds = %._crit_edge78
  %160 = load i32, ptr %8, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = load i32, ptr %9, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1000 x [1000 x i64]], ptr @sec, i64 0, i64 %161, i64 %163
  store i64 -1, ptr %164, align 8, !tbaa !8
  %165 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %161, i64 %163
  store i64 9223372036854775807, ptr %165, align 8, !tbaa !8
  br label %190

._crit_edge78.thread:                             ; preds = %109, %._crit_edge78
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %22) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #8
  %166 = load i32, ptr %8, align 4, !tbaa !11
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %24, align 4, !tbaa !11
  call void @_ZNSt4pairIxxEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #8
  store i64 1, ptr %25, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %168 unwind label %182

168:                                              ; preds = %._crit_edge78.thread
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %169 unwind label %182

169:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %26) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %28) #8
  %170 = load i32, ptr %8, align 4, !tbaa !11
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %28, align 4, !tbaa !11
  call void @_ZNSt4pairIxxEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %29) #8
  store i64 1, ptr %29, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %26, ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %172 unwind label %184

172:                                              ; preds = %169
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %173 unwind label %184

173:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %31) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %32) #8
  %174 = load i32, ptr %9, align 4, !tbaa !11
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %32, align 4, !tbaa !11
  call void @_ZNSt4pairIxxEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %33) #8
  store i64 1, ptr %33, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %30, ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %176 unwind label %186

176:                                              ; preds = %173
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %177 unwind label %186

177:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %32) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %34) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %35) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %36) #8
  %178 = load i32, ptr %9, align 4, !tbaa !11
  %179 = add nsw i32 %178, -1
  store i32 %179, ptr %36, align 4, !tbaa !11
  call void @_ZNSt4pairIxxEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %37) #8
  store i64 1, ptr %37, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %34, ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %180 unwind label %188

180:                                              ; preds = %177
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %34)
          to label %181 unwind label %188

181:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %36) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %35) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %34) #8
  br label %190

182:                                              ; preds = %168, %._crit_edge78.thread
  %183 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #8
  br label %196

184:                                              ; preds = %172, %169
  %185 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #8
  br label %196

186:                                              ; preds = %176, %173
  %187 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %32) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #8
  br label %196

188:                                              ; preds = %180, %177
  %189 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %36) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %35) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %34) #8
  br label %196

190:                                              ; preds = %181, %159
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %10) #8
  %191 = load i32, ptr %9, align 4, !tbaa !11
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %9, align 4, !tbaa !11
  %193 = sext i32 %192 to i64
  %194 = load i64, ptr %2, align 8, !tbaa !8
  %195 = icmp sgt i64 %194, %193
  br i1 %195, label %.lr.ph81, label %._crit_edge82.loopexit, !llvm.loop !24

196:                                              ; preds = %157, %182, %184, %186, %188, %132
  %.pn48.pn.pn = phi { ptr, i32 } [ %133, %132 ], [ %.pn48, %157 ], [ %189, %188 ], [ %187, %186 ], [ %185, %184 ], [ %183, %182 ]
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #8
  br label %197

197:                                              ; preds = %196, %130
  %.pn48.pn.pn.pn = phi { ptr, i32 } [ %.pn48.pn.pn, %196 ], [ %131, %130 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %265

.preheader:                                       ; preds = %227, %._crit_edge85
  %198 = load i64, ptr %3, align 8, !tbaa !8
  %199 = icmp sgt i64 %198, 0
  br i1 %199, label %.lr.ph90, label %._crit_edge91

.lr.ph88:                                         ; preds = %._crit_edge85, %227
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %.sroa.0.0.copyload = load i64, ptr %200, align 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %200, i64 8
  %.sroa.5.0.copyload = load i64, ptr %.sroa.5.0..sroa_idx, align 8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %200, i64 16
  %.sroa.6.0.copyload = load i64, ptr %.sroa.6.0..sroa_idx, align 8
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %38) #8
  store i64 %.sroa.0.0.copyload, ptr %38, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %39) #8
  store i64 %.sroa.5.0.copyload, ptr %39, align 8, !tbaa !8
  %201 = icmp slt i64 %.sroa.0.0.copyload, 0
  br i1 %201, label %227, label %202, !llvm.loop !25

202:                                              ; preds = %.lr.ph88
  %203 = load i64, ptr %1, align 8, !tbaa !8
  %204 = icmp slt i64 %.sroa.0.0.copyload, %203
  %205 = icmp sgt i64 %.sroa.5.0.copyload, -1
  %or.cond3.not60 = select i1 %204, i1 %205, i1 false
  %206 = load i64, ptr %2, align 8
  %.not = icmp slt i64 %.sroa.5.0.copyload, %206
  %or.cond57 = select i1 %or.cond3.not60, i1 %.not, i1 false
  br i1 %or.cond57, label %207, label %227, !llvm.loop !25

207:                                              ; preds = %202
  %208 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %.sroa.0.0.copyload, i64 %.sroa.5.0.copyload
  %209 = load i64, ptr %208, align 8, !tbaa !8
  %.not42 = icmp eq i64 %209, 9223372036854775807
  br i1 %.not42, label %210, label %227, !llvm.loop !25

210:                                              ; preds = %207
  store i64 %.sroa.6.0.copyload, ptr %208, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %40) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %41) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %42) #8
  %211 = add nuw nsw i64 %.sroa.0.0.copyload, 1
  store i64 %211, ptr %42, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %39)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %43) #8
  %212 = add nsw i64 %.sroa.6.0.copyload, 1
  store i64 %212, ptr %43, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %40, ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %213 unwind label %229

213:                                              ; preds = %210
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %40)
          to label %214 unwind label %229

214:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %41) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %40) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %44) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %45) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %46) #8
  %215 = load i64, ptr %38, align 8, !tbaa !8
  %216 = add nsw i64 %215, -1
  store i64 %216, ptr %46, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IxRxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %39)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %47) #8
  store i64 %212, ptr %47, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %44, ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(8) %47)
          to label %217 unwind label %231

217:                                              ; preds = %214
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %44)
          to label %218 unwind label %231

218:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %47) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %46) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %45) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %44) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %48) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %49) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %50) #8
  %219 = load i64, ptr %39, align 8, !tbaa !8
  %220 = add nsw i64 %219, 1
  store i64 %220, ptr %50, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %50)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %51) #8
  store i64 %212, ptr %51, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %48, ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(8) %51)
          to label %221 unwind label %233

221:                                              ; preds = %218
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %48)
          to label %222 unwind label %233

222:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %51) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %50) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %49) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %48) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %52) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %53) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %54) #8
  %223 = load i64, ptr %39, align 8, !tbaa !8
  %224 = add nsw i64 %223, -1
  store i64 %224, ptr %54, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %55) #8
  store i64 %212, ptr %55, align 8, !tbaa !8
  invoke void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.10") align 8 %52, ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(8) %55)
          to label %225 unwind label %235

225:                                              ; preds = %222
  invoke void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(24) %52)
          to label %226 unwind label %235

226:                                              ; preds = %225
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %55) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %54) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %53) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %52) #8
  br label %227

227:                                              ; preds = %.lr.ph88, %202, %207, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #8
  %228 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %228, label %.preheader, label %.lr.ph88

229:                                              ; preds = %213, %210
  %230 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %41) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %40) #8
  br label %237

231:                                              ; preds = %217, %214
  %232 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %47) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %46) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %45) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %44) #8
  br label %237

233:                                              ; preds = %221, %218
  %234 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %51) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %50) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %49) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %48) #8
  br label %237

235:                                              ; preds = %225, %222
  %236 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %55) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %54) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %53) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %52) #8
  br label %237

237:                                              ; preds = %235, %233, %231, %229
  %.pn = phi { ptr, i32 } [ %236, %235 ], [ %234, %233 ], [ %232, %231 ], [ %230, %229 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #8
  br label %265

._crit_edge91:                                    ; preds = %260, %.preheader
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0

.lr.ph90:                                         ; preds = %.preheader, %260
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %260 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %56) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %57) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %58) #8
  %238 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %56)
          to label %239 unwind label %263

239:                                              ; preds = %.lr.ph90
  %240 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %238, ptr noundef nonnull align 8 dereferenceable(8) %57)
          to label %241 unwind label %263

241:                                              ; preds = %239
  %242 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %240, ptr noundef nonnull align 8 dereferenceable(8) %58)
          to label %243 unwind label %263

243:                                              ; preds = %241
  %244 = load i64, ptr %56, align 8, !tbaa !8
  %245 = add nsw i64 %244, -1
  store i64 %245, ptr %56, align 8, !tbaa !8
  %246 = load i64, ptr %57, align 8, !tbaa !8
  %247 = add nsw i64 %246, -1
  store i64 %247, ptr %57, align 8, !tbaa !8
  %248 = getelementptr inbounds [1000 x [1000 x i64]], ptr @dist, i64 0, i64 %245, i64 %247
  %249 = load i64, ptr %248, align 8, !tbaa !8
  %250 = load i64, ptr %58, align 8, !tbaa !8
  %. = call i64 @llvm.smin.i64(i64 %249, i64 %250)
  %251 = sub nsw i64 %250, %.
  store i64 %251, ptr %58, align 8, !tbaa !8
  %252 = getelementptr inbounds [1000 x [1000 x i8]], ptr @b, i64 0, i64 %245, i64 %247
  %253 = load i8, ptr %252, align 1, !tbaa !16, !range !22, !noundef !23
  %254 = zext nneg i8 %253 to i64
  %255 = add nsw i64 %251, %254
  %256 = srem i64 %255, 2
  %257 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %256)
          to label %258 unwind label %263

258:                                              ; preds = %243
  %259 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %257, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %260 unwind label %263

260:                                              ; preds = %258
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %58) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %56) #8
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %261 = load i64, ptr %3, align 8, !tbaa !8
  %262 = icmp sgt i64 %261, %indvars.iv.next102
  br i1 %262, label %.lr.ph90, label %._crit_edge91, !llvm.loop !26

263:                                              ; preds = %258, %243, %241, %239, %.lr.ph90
  %264 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %58) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %56) #8
  br label %265

265:                                              ; preds = %263, %237, %197
  %.pn48.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn48.pn.pn.pn, %197 ], [ %.pn, %237 ], [ %264, %263 ]
  call void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #8
  br label %266

266:                                              ; preds = %265, %88
  %.pn54 = phi { ptr, i32 } [ %89, %88 ], [ %.pn48.pn.pn.pn.pn, %265 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn54
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIS0_IxxExESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairISt4pairIxxExES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.10") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

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

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

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

; 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 #4 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)) #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

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


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass