; LLVM IR from tangjz/acm-icpc :: lydsy (5306)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@ifct = external dso_local global [10000001 x i32], align 16
@f = external dso_local global [262145 x i32], align 16
@g = external dso_local global [262145 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7initNTTi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @dt)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr %2, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([10000001 x i32], ptr @ifct, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr @ifct, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %39, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sdiv i32 1004535809, %23
  %25 = sext i32 %24 to i64
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = srem i32 1004535809, %26
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = mul nsw i64 %25, %31
  %33 = srem i64 %32, 1004535809
  %34 = trunc i64 %33 to i32
  %35 = sub nsw i32 1004535809, %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %37
  store i32 %35, ptr %38, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %22
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !9

42:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %66, %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %54, %59
  %61 = srem i64 %60, 1004535809
  %62 = trunc i64 %61 to i32
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %48
  %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 !11

69:                                               ; preds = %47
  %70 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %70, ptr %2, align 4, !tbaa !5
  %71 = load i32, ptr @dt, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %73, label %79

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = load i32, ptr @dt, align 4, !tbaa !5
  %76 = sdiv i32 %74, %75
  store i32 %76, ptr %5, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %79

79:                                               ; preds = %73, %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %125, %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %80
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr @f, i64 %87
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %88)
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = mul nsw i64 %94, %99
  %101 = srem i64 %100, 1004535809
  %102 = trunc i64 %101 to i32
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = and i32 %106, 1
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %115

109:                                              ; preds = %85
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 1004535809, %113
  br label %120

115:                                              ; preds = %85
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %115, %109
  %121 = phi i32 [ %114, %109 ], [ %119, %115 ]
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %120
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %6, align 4, !tbaa !5
  br label %80, !llvm.loop !12

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

129:                                              ; preds = %136, %128
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = load i32, ptr %2, align 4, !tbaa !5
  %132 = shl i32 %131, 1
  %133 = or i32 %132, 1
  %134 = icmp slt i32 %130, %133
  br i1 %134, label %135, label %139

135:                                              ; preds = %129
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = shl i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %129, !llvm.loop !13

139:                                              ; preds = %129
  %140 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z7initNTTi(i32 noundef %140)
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr @f, i64 %142
  %144 = getelementptr inbounds i32, ptr %143, i64 1
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = sub nsw i32 %145, %146
  %148 = sub nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = mul i64 %149, 4
  call void @llvm.memset.p0.i64(ptr align 4 %144, i8 0, i64 %150, i1 false)
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr @g, i64 %152
  %154 = getelementptr inbounds i32, ptr %153, i64 1
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = sub nsw i32 %155, %156
  %158 = sub nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = mul i64 %159, 4
  call void @llvm.memset.p0.i64(ptr align 4 %154, i8 0, i64 %160, i1 false)
  %161 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %161, ptr noundef @f, i32 noundef 1)
  %162 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %162, ptr noundef @g, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %185, %139
  %164 = load i32, ptr %8, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = icmp slt i32 %164, %165
  br i1 %166, label %168, label %167

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

168:                                              ; preds = %163
  %169 = load i32, ptr %8, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = mul nsw i64 %173, %178
  %180 = srem i64 %179, 1004535809
  %181 = trunc i64 %180 to i32
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %183
  store i32 %181, ptr %184, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %168
  %186 = load i32, ptr %8, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %8, align 4, !tbaa !5
  br label %163, !llvm.loop !14

188:                                              ; preds = %167
  %189 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %189, ptr noundef @f, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %241, %188
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = load i32, ptr %2, align 4, !tbaa !5
  %193 = icmp sle i32 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %254

195:                                              ; preds = %190
  %196 = load i32, ptr %9, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = load i32, ptr @m, align 4, !tbaa !5
  %199 = load i32, ptr %11, align 4, !tbaa !5
  %200 = sub nsw i32 %198, %199
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = load i32, ptr %11, align 4, !tbaa !5
  %203 = load i32, ptr @dt, align 4, !tbaa !5
  %204 = mul nsw i32 %202, %203
  %205 = sub nsw i32 %201, %204
  %206 = call noundef i32 @_Z7mod_powii(i32 noundef %200, i32 noundef %205)
  %207 = sext i32 %206 to i64
  %208 = load i32, ptr @m, align 4, !tbaa !5
  %209 = load i32, ptr %11, align 4, !tbaa !5
  %210 = sub nsw i32 %208, %209
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = mul nsw i64 %207, %214
  %216 = srem i64 %215, 1004535809
  %217 = load i32, ptr @n, align 4, !tbaa !5
  %218 = load i32, ptr %11, align 4, !tbaa !5
  %219 = load i32, ptr @dt, align 4, !tbaa !5
  %220 = mul nsw i32 %218, %219
  %221 = sub nsw i32 %217, %220
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = mul nsw i64 %216, %225
  %227 = srem i64 %226, 1004535809
  %228 = load i32, ptr %10, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = mul nsw i64 %227, %229
  %231 = srem i64 %230, 1004535809
  %232 = load i32, ptr %11, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = mul nsw i64 %231, %236
  %238 = add nsw i64 %197, %237
  %239 = srem i64 %238, 1004535809
  %240 = trunc i64 %239 to i32
  store i32 %240, ptr %9, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %195
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %11, align 4, !tbaa !5
  %244 = load i32, ptr %10, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = load i32, ptr @dt, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = mul nsw i64 %245, %250
  %252 = srem i64 %251, 1004535809
  %253 = trunc i64 %252 to i32
  store i32 %253, ptr %10, align 4, !tbaa !5
  br label %190, !llvm.loop !15

254:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %255

255:                                              ; preds = %268, %254
  %256 = load i32, ptr %12, align 4, !tbaa !5
  %257 = load i32, ptr @n, align 4, !tbaa !5
  %258 = icmp sle i32 %256, %257
  br i1 %258, label %260, label %259

259:                                              ; preds = %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %271

260:                                              ; preds = %255
  %261 = load i32, ptr %9, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = load i32, ptr %12, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = mul nsw i64 %262, %264
  %266 = srem i64 %265, 1004535809
  %267 = trunc i64 %266 to i32
  store i32 %267, ptr %9, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %260
  %269 = load i32, ptr %12, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %12, align 4, !tbaa !5
  br label %255, !llvm.loop !16

271:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 2, ptr %13, align 4, !tbaa !5
  br label %272

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

276:                                              ; preds = %272
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %288

277:                                              ; preds = %272
  %278 = load i32, ptr %9, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = load i32, ptr %13, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = mul nsw i64 %279, %281
  %283 = srem i64 %282, 1004535809
  %284 = trunc i64 %283 to i32
  store i32 %284, ptr %9, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %277
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %13, align 4, !tbaa !5
  br label %272, !llvm.loop !17

288:                                              ; preds = %276
  %289 = load i32, ptr %9, align 4, !tbaa !5
  %290 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %289)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

; 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)) #5

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@ifct = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@f = external dso_local global [262145 x i32], align 16
@g = external dso_local global [262145 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7initNTTi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @dt)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %5 = load i32, ptr %4, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @ifct, i64 4), align 4, !tbaa !5
  store i32 1, ptr @ifct, align 16, !tbaa !5
  %.not72 = icmp slt i32 %5, 2
  br i1 %.not72, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %6 = add nuw i32 %5, 1
  %wide.trip.count = zext i32 %6 to i64
  br label %.lr.ph

.preheader71:                                     ; preds = %.lr.ph
  br i1 %.not72, label %._crit_edge, label %.lr.ph76.preheader

.lr.ph76.preheader:                               ; preds = %.preheader71
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @ifct, i64 4), align 4, !tbaa !5
  %xtraiter = and i64 %wide.trip.count, 1
  %7 = icmp eq i32 %6, 3
  br i1 %7, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph76.preheader.new

.lr.ph76.preheader.new:                           ; preds = %.lr.ph76.preheader
  %8 = and i64 %wide.trip.count, 4294967294
  %9 = add nsw i64 %8, -4
  br label %.lr.ph76

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 2, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %10 = trunc nuw nsw i64 %indvars.iv to i32
  %11 = udiv i32 1004535809, %10
  %12 = zext nneg i32 %11 to i64
  %13 = urem i32 1004535809, %10
  %14 = zext nneg i32 %13 to i64
  %15 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = mul nsw i64 %17, %12
  %19 = srem i64 %18, 1004535809
  %20 = trunc nsw i64 %19 to i32
  %21 = sub nsw i32 1004535809, %20
  %22 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %indvars.iv
  store i32 %21, ptr %22, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader71, label %.lr.ph, !llvm.loop !9

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph76, %.lr.ph76.preheader
  %.unr = phi i32 [ %.pre, %.lr.ph76.preheader ], [ %46, %.lr.ph76 ]
  %indvars.iv108.unr = phi i64 [ 2, %.lr.ph76.preheader ], [ %indvars.iv.next109.1, %.lr.ph76 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph76.epil

.lr.ph76.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %23 = sext i32 %.unr to i64
  %24 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %indvars.iv108.unr
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = mul nsw i64 %26, %23
  %28 = srem i64 %27, 1004535809
  %29 = trunc nsw i64 %28 to i32
  store i32 %29, ptr %24, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph76.epil, %._crit_edge.loopexit.unr-lcssa, %0, %.preheader71
  %30 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %30, ptr %1, align 4, !tbaa !5
  %31 = load i32, ptr @dt, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %47, label %52

.lr.ph76:                                         ; preds = %.lr.ph76, %.lr.ph76.preheader.new
  %33 = phi i32 [ %.pre, %.lr.ph76.preheader.new ], [ %46, %.lr.ph76 ]
  %indvars.iv108 = phi i64 [ 2, %.lr.ph76.preheader.new ], [ %indvars.iv.next109.1, %.lr.ph76 ]
  %niter = phi i64 [ 0, %.lr.ph76.preheader.new ], [ %niter.next.1, %.lr.ph76 ]
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %indvars.iv108
  %36 = load i32, ptr %35, align 8, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = mul nsw i64 %37, %34
  %39 = srem i64 %38, 1004535809
  %40 = trunc nsw i64 %39 to i32
  store i32 %40, ptr %35, align 8, !tbaa !5
  %indvars.iv.next109 = or disjoint i64 %indvars.iv108, 1
  %41 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %indvars.iv.next109
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = mul nsw i64 %39, %43
  %45 = srem i64 %44, 1004535809
  %46 = trunc nsw i64 %45 to i32
  store i32 %46, ptr %41, align 4, !tbaa !5
  %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %9
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph76, !llvm.loop !11

47:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sdiv i32 %48, %31
  store i32 %49, ptr %2, align 4, !tbaa !5
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %51 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %51, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %52

52:                                               ; preds = %47, %._crit_edge
  %53 = phi i32 [ %51, %47 ], [ %30, %._crit_edge ]
  %.not6377 = icmp slt i32 %53, 0
  br i1 %.not6377, label %.preheader70, label %.lr.ph80

.preheader70:                                     ; preds = %.lr.ph80, %52
  %.lcssa = phi i32 [ %53, %52 ], [ %68, %.lr.ph80 ]
  %54 = shl i32 %.lcssa, 1
  br label %70

.lr.ph80:                                         ; preds = %52, %.lr.ph80
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.lr.ph80 ], [ 0, %52 ]
  %55 = getelementptr inbounds i32, ptr @f, i64 %indvars.iv113
  %56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %55)
  %57 = load i32, ptr %55, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %indvars.iv113
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %61, %58
  %63 = srem i64 %62, 1004535809
  %64 = trunc nsw i64 %63 to i32
  store i32 %64, ptr %55, align 4, !tbaa !5
  %65 = and i64 %indvars.iv113, 1
  %.not68 = icmp eq i64 %65, 0
  %66 = sub nsw i32 1004535809, %60
  %spec.select = select i1 %.not68, i32 %60, i32 %66
  %67 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %indvars.iv113
  store i32 %spec.select, ptr %67, align 4, !tbaa !5
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %.not63.not = icmp slt i64 %indvars.iv113, %69
  br i1 %.not63.not, label %.lr.ph80, label %.preheader70, !llvm.loop !12

70:                                               ; preds = %70, %.preheader70
  %.058 = phi i32 [ %71, %70 ], [ 1, %.preheader70 ]
  %.not64 = icmp sgt i32 %.058, %54
  %71 = shl i32 %.058, 1
  br i1 %.not64, label %72, label %70, !llvm.loop !13

72:                                               ; preds = %70
  call void @_Z7initNTTi(i32 noundef %.058)
  %73 = load i32, ptr %1, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr @f, i64 %74
  %76 = getelementptr inbounds i8, ptr %75, i64 4
  %77 = xor i32 %73, -1
  %78 = add i32 %.058, %77
  %79 = sext i32 %78 to i64
  %80 = shl nsw i64 %79, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %76, i8 0, i64 %80, i1 false)
  %81 = getelementptr inbounds i32, ptr @g, i64 %74
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %82, i8 0, i64 %80, i1 false)
  call void @_Z3NTTiPii(i32 noundef %.058, ptr noundef nonnull @f, i32 noundef 1)
  call void @_Z3NTTiPii(i32 noundef %.058, ptr noundef nonnull @g, i32 noundef 1)
  %83 = icmp sgt i32 %.058, 0
  br i1 %83, label %.lr.ph83.preheader, label %._crit_edge84

.lr.ph83.preheader:                               ; preds = %72
  %wide.trip.count119 = zext nneg i32 %.058 to i64
  %xtraiter153 = and i64 %wide.trip.count119, 1
  %84 = icmp eq i32 %.058, 1
  br i1 %84, label %._crit_edge84.loopexit.unr-lcssa, label %.lr.ph83.preheader.new

.lr.ph83.preheader.new:                           ; preds = %.lr.ph83.preheader
  %unroll_iter155 = and i64 %wide.trip.count119, 2147483646
  br label %.lr.ph83

._crit_edge84.loopexit.unr-lcssa:                 ; preds = %.lr.ph83, %.lr.ph83.preheader
  %indvars.iv116.unr = phi i64 [ 0, %.lr.ph83.preheader ], [ %indvars.iv.next117.1, %.lr.ph83 ]
  %lcmp.mod154.not = icmp eq i64 %xtraiter153, 0
  br i1 %lcmp.mod154.not, label %._crit_edge84, label %.lr.ph83.epil

.lr.ph83.epil:                                    ; preds = %._crit_edge84.loopexit.unr-lcssa
  %85 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %indvars.iv116.unr
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %indvars.iv116.unr
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = mul nsw i64 %90, %87
  %92 = srem i64 %91, 1004535809
  %93 = trunc nsw i64 %92 to i32
  store i32 %93, ptr %85, align 4, !tbaa !5
  br label %._crit_edge84

._crit_edge84:                                    ; preds = %.lr.ph83.epil, %._crit_edge84.loopexit.unr-lcssa, %72
  call void @_Z3NTTiPii(i32 noundef %.058, ptr noundef nonnull @f, i32 noundef -1)
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %.not6585 = icmp slt i32 %94, 0
  %.pre137 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %.not6585, label %.preheader69, label %.lr.ph90.preheader

.lr.ph90.preheader:                               ; preds = %._crit_edge84
  %.pre134 = load i32, ptr @m, align 4, !tbaa !5
  %.pre136 = load i32, ptr @dt, align 4, !tbaa !5
  br label %.lr.ph90

.lr.ph83:                                         ; preds = %.lr.ph83, %.lr.ph83.preheader.new
  %indvars.iv116 = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %indvars.iv.next117.1, %.lr.ph83 ]
  %niter156 = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %niter156.next.1, %.lr.ph83 ]
  %95 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %indvars.iv116
  %96 = load i32, ptr %95, align 8, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %indvars.iv116
  %99 = load i32, ptr %98, align 8, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = mul nsw i64 %100, %97
  %102 = srem i64 %101, 1004535809
  %103 = trunc nsw i64 %102 to i32
  store i32 %103, ptr %95, align 8, !tbaa !5
  %indvars.iv.next117 = or disjoint i64 %indvars.iv116, 1
  %104 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %indvars.iv.next117
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [262145 x i32], ptr @g, i64 0, i64 %indvars.iv.next117
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %109, %106
  %111 = srem i64 %110, 1004535809
  %112 = trunc nsw i64 %111 to i32
  store i32 %112, ptr %104, align 4, !tbaa !5
  %indvars.iv.next117.1 = add nuw nsw i64 %indvars.iv116, 2
  %niter156.next.1 = add i64 %niter156, 2
  %niter156.ncmp.1 = icmp eq i64 %niter156.next.1, %unroll_iter155
  br i1 %niter156.ncmp.1, label %._crit_edge84.loopexit.unr-lcssa, label %.lr.ph83, !llvm.loop !14

.preheader69.loopexit:                            ; preds = %.lr.ph90
  %113 = trunc nsw i64 %153 to i32
  br label %.preheader69

.preheader69:                                     ; preds = %.preheader69.loopexit, %._crit_edge84
  %114 = phi i32 [ %.pre137, %._crit_edge84 ], [ %136, %.preheader69.loopexit ]
  %.056.lcssa = phi i32 [ 0, %._crit_edge84 ], [ %113, %.preheader69.loopexit ]
  %.not6692 = icmp slt i32 %114, 2
  br i1 %.not6692, label %.preheader, label %.lr.ph95.preheader

.lr.ph95.preheader:                               ; preds = %.preheader69
  %115 = add nuw i32 %114, 1
  %wide.trip.count127 = zext i32 %115 to i64
  %xtraiter157 = and i64 %wide.trip.count127, 1
  %116 = icmp eq i32 %115, 3
  br i1 %116, label %.preheader.loopexit.unr-lcssa, label %.lr.ph95.preheader.new

.lr.ph95.preheader.new:                           ; preds = %.lr.ph95.preheader
  %117 = and i64 %wide.trip.count127, 4294967294
  %118 = add nsw i64 %117, -4
  br label %.lr.ph95

.lr.ph90:                                         ; preds = %.lr.ph90.preheader, %.lr.ph90
  %119 = phi i32 [ %.pre136, %.lr.ph90.preheader ], [ %137, %.lr.ph90 ]
  %120 = phi i32 [ %.pre137, %.lr.ph90.preheader ], [ %136, %.lr.ph90 ]
  %121 = phi i32 [ %.pre134, %.lr.ph90.preheader ], [ %128, %.lr.ph90 ]
  %indvars.iv121 = phi i64 [ 0, %.lr.ph90.preheader ], [ %indvars.iv.next122, %.lr.ph90 ]
  %.05587 = phi i64 [ 1, %.lr.ph90.preheader ], [ %159, %.lr.ph90 ]
  %.05686 = phi i64 [ 0, %.lr.ph90.preheader ], [ %153, %.lr.ph90 ]
  %122 = trunc nuw nsw i64 %indvars.iv121 to i32
  %123 = sub nsw i32 %121, %122
  %124 = mul nsw i32 %119, %122
  %125 = sub nsw i32 %120, %124
  %126 = call noundef i32 @_Z7mod_powii(i32 noundef %123, i32 noundef %125)
  %127 = sext i32 %126 to i64
  %128 = load i32, ptr @m, align 4, !tbaa !5
  %129 = sub nsw i32 %128, %122
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %133, %127
  %135 = srem i64 %134, 1004535809
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = load i32, ptr @dt, align 4, !tbaa !5
  %138 = mul nsw i32 %137, %122
  %139 = sub nsw i32 %136, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = mul nsw i64 %135, %143
  %145 = srem i64 %144, 1004535809
  %146 = mul nsw i64 %145, %.05587
  %147 = srem i64 %146, 1004535809
  %148 = getelementptr inbounds [262145 x i32], ptr @f, i64 0, i64 %indvars.iv121
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = mul nsw i64 %147, %150
  %152 = add nsw i64 %151, %.05686
  %153 = srem i64 %152, 1004535809
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %154 = sext i32 %137 to i64
  %155 = getelementptr inbounds [10000001 x i32], ptr @ifct, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = mul nsw i64 %.05587, %157
  %159 = srem i64 %158, 1004535809
  %160 = load i32, ptr %1, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %.not65.not = icmp slt i64 %indvars.iv121, %161
  br i1 %.not65.not, label %.lr.ph90, label %.preheader69.loopexit, !llvm.loop !15

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph95, %.lr.ph95.preheader
  %.lcssa149.ph = phi i32 [ poison, %.lr.ph95.preheader ], [ %176, %.lr.ph95 ]
  %indvars.iv124.unr = phi i64 [ 2, %.lr.ph95.preheader ], [ %indvars.iv.next125.1, %.lr.ph95 ]
  %.193.unr = phi i32 [ %.056.lcssa, %.lr.ph95.preheader ], [ %176, %.lr.ph95 ]
  %lcmp.mod158.not = icmp eq i64 %xtraiter157, 0
  br i1 %lcmp.mod158.not, label %.preheader, label %.lr.ph95.epil

.lr.ph95.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %162 = sext i32 %.193.unr to i64
  %163 = mul nsw i64 %indvars.iv124.unr, %162
  %164 = srem i64 %163, 1004535809
  %165 = trunc nsw i64 %164 to i32
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph95.epil, %.preheader.loopexit.unr-lcssa, %.preheader69
  %.1.lcssa = phi i32 [ %.056.lcssa, %.preheader69 ], [ %.lcssa149.ph, %.preheader.loopexit.unr-lcssa ], [ %165, %.lr.ph95.epil ]
  %166 = load i32, ptr @m, align 4, !tbaa !5
  %.not6797 = icmp slt i32 %166, 2
  br i1 %.not6797, label %._crit_edge101, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %.preheader
  %167 = add nuw i32 %166, 1
  %wide.trip.count132 = zext i32 %167 to i64
  %xtraiter162 = and i64 %wide.trip.count132, 1
  %168 = icmp eq i32 %167, 3
  br i1 %168, label %._crit_edge101.loopexit.unr-lcssa, label %.lr.ph100.preheader.new

.lr.ph100.preheader.new:                          ; preds = %.lr.ph100.preheader
  %169 = and i64 %wide.trip.count132, 4294967294
  %170 = add nsw i64 %169, -4
  br label %.lr.ph100

.lr.ph95:                                         ; preds = %.lr.ph95, %.lr.ph95.preheader.new
  %indvars.iv124 = phi i64 [ 2, %.lr.ph95.preheader.new ], [ %indvars.iv.next125.1, %.lr.ph95 ]
  %.193 = phi i32 [ %.056.lcssa, %.lr.ph95.preheader.new ], [ %176, %.lr.ph95 ]
  %niter161 = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %niter161.next.1, %.lr.ph95 ]
  %171 = sext i32 %.193 to i64
  %172 = mul nsw i64 %indvars.iv124, %171
  %173 = srem i64 %172, 1004535809
  %indvars.iv.next125 = or disjoint i64 %indvars.iv124, 1
  %174 = mul nsw i64 %indvars.iv.next125, %173
  %175 = srem i64 %174, 1004535809
  %176 = trunc nsw i64 %175 to i32
  %indvars.iv.next125.1 = add nuw nsw i64 %indvars.iv124, 2
  %niter161.next.1 = add i64 %niter161, 2
  %niter161.ncmp.1 = icmp eq i64 %niter161, %118
  br i1 %niter161.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph95, !llvm.loop !16

._crit_edge101.loopexit.unr-lcssa:                ; preds = %.lr.ph100, %.lr.ph100.preheader
  %.lcssa148.ph = phi i32 [ poison, %.lr.ph100.preheader ], [ %187, %.lr.ph100 ]
  %indvars.iv129.unr = phi i64 [ 2, %.lr.ph100.preheader ], [ %indvars.iv.next130.1, %.lr.ph100 ]
  %.298.unr = phi i32 [ %.1.lcssa, %.lr.ph100.preheader ], [ %187, %.lr.ph100 ]
  %lcmp.mod163.not = icmp eq i64 %xtraiter162, 0
  br i1 %lcmp.mod163.not, label %._crit_edge101, label %.lr.ph100.epil

.lr.ph100.epil:                                   ; preds = %._crit_edge101.loopexit.unr-lcssa
  %177 = sext i32 %.298.unr to i64
  %178 = mul nsw i64 %indvars.iv129.unr, %177
  %179 = srem i64 %178, 1004535809
  %180 = trunc nsw i64 %179 to i32
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %.lr.ph100.epil, %._crit_edge101.loopexit.unr-lcssa, %.preheader
  %.2.lcssa = phi i32 [ %.1.lcssa, %.preheader ], [ %.lcssa148.ph, %._crit_edge101.loopexit.unr-lcssa ], [ %180, %.lr.ph100.epil ]
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.2.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph100:                                        ; preds = %.lr.ph100, %.lr.ph100.preheader.new
  %indvars.iv129 = phi i64 [ 2, %.lr.ph100.preheader.new ], [ %indvars.iv.next130.1, %.lr.ph100 ]
  %.298 = phi i32 [ %.1.lcssa, %.lr.ph100.preheader.new ], [ %187, %.lr.ph100 ]
  %niter166 = phi i64 [ 0, %.lr.ph100.preheader.new ], [ %niter166.next.1, %.lr.ph100 ]
  %182 = sext i32 %.298 to i64
  %183 = mul nsw i64 %indvars.iv129, %182
  %184 = srem i64 %183, 1004535809
  %indvars.iv.next130 = or disjoint i64 %indvars.iv129, 1
  %185 = mul nsw i64 %indvars.iv.next130, %184
  %186 = srem i64 %185, 1004535809
  %187 = trunc nsw i64 %186 to i32
  %indvars.iv.next130.1 = add nuw nsw i64 %indvars.iv129, 2
  %niter166.next.1 = add i64 %niter166, 2
  %niter166.ncmp.1 = icmp eq i64 %niter166, %170
  br i1 %niter166.ncmp.1, label %._crit_edge101.loopexit.unr-lcssa, label %.lr.ph100, !llvm.loop !17
}

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

; 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 #5

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


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