; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2018.01 (atlarge)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque.3" }
%"class.std::deque.3" = type { %"class.std::_Deque_base.4" }
%"class.std::_Deque_base.4" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::stack", align 8
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca i32, align 4
  %33 = alloca %"class.std::vector", align 8
  %34 = alloca ptr, align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca %"class.std::queue", align 8
  %42 = alloca i64, align 8
  %43 = alloca i8, align 1
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %47 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %48 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %49 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %50 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %51 = getelementptr i8, ptr %50, i64 -24
  %52 = load i64, ptr %51, align 8
  %53 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %52
  %54 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %53, ptr noundef null)
  %55 = load ptr, ptr @stdin, align 8, !tbaa !8
  %56 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %55)
  %57 = load ptr, ptr @stdout, align 8, !tbaa !8
  %58 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %61 = load i32, ptr %3, align 4, !tbaa !11
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %3, align 4, !tbaa !11
  %63 = load i32, ptr %2, align 4, !tbaa !11
  %64 = zext i32 %63 to i64
  %65 = call ptr @llvm.stacksave.p0()
  store ptr %65, ptr %4, align 8
  %66 = alloca %"class.std::vector", i64 %64, align 16
  store i64 %64, ptr %5, align 8
  %67 = icmp eq i64 %64, 0
  br i1 %67, label %74, label %68

68:                                               ; preds = %0
  %69 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %64
  br label %70

70:                                               ; preds = %70, %68
  %71 = phi ptr [ %66, %68 ], [ %72, %70 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %71) #9
  %72 = getelementptr inbounds %"class.std::vector", ptr %71, i64 1
  %73 = icmp eq ptr %72, %69
  br i1 %73, label %74, label %70

74:                                               ; preds = %70, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %75

75:                                               ; preds = %100, %74
  %76 = load i32, ptr %6, align 4, !tbaa !11
  %77 = load i32, ptr %2, align 4, !tbaa !11
  %78 = sub nsw i32 %77, 1
  %79 = icmp slt i32 %76, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %116

81:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %82 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %83 unwind label %103

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %82, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %85 unwind label %103

85:                                               ; preds = %83
  %86 = load i32, ptr %7, align 4, !tbaa !11
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %90 = load i32, ptr %8, align 4, !tbaa !11
  %91 = sub nsw i32 %90, 1
  store i32 %91, ptr %11, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %92 unwind label %107

92:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  %93 = load i32, ptr %8, align 4, !tbaa !11
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %97 = load i32, ptr %7, align 4, !tbaa !11
  %98 = sub nsw i32 %97, 1
  store i32 %98, ptr %12, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %99 unwind label %111

99:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %6, align 4, !tbaa !11
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %6, align 4, !tbaa !11
  br label %75, !llvm.loop !13

103:                                              ; preds = %83, %81
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %9, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %10, align 4
  br label %115

107:                                              ; preds = %85
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %9, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %115

111:                                              ; preds = %92
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %9, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %115

115:                                              ; preds = %111, %107, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %478

116:                                              ; preds = %80
  %117 = load i32, ptr %2, align 4, !tbaa !11
  %118 = zext i32 %117 to i64
  %119 = alloca i64, i64 %118, align 16
  store i64 %118, ptr %13, align 8
  %120 = load i32, ptr %2, align 4, !tbaa !11
  %121 = zext i32 %120 to i64
  %122 = alloca %"class.std::vector", i64 %121, align 16
  store i64 %121, ptr %14, align 8
  %123 = icmp eq i64 %121, 0
  br i1 %123, label %130, label %124

124:                                              ; preds = %116
  %125 = getelementptr inbounds %"class.std::vector", ptr %122, i64 %121
  br label %126

126:                                              ; preds = %126, %124
  %127 = phi ptr [ %122, %124 ], [ %128, %126 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %127) #9
  %128 = getelementptr inbounds %"class.std::vector", ptr %127, i64 1
  %129 = icmp eq ptr %128, %125
  br i1 %129, label %130, label %126

130:                                              ; preds = %126, %116
  %131 = load i32, ptr %2, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i64, ptr %119, i64 %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 -1, ptr %15, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %119, ptr noundef %133, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %134 unwind label %153

134:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #9
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %135 unwind label %157

135:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %136 unwind label %161

136:                                              ; preds = %135
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %137 unwind label %161

137:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %138

138:                                              ; preds = %217, %215, %137
  %139 = invoke noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %140 unwind label %165

140:                                              ; preds = %138
  %141 = xor i1 %139, true
  br i1 %141, label %142, label %219

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %143 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %144 unwind label %169

144:                                              ; preds = %142
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %143, i64 8, i1 false)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %145 unwind label %169

145:                                              ; preds = %144
  %146 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !15
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i64, ptr %119, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !17
  %151 = icmp ne i64 %150, -1
  br i1 %151, label %152, label %173

152:                                              ; preds = %145
  store i32 5, ptr %20, align 4
  br label %215, !llvm.loop !19

153:                                              ; preds = %130
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %9, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %463

157:                                              ; preds = %134
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %9, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %10, align 4
  br label %455

161:                                              ; preds = %136, %135
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %9, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %454

165:                                              ; preds = %342, %340, %138
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %9, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %10, align 4
  br label %454

169:                                              ; preds = %173, %144, %142
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %9, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %10, align 4
  br label %218

173:                                              ; preds = %145
  %174 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !20
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %178 = load i32, ptr %177, align 4, !tbaa !15
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i64, ptr %119, i64 %179
  store i64 %176, ptr %180, align 8, !tbaa !17
  %181 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %182 = load i32, ptr %181, align 4, !tbaa !20
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds %"class.std::vector", ptr %122, i64 %183
  %185 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %184, ptr noundef nonnull align 4 dereferenceable(4) %185)
          to label %186 unwind label %169

186:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %187 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %188 = load i32, ptr %187, align 4, !tbaa !15
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %189
  store ptr %190, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %191 = load ptr, ptr %21, align 8, !tbaa !8
  %192 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %191) #9
  %193 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %192, ptr %193, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %194 = load ptr, ptr %21, align 8, !tbaa !8
  %195 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %194) #9
  %196 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  br label %197

197:                                              ; preds = %208, %186
  %198 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #9
  br i1 %198, label %200, label %199

199:                                              ; preds = %197
  store i32 7, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %214

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %201 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  %202 = load i32, ptr %201, align 4, !tbaa !11
  store i32 %202, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  %203 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %204 = load i32, ptr %203, align 4, !tbaa !20
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %26, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %206 unwind label %210

206:                                              ; preds = %200
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(8) %25)
          to label %207 unwind label %210

207:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %208

208:                                              ; preds = %207
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  br label %197

210:                                              ; preds = %206, %200
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %9, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %218

214:                                              ; preds = %199
  store i32 0, ptr %20, align 4
  br label %215

215:                                              ; preds = %214, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  %216 = load i32, ptr %20, align 4
  switch i32 %216, label %491 [
    i32 0, label %217
    i32 5, label %138
  ]

217:                                              ; preds = %215
  br label %138, !llvm.loop !19

218:                                              ; preds = %210, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %454

219:                                              ; preds = %140
  %220 = load i32, ptr %2, align 4, !tbaa !11
  %221 = zext i32 %220 to i64
  %222 = alloca i32, i64 %221, align 16
  store i64 %221, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %223 = load i32, ptr %2, align 4, !tbaa !11
  %224 = sub nsw i32 %223, 1
  store i32 %224, ptr %28, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %331, %219
  %226 = load i32, ptr %28, align 4, !tbaa !11
  %227 = icmp sge i32 %226, 0
  br i1 %227, label %229, label %228

228:                                              ; preds = %225
  store i32 9, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %334

229:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %230 = load i32, ptr %28, align 4, !tbaa !11
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %"class.std::vector", ptr %122, i64 %231
  store ptr %232, ptr %29, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %233 = load ptr, ptr %29, align 8, !tbaa !8
  %234 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %233) #9
  %235 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %234, ptr %235, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  %236 = load ptr, ptr %29, align 8, !tbaa !8
  %237 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %236) #9
  %238 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %237, ptr %238, align 8
  br label %239

239:                                              ; preds = %327, %229
  %240 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #9
  br i1 %240, label %242, label %241

241:                                              ; preds = %239
  store i32 12, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  br label %330

242:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %243 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #9
  %244 = load i32, ptr %243, align 4, !tbaa !11
  store i32 %244, ptr %32, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #9
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %245 = load i32, ptr %32, align 4, !tbaa !11
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %246
  store ptr %247, ptr %34, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %248 = load ptr, ptr %34, align 8, !tbaa !8
  %249 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %248) #9
  %250 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %249, ptr %250, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #9
  %251 = load ptr, ptr %34, align 8, !tbaa !8
  %252 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %251) #9
  %253 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  br label %254

254:                                              ; preds = %274, %242
  %255 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36) #9
  br i1 %255, label %257, label %256

256:                                              ; preds = %254
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  br label %276

257:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  %258 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #9
  %259 = load i32, ptr %258, align 4, !tbaa !11
  store i32 %259, ptr %37, align 4, !tbaa !11
  %260 = load i32, ptr %37, align 4, !tbaa !11
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds i64, ptr %119, i64 %261
  %263 = load i64, ptr %262, align 8, !tbaa !17
  %264 = load i32, ptr %28, align 4, !tbaa !11
  %265 = sext i32 %264 to i64
  %266 = icmp sgt i64 %263, %265
  br i1 %266, label %267, label %273

267:                                              ; preds = %257
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %268 unwind label %269

268:                                              ; preds = %267
  br label %273

269:                                              ; preds = %267
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %9, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  br label %329

273:                                              ; preds = %268, %257
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  br label %274

274:                                              ; preds = %273
  %275 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #9
  br label %254

276:                                              ; preds = %256
  %277 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  %278 = trunc i64 %277 to i32
  %279 = icmp eq i32 %278, 0
  br i1 %279, label %280, label %284

280:                                              ; preds = %276
  %281 = load i32, ptr %32, align 4, !tbaa !11
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds i32, ptr %222, i64 %282
  store i32 0, ptr %283, align 4, !tbaa !11
  br label %326

284:                                              ; preds = %276
  %285 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef 0) #9
  %286 = load i32, ptr %285, align 4, !tbaa !11
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds i32, ptr %222, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !11
  %290 = add nsw i32 %289, 1
  %291 = load i32, ptr %32, align 4, !tbaa !11
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds i32, ptr %222, i64 %292
  store i32 %290, ptr %293, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  store i32 1, ptr %38, align 4, !tbaa !11
  br label %294

294:                                              ; preds = %318, %284
  %295 = load i32, ptr %38, align 4, !tbaa !11
  %296 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  %297 = trunc i64 %296 to i32
  %298 = icmp slt i32 %295, %297
  br i1 %298, label %300, label %299

299:                                              ; preds = %294
  store i32 16, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %325

300:                                              ; preds = %294
  %301 = load i32, ptr %32, align 4, !tbaa !11
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds i32, ptr %222, i64 %302
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  %304 = load i32, ptr %38, align 4, !tbaa !11
  %305 = sext i32 %304 to i64
  %306 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %305) #9
  %307 = load i32, ptr %306, align 4, !tbaa !11
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds i32, ptr %222, i64 %308
  %310 = load i32, ptr %309, align 4, !tbaa !11
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %39, align 4, !tbaa !11
  %312 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %303, ptr noundef nonnull align 4 dereferenceable(4) %39)
          to label %313 unwind label %321

313:                                              ; preds = %300
  %314 = load i32, ptr %312, align 4, !tbaa !11
  %315 = load i32, ptr %32, align 4, !tbaa !11
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds i32, ptr %222, i64 %316
  store i32 %314, ptr %317, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %318

318:                                              ; preds = %313
  %319 = load i32, ptr %38, align 4, !tbaa !11
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %38, align 4, !tbaa !11
  br label %294, !llvm.loop !21

321:                                              ; preds = %300
  %322 = landingpad { ptr, i32 }
          cleanup
  %323 = extractvalue { ptr, i32 } %322, 0
  store ptr %323, ptr %9, align 8
  %324 = extractvalue { ptr, i32 } %322, 1
  store i32 %324, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %329

325:                                              ; preds = %299
  br label %326

326:                                              ; preds = %325, %280
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  br label %327

327:                                              ; preds = %326
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #9
  br label %239

329:                                              ; preds = %321, %269
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %454

330:                                              ; preds = %241
  br label %331

331:                                              ; preds = %330
  %332 = load i32, ptr %28, align 4, !tbaa !11
  %333 = add nsw i32 %332, -1
  store i32 %333, ptr %28, align 4, !tbaa !11
  br label %225, !llvm.loop !22

334:                                              ; preds = %228
  %335 = load i32, ptr %3, align 4, !tbaa !11
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds i32, ptr %222, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !11
  %339 = icmp eq i32 %338, 0
  br i1 %339, label %340, label %345

340:                                              ; preds = %334
  %341 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %342 unwind label %165

342:                                              ; preds = %340
  %343 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %341, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %344 unwind label %165

344:                                              ; preds = %342
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %451

345:                                              ; preds = %334
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  store i32 0, ptr %40, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 80, ptr %41) #9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %41)
          to label %346 unwind label %370

346:                                              ; preds = %345
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %41, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %347 unwind label %374

347:                                              ; preds = %346
  %348 = load i32, ptr %2, align 4, !tbaa !11
  %349 = zext i32 %348 to i64
  %350 = alloca i8, i64 %349, align 16
  store i64 %349, ptr %42, align 8
  %351 = load i32, ptr %2, align 4, !tbaa !11
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds i8, ptr %350, i64 %352
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #9
  store i8 0, ptr %43, align 1, !tbaa !23
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %350, ptr noundef %353, ptr noundef nonnull align 1 dereferenceable(1) %43)
          to label %354 unwind label %378

354:                                              ; preds = %347
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #9
  br label %355

355:                                              ; preds = %441, %439, %354
  %356 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %41)
          to label %357 unwind label %374

357:                                              ; preds = %355
  %358 = xor i1 %356, true
  br i1 %358, label %359, label %443

359:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %360 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %41)
          to label %361 unwind label %382

361:                                              ; preds = %359
  %362 = load i32, ptr %360, align 4, !tbaa !11
  store i32 %362, ptr %44, align 4, !tbaa !11
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %41)
          to label %363 unwind label %382

363:                                              ; preds = %361
  %364 = load i32, ptr %44, align 4, !tbaa !11
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds i8, ptr %350, i64 %365
  %367 = load i8, ptr %366, align 1, !tbaa !23, !range !25, !noundef !26
  %368 = trunc i8 %367 to i1
  br i1 %368, label %369, label %386

369:                                              ; preds = %363
  store i32 19, ptr %20, align 4
  br label %439, !llvm.loop !27

370:                                              ; preds = %345
  %371 = landingpad { ptr, i32 }
          cleanup
  %372 = extractvalue { ptr, i32 } %371, 0
  store ptr %372, ptr %9, align 8
  %373 = extractvalue { ptr, i32 } %371, 1
  store i32 %373, ptr %10, align 4
  br label %450

374:                                              ; preds = %446, %443, %355, %346
  %375 = landingpad { ptr, i32 }
          cleanup
  %376 = extractvalue { ptr, i32 } %375, 0
  store ptr %376, ptr %9, align 8
  %377 = extractvalue { ptr, i32 } %375, 1
  store i32 %377, ptr %10, align 4
  br label %449

378:                                              ; preds = %347
  %379 = landingpad { ptr, i32 }
          cleanup
  %380 = extractvalue { ptr, i32 } %379, 0
  store ptr %380, ptr %9, align 8
  %381 = extractvalue { ptr, i32 } %379, 1
  store i32 %381, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #9
  br label %449

382:                                              ; preds = %361, %359
  %383 = landingpad { ptr, i32 }
          cleanup
  %384 = extractvalue { ptr, i32 } %383, 0
  store ptr %384, ptr %9, align 8
  %385 = extractvalue { ptr, i32 } %383, 1
  store i32 %385, ptr %10, align 4
  br label %442

386:                                              ; preds = %363
  %387 = load i32, ptr %44, align 4, !tbaa !11
  %388 = sext i32 %387 to i64
  %389 = getelementptr inbounds i8, ptr %350, i64 %388
  store i8 1, ptr %389, align 1, !tbaa !23
  %390 = load i32, ptr %44, align 4, !tbaa !11
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds i64, ptr %119, i64 %391
  %393 = load i64, ptr %392, align 8, !tbaa !17
  %394 = load i32, ptr %44, align 4, !tbaa !11
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds i32, ptr %222, i64 %395
  %397 = load i32, ptr %396, align 4, !tbaa !11
  %398 = sext i32 %397 to i64
  %399 = icmp eq i64 %393, %398
  br i1 %399, label %412, label %400

400:                                              ; preds = %386
  %401 = load i32, ptr %44, align 4, !tbaa !11
  %402 = sext i32 %401 to i64
  %403 = getelementptr inbounds i64, ptr %119, i64 %402
  %404 = load i64, ptr %403, align 8, !tbaa !17
  %405 = load i32, ptr %44, align 4, !tbaa !11
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds i32, ptr %222, i64 %406
  %408 = load i32, ptr %407, align 4, !tbaa !11
  %409 = add nsw i32 %408, 1
  %410 = sext i32 %409 to i64
  %411 = icmp eq i64 %404, %410
  br i1 %411, label %412, label %415

412:                                              ; preds = %400, %386
  %413 = load i32, ptr %40, align 4, !tbaa !11
  %414 = add nsw i32 %413, 1
  store i32 %414, ptr %40, align 4, !tbaa !11
  store i32 19, ptr %20, align 4
  br label %439, !llvm.loop !27

415:                                              ; preds = %400
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #9
  %416 = load i32, ptr %44, align 4, !tbaa !11
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %417
  store ptr %418, ptr %45, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #9
  %419 = load ptr, ptr %45, align 8, !tbaa !8
  %420 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %419) #9
  %421 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  store ptr %420, ptr %421, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #9
  %422 = load ptr, ptr %45, align 8, !tbaa !8
  %423 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %422) #9
  %424 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  store ptr %423, ptr %424, align 8
  br label %425

425:                                              ; preds = %432, %415
  %426 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %47) #9
  br i1 %426, label %428, label %427

427:                                              ; preds = %425
  store i32 21, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #9
  br label %438

428:                                              ; preds = %425
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #9
  %429 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #9
  %430 = load i32, ptr %429, align 4, !tbaa !11
  store i32 %430, ptr %48, align 4, !tbaa !11
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %41, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %431 unwind label %434

431:                                              ; preds = %428
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #9
  br label %432

432:                                              ; preds = %431
  %433 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #9
  br label %425

434:                                              ; preds = %428
  %435 = landingpad { ptr, i32 }
          cleanup
  %436 = extractvalue { ptr, i32 } %435, 0
  store ptr %436, ptr %9, align 8
  %437 = extractvalue { ptr, i32 } %435, 1
  store i32 %437, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #9
  br label %442

438:                                              ; preds = %427
  store i32 0, ptr %20, align 4
  br label %439

439:                                              ; preds = %438, %412, %369
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  %440 = load i32, ptr %20, align 4
  switch i32 %440, label %491 [
    i32 0, label %441
    i32 19, label %355
  ]

441:                                              ; preds = %439
  br label %355, !llvm.loop !27

442:                                              ; preds = %434, %382
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  br label %449

443:                                              ; preds = %357
  %444 = load i32, ptr %40, align 4, !tbaa !11
  %445 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %444)
          to label %446 unwind label %374

446:                                              ; preds = %443
  %447 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %445, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %448 unwind label %374

448:                                              ; preds = %446
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %41) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %451

449:                                              ; preds = %442, %378, %374
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %41) #9
  br label %450

450:                                              ; preds = %449, %370
  call void @llvm.lifetime.end.p0(i64 80, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %454

451:                                              ; preds = %448, %344
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #9
  %452 = getelementptr inbounds %"class.std::vector", ptr %122, i64 %121
  %453 = icmp eq ptr %122, %452
  br i1 %453, label %460, label %456

454:                                              ; preds = %450, %329, %218, %165, %161
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #9
  br label %455

455:                                              ; preds = %454, %157
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #9
  br label %463

456:                                              ; preds = %456, %451
  %457 = phi ptr [ %452, %451 ], [ %458, %456 ]
  %458 = getelementptr inbounds %"class.std::vector", ptr %457, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %458) #9
  %459 = icmp eq ptr %458, %122
  br i1 %459, label %460, label %456

460:                                              ; preds = %456, %451
  %461 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %64
  %462 = icmp eq ptr %66, %461
  br i1 %462, label %475, label %471

463:                                              ; preds = %455, %153
  %464 = getelementptr inbounds %"class.std::vector", ptr %122, i64 %121
  %465 = icmp eq ptr %122, %464
  br i1 %465, label %470, label %466

466:                                              ; preds = %466, %463
  %467 = phi ptr [ %464, %463 ], [ %468, %466 ]
  %468 = getelementptr inbounds %"class.std::vector", ptr %467, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %468) #9
  %469 = icmp eq ptr %468, %122
  br i1 %469, label %470, label %466

470:                                              ; preds = %466, %463
  br label %478

471:                                              ; preds = %471, %460
  %472 = phi ptr [ %461, %460 ], [ %473, %471 ]
  %473 = getelementptr inbounds %"class.std::vector", ptr %472, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %473) #9
  %474 = icmp eq ptr %473, %66
  br i1 %474, label %475, label %471

475:                                              ; preds = %471, %460
  %476 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %476)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %477 = load i32, ptr %1, align 4
  ret i32 %477

478:                                              ; preds = %470, %115
  %479 = getelementptr inbounds %"class.std::vector", ptr %66, i64 %64
  %480 = icmp eq ptr %66, %479
  br i1 %480, label %485, label %481

481:                                              ; preds = %481, %478
  %482 = phi ptr [ %479, %478 ], [ %483, %481 ]
  %483 = getelementptr inbounds %"class.std::vector", ptr %482, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %483) #9
  %484 = icmp eq ptr %483, %66
  br i1 %484, label %485, label %481

485:                                              ; preds = %481, %478
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %486

486:                                              ; preds = %485
  %487 = load ptr, ptr %9, align 8
  %488 = load i32, ptr %10, align 4
  %489 = insertvalue { ptr, i32 } poison, ptr %487, 0
  %490 = insertvalue { ptr, i32 } %489, i32 %488, 1
  resume { ptr, i32 } %490

491:                                              ; preds = %439, %215
  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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #5 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), 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 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #6

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !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 = !{!16, !12, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !10, i64 0}
!19 = distinct !{!19, !14}
!20 = !{!16, !12, i64 4}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = !{!24, !24, i64 0}
!24 = !{!"bool", !10, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !14}


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

%"class.std::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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque.3" }
%"class.std::deque.3" = type { %"class.std::_Deque_base.4" }
%"class.std::_Deque_base.4" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::queue", align 8
  %25 = alloca i8, align 1
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca i32, align 4
  %29 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %31 = getelementptr i8, ptr %30, i64 -24
  %32 = load i64, ptr %31, align 8
  %33 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %32
  %34 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %33, ptr noundef null)
  %35 = load ptr, ptr @stdin, align 8, !tbaa !8
  %36 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %35)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !8
  %38 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %41 = load i32, ptr %2, align 4, !tbaa !11
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr %2, align 4, !tbaa !11
  %43 = load i32, ptr %1, align 4, !tbaa !11
  %44 = zext i32 %43 to i64
  %45 = call ptr @llvm.stacksave.p0()
  %46 = alloca %"class.std::vector", i64 %44, align 16
  %47 = icmp eq i32 %43, 0
  br i1 %47, label %.loopexit72, label %48

48:                                               ; preds = %0
  %49 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %44
  br label %50

50:                                               ; preds = %50, %48
  %51 = phi ptr [ %46, %48 ], [ %52, %50 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %51) #8
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  %53 = icmp eq ptr %52, %49
  br i1 %53, label %.loopexit72, label %50

.loopexit72:                                      ; preds = %50, %0
  %invariant.gep = getelementptr i8, ptr %46, i64 -24
  %54 = load i32, ptr %1, align 4, !tbaa !11
  %55 = icmp sgt i32 %54, 1
  br i1 %55, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %73, %.loopexit72
  %.lcssa = phi i32 [ %54, %.loopexit72 ], [ %75, %73 ]
  %56 = zext i32 %.lcssa to i64
  %57 = alloca i64, i64 %56, align 16
  %58 = alloca %"class.std::vector", i64 %56, align 16
  %59 = icmp eq i32 %.lcssa, 0
  br i1 %59, label %.loopexit71, label %85

.lr.ph:                                           ; preds = %.loopexit72, %73
  %.03479 = phi i32 [ %74, %73 ], [ 0, %.loopexit72 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %60 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %61 unwind label %78

61:                                               ; preds = %.lr.ph
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %63 unwind label %78

63:                                               ; preds = %61
  %64 = load i32, ptr %3, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %gep = getelementptr %"class.std::vector", ptr %invariant.gep, i64 %65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %66 = load i32, ptr %4, align 4, !tbaa !11
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %5, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %gep, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %68 unwind label %80

68:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %69 = load i32, ptr %4, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %gep78 = getelementptr %"class.std::vector", ptr %invariant.gep, i64 %70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %71 = load i32, ptr %3, align 4, !tbaa !11
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %6, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %gep78, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %73 unwind label %82

73:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %74 = add nuw nsw i32 %.03479, 1
  %75 = load i32, ptr %1, align 4, !tbaa !11
  %76 = add nsw i32 %75, -1
  %77 = icmp slt i32 %74, %76
  br i1 %77, label %.lr.ph, label %._crit_edge, !llvm.loop !13

78:                                               ; preds = %61, %.lr.ph
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %84

80:                                               ; preds = %63
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %84

82:                                               ; preds = %68
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  br label %84

84:                                               ; preds = %82, %80, %78
  %.pn61 = phi { ptr, i32 } [ %83, %82 ], [ %81, %80 ], [ %79, %78 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %.loopexit65

85:                                               ; preds = %._crit_edge
  %86 = getelementptr inbounds %"class.std::vector", ptr %58, i64 %56
  br label %87

87:                                               ; preds = %87, %85
  %88 = phi ptr [ %58, %85 ], [ %89, %87 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %88) #8
  %89 = getelementptr inbounds i8, ptr %88, i64 24
  %90 = icmp eq ptr %89, %86
  br i1 %90, label %.loopexit71.loopexit, label %87

.loopexit71.loopexit:                             ; preds = %87
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  br label %.loopexit71

.loopexit71:                                      ; preds = %.loopexit71.loopexit, %._crit_edge
  %91 = phi i32 [ %.pre, %.loopexit71.loopexit ], [ 0, %._crit_edge ]
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i64, ptr %57, i64 %92
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 -1, ptr %7, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %57, ptr noundef nonnull %93, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %94 unwind label %106

94:                                               ; preds = %.loopexit71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #8
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %95 unwind label %108

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %10)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %96 unwind label %110

96:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  %97 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %97, label %._crit_edge85, label %.lr.ph84

.lr.ph84:                                         ; preds = %96
  %98 = getelementptr inbounds i8, ptr %11, i64 4
  br label %99

99:                                               ; preds = %.lr.ph84, %136
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %101 = load i64, ptr %100, align 4
  store i64 %101, ptr %11, align 8
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %102 = load i32, ptr %11, align 8, !tbaa !15
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i64, ptr %57, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !17
  %.not = icmp eq i64 %105, -1
  br i1 %.not, label %116, label %136, !llvm.loop !19

106:                                              ; preds = %.loopexit71
  %107 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %267

108:                                              ; preds = %94
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %262

110:                                              ; preds = %95
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %261

112:                                              ; preds = %202, %200
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %261

114:                                              ; preds = %116
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %138

116:                                              ; preds = %99
  %117 = load i32, ptr %98, align 4, !tbaa !20
  %118 = sext i32 %117 to i64
  store i64 %118, ptr %104, align 8, !tbaa !17
  %119 = getelementptr inbounds %"class.std::vector", ptr %58, i64 %118
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %119, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %120 unwind label %114

120:                                              ; preds = %116
  %121 = load i32, ptr %11, align 8, !tbaa !15
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %122
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %124 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %123) #8
  store ptr %124, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %125 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %123) #8
  store ptr %125, ptr %13, align 8
  %126 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %126, label %.lr.ph81, label %._crit_edge82

._crit_edge82:                                    ; preds = %131, %120
  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 %136

.lr.ph81:                                         ; preds = %120, %131
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %128 = load i32, ptr %127, align 4, !tbaa !11
  store i32 %128, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  %129 = load i32, ptr %98, align 4, !tbaa !20
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %16, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %16)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %131 unwind label %134

131:                                              ; preds = %.lr.ph81
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %133 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %133, label %.lr.ph81, label %._crit_edge82

134:                                              ; preds = %.lr.ph81
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %138

136:                                              ; preds = %99, %._crit_edge82
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  %137 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %137, label %._crit_edge85, label %99

138:                                              ; preds = %134, %114
  %.pn56 = phi { ptr, i32 } [ %135, %134 ], [ %115, %114 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  br label %261

._crit_edge85:                                    ; preds = %136, %96
  %139 = load i32, ptr %1, align 4, !tbaa !11
  %140 = zext i32 %139 to i64
  %141 = alloca i32, i64 %140, align 16
  %142 = icmp sgt i32 %139, 0
  br i1 %142, label %.lr.ph98, label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge94, %._crit_edge85
  %143 = load i32, ptr %2, align 4, !tbaa !11
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %141, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %200, label %204

.lr.ph98:                                         ; preds = %._crit_edge85, %._crit_edge94
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %._crit_edge94 ], [ %140, %._crit_edge85 ]
  %indvars.iv.next111 = add nsw i64 %indvars.iv110, -1
  %148 = getelementptr inbounds %"class.std::vector", ptr %58, i64 %indvars.iv.next111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %149 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #8
  store ptr %149, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #8
  %150 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #8
  store ptr %150, ptr %18, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br i1 %151, label %.lr.ph93, label %._crit_edge94

._crit_edge94:                                    ; preds = %.loopexit70, %.lr.ph98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  %152 = icmp sgt i64 %indvars.iv110, 1
  br i1 %152, label %.lr.ph98, label %._crit_edge99, !llvm.loop !21

.lr.ph93:                                         ; preds = %.lr.ph98, %.loopexit70
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  %154 = load i32, ptr %153, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %155
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #8
  %157 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  store ptr %157, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #8
  %158 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  store ptr %158, ptr %21, align 8
  %159 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %159, label %.lr.ph87, label %._crit_edge88

._crit_edge88:                                    ; preds = %171, %.lr.ph93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #8
  %160 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  %161 = and i64 %160, 4294967295
  %162 = icmp eq i64 %161, 0
  br i1 %162, label %174, label %176

.lr.ph87:                                         ; preds = %.lr.ph93, %171
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #8
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %164 = load i32, ptr %163, align 4, !tbaa !11
  store i32 %164, ptr %22, align 4, !tbaa !11
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i64, ptr %57, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !17
  %.not113 = icmp slt i64 %167, %indvars.iv110
  br i1 %.not113, label %171, label %168

168:                                              ; preds = %.lr.ph87
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %171 unwind label %169

169:                                              ; preds = %168
  %170 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  br label %261

171:                                              ; preds = %168, %.lr.ph87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #8
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %173 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %173, label %.lr.ph87, label %._crit_edge88

174:                                              ; preds = %._crit_edge88
  %175 = getelementptr inbounds i32, ptr %141, i64 %155
  store i32 0, ptr %175, align 4, !tbaa !11
  br label %.loopexit70

176:                                              ; preds = %._crit_edge88
  %177 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef 0) #8
  %178 = load i32, ptr %177, align 4, !tbaa !11
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %141, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !11
  %182 = add nsw i32 %181, 1
  %183 = getelementptr inbounds i32, ptr %141, i64 %155
  store i32 %182, ptr %183, align 4, !tbaa !11
  %184 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  %185 = trunc i64 %184 to i32
  %186 = icmp sgt i32 %185, 1
  br i1 %186, label %.lr.ph91, label %.loopexit70

.lr.ph91:                                         ; preds = %176, %.lr.ph91
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph91 ], [ 1, %176 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #8
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %indvars.iv) #8
  %188 = load i32, ptr %187, align 4, !tbaa !11
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %141, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !11
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %23, align 4, !tbaa !11
  %193 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %183, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %194 = load i32, ptr %193, align 4, !tbaa !11
  store i32 %194, ptr %183, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %195 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  %sext = shl i64 %195, 32
  %196 = ashr exact i64 %sext, 32
  %197 = icmp slt i64 %indvars.iv.next, %196
  br i1 %197, label %.lr.ph91, label %.loopexit70, !llvm.loop !22

.loopexit70:                                      ; preds = %.lr.ph91, %176, %174
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  %199 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br i1 %199, label %.lr.ph93, label %._crit_edge94

200:                                              ; preds = %._crit_edge99
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %202 unwind label %112

202:                                              ; preds = %200
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %259 unwind label %112

204:                                              ; preds = %._crit_edge99
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %24) #8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
          to label %205 unwind label %220

205:                                              ; preds = %204
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %24, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %206 unwind label %222

206:                                              ; preds = %205
  %207 = load i32, ptr %1, align 4, !tbaa !11
  %208 = zext i32 %207 to i64
  %209 = alloca i8, i64 %208, align 16
  %210 = sext i32 %207 to i64
  %211 = getelementptr inbounds i8, ptr %209, i64 %210
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %25) #8
  store i8 0, ptr %25, align 1, !tbaa !23
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %209, ptr noundef nonnull %211, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %212 unwind label %224

212:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #8
  %213 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
  br i1 %213, label %._crit_edge106, label %.lr.ph105

.lr.ph105:                                        ; preds = %212, %251
  %.036103 = phi i32 [ %.137, %251 ], [ 0, %212 ]
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
  %215 = load i32, ptr %214, align 4, !tbaa !11
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i8, ptr %209, i64 %216
  %218 = load i8, ptr %217, align 1, !tbaa !23, !range !25, !noundef !26
  %219 = trunc nuw i8 %218 to i1
  br i1 %219, label %251, label %226, !llvm.loop !27

220:                                              ; preds = %204
  %221 = landingpad { ptr, i32 }
          cleanup
  br label %258

222:                                              ; preds = %254, %._crit_edge106, %205
  %223 = landingpad { ptr, i32 }
          cleanup
  br label %257

224:                                              ; preds = %206
  %225 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #8
  br label %257

226:                                              ; preds = %.lr.ph105
  store i8 1, ptr %217, align 1, !tbaa !23
  %227 = getelementptr inbounds i64, ptr %57, i64 %216
  %228 = load i64, ptr %227, align 8, !tbaa !17
  %229 = getelementptr inbounds i32, ptr %141, i64 %216
  %230 = load i32, ptr %229, align 4, !tbaa !11
  %231 = sext i32 %230 to i64
  %232 = icmp eq i64 %228, %231
  br i1 %232, label %237, label %233

233:                                              ; preds = %226
  %234 = add nsw i32 %230, 1
  %235 = sext i32 %234 to i64
  %236 = icmp eq i64 %228, %235
  br i1 %236, label %237, label %239

237:                                              ; preds = %233, %226
  %238 = add nsw i32 %.036103, 1
  br label %251, !llvm.loop !27

239:                                              ; preds = %233
  %240 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %216
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #8
  %241 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %240) #8
  store ptr %241, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #8
  %242 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %240) #8
  store ptr %242, ptr %27, align 8
  %243 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  br i1 %243, label %.lr.ph101, label %._crit_edge102

._crit_edge102:                                   ; preds = %246, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #8
  br label %251

.lr.ph101:                                        ; preds = %239, %246
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %28) #8
  %244 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  %245 = load i32, ptr %244, align 4, !tbaa !11
  store i32 %245, ptr %28, align 4, !tbaa !11
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %24, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %246 unwind label %249

246:                                              ; preds = %.lr.ph101
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #8
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  %248 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  br i1 %248, label %.lr.ph101, label %._crit_edge102

249:                                              ; preds = %.lr.ph101
  %250 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #8
  br label %257

251:                                              ; preds = %.lr.ph105, %._crit_edge102, %237
  %.137 = phi i32 [ %238, %237 ], [ %.036103, %._crit_edge102 ], [ %.036103, %.lr.ph105 ]
  %252 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
  br i1 %252, label %._crit_edge106, label %.lr.ph105

._crit_edge106:                                   ; preds = %251, %212
  %.036.lcssa = phi i32 [ 0, %212 ], [ %.137, %251 ]
  %253 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.036.lcssa)
          to label %254 unwind label %222

254:                                              ; preds = %._crit_edge106
  %255 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %253, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %256 unwind label %222

256:                                              ; preds = %254
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %24) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %24) #8
  br label %259

257:                                              ; preds = %249, %224, %222
  %.pn = phi { ptr, i32 } [ %250, %249 ], [ %223, %222 ], [ %225, %224 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %24) #8
  br label %258

258:                                              ; preds = %257, %220
  %.pn.pn = phi { ptr, i32 } [ %.pn, %257 ], [ %221, %220 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %24) #8
  br label %261

259:                                              ; preds = %202, %256
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #8
  br i1 %59, label %.loopexit69, label %.preheader68.preheader

.preheader68.preheader:                           ; preds = %259
  %260 = getelementptr inbounds %"class.std::vector", ptr %58, i64 %56
  br label %.preheader68

261:                                              ; preds = %258, %169, %138, %112, %110
  %.pn56.pn = phi { ptr, i32 } [ %.pn56, %138 ], [ %170, %169 ], [ %113, %112 ], [ %.pn.pn, %258 ], [ %111, %110 ]
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  br label %262

262:                                              ; preds = %261, %108
  %.pn56.pn.pn = phi { ptr, i32 } [ %.pn56.pn, %261 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #8
  br label %267

.preheader68:                                     ; preds = %.preheader68.preheader, %.preheader68
  %263 = phi ptr [ %264, %.preheader68 ], [ %260, %.preheader68.preheader ]
  %264 = getelementptr inbounds i8, ptr %263, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %264) #8
  %265 = icmp eq ptr %264, %58
  br i1 %265, label %.loopexit69, label %.preheader68

.loopexit69:                                      ; preds = %.preheader68, %259
  br i1 %47, label %.loopexit67, label %.preheader66.preheader

.preheader66.preheader:                           ; preds = %.loopexit69
  %266 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %44
  br label %.preheader66

267:                                              ; preds = %262, %106
  %.pn56.pn.pn.pn = phi { ptr, i32 } [ %.pn56.pn.pn, %262 ], [ %107, %106 ]
  br i1 %59, label %.loopexit65, label %.preheader64.preheader

.preheader64.preheader:                           ; preds = %267
  %268 = getelementptr inbounds %"class.std::vector", ptr %58, i64 %56
  br label %.preheader64

.preheader64:                                     ; preds = %.preheader64.preheader, %.preheader64
  %269 = phi ptr [ %270, %.preheader64 ], [ %268, %.preheader64.preheader ]
  %270 = getelementptr inbounds i8, ptr %269, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %270) #8
  %271 = icmp eq ptr %270, %58
  br i1 %271, label %.loopexit65, label %.preheader64

.preheader66:                                     ; preds = %.preheader66.preheader, %.preheader66
  %272 = phi ptr [ %273, %.preheader66 ], [ %266, %.preheader66.preheader ]
  %273 = getelementptr inbounds i8, ptr %272, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %273) #8
  %274 = icmp eq ptr %273, %46
  br i1 %274, label %.loopexit67, label %.preheader66

.loopexit67:                                      ; preds = %.preheader66, %.loopexit69
  call void @llvm.stackrestore.p0(ptr %45)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.loopexit65:                                      ; preds = %.preheader64, %267, %84
  %.pn61.pn = phi { ptr, i32 } [ %.pn61, %84 ], [ %.pn56.pn.pn.pn, %267 ], [ %.pn56.pn.pn.pn, %.preheader64 ]
  br i1 %47, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.loopexit65
  %275 = getelementptr inbounds %"class.std::vector", ptr %46, i64 %44
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %276 = phi ptr [ %277, %.preheader ], [ %275, %.preheader.preheader ]
  %277 = getelementptr inbounds i8, ptr %276, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %277) #8
  %278 = icmp eq ptr %277, %46
  br i1 %278, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %.loopexit65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn61.pn
}

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), 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 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_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 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress 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 = !{!"any pointer", !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 = !{!16, !12, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !10, i64 0}
!19 = distinct !{!19, !14}
!20 = !{!16, !12, i64 4}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = !{!24, !24, i64 0}
!24 = !{!"bool", !10, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !14}


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