; LLVM IR from abeaumont/competitive-programming :: cses (1696)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [1002 x i32], align 16
@g = external dso_local global [1002 x [1002 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsi(i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 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 i32, align 4
  %9 = alloca %"class.std::queue", align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::tuple", align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.std::tuple", align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %45, %0
  %35 = load i32, ptr %5, align 4, !tbaa !8
  %36 = load i32, ptr @n, align 4, !tbaa !8
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %48

39:                                               ; preds = %34
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1002 x i32], ptr @g, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %39
  %46 = load i32, ptr %5, align 4, !tbaa !8
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !8
  br label %34, !llvm.loop !11

48:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %49 = load i32, ptr @n, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %6, align 4, !tbaa !8
  br label %51

51:                                               ; preds = %70, %48
  %52 = load i32, ptr %6, align 4, !tbaa !8
  %53 = load i32, ptr @n, align 4, !tbaa !8
  %54 = load i32, ptr @m, align 4, !tbaa !8
  %55 = add nsw i32 %53, %54
  %56 = icmp sle i32 %52, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %73

58:                                               ; preds = %51
  %59 = load i32, ptr %6, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %60
  %62 = load i32, ptr @n, align 4, !tbaa !8
  %63 = load i32, ptr @m, align 4, !tbaa !8
  %64 = add nsw i32 %62, %63
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1002 x i32], ptr %61, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !8
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %67, align 4, !tbaa !8
  br label %70

70:                                               ; preds = %58
  %71 = load i32, ptr %6, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %6, align 4, !tbaa !8
  br label %51, !llvm.loop !13

73:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %74

74:                                               ; preds = %92, %73
  %75 = load i32, ptr %7, align 4, !tbaa !8
  %76 = load i32, ptr %2, align 4, !tbaa !8
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %95

79:                                               ; preds = %74
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %80, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %82 = load i32, ptr %3, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %83
  %85 = load i32, ptr @n, align 4, !tbaa !8
  %86 = load i32, ptr %4, align 4, !tbaa !8
  %87 = add nsw i32 %85, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1002 x i32], ptr %84, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %89, align 4, !tbaa !8
  br label %92

92:                                               ; preds = %79
  %93 = load i32, ptr %7, align 4, !tbaa !8
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !8
  br label %74, !llvm.loop !14

95:                                               ; preds = %78
  br label %96

96:                                               ; preds = %185, %95
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr @n, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr @l, i64 %99
  %101 = load i32, ptr @m, align 4, !tbaa !8
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  %104 = getelementptr inbounds i32, ptr %103, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 -1, ptr %8, align 4, !tbaa !8
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @l, ptr noundef %104, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %105 unwind label %121

105:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  store i32 0, ptr @l, align 16, !tbaa !8
  br label %106

106:                                              ; preds = %172, %105
  %107 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %108 unwind label %125

108:                                              ; preds = %106
  %109 = xor i1 %107, true
  br i1 %109, label %110, label %173

110:                                              ; preds = %108
  %111 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %112 unwind label %125

112:                                              ; preds = %110
  %113 = load i32, ptr %111, align 4, !tbaa !8
  store i32 %113, ptr %3, align 4, !tbaa !8
  %114 = load i32, ptr %3, align 4, !tbaa !8
  %115 = load i32, ptr @n, align 4, !tbaa !8
  %116 = load i32, ptr @m, align 4, !tbaa !8
  %117 = add nsw i32 %115, %116
  %118 = add nsw i32 %117, 1
  %119 = icmp eq i32 %114, %118
  br i1 %119, label %120, label %129

120:                                              ; preds = %112
  br label %173

121:                                              ; preds = %97
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %11, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %186

125:                                              ; preds = %178, %173, %129, %110, %106
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %11, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %12, align 4
  br label %186

129:                                              ; preds = %112
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %130 unwind label %125

130:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %131

131:                                              ; preds = %169, %130
  %132 = load i32, ptr %13, align 4, !tbaa !8
  %133 = load i32, ptr @n, align 4, !tbaa !8
  %134 = load i32, ptr @m, align 4, !tbaa !8
  %135 = add nsw i32 %133, %134
  %136 = add nsw i32 %135, 1
  %137 = icmp sle i32 %132, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %172

139:                                              ; preds = %131
  %140 = load i32, ptr %13, align 4, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1002 x i32], ptr @l, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !8
  %144 = icmp slt i32 %143, 0
  br i1 %144, label %145, label %168

145:                                              ; preds = %139
  %146 = load i32, ptr %3, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %147
  %149 = load i32, ptr %13, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1002 x i32], ptr %148, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !8
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %168

154:                                              ; preds = %145
  %155 = load i32, ptr %3, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [1002 x i32], ptr @l, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !8
  %159 = add nsw i32 %158, 1
  %160 = load i32, ptr %13, align 4, !tbaa !8
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1002 x i32], ptr @l, i64 0, i64 %161
  store i32 %159, ptr %162, align 4, !tbaa !8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %163 unwind label %164

163:                                              ; preds = %154
  br label %168

164:                                              ; preds = %154
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %11, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %186

168:                                              ; preds = %163, %145, %139
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %13, align 4, !tbaa !8
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %13, align 4, !tbaa !8
  br label %131, !llvm.loop !15

172:                                              ; preds = %138
  br label %106, !llvm.loop !16

173:                                              ; preds = %120, %108
  %174 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %175 unwind label %125

175:                                              ; preds = %173
  br i1 %174, label %176, label %177

176:                                              ; preds = %175
  store i32 12, ptr %14, align 4
  br label %183

177:                                              ; preds = %175
  br label %178

178:                                              ; preds = %181, %177
  %179 = invoke noundef zeroext i1 @_Z3dfsi(i32 noundef 0)
          to label %180 unwind label %125

180:                                              ; preds = %178
  br i1 %179, label %181, label %182

181:                                              ; preds = %180
  br label %178, !llvm.loop !17

182:                                              ; preds = %180
  store i32 0, ptr %14, align 4
  br label %183

183:                                              ; preds = %182, %176
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #8
  %184 = load i32, ptr %14, align 4
  switch i32 %184, label %278 [
    i32 0, label %185
    i32 12, label %187
  ]

185:                                              ; preds = %183
  br label %96, !llvm.loop !18

186:                                              ; preds = %164, %125, %121
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #8
  br label %272

187:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !8
  br label %188

188:                                              ; preds = %223, %187
  %189 = load i32, ptr %16, align 4, !tbaa !8
  %190 = load i32, ptr @n, align 4, !tbaa !8
  %191 = icmp sle i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %226

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %194 = load i32, ptr @n, align 4, !tbaa !8
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %17, align 4, !tbaa !8
  br label %196

196:                                              ; preds = %219, %193
  %197 = load i32, ptr %17, align 4, !tbaa !8
  %198 = load i32, ptr @n, align 4, !tbaa !8
  %199 = load i32, ptr @m, align 4, !tbaa !8
  %200 = add nsw i32 %198, %199
  %201 = icmp sle i32 %197, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %196
  store i32 23, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %222

203:                                              ; preds = %196
  %204 = load i32, ptr %17, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %205
  %207 = load i32, ptr %16, align 4, !tbaa !8
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [1002 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !8
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %218

212:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17) #8
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %213 unwind label %214

213:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %218

214:                                              ; preds = %212
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %11, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %271

218:                                              ; preds = %213, %203
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %17, align 4, !tbaa !8
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %17, align 4, !tbaa !8
  br label %196, !llvm.loop !19

222:                                              ; preds = %202
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %16, align 4, !tbaa !8
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %16, align 4, !tbaa !8
  br label %188, !llvm.loop !20

226:                                              ; preds = %192
  %227 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %227)
          to label %229 unwind label %241

229:                                              ; preds = %226
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %228, i8 noundef signext 10)
          to label %231 unwind label %241

231:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store ptr %15, ptr %19, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %232 = load ptr, ptr %19, align 8, !tbaa !21
  %233 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %232) #8
  %234 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %235 = load ptr, ptr %19, align 8, !tbaa !21
  %236 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %235) #8
  %237 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %236, ptr %237, align 8
  br label %238

238:                                              ; preds = %263, %231
  %239 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %239, label %245, label %240

240:                                              ; preds = %238
  store i32 26, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %269

241:                                              ; preds = %229, %226
  %242 = landingpad { ptr, i32 }
          cleanup
  %243 = extractvalue { ptr, i32 } %242, 0
  store ptr %243, ptr %11, align 8
  %244 = extractvalue { ptr, i32 } %242, 1
  store i32 %244, ptr %12, align 4
  br label %271

245:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %246 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %246, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEEONSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %22) #8
  store ptr %247, ptr %23, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %248 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEEONSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %22) #8
  store ptr %248, ptr %24, align 8, !tbaa !21
  %249 = load ptr, ptr %23, align 8, !tbaa !21
  %250 = load i32, ptr %249, align 4, !tbaa !8
  %251 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %250)
          to label %252 unwind label %265

252:                                              ; preds = %245
  %253 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %251, i8 noundef signext 32)
          to label %254 unwind label %265

254:                                              ; preds = %252
  %255 = load ptr, ptr %24, align 8, !tbaa !21
  %256 = load i32, ptr %255, align 4, !tbaa !8
  %257 = load i32, ptr @n, align 4, !tbaa !8
  %258 = sub nsw i32 %256, %257
  %259 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %253, i32 noundef %258)
          to label %260 unwind label %265

260:                                              ; preds = %254
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %259, i8 noundef signext 10)
          to label %262 unwind label %265

262:                                              ; preds = %260
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %263

263:                                              ; preds = %262
  %264 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br label %238

265:                                              ; preds = %260, %254, %252, %245
  %266 = landingpad { ptr, i32 }
          cleanup
  %267 = extractvalue { ptr, i32 } %266, 0
  store ptr %267, ptr %11, align 8
  %268 = extractvalue { ptr, i32 } %266, 1
  store i32 %268, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %271

269:                                              ; preds = %240
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %270 = load i32, ptr %1, align 4
  ret i32 %270

271:                                              ; preds = %265, %241, %214
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  br label %272

272:                                              ; preds = %271, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %273

273:                                              ; preds = %272
  %274 = load ptr, ptr %11, align 8
  %275 = load i32, ptr %12, align 4
  %276 = insertvalue { ptr, i32 } poison, ptr %274, 0
  %277 = insertvalue { ptr, i32 } %276, i32 %275, 1
  resume { ptr, i32 } %277

278:                                              ; preds = %183
  unreachable
}

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 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)) #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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

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

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

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

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

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

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

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

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

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

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


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [1002 x i32], align 16
@g = external dso_local local_unnamed_addr global [1002 x [1002 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsi(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 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 %"class.std::queue", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::tuple", align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.std::tuple", align 8
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %24 = load i32, ptr @n, align 4, !tbaa !8
  %.not43 = icmp slt i32 %24, 1
  br i1 %.not43, label %.preheader42, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %25 = add nuw i32 %24, 1
  %wide.trip.count = zext i32 %25 to i64
  %26 = zext nneg i32 %24 to i64
  %min.iters.check = icmp ult i32 %24, 8
  br i1 %min.iters.check, label %.lr.ph.preheader92, label %vector.ph

.lr.ph.preheader92:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %26, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %27 = getelementptr inbounds [1002 x i32], ptr @g, i64 0, i64 %offset.idx
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <4 x i32>, ptr %27, align 4, !tbaa !8
  %wide.load89 = load <4 x i32>, ptr %28, align 4, !tbaa !8
  %29 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %30 = add nsw <4 x i32> %wide.load89, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %29, ptr %27, align 4, !tbaa !8
  store <4 x i32> %30, ptr %28, align 4, !tbaa !8
  %index.next = add nuw i64 %index, 8
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %26
  br i1 %cmp.n, label %.preheader42, label %.lr.ph.preheader92

.preheader42:                                     ; preds = %.lr.ph, %middle.block, %0
  %32 = load i32, ptr @m, align 4, !tbaa !8
  %.not26.not45 = icmp sgt i32 %32, 0
  br i1 %.not26.not45, label %.lr.ph47, label %.preheader41

.lr.ph47:                                         ; preds = %.preheader42
  %33 = add nsw i32 %32, %24
  %34 = add nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = sext i32 %24 to i64
  %37 = sext i32 %33 to i64
  br label %43

.lr.ph:                                           ; preds = %.lr.ph.preheader92, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader92 ]
  %38 = getelementptr inbounds [1002 x i32], ptr @g, i64 0, i64 %indvars.iv
  %39 = load i32, ptr %38, align 4, !tbaa !8
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader42, label %.lr.ph, !llvm.loop !15

.preheader41:                                     ; preds = %43, %.preheader42
  %41 = load i32, ptr %1, align 4, !tbaa !8
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph49, label %.preheader40.preheader

43:                                               ; preds = %.lr.ph47, %43
  %indvars.iv72 = phi i64 [ %36, %.lr.ph47 ], [ %indvars.iv.next73, %43 ]
  %indvars.iv.next73 = add nsw i64 %indvars.iv72, 1
  %44 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %indvars.iv.next73, i64 %35
  %45 = load i32, ptr %44, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !8
  %.not26.not = icmp slt i64 %indvars.iv.next73, %37
  br i1 %.not26.not, label %43, label %.preheader41, !llvm.loop !16

.lr.ph49:                                         ; preds = %.preheader41, %.lr.ph49
  %.01648 = phi i32 [ %58, %.lr.ph49 ], [ 0, %.preheader41 ]
  %47 = 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)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = load i32, ptr @n, align 4, !tbaa !8
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = add nsw i32 %52, %51
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %50, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %55, align 4, !tbaa !8
  %58 = add nuw nsw i32 %.01648, 1
  %59 = load i32, ptr %1, align 4, !tbaa !8
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %.lr.ph49, label %.preheader40.preheader, !llvm.loop !17

.preheader40.preheader:                           ; preds = %.lr.ph49, %.preheader41
  %.ph = phi i32 [ %24, %.preheader41 ], [ %51, %.lr.ph49 ]
  br label %.preheader40

.preheader40:                                     ; preds = %.preheader40.preheader, %114
  %61 = phi i32 [ %.pre, %114 ], [ %.ph, %.preheader40.preheader ]
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr @l, i64 %62
  %64 = load i32, ptr @m, align 4, !tbaa !8
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !8
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @l, ptr noundef nonnull %67, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #7
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %68 unwind label %77

68:                                               ; preds = %.preheader40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  store i32 0, ptr @l, align 16, !tbaa !8
  %69 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %69, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %68, %._crit_edge
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %71 = load i32, ptr %70, align 4, !tbaa !8
  store i32 %71, ptr %2, align 4, !tbaa !8
  %72 = load i32, ptr @n, align 4, !tbaa !8
  %73 = load i32, ptr @m, align 4, !tbaa !8
  %74 = add i32 %72, 1
  %75 = add i32 %74, %73
  %76 = icmp eq i32 %71, %75
  br i1 %76, label %._crit_edge55, label %81

77:                                               ; preds = %.preheader40
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %115

79:                                               ; preds = %.preheader
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %115

81:                                               ; preds = %.lr.ph54
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  %82 = load i32, ptr @n, align 4, !tbaa !8
  %83 = load i32, ptr @m, align 4, !tbaa !8
  %84 = add i32 %82, 1
  %85 = add i32 %84, %83
  %.not2750 = icmp slt i32 %85, 0
  br i1 %.not2750, label %._crit_edge, label %.lr.ph52

._crit_edge:                                      ; preds = %104, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %86 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %86, label %._crit_edge55, label %.lr.ph54, !llvm.loop !18

.lr.ph52:                                         ; preds = %81, %104
  %87 = phi i32 [ %105, %104 ], [ %83, %81 ]
  %88 = phi i32 [ %106, %104 ], [ %82, %81 ]
  %storemerge51 = phi i32 [ %108, %104 ], [ 0, %81 ]
  %89 = sext i32 %storemerge51 to i64
  %90 = getelementptr inbounds [1002 x i32], ptr @l, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = icmp slt i32 %91, 0
  br i1 %92, label %93, label %104

93:                                               ; preds = %.lr.ph52
  %94 = load i32, ptr %2, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %95, i64 %89
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %.not28 = icmp eq i32 %97, 0
  br i1 %.not28, label %104, label %98

98:                                               ; preds = %93
  %99 = getelementptr inbounds [1002 x i32], ptr @l, i64 0, i64 %95
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %90, align 4, !tbaa !8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %._crit_edge75 unwind label %102

._crit_edge75:                                    ; preds = %98
  %.pre76 = load i32, ptr %7, align 4, !tbaa !8
  %.pre77 = load i32, ptr @n, align 4, !tbaa !8
  %.pre78 = load i32, ptr @m, align 4, !tbaa !8
  br label %104

102:                                              ; preds = %98
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %115

104:                                              ; preds = %._crit_edge75, %.lr.ph52, %93
  %105 = phi i32 [ %.pre78, %._crit_edge75 ], [ %87, %.lr.ph52 ], [ %87, %93 ]
  %106 = phi i32 [ %.pre77, %._crit_edge75 ], [ %88, %.lr.ph52 ], [ %88, %93 ]
  %107 = phi i32 [ %.pre76, %._crit_edge75 ], [ %storemerge51, %.lr.ph52 ], [ %storemerge51, %93 ]
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %7, align 4, !tbaa !8
  %109 = add i32 %106, 1
  %110 = add i32 %109, %105
  %.not27.not = icmp slt i32 %107, %110
  br i1 %.not27.not, label %.lr.ph52, label %._crit_edge, !llvm.loop !19

._crit_edge55:                                    ; preds = %._crit_edge, %.lr.ph54, %68
  %111 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %111, label %116, label %.preheader

.preheader:                                       ; preds = %._crit_edge55, %113
  %112 = invoke noundef zeroext i1 @_Z3dfsi(i32 noundef 0)
          to label %113 unwind label %79

113:                                              ; preds = %.preheader
  br i1 %112, label %.preheader, label %114, !llvm.loop !20

114:                                              ; preds = %113
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #7
  %.pre = load i32, ptr @n, align 4, !tbaa !8
  br label %.preheader40

115:                                              ; preds = %102, %79, %77
  %.pn = phi { ptr, i32 } [ %80, %79 ], [ %103, %102 ], [ %78, %77 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #7
  br label %175

116:                                              ; preds = %._crit_edge55
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  %117 = load i32, ptr @n, align 4, !tbaa !8
  %.not3164 = icmp slt i32 %117, 1
  br i1 %.not3164, label %._crit_edge67, label %.lr.ph66.preheader

.lr.ph66.preheader:                               ; preds = %116
  %.pre80 = load i32, ptr @m, align 4, !tbaa !8
  br label %.lr.ph66

._crit_edge67:                                    ; preds = %._crit_edge63, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %118 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %118)
          to label %146 unwind label %152

.lr.ph66:                                         ; preds = %.lr.ph66.preheader, %._crit_edge63
  %120 = phi i32 [ %117, %.lr.ph66.preheader ], [ %124, %._crit_edge63 ]
  %121 = phi i32 [ 1, %.lr.ph66.preheader ], [ %128, %._crit_edge63 ]
  %122 = phi i32 [ %.pre80, %.lr.ph66.preheader ], [ %126, %._crit_edge63 ]
  %123 = phi i32 [ %.pre80, %.lr.ph66.preheader ], [ %127, %._crit_edge63 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %storemerge3258 = add nsw i32 %120, 1
  store i32 %storemerge3258, ptr %10, align 4, !tbaa !8
  %.not33.not59 = icmp sgt i32 %123, 0
  br i1 %.not33.not59, label %.lr.ph62, label %._crit_edge63

._crit_edge63.loopexit:                           ; preds = %141
  %.pre84 = load i32, ptr %9, align 4, !tbaa !8
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.lr.ph66
  %124 = phi i32 [ %142, %._crit_edge63.loopexit ], [ %120, %.lr.ph66 ]
  %125 = phi i32 [ %.pre84, %._crit_edge63.loopexit ], [ %121, %.lr.ph66 ]
  %126 = phi i32 [ %143, %._crit_edge63.loopexit ], [ %122, %.lr.ph66 ]
  %127 = phi i32 [ %143, %._crit_edge63.loopexit ], [ %123, %.lr.ph66 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %128 = add nsw i32 %125, 1
  store i32 %128, ptr %9, align 4, !tbaa !8
  %.not31.not = icmp slt i32 %125, %124
  br i1 %.not31.not, label %.lr.ph66, label %._crit_edge67, !llvm.loop !21

.lr.ph62:                                         ; preds = %.lr.ph66, %141
  %129 = phi i32 [ %142, %141 ], [ %120, %.lr.ph66 ]
  %130 = phi i32 [ %143, %141 ], [ %122, %.lr.ph66 ]
  %131 = phi i32 [ %144, %141 ], [ %120, %.lr.ph66 ]
  %storemerge3260 = phi i32 [ %storemerge32, %141 ], [ %storemerge3258, %.lr.ph66 ]
  %132 = sext i32 %storemerge3260 to i64
  %133 = load i32, ptr %9, align 4, !tbaa !8
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1002 x [1002 x i32]], ptr @g, i64 0, i64 %132, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !8
  %.not34 = icmp eq i32 %136, 0
  br i1 %.not34, label %141, label %137

137:                                              ; preds = %.lr.ph62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %138 unwind label %139

138:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %storemerge32.in.pre = load i32, ptr %10, align 4, !tbaa !8
  %.pre82 = load i32, ptr @n, align 4, !tbaa !8
  %.pre83 = load i32, ptr @m, align 4, !tbaa !8
  br label %141

139:                                              ; preds = %137
  %140 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %174

141:                                              ; preds = %.lr.ph62, %138
  %142 = phi i32 [ %129, %.lr.ph62 ], [ %.pre82, %138 ]
  %143 = phi i32 [ %130, %.lr.ph62 ], [ %.pre83, %138 ]
  %144 = phi i32 [ %131, %.lr.ph62 ], [ %.pre82, %138 ]
  %storemerge32.in = phi i32 [ %storemerge3260, %.lr.ph62 ], [ %storemerge32.in.pre, %138 ]
  %storemerge32 = add nsw i32 %storemerge32.in, 1
  store i32 %storemerge32, ptr %10, align 4, !tbaa !8
  %145 = add nsw i32 %143, %144
  %.not33.not = icmp slt i32 %storemerge32.in, %145
  br i1 %.not33.not, label %.lr.ph62, label %._crit_edge63.loopexit, !llvm.loop !22

146:                                              ; preds = %._crit_edge67
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %119, i8 noundef signext 10)
          to label %148 unwind label %152

148:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %149 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  store ptr %149, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %150 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  store ptr %150, ptr %13, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %151, label %.lr.ph69, label %._crit_edge70

._crit_edge70:                                    ; preds = %169, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

152:                                              ; preds = %146, %._crit_edge67
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %174

.lr.ph69:                                         ; preds = %148, %169
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %154 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %155 = load i64, ptr %154, align 4
  store i64 %155, ptr %14, align 8
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEEONSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %14) #7
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEEONSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %14) #7
  %158 = load i32, ptr %156, align 4, !tbaa !8
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %158)
          to label %160 unwind label %172

160:                                              ; preds = %.lr.ph69
  %161 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %159, i8 noundef signext 32)
          to label %162 unwind label %172

162:                                              ; preds = %160
  %163 = load i32, ptr %157, align 4, !tbaa !8
  %164 = load i32, ptr @n, align 4, !tbaa !8
  %165 = sub nsw i32 %163, %164
  %166 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %161, i32 noundef %165)
          to label %167 unwind label %172

167:                                              ; preds = %162
  %168 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %166, i8 noundef signext 10)
          to label %169 unwind label %172

169:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %171 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJiiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %171, label %.lr.ph69, label %._crit_edge70

172:                                              ; preds = %167, %162, %160, %.lr.ph69
  %173 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %174

174:                                              ; preds = %172, %152, %139
  %.pn35 = phi { ptr, i32 } [ %140, %139 ], [ %173, %172 ], [ %153, %152 ]
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  br label %175

175:                                              ; preds = %174, %115
  %.pn35.pn = phi { ptr, i32 } [ %.pn35, %174 ], [ %.pn, %115 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn35.pn
}

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

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

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 #4

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 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 #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

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

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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