; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/CodeStorm/Problem E (E)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@MOD = external dso_local global i64, align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dp = external dso_local global [1000100 x i32], align 16
@cnt = external dso_local global [1000100 x [3 x i32]], align 16
@a = external dso_local global [1000100 x i32], align 16
@d = external dso_local global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca 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 i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  %27 = alloca i64, align 8
  %28 = alloca i32, align 4
  %29 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %38, %0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 10
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %36
  store i32 1, ptr %37, align 4, !tbaa !5
  br label %38

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

41:                                               ; preds = %33
  store i32 1, ptr @d, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %56, %41
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = icmp sle i32 %43, 9
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %59

46:                                               ; preds = %42
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = mul nsw i32 %51, 10
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %46
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %3, align 4, !tbaa !5
  br label %42, !llvm.loop !11

59:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 10, ptr %4, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %198, %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = icmp slt i32 %61, 1000100
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %65 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %65, ptr %8, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %69, %64
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %74

69:                                               ; preds = %66
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sdiv i32 %72, 10
  store i32 %73, ptr %8, align 4, !tbaa !5
  br label %66, !llvm.loop !12

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

75:                                               ; preds = %148, %74
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %151

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = srem i32 %81, %86
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sdiv i32 %87, %91
  store i32 %92, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = srem i32 %93, %97
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sdiv i32 %98, %103
  store i32 %104, ptr %11, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %10, align 4, !tbaa !5
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = icmp sge i32 %108, 10
  br i1 %109, label %110, label %113

110:                                              ; preds = %80
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 10
  store i32 %112, ptr %10, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %110, %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sdiv i32 %114, %119
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = mul nsw i32 %120, %124
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = mul nsw i32 %126, %131
  %133 = add nsw i32 %125, %132
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = srem i32 %134, %139
  %141 = add nsw i32 %133, %140
  store i32 %141, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = or i32 %146, %145
  store i32 %147, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %148

148:                                              ; preds = %113
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %9, align 4, !tbaa !5
  br label %75, !llvm.loop !13

151:                                              ; preds = %79
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = icmp eq i32 %152, 1
  br i1 %153, label %154, label %158

154:                                              ; preds = %151
  %155 = load i32, ptr %4, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %156
  store i32 2, ptr %157, align 4, !tbaa !5
  br label %197

158:                                              ; preds = %151
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = icmp eq i32 %159, 2
  br i1 %160, label %161, label %165

161:                                              ; preds = %158
  %162 = load i32, ptr %4, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %163
  store i32 1, ptr %164, align 4, !tbaa !5
  br label %196

165:                                              ; preds = %158
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = and i32 %166, 1
  %168 = icmp sgt i32 %167, 0
  br i1 %168, label %169, label %177

169:                                              ; preds = %165
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = and i32 %170, 2
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %173, label %177

173:                                              ; preds = %169
  %174 = load i32, ptr %4, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %175
  store i32 4, ptr %176, align 4, !tbaa !5
  br label %195

177:                                              ; preds = %169, %165
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = and i32 %178, 1
  %180 = icmp sgt i32 %179, 0
  br i1 %180, label %181, label %185

181:                                              ; preds = %177
  %182 = load i32, ptr %4, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %183
  store i32 2, ptr %184, align 4, !tbaa !5
  br label %194

185:                                              ; preds = %177
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = and i32 %186, 2
  %188 = icmp sgt i32 %187, 0
  br i1 %188, label %189, label %193

189:                                              ; preds = %185
  %190 = load i32, ptr %4, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %191
  store i32 1, ptr %192, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %189, %185
  br label %194

194:                                              ; preds = %193, %181
  br label %195

195:                                              ; preds = %194, %173
  br label %196

196:                                              ; preds = %195, %161
  br label %197

197:                                              ; preds = %196, %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %4, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %4, align 4, !tbaa !5
  br label %60, !llvm.loop !14

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

202:                                              ; preds = %239, %201
  %203 = load i32, ptr %13, align 4, !tbaa !5
  %204 = icmp slt i32 %203, 1000100
  br i1 %204, label %206, label %205

205:                                              ; preds = %202
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %242

206:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %235, %206
  %208 = load i32, ptr %14, align 4, !tbaa !5
  %209 = icmp slt i32 %208, 3
  br i1 %209, label %211, label %210

210:                                              ; preds = %207
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %238

211:                                              ; preds = %207
  %212 = load i32, ptr %13, align 4, !tbaa !5
  %213 = sub nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %214
  %216 = load i32, ptr %14, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [3 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = load i32, ptr %14, align 4, !tbaa !5
  %225 = shl i32 1, %224
  %226 = icmp eq i32 %223, %225
  %227 = zext i1 %226 to i32
  %228 = add nsw i32 %219, %227
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %230
  %232 = load i32, ptr %14, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [3 x i32], ptr %231, i64 0, i64 %233
  store i32 %228, ptr %234, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %211
  %236 = load i32, ptr %14, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %14, align 4, !tbaa !5
  br label %207, !llvm.loop !15

238:                                              ; preds = %210
  br label %239

239:                                              ; preds = %238
  %240 = load i32, ptr %13, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %13, align 4, !tbaa !5
  br label %202, !llvm.loop !16

242:                                              ; preds = %205
  %243 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %244

244:                                              ; preds = %522, %242
  %245 = load i32, ptr @t, align 4, !tbaa !5
  %246 = add nsw i32 %245, -1
  store i32 %246, ptr @t, align 4, !tbaa !5
  %247 = icmp ne i32 %245, 0
  br i1 %247, label %248, label %525

248:                                              ; preds = %244
  %249 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %250 = load i32, ptr @n, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %251
  %253 = getelementptr inbounds [3 x i32], ptr %252, i64 0, i64 0
  %254 = load i32, ptr %253, align 4, !tbaa !5
  store i32 %254, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %255 = load i32, ptr @n, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %256
  %258 = getelementptr inbounds [3 x i32], ptr %257, i64 0, i64 1
  %259 = load i32, ptr %258, align 4, !tbaa !5
  store i32 %259, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %260 = load i32, ptr @n, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %261
  %263 = getelementptr inbounds [3 x i32], ptr %262, i64 0, i64 2
  %264 = load i32, ptr %263, align 4, !tbaa !5
  store i32 %264, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %308, %248
  %266 = load i32, ptr %21, align 4, !tbaa !5
  %267 = load i32, ptr @m, align 4, !tbaa !5
  %268 = icmp slt i32 %266, %267
  br i1 %268, label %270, label %269

269:                                              ; preds = %265
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %311

270:                                              ; preds = %265
  %271 = load i32, ptr %21, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %272
  %274 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %273)
  %275 = load i32, ptr %21, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = icmp eq i32 %281, 1
  %283 = zext i1 %282 to i32
  %284 = load i32, ptr %15, align 4, !tbaa !5
  %285 = add nsw i32 %284, %283
  store i32 %285, ptr %15, align 4, !tbaa !5
  %286 = load i32, ptr %21, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = icmp eq i32 %292, 2
  %294 = zext i1 %293 to i32
  %295 = load i32, ptr %16, align 4, !tbaa !5
  %296 = add nsw i32 %295, %294
  store i32 %296, ptr %16, align 4, !tbaa !5
  %297 = load i32, ptr %21, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %298
  %300 = load i32, ptr %299, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !5
  %304 = icmp eq i32 %303, 4
  %305 = zext i1 %304 to i32
  %306 = load i32, ptr %17, align 4, !tbaa !5
  %307 = add nsw i32 %306, %305
  store i32 %307, ptr %17, align 4, !tbaa !5
  br label %308

308:                                              ; preds = %270
  %309 = load i32, ptr %21, align 4, !tbaa !5
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %21, align 4, !tbaa !5
  br label %265, !llvm.loop !17

311:                                              ; preds = %269
  %312 = load i32, ptr %15, align 4, !tbaa !5
  %313 = load i32, ptr %18, align 4, !tbaa !5
  %314 = sub nsw i32 %313, %312
  store i32 %314, ptr %18, align 4, !tbaa !5
  %315 = load i32, ptr %16, align 4, !tbaa !5
  %316 = load i32, ptr %19, align 4, !tbaa !5
  %317 = sub nsw i32 %316, %315
  store i32 %317, ptr %19, align 4, !tbaa !5
  %318 = load i32, ptr %17, align 4, !tbaa !5
  %319 = load i32, ptr %20, align 4, !tbaa !5
  %320 = sub nsw i32 %319, %318
  store i32 %320, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %321 = load i32, ptr %18, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %322)
  store i64 %323, ptr %22, align 8, !tbaa !18
  %324 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @__FUNCTION__.main)
  %325 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %324, ptr noundef @.str.2)
  %326 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %325, i32 noundef 120)
  %327 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %326, ptr noundef @.str.2)
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %327, ptr noundef @.str.3)
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %328, ptr noundef @.str.2)
  %330 = load i64, ptr %22, align 8, !tbaa !18
  %331 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %329, i64 noundef %330)
  %332 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %331, ptr noundef @.str.2)
  %333 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %332, ptr noundef @.str.4)
  %334 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %333, ptr noundef @.str.2)
  %335 = load i32, ptr %16, align 4, !tbaa !5
  %336 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %334, i32 noundef %335)
  %337 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %336, ptr noundef @.str.2)
  %338 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %337, ptr noundef @.str.5)
  %339 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %338, ptr noundef @.str.2)
  %340 = load i32, ptr %19, align 4, !tbaa !5
  %341 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %339, i32 noundef %340)
  %342 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %341, ptr noundef @.str.2)
  %343 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %342, ptr noundef @.str.6)
  %344 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %343, ptr noundef @.str.2)
  %345 = load i32, ptr %20, align 4, !tbaa !5
  %346 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %344, i32 noundef %345)
  %347 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %346, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %348 = load i32, ptr %16, align 4, !tbaa !5
  %349 = srem i32 %348, 2
  %350 = icmp eq i32 %349, 1
  br i1 %350, label %351, label %427

351:                                              ; preds = %311
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 1, ptr %23, align 8, !tbaa !18
  %352 = load i32, ptr %19, align 4, !tbaa !5
  %353 = icmp sgt i32 %352, 1
  br i1 %353, label %354, label %369

354:                                              ; preds = %351
  %355 = load i32, ptr %20, align 4, !tbaa !5
  %356 = icmp sgt i32 %355, 0
  br i1 %356, label %357, label %369

357:                                              ; preds = %354
  %358 = load i64, ptr %23, align 8, !tbaa !18
  %359 = load i32, ptr %19, align 4, !tbaa !5
  %360 = sub nsw i32 %359, 1
  %361 = load i32, ptr %20, align 4, !tbaa !5
  %362 = add nsw i32 %360, %361
  %363 = sub nsw i32 %362, 1
  %364 = sext i32 %363 to i64
  %365 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %364)
  %366 = mul nsw i64 %358, %365
  %367 = load i64, ptr @MOD, align 8, !tbaa !18
  %368 = srem i64 %366, %367
  store i64 %368, ptr %23, align 8, !tbaa !18
  br label %383

369:                                              ; preds = %354, %351
  %370 = load i32, ptr %20, align 4, !tbaa !5
  %371 = icmp sgt i32 %370, 0
  br i1 %371, label %372, label %381

372:                                              ; preds = %369
  %373 = load i64, ptr %23, align 8, !tbaa !18
  %374 = load i32, ptr %20, align 4, !tbaa !5
  %375 = sub nsw i32 %374, 1
  %376 = sext i32 %375 to i64
  %377 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %376)
  %378 = mul nsw i64 %373, %377
  %379 = load i64, ptr @MOD, align 8, !tbaa !18
  %380 = srem i64 %378, %379
  store i64 %380, ptr %23, align 8, !tbaa !18
  br label %382

381:                                              ; preds = %369
  store i64 0, ptr %23, align 8, !tbaa !18
  br label %382

382:                                              ; preds = %381, %372
  br label %383

383:                                              ; preds = %382, %357
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store i64 1, ptr %24, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !5
  %384 = load i32, ptr %19, align 4, !tbaa !5
  %385 = icmp sgt i32 %384, 0
  br i1 %385, label %386, label %408

386:                                              ; preds = %383
  %387 = load i64, ptr %24, align 8, !tbaa !18
  %388 = load i32, ptr %19, align 4, !tbaa !5
  %389 = sub nsw i32 %388, 1
  %390 = sext i32 %389 to i64
  %391 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %390)
  %392 = mul nsw i64 %387, %391
  %393 = load i64, ptr @MOD, align 8, !tbaa !18
  %394 = srem i64 %392, %393
  store i64 %394, ptr %24, align 8, !tbaa !18
  %395 = load i32, ptr %20, align 4, !tbaa !5
  %396 = icmp sgt i32 %395, 1
  br i1 %396, label %397, label %406

397:                                              ; preds = %386
  %398 = load i64, ptr %24, align 8, !tbaa !18
  %399 = load i32, ptr %20, align 4, !tbaa !5
  %400 = sub nsw i32 %399, 1
  %401 = sext i32 %400 to i64
  %402 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %401)
  %403 = mul nsw i64 %398, %402
  %404 = load i64, ptr @MOD, align 8, !tbaa !18
  %405 = srem i64 %403, %404
  store i64 %405, ptr %24, align 8, !tbaa !18
  br label %407

406:                                              ; preds = %386
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %407

407:                                              ; preds = %406, %397
  br label %409

408:                                              ; preds = %383
  store i64 0, ptr %24, align 8, !tbaa !18
  br label %409

409:                                              ; preds = %408, %407
  %410 = load i64, ptr %22, align 8, !tbaa !18
  %411 = load i64, ptr %23, align 8, !tbaa !18
  %412 = load i64, ptr %24, align 8, !tbaa !18
  %413 = add nsw i64 %411, %412
  %414 = mul nsw i64 %410, %413
  %415 = load i64, ptr @MOD, align 8, !tbaa !18
  %416 = srem i64 %414, %415
  %417 = load i64, ptr @MOD, align 8, !tbaa !18
  %418 = srem i64 %416, %417
  store i64 %418, ptr %22, align 8, !tbaa !18
  %419 = load i64, ptr %22, align 8, !tbaa !18
  %420 = load i32, ptr %25, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = sub nsw i64 %419, %421
  %423 = load i64, ptr @MOD, align 8, !tbaa !18
  %424 = add nsw i64 %422, %423
  %425 = load i64, ptr @MOD, align 8, !tbaa !18
  %426 = srem i64 %424, %425
  store i64 %426, ptr %22, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %522

427:                                              ; preds = %311
  %428 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @__FUNCTION__.main)
  %429 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %428, ptr noundef @.str.2)
  %430 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %429, i32 noundef 148)
  %431 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %430, ptr noundef @.str.2)
  %432 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %431, ptr noundef @.str.7)
  %433 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %432, ptr noundef @.str.2)
  %434 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %433, ptr noundef @.str.8)
  %435 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %434, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  store i8 0, ptr %26, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store i64 1, ptr %27, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !5
  %436 = load i32, ptr %19, align 4, !tbaa !5
  %437 = icmp sgt i32 %436, 1
  br i1 %437, label %438, label %463

438:                                              ; preds = %427
  %439 = load i64, ptr %27, align 8, !tbaa !18
  %440 = load i32, ptr %19, align 4, !tbaa !5
  %441 = sub nsw i32 %440, 1
  %442 = sext i32 %441 to i64
  %443 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %442)
  %444 = mul nsw i64 %439, %443
  %445 = load i64, ptr @MOD, align 8, !tbaa !18
  %446 = srem i64 %444, %445
  store i64 %446, ptr %27, align 8, !tbaa !18
  %447 = load i32, ptr %20, align 4, !tbaa !5
  %448 = icmp sgt i32 %447, 1
  br i1 %448, label %449, label %458

449:                                              ; preds = %438
  %450 = load i64, ptr %27, align 8, !tbaa !18
  %451 = load i32, ptr %20, align 4, !tbaa !5
  %452 = sub nsw i32 %451, 1
  %453 = sext i32 %452 to i64
  %454 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %453)
  %455 = mul nsw i64 %450, %454
  %456 = load i64, ptr @MOD, align 8, !tbaa !18
  %457 = srem i64 %455, %456
  store i64 %457, ptr %27, align 8, !tbaa !18
  br label %458

458:                                              ; preds = %449, %438
  %459 = load i64, ptr %22, align 8, !tbaa !18
  %460 = icmp sgt i64 %459, 1
  br i1 %460, label %461, label %462

461:                                              ; preds = %458
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %462

462:                                              ; preds = %461, %458
  br label %485

463:                                              ; preds = %427
  %464 = load i32, ptr %20, align 4, !tbaa !5
  %465 = icmp sgt i32 %464, 1
  br i1 %465, label %466, label %479

466:                                              ; preds = %463
  %467 = load i64, ptr %27, align 8, !tbaa !18
  %468 = load i32, ptr %20, align 4, !tbaa !5
  %469 = sub nsw i32 %468, 1
  %470 = sext i32 %469 to i64
  %471 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %470)
  %472 = mul nsw i64 %467, %471
  %473 = load i64, ptr @MOD, align 8, !tbaa !18
  %474 = srem i64 %472, %473
  store i64 %474, ptr %27, align 8, !tbaa !18
  %475 = load i64, ptr %22, align 8, !tbaa !18
  %476 = icmp sgt i64 %475, 1
  br i1 %476, label %477, label %478

477:                                              ; preds = %466
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %478

478:                                              ; preds = %477, %466
  br label %484

479:                                              ; preds = %463
  store i64 0, ptr %27, align 8, !tbaa !18
  %480 = load i64, ptr %22, align 8, !tbaa !18
  %481 = icmp sgt i64 %480, 1
  br i1 %481, label %482, label %483

482:                                              ; preds = %479
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %483

483:                                              ; preds = %482, %479
  br label %484

484:                                              ; preds = %483, %478
  br label %485

485:                                              ; preds = %484, %462
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  store i64 1, ptr %29, align 8, !tbaa !18
  %486 = load i32, ptr %19, align 4, !tbaa !5
  %487 = icmp sgt i32 %486, 0
  br i1 %487, label %488, label %503

488:                                              ; preds = %485
  %489 = load i32, ptr %20, align 4, !tbaa !5
  %490 = icmp sgt i32 %489, 0
  br i1 %490, label %491, label %503

491:                                              ; preds = %488
  %492 = load i64, ptr %29, align 8, !tbaa !18
  %493 = load i32, ptr %19, align 4, !tbaa !5
  %494 = sub nsw i32 %493, 1
  %495 = load i32, ptr %20, align 4, !tbaa !5
  %496 = add nsw i32 %494, %495
  %497 = sub nsw i32 %496, 1
  %498 = sext i32 %497 to i64
  %499 = call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %498)
  %500 = mul nsw i64 %492, %499
  %501 = load i64, ptr @MOD, align 8, !tbaa !18
  %502 = srem i64 %500, %501
  store i64 %502, ptr %29, align 8, !tbaa !18
  store i8 1, ptr %26, align 1, !tbaa !20
  br label %504

503:                                              ; preds = %488, %485
  store i64 0, ptr %29, align 8, !tbaa !18
  br label %504

504:                                              ; preds = %503, %491
  %505 = load i64, ptr %22, align 8, !tbaa !18
  %506 = load i64, ptr %27, align 8, !tbaa !18
  %507 = load i64, ptr %29, align 8, !tbaa !18
  %508 = add nsw i64 %506, %507
  %509 = mul nsw i64 %505, %508
  %510 = load i64, ptr @MOD, align 8, !tbaa !18
  %511 = srem i64 %509, %510
  %512 = load i64, ptr @MOD, align 8, !tbaa !18
  %513 = srem i64 %511, %512
  store i64 %513, ptr %22, align 8, !tbaa !18
  %514 = load i64, ptr %22, align 8, !tbaa !18
  %515 = load i32, ptr %28, align 4, !tbaa !5
  %516 = sext i32 %515 to i64
  %517 = sub nsw i64 %514, %516
  %518 = load i64, ptr @MOD, align 8, !tbaa !18
  %519 = add nsw i64 %517, %518
  %520 = load i64, ptr @MOD, align 8, !tbaa !18
  %521 = srem i64 %519, %520
  store i64 %521, ptr %22, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  br label %522

522:                                              ; preds = %504, %409
  %523 = load i64, ptr %22, align 8, !tbaa !18
  %524 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %523)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #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
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %244, !llvm.loop !22

525:                                              ; preds = %244
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 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 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [1000100 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [1000100 x [3 x i32]], align 16
@a = external dso_local global [1000100 x i32], align 16
@d = external dso_local local_unnamed_addr global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
.preheader164.preheader:
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dp, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @dp, i64 36), align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 10, i32 100, i32 1000>, ptr @d, align 16, !tbaa !5
  store <4 x i32> <i32 10000, i32 100000, i32 1000000, i32 10000000>, ptr getelementptr inbounds (i8, ptr @d, i64 16), align 16, !tbaa !5
  store i32 100000000, ptr getelementptr inbounds (i8, ptr @d, i64 32), align 16, !tbaa !5
  store i32 1000000000, ptr getelementptr inbounds (i8, ptr @d, i64 36), align 4, !tbaa !5
  br label %.preheader164

.preheader164:                                    ; preds = %.preheader164.preheader, %.thread233
  %indvars.iv198 = phi i64 [ 10, %.preheader164.preheader ], [ %indvars.iv.next199, %.thread233 ]
  %0 = trunc nuw nsw i64 %indvars.iv198 to i32
  br label %1

.preheader163:                                    ; preds = %1
  %.not189 = icmp eq i32 %.0139168, 0
  br i1 %.not189, label %.thread233, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader163
  %wide.trip.count = zext i32 %indvars.iv196 to i64
  br label %.lr.ph

1:                                                ; preds = %.preheader164, %1
  %indvars.iv196 = phi i32 [ 1, %.preheader164 ], [ %indvars.iv.next197, %1 ]
  %.0138169 = phi i32 [ %0, %.preheader164 ], [ %3, %1 ]
  %.0139168 = phi i32 [ 0, %.preheader164 ], [ %2, %1 ]
  %2 = add nuw nsw i32 %.0139168, 1
  %3 = sdiv i32 %.0138169, 10
  %.0138169.off = add nsw i32 %.0138169, 9
  %.not151 = icmp ult i32 %.0138169.off, 19
  %indvars.iv.next197 = add nuw i32 %indvars.iv196, 1
  br i1 %.not151, label %.preheader163, label %1, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  switch i32 %26, label %28 [
    i32 1, label %.thread233.sink.split
    i32 2, label %27
  ]

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %4 = phi i32 [ 10, %.lr.ph.preheader ], [ %6, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.0140170 = phi i32 [ 0, %.lr.ph.preheader ], [ %26, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %5 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %indvars.iv.next
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = srem i32 %0, %6
  %8 = sdiv i32 %7, %4
  %9 = srem i32 %0, %4
  %10 = add nsw i64 %indvars.iv, -1
  %11 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = sdiv i32 %9, %12
  %14 = add nsw i32 %13, %8
  %15 = icmp sgt i32 %14, 9
  %16 = add nsw i32 %14, -10
  %spec.select = select i1 %15, i32 %16, i32 %14
  %17 = sdiv i32 %0, %6
  %18 = mul nsw i32 %17, %4
  %19 = mul nsw i32 %spec.select, %12
  %20 = srem i32 %0, %12
  %21 = add i32 %20, %18
  %22 = add i32 %21, %19
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = or i32 %25, %.0140170
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

27:                                               ; preds = %._crit_edge
  br label %.thread233.sink.split

28:                                               ; preds = %._crit_edge
  %29 = and i32 %26, 3
  %or.cond155.not = icmp eq i32 %29, 3
  br i1 %or.cond155.not, label %.thread233.sink.split, label %30

30:                                               ; preds = %28
  %31 = and i32 %26, 1
  %.not152.not = icmp eq i32 %31, 0
  %32 = and i32 %26, 3
  %brmerge.not = icmp eq i32 %32, 0
  %.mux = select i1 %.not152.not, i32 1, i32 2
  br i1 %brmerge.not, label %.thread233, label %.thread233.sink.split

.thread233.sink.split:                            ; preds = %30, %28, %._crit_edge, %27
  %.sink = phi i32 [ 1, %27 ], [ 2, %._crit_edge ], [ 4, %28 ], [ %.mux, %30 ]
  %33 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %indvars.iv198
  store i32 %.sink, ptr %33, align 4, !tbaa !5
  br label %.thread233

.thread233:                                       ; preds = %30, %.thread233.sink.split, %.preheader163
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %exitcond201.not = icmp eq i64 %indvars.iv.next199, 1000100
  br i1 %exitcond201.not, label %.preheader.preheader, label %.preheader164, !llvm.loop !12

.preheader.preheader:                             ; preds = %.thread233
  %34 = load <2 x i32>, ptr @cnt, align 16, !tbaa !5
  %.pre215 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 8), align 8, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %35 = phi i32 [ %.pre215, %.preheader.preheader ], [ %47, %.preheader ]
  %indvars.iv206 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next207, %.preheader ]
  %36 = phi <2 x i32> [ %34, %.preheader.preheader ], [ %44, %.preheader ]
  %37 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %indvars.iv206
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %indvars.iv206, i64 0
  %40 = insertelement <2 x i32> poison, i32 %38, i64 0
  %41 = shufflevector <2 x i32> %40, <2 x i32> poison, <2 x i32> zeroinitializer
  %42 = icmp eq <2 x i32> %41, <i32 1, i32 2>
  %43 = zext <2 x i1> %42 to <2 x i32>
  %44 = add nsw <2 x i32> %36, %43
  store <2 x i32> %44, ptr %39, align 4, !tbaa !5
  %45 = icmp eq i32 %38, 4
  %46 = zext i1 %45 to i32
  %47 = add nsw i32 %35, %46
  %48 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %indvars.iv206, i64 2
  store i32 %47, ptr %48, align 4, !tbaa !5
  %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
  %exitcond209.not = icmp eq i64 %indvars.iv.next207, 1000100
  br i1 %exitcond209.not, label %49, label %.preheader, !llvm.loop !13

49:                                               ; preds = %.preheader
  %50 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %51 = load i32, ptr @t, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr @t, align 4, !tbaa !5
  %.not185 = icmp eq i32 %51, 0
  br i1 %.not185, label %._crit_edge188, label %.lr.ph187

.lr.ph187:                                        ; preds = %49, %196
  %53 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000100 x [3 x i32]], ptr @cnt, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %56, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %56, i64 8
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph180, label %._crit_edge181

._crit_edge181:                                   ; preds = %.lr.ph180, %.lr.ph187
  %.0131.lcssa = phi i32 [ 0, %.lr.ph187 ], [ %98, %.lr.ph180 ]
  %.0130.lcssa = phi i32 [ 0, %.lr.ph187 ], [ %101, %.lr.ph180 ]
  %.0129.lcssa = phi i32 [ 0, %.lr.ph187 ], [ %104, %.lr.ph180 ]
  %64 = sub nsw i32 %57, %.0131.lcssa
  %65 = sub nsw i32 %59, %.0130.lcssa
  %66 = sub nsw i32 %61, %.0129.lcssa
  %67 = sext i32 %64 to i64
  %68 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %67)
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @__FUNCTION__.main)
  %70 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str.2)
  %71 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %70, i32 noundef 120)
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @.str.2)
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @.str.3)
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull @.str.2)
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %74, i64 noundef %68)
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @.str.2)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.4)
  %78 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @.str.2)
  %79 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %.0130.lcssa)
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @.str.2)
  %81 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @.str.5)
  %82 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str.2)
  %83 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %82, i32 noundef %65)
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @.str.2)
  %85 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str.6)
  %86 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull @.str.2)
  %87 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %86, i32 noundef %66)
  %88 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %89 = and i32 %.0130.lcssa, 1
  %.not150 = icmp eq i32 %89, 0
  br i1 %.not150, label %148, label %108

.lr.ph180:                                        ; preds = %.lr.ph187, %.lr.ph180
  %indvars.iv210 = phi i64 [ %indvars.iv.next211, %.lr.ph180 ], [ 0, %.lr.ph187 ]
  %.0129177 = phi i32 [ %104, %.lr.ph180 ], [ 0, %.lr.ph187 ]
  %.0130176 = phi i32 [ %101, %.lr.ph180 ], [ 0, %.lr.ph187 ]
  %.0131175 = phi i32 [ %98, %.lr.ph180 ], [ 0, %.lr.ph187 ]
  %90 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %indvars.iv210
  %91 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %90)
  %92 = load i32, ptr %90, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp eq i32 %95, 1
  %97 = zext i1 %96 to i32
  %98 = add nuw nsw i32 %.0131175, %97
  %99 = icmp eq i32 %95, 2
  %100 = zext i1 %99 to i32
  %101 = add nuw nsw i32 %.0130176, %100
  %102 = icmp eq i32 %95, 4
  %103 = zext i1 %102 to i32
  %104 = add nuw nsw i32 %.0129177, %103
  %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
  %105 = load i32, ptr @m, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next211, %106
  br i1 %107, label %.lr.ph180, label %._crit_edge181, !llvm.loop !14

108:                                              ; preds = %._crit_edge181
  %109 = icmp sgt i32 %65, 1
  %110 = icmp sgt i32 %66, 0
  %or.cond = select i1 %109, i1 %110, i1 false
  br i1 %or.cond, label %.thread, label %117

.thread:                                          ; preds = %108
  %111 = add nuw i32 %66, %65
  %112 = add i32 %111, -2
  %113 = zext nneg i32 %112 to i64
  %114 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %113)
  %115 = load i64, ptr @MOD, align 8, !tbaa !15
  %116 = srem i64 %114, %115
  br label %126

117:                                              ; preds = %108
  br i1 %110, label %118, label %124

118:                                              ; preds = %117
  %119 = add nsw i32 %66, -1
  %120 = zext nneg i32 %119 to i64
  %121 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %120)
  %122 = load i64, ptr @MOD, align 8, !tbaa !15
  %123 = srem i64 %121, %122
  br label %124

124:                                              ; preds = %117, %118
  %.0126 = phi i64 [ %123, %118 ], [ 0, %117 ]
  %125 = icmp sgt i32 %65, 0
  br i1 %125, label %126, label %._crit_edge216

._crit_edge216:                                   ; preds = %124
  %.pre217 = load i64, ptr @MOD, align 8, !tbaa !15
  br label %140

126:                                              ; preds = %.thread, %124
  %.0126161 = phi i64 [ %116, %.thread ], [ %.0126, %124 ]
  %127 = add nsw i32 %65, -1
  %128 = zext nneg i32 %127 to i64
  %129 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %128)
  %130 = load i64, ptr @MOD, align 8, !tbaa !15
  %131 = srem i64 %129, %130
  %132 = icmp sgt i32 %66, 1
  br i1 %132, label %133, label %140

133:                                              ; preds = %126
  %134 = add nsw i32 %66, -1
  %135 = zext nneg i32 %134 to i64
  %136 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %135)
  %137 = mul nsw i64 %136, %131
  %138 = load i64, ptr @MOD, align 8, !tbaa !15
  %139 = srem i64 %137, %138
  br label %140

140:                                              ; preds = %._crit_edge216, %126, %133
  %141 = phi i64 [ %138, %133 ], [ %130, %126 ], [ %.pre217, %._crit_edge216 ]
  %.0126160 = phi i64 [ %.0126161, %133 ], [ %.0126161, %126 ], [ %.0126, %._crit_edge216 ]
  %.0125 = phi i64 [ %139, %133 ], [ %131, %126 ], [ 0, %._crit_edge216 ]
  %.0124.neg = phi i64 [ 0, %133 ], [ -1, %126 ], [ 0, %._crit_edge216 ]
  %142 = add nsw i64 %.0125, %.0126160
  %143 = mul nsw i64 %142, %68
  %144 = srem i64 %143, %141
  %145 = add i64 %141, %.0124.neg
  %146 = add i64 %145, %144
  %147 = srem i64 %146, %141
  br label %196

148:                                              ; preds = %._crit_edge181
  %149 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @__FUNCTION__.main)
  %150 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef nonnull @.str.2)
  %151 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %150, i32 noundef 148)
  %152 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef nonnull @.str.2)
  %153 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef nonnull @.str.7)
  %154 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef nonnull @.str.2)
  %155 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef nonnull @.str.8)
  %156 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %157 = icmp sgt i32 %65, 1
  br i1 %157, label %158, label %170

158:                                              ; preds = %148
  %159 = add nsw i32 %65, -1
  %160 = zext nneg i32 %159 to i64
  %161 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %160)
  %162 = load i64, ptr @MOD, align 8, !tbaa !15
  %163 = srem i64 %161, %162
  %164 = icmp sgt i32 %66, 1
  br i1 %164, label %165, label %178

165:                                              ; preds = %158
  %166 = add nsw i32 %66, -1
  %167 = zext nneg i32 %166 to i64
  %168 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %167)
  %169 = mul nsw i64 %168, %163
  br label %.sink.split

170:                                              ; preds = %148
  %171 = icmp sgt i32 %66, 1
  br i1 %171, label %172, label %178

172:                                              ; preds = %170
  %173 = add nsw i32 %66, -1
  %174 = zext nneg i32 %173 to i64
  %175 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %174)
  br label %.sink.split

.sink.split:                                      ; preds = %172, %165
  %.sink239 = phi i64 [ %169, %165 ], [ %175, %172 ]
  %176 = load i64, ptr @MOD, align 8, !tbaa !15
  %177 = srem i64 %.sink239, %176
  br label %178

178:                                              ; preds = %.sink.split, %170, %158
  %.1 = phi i64 [ %163, %158 ], [ 0, %170 ], [ %177, %.sink.split ]
  %.0122.neg.in = icmp sgt i64 %68, 1
  %.0122.neg = sext i1 %.0122.neg.in to i64
  %179 = icmp sgt i32 %65, 0
  %180 = icmp sgt i32 %66, 0
  %or.cond3 = select i1 %179, i1 %180, i1 false
  br i1 %or.cond3, label %181, label %._crit_edge218

._crit_edge218:                                   ; preds = %178
  %.pre219 = load i64, ptr @MOD, align 8, !tbaa !15
  br label %188

181:                                              ; preds = %178
  %182 = add nuw i32 %66, %65
  %183 = add i32 %182, -2
  %184 = zext nneg i32 %183 to i64
  %185 = tail call noundef i64 @_Z4fastxx(i64 noundef 2, i64 noundef %184)
  %186 = load i64, ptr @MOD, align 8, !tbaa !15
  %187 = srem i64 %185, %186
  br label %188

188:                                              ; preds = %._crit_edge218, %181
  %189 = phi i64 [ %186, %181 ], [ %.pre219, %._crit_edge218 ]
  %.0 = phi i64 [ %187, %181 ], [ 0, %._crit_edge218 ]
  %190 = add nsw i64 %.0, %.1
  %191 = mul nsw i64 %190, %68
  %192 = srem i64 %191, %189
  %193 = add i64 %189, %.0122.neg
  %194 = add i64 %193, %192
  %195 = srem i64 %194, %189
  br label %196

196:                                              ; preds = %188, %140
  %.0127 = phi i64 [ %147, %140 ], [ %195, %188 ]
  %197 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %.0127)
  %198 = load i32, ptr @t, align 4, !tbaa !5
  %199 = add nsw i32 %198, -1
  store i32 %199, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %198, 0
  br i1 %.not, label %._crit_edge188, label %.lr.ph187, !llvm.loop !17

._crit_edge188:                                   ; preds = %196, %49
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

!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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !10}


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