; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/Educational 14/Problem F (F2)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [3000002 x i32], align 16
@b = external dso_local global [3000002 x i64], align 16
@ans = external dso_local global [3000002 x i64], align 16
@v = external dso_local global [3000002 x %"class.std::vector"], align 16
@q = external dso_local global [3000002 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %37, %0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %40

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %37

37:                                               ; preds = %30
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

40:                                               ; preds = %29
  %41 = load i32, ptr getelementptr inbounds ([3000002 x i32], ptr @a, i64 0, i64 3000001), align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  store i64 %42, ptr getelementptr inbounds ([3000002 x i64], ptr @b, i64 0, i64 3000001), align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 3000000, ptr %4, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %66, %40
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = icmp sge i32 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %69

47:                                               ; preds = %43
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %54
  store i64 %52, ptr %55, align 8, !tbaa !11
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = add nsw i64 %64, %60
  store i64 %65, ptr %63, align 8, !tbaa !11
  br label %66

66:                                               ; preds = %47
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %4, align 4, !tbaa !5
  br label %43, !llvm.loop !13

69:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %105, %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 3000002
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %70
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %104

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  store i64 %85, ptr %8, align 8, !tbaa !11
  %86 = load i64, ptr %7, align 8, !tbaa !11
  %87 = load i64, ptr %8, align 8, !tbaa !11
  %88 = icmp sle i64 %86, %87
  br i1 %88, label %89, label %94

89:                                               ; preds = %80
  %90 = load i64, ptr %7, align 8, !tbaa !11
  %91 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = sub nsw i64 %92, 1
  br label %98

94:                                               ; preds = %80
  %95 = load i64, ptr %7, align 8, !tbaa !11
  %96 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %94, %89
  %99 = phi i64 [ %93, %89 ], [ %97, %94 ]
  %100 = load i64, ptr %8, align 8, !tbaa !11
  %101 = mul nsw i64 %99, %100
  %102 = load i64, ptr %5, align 8, !tbaa !11
  %103 = add nsw i64 %102, %101
  store i64 %103, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %104

104:                                              ; preds = %98, %74
  br label %105

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

108:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  %109 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %122, %108
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr @m, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %125

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %116 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11)
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @q, i64 0, i64 %118
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %119, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %122

122:                                              ; preds = %115
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !5
  br label %110, !llvm.loop !15

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

126:                                              ; preds = %152, %125
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = icmp slt i32 %127, 3000002
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %155

130:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %131 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %131, ptr %14, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %147, %130
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = icmp slt i32 %133, 3000002
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %151

136:                                              ; preds = %132
  %137 = load i32, ptr %12, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %146

142:                                              ; preds = %136
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @v, i64 0, i64 %144
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %145, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br label %146

146:                                              ; preds = %142, %136
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = load i32, ptr %14, align 4, !tbaa !5
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr %14, align 4, !tbaa !5
  br label %132, !llvm.loop !16

151:                                              ; preds = %135
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %12, align 4, !tbaa !5
  br label %126, !llvm.loop !17

155:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %270, %155
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = icmp sle i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %273

161:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %266, %161
  %163 = load i32, ptr %17, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @q, i64 0, i64 %166
  %168 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %167) #6
  %169 = icmp ult i64 %164, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %162
  store i32 23, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %269

171:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %172 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %172, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %173 = load i32, ptr %16, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @q, i64 0, i64 %174
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %175, i64 noundef %177) #6
  %179 = load i32, ptr %178, align 4, !tbaa !5
  store i32 %179, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  br label %180

180:                                              ; preds = %258, %171
  %181 = load i32, ptr %15, align 4, !tbaa !5
  %182 = load i32, ptr %18, align 4, !tbaa !5
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %184, label %261

184:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %255, %184
  %186 = load i32, ptr %22, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = load i32, ptr %15, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @v, i64 0, i64 %189
  %191 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %190) #6
  %192 = icmp ult i64 %187, %191
  br i1 %192, label %194, label %193

193:                                              ; preds = %185
  store i32 28, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %258

194:                                              ; preds = %185
  %195 = load i32, ptr %15, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @v, i64 0, i64 %196
  %198 = load i32, ptr %22, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %197, i64 noundef %199) #6
  %201 = load i32, ptr %200, align 4, !tbaa !5
  store i32 %201, ptr %20, align 4, !tbaa !5
  %202 = load i32, ptr %15, align 4, !tbaa !5
  %203 = load i32, ptr %20, align 4, !tbaa !5
  %204 = sdiv i32 %202, %203
  store i32 %204, ptr %21, align 4, !tbaa !5
  %205 = load i32, ptr %21, align 4, !tbaa !5
  %206 = load i32, ptr %20, align 4, !tbaa !5
  %207 = icmp sle i32 %205, %206
  br i1 %207, label %208, label %214

208:                                              ; preds = %194
  %209 = load i32, ptr %21, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !11
  %213 = sub nsw i64 %212, 1
  br label %219

214:                                              ; preds = %194
  %215 = load i32, ptr %21, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !11
  br label %219

219:                                              ; preds = %214, %208
  %220 = phi i64 [ %213, %208 ], [ %218, %214 ]
  %221 = load i32, ptr %20, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = mul nsw i64 %220, %225
  %227 = load i64, ptr %5, align 8, !tbaa !11
  %228 = sub nsw i64 %227, %226
  store i64 %228, ptr %5, align 8, !tbaa !11
  %229 = load i32, ptr %21, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %21, align 4, !tbaa !5
  %231 = load i32, ptr %21, align 4, !tbaa !5
  %232 = load i32, ptr %20, align 4, !tbaa !5
  %233 = icmp sle i32 %231, %232
  br i1 %233, label %234, label %240

234:                                              ; preds = %219
  %235 = load i32, ptr %21, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %236
  %238 = load i64, ptr %237, align 8, !tbaa !11
  %239 = sub nsw i64 %238, 1
  br label %245

240:                                              ; preds = %219
  %241 = load i32, ptr %21, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %242
  %244 = load i64, ptr %243, align 8, !tbaa !11
  br label %245

245:                                              ; preds = %240, %234
  %246 = phi i64 [ %239, %234 ], [ %244, %240 ]
  %247 = load i32, ptr %20, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = mul nsw i64 %246, %251
  %253 = load i64, ptr %5, align 8, !tbaa !11
  %254 = add nsw i64 %253, %252
  store i64 %254, ptr %5, align 8, !tbaa !11
  br label %255

255:                                              ; preds = %245
  %256 = load i32, ptr %22, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %22, align 4, !tbaa !5
  br label %185, !llvm.loop !18

258:                                              ; preds = %193
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %15, align 4, !tbaa !5
  br label %180, !llvm.loop !19

261:                                              ; preds = %180
  %262 = load i64, ptr %5, align 8, !tbaa !11
  %263 = load i32, ptr %19, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [3000002 x i64], ptr @ans, i64 0, i64 %264
  store i64 %262, ptr %265, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %266

266:                                              ; preds = %261
  %267 = load i32, ptr %17, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %17, align 4, !tbaa !5
  br label %162, !llvm.loop !20

269:                                              ; preds = %170
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %16, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %16, align 4, !tbaa !5
  br label %156, !llvm.loop !21

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

274:                                              ; preds = %285, %273
  %275 = load i32, ptr %23, align 4, !tbaa !5
  %276 = load i32, ptr @m, align 4, !tbaa !5
  %277 = icmp sle i32 %275, %276
  br i1 %277, label %279, label %278

278:                                              ; preds = %274
  store i32 31, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %288

279:                                              ; preds = %274
  %280 = load i32, ptr %23, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [3000002 x i64], ptr @ans, i64 0, i64 %281
  %283 = load i64, ptr %282, align 8, !tbaa !11
  %284 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %283)
  br label %285

285:                                              ; preds = %279
  %286 = load i32, ptr %23, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %23, align 4, !tbaa !5
  br label %274, !llvm.loop !22

288:                                              ; preds = %278
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %289 = load i32, ptr %1, align 4
  ret i32 %289
}

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

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

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

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

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

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 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 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [3000002 x i32], align 16
@b = external dso_local local_unnamed_addr global [3000002 x i64], align 16
@ans = external dso_local local_unnamed_addr global [3000002 x i64], align 16
@v = external dso_local global [3000002 x %"class.std::vector"], align 16
@q = external dso_local global [3000002 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not89 = icmp slt i32 %7, 1
  br i1 %.not89, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 12000004), align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  store i64 %9, ptr getelementptr inbounds (i8, ptr @b, i64 24000008), align 8, !tbaa !9
  br label %19

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.05990 = phi i32 [ %16, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %16 = add nuw nsw i32 %.05990, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.05990, %17
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader88:                                     ; preds = %19
  %18 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8
  br label %45

19:                                               ; preds = %26, %._crit_edge
  %20 = phi i64 [ %9, %._crit_edge ], [ %41, %26 ]
  %indvars.iv = phi i64 [ 3000000, %._crit_edge ], [ %indvars.iv.next.3, %26 ]
  %21 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv
  %22 = load i32, ptr %21, align 16, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %indvars.iv
  %25 = add nsw i64 %20, %23
  store i64 %25, ptr %24, align 16, !tbaa !9
  %.not147 = icmp eq i64 %indvars.iv, 0
  br i1 %.not147, label %.preheader88, label %26, !llvm.loop !13

26:                                               ; preds = %19
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %27 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv.next
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %indvars.iv.next
  %31 = add nsw i64 %25, %29
  store i64 %31, ptr %30, align 8, !tbaa !9
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
  %32 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv.next.1
  %33 = load i32, ptr %32, align 8, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %indvars.iv.next.1
  %36 = add nsw i64 %31, %34
  store i64 %36, ptr %35, align 16, !tbaa !9
  %indvars.iv.next.2 = add nsw i64 %indvars.iv, -3
  %37 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv.next.2
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %indvars.iv.next.2
  %41 = add nsw i64 %36, %39
  store i64 %41, ptr %40, align 8, !tbaa !9
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, -4
  br label %19

42:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %.not7794 = icmp slt i32 %44, 1
  br i1 %.not7794, label %._crit_edge97, label %.lr.ph96

45:                                               ; preds = %66, %.preheader88
  %indvars.iv128 = phi i64 [ 1, %.preheader88 ], [ %indvars.iv.next129.1, %66 ]
  %.06593 = phi i64 [ 0, %.preheader88 ], [ %.166.1, %66 ]
  %46 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv128
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not84 = icmp eq i32 %47, 0
  br i1 %.not84, label %55, label %48

48:                                               ; preds = %45
  %49 = sext i32 %47 to i64
  %50 = icmp sgt i32 %47, 0
  %51 = sext i1 %50 to i64
  %52 = add nsw i64 %18, %51
  %53 = mul nsw i64 %52, %49
  %54 = add nsw i64 %53, %.06593
  br label %55

55:                                               ; preds = %45, %48
  %.166 = phi i64 [ %54, %48 ], [ %.06593, %45 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next129, 3000002
  br i1 %exitcond.not, label %42, label %56, !llvm.loop !14

56:                                               ; preds = %55
  %57 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %indvars.iv.next129
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not84.1 = icmp eq i32 %58, 0
  br i1 %.not84.1, label %66, label %59

59:                                               ; preds = %56
  %60 = sext i32 %58 to i64
  %61 = icmp sgt i32 %58, 0
  %62 = sext i1 %61 to i64
  %63 = add nsw i64 %18, %62
  %64 = mul nsw i64 %63, %60
  %65 = add nsw i64 %64, %.166
  br label %66

66:                                               ; preds = %59, %56
  %.166.1 = phi i64 [ %65, %59 ], [ %.166, %56 ]
  %indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
  br label %45

._crit_edge97:                                    ; preds = %.lr.ph96, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %.preheader87

.lr.ph96:                                         ; preds = %42, %.lr.ph96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @q, i64 0, i64 %69
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %3, align 4, !tbaa !5
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %.not77.not = icmp slt i32 %73, %75
  br i1 %.not77.not, label %.lr.ph96, label %._crit_edge97, !llvm.loop !15

76:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %.not79116 = icmp slt i32 %77, 1
  br i1 %.not79116, label %.preheader, label %.preheader86

78:                                               ; preds = %88
  %79 = add nsw i32 %89, 1
  store i32 %79, ptr %5, align 4, !tbaa !5
  %80 = icmp slt i32 %89, 3000001
  br i1 %80, label %.preheader87.backedge, label %76

.preheader87:                                     ; preds = %.preheader87.backedge, %._crit_edge97
  %81 = phi i32 [ 1, %._crit_edge97 ], [ %.be, %.preheader87.backedge ]
  %.06498 = phi i32 [ 1, %._crit_edge97 ], [ %.06498.be, %.preheader87.backedge ]
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %.not83 = icmp eq i32 %84, 0
  br i1 %.not83, label %88, label %85

85:                                               ; preds = %.preheader87
  %86 = sext i32 %.06498 to i64
  %87 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @v, i64 0, i64 %86
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %87, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %.preheader87, %85
  %89 = phi i32 [ %81, %.preheader87 ], [ %.pre, %85 ]
  %90 = add nsw i32 %89, %.06498
  %91 = icmp slt i32 %90, 3000002
  br i1 %91, label %.preheader87.backedge, label %78

.preheader87.backedge:                            ; preds = %88, %78
  %.be = phi i32 [ %89, %88 ], [ %79, %78 ]
  %.06498.be = phi i32 [ %90, %88 ], [ %79, %78 ]
  br label %.preheader87, !llvm.loop !16

.preheader86:                                     ; preds = %76, %._crit_edge113
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %._crit_edge113 ], [ 1, %76 ]
  %.063118 = phi i32 [ %.1.lcssa, %._crit_edge113 ], [ 1, %76 ]
  %.267117 = phi i64 [ %.3.lcssa, %._crit_edge113 ], [ %.166, %76 ]
  %92 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @q, i64 0, i64 %indvars.iv137
  %93 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  %.not = icmp eq i64 %93, 0
  br i1 %.not, label %._crit_edge113, label %.lr.ph112.preheader

.lr.ph112.preheader:                              ; preds = %.preheader86
  %94 = trunc nsw i64 %indvars.iv137 to i32
  br label %.lr.ph112

.preheader:                                       ; preds = %._crit_edge113, %76
  %95 = load i32, ptr @m, align 4, !tbaa !5
  %.not80120 = icmp slt i32 %95, 1
  br i1 %.not80120, label %._crit_edge123, label %.lr.ph122

._crit_edge113:                                   ; preds = %._crit_edge106, %.preheader86
  %.3.lcssa = phi i64 [ %.267117, %.preheader86 ], [ %.4.lcssa, %._crit_edge106 ]
  %.1.lcssa = phi i32 [ %.063118, %.preheader86 ], [ %.2.lcssa, %._crit_edge106 ]
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %.not79.not = icmp slt i64 %indvars.iv137, %97
  br i1 %.not79.not, label %.preheader86, label %.preheader, !llvm.loop !17

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %._crit_edge106
  %indvars.iv140 = phi i64 [ 0, %.lr.ph112.preheader ], [ %indvars.iv.next141, %._crit_edge106 ]
  %.1110 = phi i32 [ %.063118, %.lr.ph112.preheader ], [ %.2.lcssa, %._crit_edge106 ]
  %.3109 = phi i64 [ %.267117, %.lr.ph112.preheader ], [ %.4.lcssa, %._crit_edge106 ]
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %indvars.iv140) #6
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %.1110 to i64
  %101 = icmp sgt i64 %indvars.iv137, %100
  br i1 %101, label %.preheader85, label %._crit_edge106

.preheader85:                                     ; preds = %.lr.ph112, %._crit_edge103
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %._crit_edge103 ], [ %100, %.lr.ph112 ]
  %.4104 = phi i64 [ %.5.lcssa, %._crit_edge103 ], [ %.3109, %.lr.ph112 ]
  %102 = getelementptr inbounds [3000002 x %"class.std::vector"], ptr @v, i64 0, i64 %indvars.iv134
  %103 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #6
  %.not124 = icmp eq i64 %103, 0
  br i1 %.not124, label %._crit_edge103, label %.lr.ph102.preheader

.lr.ph102.preheader:                              ; preds = %.preheader85
  %104 = trunc nsw i64 %indvars.iv134 to i32
  br label %.lr.ph102

._crit_edge103:                                   ; preds = %.lr.ph102, %.preheader85
  %.5.lcssa = phi i64 [ %.4104, %.preheader85 ], [ %123, %.lr.ph102 ]
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, 1
  %exitcond139.not = icmp eq i64 %indvars.iv.next135, %indvars.iv137
  br i1 %exitcond139.not, label %._crit_edge106, label %.preheader85, !llvm.loop !18

.lr.ph102:                                        ; preds = %.lr.ph102.preheader, %.lr.ph102
  %indvars.iv131 = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next132, %.lr.ph102 ]
  %.5100 = phi i64 [ %.4104, %.lr.ph102.preheader ], [ %123, %.lr.ph102 ]
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %indvars.iv131) #6
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sdiv i32 %104, %106
  %.not81 = icmp sle i32 %107, %106
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = sext i1 %.not81 to i64
  %112 = add nsw i64 %110, %111
  %113 = sext i32 %106 to i64
  %114 = getelementptr inbounds [3000002 x i32], ptr @a, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = add nsw i32 %107, 1
  %.not82.not = icmp slt i32 %107, %106
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3000002 x i64], ptr @b, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = sext i1 %.not82.not to i64
  %122 = add nsw i64 %120, %121
  %reass.add = sub i64 %122, %112
  %reass.mul = mul i64 %reass.add, %116
  %123 = add i64 %reass.mul, %.5100
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %124 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #6
  %125 = icmp ugt i64 %124, %indvars.iv.next132
  br i1 %125, label %.lr.ph102, label %._crit_edge103, !llvm.loop !19

._crit_edge106:                                   ; preds = %._crit_edge103, %.lr.ph112
  %.4.lcssa = phi i64 [ %.3109, %.lr.ph112 ], [ %.5.lcssa, %._crit_edge103 ]
  %.2.lcssa = phi i32 [ %.1110, %.lr.ph112 ], [ %94, %._crit_edge103 ]
  %126 = sext i32 %99 to i64
  %127 = getelementptr inbounds [3000002 x i64], ptr @ans, i64 0, i64 %126
  store i64 %.4.lcssa, ptr %127, align 8, !tbaa !9
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %128 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  %129 = icmp ugt i64 %128, %indvars.iv.next141
  br i1 %129, label %.lr.ph112, label %._crit_edge113, !llvm.loop !20

._crit_edge123:                                   ; preds = %.lr.ph122, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret i32 0

.lr.ph122:                                        ; preds = %.preheader, %.lr.ph122
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %.lr.ph122 ], [ 1, %.preheader ]
  %130 = getelementptr inbounds [3000002 x i64], ptr @ans, i64 0, i64 %indvars.iv144
  %131 = load i64, ptr %130, align 8, !tbaa !9
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %131)
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %133 = load i32, ptr @m, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %.not80.not = icmp slt i64 %indvars.iv144, %134
  br i1 %.not80.not, label %.lr.ph122, label %._crit_edge123, !llvm.loop !21
}

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

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

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

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

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

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 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 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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}


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