; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Morgan Stanley/Morgan Stanley 2015/Problem D (D)

; 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::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" }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@in = external dso_local global [10100 x i32], align 16
@out = external dso_local global [10100 x i32], align 16
@v = external dso_local global [10100 x i32], align 16
@c = external dso_local global [10100 x i64], align 16
@dp = external dso_local global [10100 x [310 x i64]], align 16
@inf = external dso_local global i64, align 8
@g = external dso_local global [10100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %27

27:                                               ; preds = %397, %0
  %28 = load i32, ptr @t, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr @t, align 4, !tbaa !5
  %30 = icmp ne i32 %28, 0
  br i1 %30, label %31, label %400

31:                                               ; preds = %27
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %81, %31
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %40
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i64, ptr @c, i64 %43
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %44)
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [10100 x i32], ptr @out, i64 0, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %50
  store i32 0, ptr %51, align 4, !tbaa !5
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %69, %38
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr @k, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %72

60:                                               ; preds = %55
  %61 = load i64, ptr @inf, align 8, !tbaa !9
  %62 = sub nsw i64 0, %61
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [310 x i64], ptr %65, i64 0, i64 %67
  store i64 %62, ptr %68, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %60
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %4, align 4, !tbaa !5
  br label %55, !llvm.loop !11

72:                                               ; preds = %59
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %78
  %80 = getelementptr inbounds [310 x i64], ptr %79, i64 0, i64 0
  store i64 %76, ptr %80, align 16, !tbaa !9
  br label %81

81:                                               ; preds = %72
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %2, align 4, !tbaa !5
  br label %33, !llvm.loop !13

84:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %105, %84
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %108

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %91 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %6, ptr noundef %7)
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %93
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10100 x i32], ptr @out, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %97, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %102, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %105

105:                                              ; preds = %90
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %5, align 4, !tbaa !5
  br label %85, !llvm.loop !14

108:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %138, %108
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr @n, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %141

114:                                              ; preds = %109
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %137

120:                                              ; preds = %114
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %121 unwind label %133

121:                                              ; preds = %120
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i32, ptr @m, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = mul nsw i64 %125, %127
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %130
  %132 = getelementptr inbounds [310 x i64], ptr %131, i64 0, i64 1
  store i64 %128, ptr %132, align 8, !tbaa !9
  br label %137

133:                                              ; preds = %120
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %10, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %399

137:                                              ; preds = %121, %114
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !5
  br label %109, !llvm.loop !15

141:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %142 = load i64, ptr @inf, align 8, !tbaa !9
  %143 = sub nsw i64 0, %142
  store i64 %143, ptr %12, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %363, %361, %141
  %145 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %146 unwind label %159

146:                                              ; preds = %144
  %147 = xor i1 %145, true
  br i1 %147, label %148, label %365

148:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %149 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %150 unwind label %163

150:                                              ; preds = %148
  %151 = load i32, ptr %149, align 4, !tbaa !5
  store i32 %151, ptr %13, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %152 unwind label %163

152:                                              ; preds = %150
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %167

158:                                              ; preds = %152
  store i32 16, ptr %3, align 4
  br label %361, !llvm.loop !16

159:                                              ; preds = %394, %144
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %10, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %11, align 4
  br label %398

163:                                              ; preds = %150, %148
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %10, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %11, align 4
  br label %364

167:                                              ; preds = %152
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %169
  store i32 1, ptr %170, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %186, %167
  %172 = load i32, ptr %14, align 4, !tbaa !5
  %173 = load i32, ptr @k, align 4, !tbaa !5
  %174 = icmp sle i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 18, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %193

176:                                              ; preds = %171
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %178
  %180 = load i32, ptr %14, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [310 x i64], ptr %179, i64 0, i64 %181
  %183 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %182)
          to label %184 unwind label %189

184:                                              ; preds = %176
  %185 = load i64, ptr %183, align 8, !tbaa !9
  store i64 %185, ptr %12, align 8, !tbaa !9
  br label %186

186:                                              ; preds = %184
  %187 = load i32, ptr %14, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %14, align 4, !tbaa !5
  br label %171, !llvm.loop !17

189:                                              ; preds = %176
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %10, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %364

193:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %215, %193
  %195 = load i32, ptr %15, align 4, !tbaa !5
  %196 = load i32, ptr @k, align 4, !tbaa !5
  %197 = icmp sle i32 %195, %196
  br i1 %197, label %199, label %198

198:                                              ; preds = %194
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %222

199:                                              ; preds = %194
  %200 = load i32, ptr %13, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %201
  %203 = load i32, ptr %15, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [310 x i64], ptr %202, i64 0, i64 %204
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !9
  %206 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %205, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %207 unwind label %218

207:                                              ; preds = %199
  %208 = load i64, ptr %206, align 8, !tbaa !9
  %209 = load i32, ptr %13, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %210
  %212 = load i32, ptr %15, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [310 x i64], ptr %211, i64 0, i64 %213
  store i64 %208, ptr %214, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %215

215:                                              ; preds = %207
  %216 = load i32, ptr %15, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %15, align 4, !tbaa !5
  br label %194, !llvm.loop !18

218:                                              ; preds = %199
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %10, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %364

222:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %223 = load i32, ptr %13, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %224
  %226 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %225) #6
  %227 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %226, ptr %227, align 8
  br label %228

228:                                              ; preds = %356, %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %230
  %232 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %231) #6
  %233 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  %234 = 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) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br i1 %234, label %236, label %235

235:                                              ; preds = %228
  store i32 24, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %360

236:                                              ; preds = %228
  %237 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %244

243:                                              ; preds = %236
  br label %356

244:                                              ; preds = %236
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %247
  %249 = getelementptr inbounds [310 x i64], ptr %248, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %250 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %252
  %254 = load i64, ptr %253, align 8, !tbaa !9
  %255 = load i32, ptr %13, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %256
  %258 = getelementptr inbounds [310 x i64], ptr %257, i64 0, i64 0
  %259 = load i64, ptr %258, align 16, !tbaa !9
  %260 = add nsw i64 %254, %259
  store i64 %260, ptr %19, align 8, !tbaa !9
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %249, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %262 unwind label %274

262:                                              ; preds = %244
  %263 = load i64, ptr %261, align 8, !tbaa !9
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %266
  %268 = getelementptr inbounds [310 x i64], ptr %267, i64 0, i64 0
  store i64 %263, ptr %268, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %328, %262
  %270 = load i32, ptr %20, align 4, !tbaa !5
  %271 = load i32, ptr @k, align 4, !tbaa !5
  %272 = icmp sle i32 %270, %271
  br i1 %272, label %278, label %273

273:                                              ; preds = %269
  store i32 27, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %335

274:                                              ; preds = %244
  %275 = landingpad { ptr, i32 }
          cleanup
  %276 = extractvalue { ptr, i32 } %275, 0
  store ptr %276, ptr %10, align 8
  %277 = extractvalue { ptr, i32 } %275, 1
  store i32 %277, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %359

278:                                              ; preds = %269
  %279 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %281
  %283 = load i32, ptr %20, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [310 x i64], ptr %282, i64 0, i64 %284
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %287
  %289 = load i32, ptr %20, align 4, !tbaa !5
  %290 = sub nsw i32 %289, 1
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [310 x i64], ptr %288, i64 0, i64 %291
  %293 = load i64, ptr %292, align 8, !tbaa !9
  %294 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %296
  %298 = load i64, ptr %297, align 8, !tbaa !9
  %299 = load i32, ptr @m, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = mul nsw i64 %298, %300
  %302 = add nsw i64 %293, %301
  store i64 %302, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %303 = load i32, ptr %13, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %304
  %306 = load i32, ptr %20, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [310 x i64], ptr %305, i64 0, i64 %307
  %309 = load i64, ptr %308, align 8, !tbaa !9
  %310 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %312
  %314 = load i64, ptr %313, align 8, !tbaa !9
  %315 = add nsw i64 %309, %314
  store i64 %315, ptr %22, align 8, !tbaa !9
  %316 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %317 unwind label %331

317:                                              ; preds = %278
  %318 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %285, ptr noundef nonnull align 8 dereferenceable(8) %316)
          to label %319 unwind label %331

319:                                              ; preds = %317
  %320 = load i64, ptr %318, align 8, !tbaa !9
  %321 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %322 = load i32, ptr %321, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %323
  %325 = load i32, ptr %20, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [310 x i64], ptr %324, i64 0, i64 %326
  store i64 %320, ptr %327, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %328

328:                                              ; preds = %319
  %329 = load i32, ptr %20, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %20, align 4, !tbaa !5
  br label %269, !llvm.loop !19

331:                                              ; preds = %317, %278
  %332 = landingpad { ptr, i32 }
          cleanup
  %333 = extractvalue { ptr, i32 } %332, 0
  store ptr %333, ptr %10, align 8
  %334 = extractvalue { ptr, i32 } %332, 1
  store i32 %334, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %359

335:                                              ; preds = %273
  %336 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %337 = load i32, ptr %336, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !5
  %341 = add nsw i32 %340, -1
  store i32 %341, ptr %339, align 4, !tbaa !5
  %342 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %343 = load i32, ptr %342, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %344
  %346 = load i32, ptr %345, align 4, !tbaa !5
  %347 = icmp eq i32 %346, 0
  br i1 %347, label %348, label %355

348:                                              ; preds = %335
  %349 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %349)
          to label %350 unwind label %351

350:                                              ; preds = %348
  br label %355

351:                                              ; preds = %348
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %10, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %11, align 4
  br label %359

355:                                              ; preds = %350, %335
  br label %356

356:                                              ; preds = %355, %243
  %357 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 0) #6
  %358 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %357, ptr %358, align 8
  br label %228, !llvm.loop !20

359:                                              ; preds = %351, %331, %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %364

360:                                              ; preds = %235
  store i32 0, ptr %3, align 4
  br label %361

361:                                              ; preds = %360, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %362 = load i32, ptr %3, align 4
  switch i32 %362, label %406 [
    i32 0, label %363
    i32 16, label %144
  ]

363:                                              ; preds = %361
  br label %144, !llvm.loop !16

364:                                              ; preds = %359, %218, %189, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %398

365:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %366

366:                                              ; preds = %387, %365
  %367 = load i32, ptr %24, align 4, !tbaa !5
  %368 = load i32, ptr @n, align 4, !tbaa !5
  %369 = icmp slt i32 %367, %368
  br i1 %369, label %371, label %370

370:                                              ; preds = %366
  store i32 30, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %394

371:                                              ; preds = %366
  %372 = load i32, ptr %24, align 4, !tbaa !5
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %373
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %375 = load i32, ptr %24, align 4, !tbaa !5
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %376
  %378 = load i64, ptr %377, align 8, !tbaa !9
  %379 = load i32, ptr @m, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = mul nsw i64 %378, %380
  store i64 %381, ptr %25, align 8, !tbaa !9
  %382 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %374, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %383 unwind label %390

383:                                              ; preds = %371
  %384 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %382)
          to label %385 unwind label %390

385:                                              ; preds = %383
  %386 = load i64, ptr %384, align 8, !tbaa !9
  store i64 %386, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %387

387:                                              ; preds = %385
  %388 = load i32, ptr %24, align 4, !tbaa !5
  %389 = add nsw i32 %388, 1
  store i32 %389, ptr %24, align 4, !tbaa !5
  br label %366, !llvm.loop !21

390:                                              ; preds = %383, %371
  %391 = landingpad { ptr, i32 }
          cleanup
  %392 = extractvalue { ptr, i32 } %391, 0
  store ptr %392, ptr %10, align 8
  %393 = extractvalue { ptr, i32 } %391, 1
  store i32 %393, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %398

394:                                              ; preds = %370
  %395 = load i64, ptr %12, align 8, !tbaa !9
  %396 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %395)
          to label %397 unwind label %159

397:                                              ; preds = %394
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  br label %27, !llvm.loop !22

398:                                              ; preds = %390, %364, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %399

399:                                              ; preds = %398, %133
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  br label %401

400:                                              ; preds = %27
  ret i32 0

401:                                              ; preds = %399
  %402 = load ptr, ptr %10, align 8
  %403 = load i32, ptr %11, align 4
  %404 = insertvalue { ptr, i32 } poison, ptr %402, 0
  %405 = insertvalue { ptr, i32 } %404, i32 %403, 1
  resume { ptr, i32 } %405

406:                                              ; preds = %361
  unreachable
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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)) #4 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; 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)) #3 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !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 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


; 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::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" }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@in = external dso_local local_unnamed_addr global [10100 x i32], align 16
@out = external dso_local local_unnamed_addr global [10100 x i32], align 16
@v = external dso_local local_unnamed_addr global [10100 x i32], align 16
@c = external dso_local global [10100 x i64], align 16
@dp = external dso_local global [10100 x [310 x i64]], align 16
@inf = external dso_local local_unnamed_addr global i64, align 8
@g = external dso_local global [10100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; 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 %"class.std::queue", align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @t, align 4, !tbaa !5
  %.not94 = icmp eq i32 %14, 0
  br i1 %.not94, label %._crit_edge97, label %.lr.ph96

.lr.ph96:                                         ; preds = %0, %._crit_edge93
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph65, label %._crit_edge68

.preheader60:                                     ; preds = %._crit_edge
  %19 = icmp sgt i32 %36, 1
  br i1 %19, label %.lr.ph67, label %._crit_edge68

.lr.ph65:                                         ; preds = %.lr.ph96, %._crit_edge
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %._crit_edge ], [ 0, %.lr.ph96 ]
  %20 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv99
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %21 = getelementptr inbounds i64, ptr @c, i64 %indvars.iv99
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %21)
  %23 = getelementptr inbounds [10100 x i32], ptr @out, i64 0, i64 %indvars.iv99
  store i32 0, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %indvars.iv99
  store i32 0, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %indvars.iv99
  store i32 0, ptr %25, align 4, !tbaa !5
  %26 = load i32, ptr @k, align 4, !tbaa !5
  %.not5861 = icmp slt i32 %26, 1
  br i1 %.not5861, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph65
  %27 = load i64, ptr @inf, align 8, !tbaa !9
  %28 = sub nsw i64 0, %27
  %29 = add nuw i32 %26, 1
  %wide.trip.count = zext i32 %29 to i64
  %30 = zext nneg i32 %26 to i64
  %min.iters.check = icmp ult i32 %26, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %30, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %28, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  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
  %31 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %offset.idx
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store <2 x i64> %broadcast.splat, ptr %31, align 8, !tbaa !9
  store <2 x i64> %broadcast.splat, ptr %32, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %30
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.lr.ph65
  %34 = load i64, ptr %21, align 8, !tbaa !9
  %35 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %indvars.iv99
  store i64 %34, ptr %35, align 16, !tbaa !9
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next100, %37
  br i1 %38, label %.lr.ph65, label %.preheader60, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %39 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %indvars.iv
  store i64 %28, ptr %39, align 8, !tbaa !9
  %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 %._crit_edge, label %scalar.ph, !llvm.loop !16

._crit_edge68:                                    ; preds = %.lr.ph67, %.lr.ph96, %.preheader60
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph71, label %._crit_edge72

.lr.ph67:                                         ; preds = %.preheader60, %.lr.ph67
  %.04966 = phi i32 [ %56, %.lr.ph67 ], [ 1, %.preheader60 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %44
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [10100 x i32], ptr @out, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %56 = add nuw nsw i32 %.04966, 1
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %.lr.ph67, label %._crit_edge68, !llvm.loop !17

._crit_edge72:                                    ; preds = %79, %._crit_edge68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %59 = load i64, ptr @inf, align 8, !tbaa !9
  %60 = sub nsw i64 0, %59
  store i64 %60, ptr %5, align 8, !tbaa !9
  %61 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %61, label %.preheader59, label %.lr.ph90

.lr.ph71:                                         ; preds = %._crit_edge68, %79
  %62 = phi i32 [ %80, %79 ], [ %40, %._crit_edge68 ]
  %storemerge69 = phi i32 [ %82, %79 ], [ 0, %._crit_edge68 ]
  %63 = sext i32 %storemerge69 to i64
  %64 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %79

67:                                               ; preds = %.lr.ph71
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %68 unwind label %77

68:                                               ; preds = %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = mul nsw i64 %72, %74
  %76 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %70, i64 1
  store i64 %75, ptr %76, align 8, !tbaa !9
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %79

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

79:                                               ; preds = %.lr.ph71, %68
  %80 = phi i32 [ %62, %.lr.ph71 ], [ %.pre, %68 ]
  %81 = phi i32 [ %storemerge69, %.lr.ph71 ], [ %69, %68 ]
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %4, align 4, !tbaa !5
  %83 = icmp slt i32 %82, %80
  br i1 %83, label %.lr.ph71, label %._crit_edge72, !llvm.loop !18

.preheader59:                                     ; preds = %186, %._crit_edge72
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph92, label %.preheader59.._crit_edge93_crit_edge

.preheader59.._crit_edge93_crit_edge:             ; preds = %.preheader59
  %.pre114 = load i64, ptr %5, align 8, !tbaa !9
  br label %._crit_edge93

.lr.ph90:                                         ; preds = %._crit_edge72, %186
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %87 = load i32, ptr %86, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %.not52 = icmp eq i32 %90, 0
  br i1 %.not52, label %91, label %186, !llvm.loop !19

91:                                               ; preds = %.lr.ph90
  store i32 1, ptr %89, align 4, !tbaa !5
  %92 = load i32, ptr @k, align 4, !tbaa !5
  %.not5373 = icmp slt i32 %92, 0
  br i1 %.not5373, label %._crit_edge80, label %.lr.ph76

.preheader:                                       ; preds = %.lr.ph76
  %.not5477 = icmp slt i32 %96, 0
  br i1 %.not5477, label %._crit_edge80, label %.lr.ph79

.lr.ph76:                                         ; preds = %91, %.lr.ph76
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.lr.ph76 ], [ 0, %91 ]
  %93 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %88, i64 %indvars.iv102
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load i64, ptr %94, align 8, !tbaa !9
  store i64 %95, ptr %5, align 8, !tbaa !9
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %96 = load i32, ptr @k, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %.not53.not = icmp slt i64 %indvars.iv102, %97
  br i1 %.not53.not, label %.lr.ph76, label %.preheader, !llvm.loop !20

._crit_edge80:                                    ; preds = %.lr.ph79, %91, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %98 = getelementptr inbounds [10100 x %"class.std::vector"], ptr @g, i64 0, i64 %88
  %99 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  store ptr %99, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %100 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  store ptr %100, ptr %8, align 8
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br i1 %101, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %._crit_edge80
  %102 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %88
  br label %108

.lr.ph79:                                         ; preds = %.preheader, %.lr.ph79
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph79 ], [ 0, %.preheader ]
  %103 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %88, i64 %indvars.iv105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %105 = load i64, ptr %104, align 8, !tbaa !9
  store i64 %105, ptr %103, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %106 = load i32, ptr @k, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %.not54.not = icmp slt i64 %indvars.iv105, %107
  br i1 %.not54.not, label %.lr.ph79, label %._crit_edge80, !llvm.loop !21

._crit_edge88:                                    ; preds = %182, %._crit_edge80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %186

108:                                              ; preds = %.lr.ph87, %182
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10100 x i32], ptr @v, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %.not55 = icmp eq i32 %113, 0
  br i1 %.not55, label %114, label %182

114:                                              ; preds = %108
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %117
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = load i64, ptr %102, align 16, !tbaa !9
  %125 = add nsw i64 %124, %123
  store i64 %125, ptr %9, align 8, !tbaa !9
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %130
  store i64 %127, ptr %131, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %132 = load i32, ptr @k, align 4, !tbaa !5
  %.not5681 = icmp slt i32 %132, 1
  br i1 %.not5681, label %._crit_edge85, label %.lr.ph84

._crit_edge85:                                    ; preds = %.lr.ph84, %114
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %137, -1
  store i32 %138, ptr %136, align 4, !tbaa !5
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [10100 x i32], ptr @in, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %178, label %182

.lr.ph84:                                         ; preds = %114, %.lr.ph84
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph84 ], [ 1, %114 ]
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %147, i64 %indvars.iv108
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %149 = add nsw i64 %indvars.iv108, -1
  %150 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %88, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !9
  %157 = load i32, ptr @m, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = mul nsw i64 %156, %158
  %160 = add nsw i64 %159, %151
  store i64 %160, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %161 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %88, i64 %indvars.iv108
  %162 = load i64, ptr %161, align 8, !tbaa !9
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = add nsw i64 %167, %162
  store i64 %168, ptr %11, align 8, !tbaa !9
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef nonnull align 8 dereferenceable(8) %169)
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [10100 x [310 x i64]], ptr @dp, i64 0, i64 %174, i64 %indvars.iv108
  store i64 %171, ptr %175, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %176 = load i32, ptr @k, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %.not56.not = icmp slt i64 %indvars.iv108, %177
  br i1 %.not56.not, label %.lr.ph84, label %._crit_edge85, !llvm.loop !22

178:                                              ; preds = %._crit_edge85
  %179 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %179)
          to label %182 unwind label %180

180:                                              ; preds = %178
  %181 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %203

182:                                              ; preds = %._crit_edge85, %178, %108
  %183 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %184 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  store ptr %184, ptr %8, align 8
  %185 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br i1 %185, label %108, label %._crit_edge88, !llvm.loop !23

186:                                              ; preds = %.lr.ph90, %._crit_edge88
  %187 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %187, label %.preheader59, label %.lr.ph90

._crit_edge93:                                    ; preds = %.lr.ph92, %.preheader59.._crit_edge93_crit_edge
  %188 = phi i64 [ %.pre114, %.preheader59.._crit_edge93_crit_edge ], [ %199, %.lr.ph92 ]
  %189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %188)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  %190 = load i32, ptr @t, align 4, !tbaa !5
  %191 = add nsw i32 %190, -1
  store i32 %191, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %190, 0
  br i1 %.not, label %._crit_edge97, label %.lr.ph96, !llvm.loop !24

.lr.ph92:                                         ; preds = %.preheader59, %.lr.ph92
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.lr.ph92 ], [ 0, %.preheader59 ]
  %192 = getelementptr inbounds [10100 x i64], ptr @c, i64 0, i64 %indvars.iv111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %193 = load i64, ptr %192, align 8, !tbaa !9
  %194 = load i32, ptr @m, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = mul nsw i64 %193, %195
  store i64 %196, ptr %12, align 8, !tbaa !9
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %192, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %197)
  %199 = load i64, ptr %198, align 8, !tbaa !9
  store i64 %199, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %200 = load i32, ptr @n, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = icmp slt i64 %indvars.iv.next112, %201
  br i1 %202, label %.lr.ph92, label %._crit_edge93, !llvm.loop !25

203:                                              ; preds = %180, %77
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %181, %180 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn

._crit_edge97:                                    ; preds = %._crit_edge93, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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) #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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 #4 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

; 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 #3 align 2

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

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

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

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

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

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


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