; LLVM IR from tangjz/acm-icpc :: loj (3212)

; 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
@t = external dso_local global i32, align 4
@f = external dso_local global [40000001 x i32], align 16
@que = external dso_local global [40000001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@s = external dso_local global [40000001 x i64], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE1x = external hidden global i32, align 4
@_ZZ4mainE1y = external hidden global i32, align 4
@_ZZ4mainE1z = external hidden global i32, align 4
@_ZZ4mainE1m = external hidden global i32, align 4
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i128, align 16
  %10 = alloca i128, align 16
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = load ptr, ptr @stdin, align 8, !tbaa !5
  %13 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %12)
  %14 = load ptr, ptr @stdout, align 8, !tbaa !5
  %15 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %14)
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n, ptr noundef @t)
  %17 = load i32, ptr @t, align 4, !tbaa !9
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %34, label %19

19:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %30, %19
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = load i32, ptr @n, align 4, !tbaa !9
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i64, ptr @s, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %28)
  br label %30

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !9
  br label %20, !llvm.loop !11

33:                                               ; preds = %24
  br label %103

34:                                               ; preds = %0
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef @_ZZ4mainE1x, ptr noundef @_ZZ4mainE1y, ptr noundef @_ZZ4mainE1z, ptr noundef getelementptr inbounds (i64, ptr @s, i64 1), ptr noundef getelementptr inbounds (i64, ptr @s, i64 2), ptr noundef @_ZZ4mainE1m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 3, ptr %3, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %66, %34
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = load i32, ptr @n, align 4, !tbaa !9
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %69

41:                                               ; preds = %36
  %42 = load i32, ptr @_ZZ4mainE1x, align 4, !tbaa !9
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !13
  %48 = trunc i64 %47 to i32
  %49 = mul nsw i32 %42, %48
  %50 = load i32, ptr @_ZZ4mainE1y, align 4, !tbaa !9
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = sub nsw i32 %51, 2
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !13
  %56 = trunc i64 %55 to i32
  %57 = mul nsw i32 %50, %56
  %58 = add nsw i32 %49, %57
  %59 = load i32, ptr @_ZZ4mainE1z, align 4, !tbaa !9
  %60 = add nsw i32 %58, %59
  %61 = and i32 %60, 1073741823
  %62 = sext i32 %61 to i64
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %64
  store i64 %62, ptr %65, align 8, !tbaa !13
  br label %66

66:                                               ; preds = %41
  %67 = load i32, ptr %3, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !9
  br label %36, !llvm.loop !15

69:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %101, %69
  %71 = load i32, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %73 = icmp ne i32 %71, 0
  br i1 %73, label %74, label %102

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = sub nsw i32 %78, %77
  store i32 %79, ptr %7, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %98, %74
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %84, label %101

84:                                               ; preds = %80
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !13
  %89 = trunc i64 %88 to i32
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = srem i32 %89, %90
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = add nsw i32 %91, %92
  %94 = sext i32 %93 to i64
  %95 = load i32, ptr %4, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %96
  store i64 %94, ptr %97, align 8, !tbaa !13
  br label %98

98:                                               ; preds = %84
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %4, align 4, !tbaa !9
  br label %80, !llvm.loop !16

101:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %70, !llvm.loop !17

102:                                              ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %103

103:                                              ; preds = %102, %33
  %104 = load i32, ptr @R, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @R, align 4, !tbaa !9
  %106 = sext i32 %104 to i64
  %107 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %106
  store i32 0, ptr %107, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %242, %103
  %109 = load i32, ptr %8, align 4, !tbaa !9
  %110 = load i32, ptr @n, align 4, !tbaa !9
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %245

113:                                              ; preds = %108
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !13
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !13
  %123 = add nsw i64 %122, %118
  store i64 %123, ptr %121, align 8, !tbaa !13
  br label %124

124:                                              ; preds = %167, %113
  %125 = load i32, ptr @L, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  %127 = load i32, ptr @R, align 4, !tbaa !9
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %164

129:                                              ; preds = %124
  %130 = load i32, ptr %8, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !13
  %134 = load i32, ptr @L, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !13
  %142 = sub nsw i64 %133, %141
  %143 = load i32, ptr @L, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !13
  %151 = load i32, ptr @L, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !13
  %162 = sub nsw i64 %150, %161
  %163 = icmp sge i64 %142, %162
  br label %164

164:                                              ; preds = %129, %124
  %165 = phi i1 [ false, %124 ], [ %163, %129 ]
  br i1 %165, label %166, label %170

166:                                              ; preds = %164
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr @L, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr @L, align 4, !tbaa !9
  br label %124, !llvm.loop !18

170:                                              ; preds = %164
  %171 = load i32, ptr @L, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = load i32, ptr %8, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %176
  store i32 %174, ptr %177, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %233, %170
  %179 = load i32, ptr @L, align 4, !tbaa !9
  %180 = load i32, ptr @R, align 4, !tbaa !9
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %182, label %230

182:                                              ; preds = %178
  %183 = load i32, ptr %8, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %184
  %186 = load i64, ptr %185, align 8, !tbaa !13
  %187 = load i32, ptr %8, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !13
  %191 = load i32, ptr %8, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %195
  %197 = load i64, ptr %196, align 8, !tbaa !13
  %198 = sub nsw i64 %190, %197
  %199 = add nsw i64 %186, %198
  %200 = load i32, ptr @R, align 4, !tbaa !9
  %201 = sub nsw i32 %200, 1
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %205
  %207 = load i64, ptr %206, align 8, !tbaa !13
  %208 = load i32, ptr @R, align 4, !tbaa !9
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %213
  %215 = load i64, ptr %214, align 8, !tbaa !13
  %216 = load i32, ptr @R, align 4, !tbaa !9
  %217 = sub nsw i32 %216, 1
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !9
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %224
  %226 = load i64, ptr %225, align 8, !tbaa !13
  %227 = sub nsw i64 %215, %226
  %228 = add nsw i64 %207, %227
  %229 = icmp sle i64 %199, %228
  br label %230

230:                                              ; preds = %182, %178
  %231 = phi i1 [ false, %178 ], [ %229, %182 ]
  br i1 %231, label %232, label %236

232:                                              ; preds = %230
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr @R, align 4, !tbaa !9
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr @R, align 4, !tbaa !9
  br label %178, !llvm.loop !19

236:                                              ; preds = %230
  %237 = load i32, ptr %8, align 4, !tbaa !9
  %238 = load i32, ptr @R, align 4, !tbaa !9
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr @R, align 4, !tbaa !9
  %240 = sext i32 %238 to i64
  %241 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %240
  store i32 %237, ptr %241, align 4, !tbaa !9
  br label %242

242:                                              ; preds = %236
  %243 = load i32, ptr %8, align 4, !tbaa !9
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %8, align 4, !tbaa !9
  br label %108, !llvm.loop !20

245:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  store i128 0, ptr %9, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %246 = load i32, ptr @n, align 4, !tbaa !9
  store i32 %246, ptr %11, align 4, !tbaa !9
  br label %247

247:                                              ; preds = %270, %245
  %248 = load i32, ptr %11, align 4, !tbaa !9
  %249 = icmp sgt i32 %248, 0
  br i1 %249, label %251, label %250

250:                                              ; preds = %247
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %275

251:                                              ; preds = %247
  %252 = load i32, ptr %11, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !13
  %256 = load i32, ptr %11, align 4, !tbaa !9
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !9
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %260
  %262 = load i64, ptr %261, align 8, !tbaa !13
  %263 = sub nsw i64 %255, %262
  %264 = sext i64 %263 to i128
  store i128 %264, ptr %10, align 16, !tbaa !21
  %265 = load i128, ptr %10, align 16, !tbaa !21
  %266 = load i128, ptr %10, align 16, !tbaa !21
  %267 = mul nsw i128 %265, %266
  %268 = load i128, ptr %9, align 16, !tbaa !21
  %269 = add nsw i128 %268, %267
  store i128 %269, ptr %9, align 16, !tbaa !21
  br label %270

270:                                              ; preds = %251
  %271 = load i32, ptr %11, align 4, !tbaa !9
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !9
  store i32 %274, ptr %11, align 4, !tbaa !9
  br label %247, !llvm.loop !23

275:                                              ; preds = %250
  %276 = load i128, ptr %9, align 16, !tbaa !21
  %277 = icmp slt i128 %276, 1000000000000000000
  br i1 %277, label %278, label %282

278:                                              ; preds = %275
  %279 = load i128, ptr %9, align 16, !tbaa !21
  %280 = trunc i128 %279 to i64
  %281 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %280)
  br label %290

282:                                              ; preds = %275
  %283 = load i128, ptr %9, align 16, !tbaa !21
  %284 = sdiv i128 %283, 1000000000000000000
  %285 = trunc i128 %284 to i64
  %286 = load i128, ptr %9, align 16, !tbaa !21
  %287 = srem i128 %286, 1000000000000000000
  %288 = trunc i128 %287 to i64
  %289 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %285, i32 noundef 18, i64 noundef %288)
  br label %290

290:                                              ; preds = %282, %278
  %291 = load ptr, ptr @stdin, align 8, !tbaa !5
  %292 = call i32 @fclose(ptr noundef %291)
  %293 = load ptr, ptr @stdout, align 8, !tbaa !5
  %294 = call i32 @fclose(ptr noundef %293)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

declare i32 @fclose(ptr noundef) #1

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"__int128", !7, i64 0}
!23 = distinct !{!23, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [40000001 x i32], align 16
@que = external dso_local local_unnamed_addr global [40000001 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local global [40000001 x i64], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE1x = external hidden global i32, align 4
@_ZZ4mainE1y = external hidden global i32, align 4
@_ZZ4mainE1z = external hidden global i32, align 4
@_ZZ4mainE1m = external hidden global i32, align 4
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = load ptr, ptr @stdin, align 8, !tbaa !5
  %5 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %4)
  %6 = load ptr, ptr @stdout, align 8, !tbaa !5
  %7 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %6)
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @t)
  %9 = load i32, ptr @t, align 4, !tbaa !9
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.preheader54, label %19

.preheader54:                                     ; preds = %0
  %10 = load i32, ptr @n, align 4, !tbaa !9
  %.not4367 = icmp slt i32 %10, 1
  br i1 %.not4367, label %.loopexit.thread, label %.lr.ph69

.loopexit.thread:                                 ; preds = %.preheader54
  %11 = load i32, ptr @R, align 4, !tbaa !9
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr @R, align 4, !tbaa !9
  %13 = sext i32 %11 to i64
  %14 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %13
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %._crit_edge99.thread

.lr.ph69:                                         ; preds = %.preheader54, %.lr.ph69
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph69 ], [ 1, %.preheader54 ]
  %15 = getelementptr inbounds i64, ptr @s, i64 %indvars.iv109
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %15)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %17 = load i32, ptr @n, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %.not43.not = icmp slt i64 %indvars.iv109, %18
  br i1 %.not43.not, label %.lr.ph69, label %.loopexit, !llvm.loop !11

19:                                               ; preds = %0
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @_ZZ4mainE1x, ptr noundef nonnull @_ZZ4mainE1y, ptr noundef nonnull @_ZZ4mainE1z, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 8), ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 16), ptr noundef nonnull @_ZZ4mainE1m)
  %21 = load i32, ptr @n, align 4, !tbaa !9
  %.not4459 = icmp slt i32 %21, 3
  br i1 %.not4459, label %.preheader55, label %.lr.ph

.lr.ph:                                           ; preds = %19
  %22 = load i32, ptr @_ZZ4mainE1x, align 4, !tbaa !9
  %23 = load i32, ptr @_ZZ4mainE1y, align 4, !tbaa !9
  %24 = load i32, ptr @_ZZ4mainE1z, align 4, !tbaa !9
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @s, i64 16), align 16, !tbaa !13
  %25 = trunc i64 %.pre to i32
  %26 = zext nneg i32 %21 to i64
  %xtraiter = and i64 %26, 1
  %27 = icmp eq i32 %21, 3
  br i1 %27, label %.preheader55.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %28 = and i64 %26, 2147483646
  %29 = add nsw i64 %28, -4
  br label %43

.preheader55.loopexit.unr-lcssa:                  ; preds = %43, %.lr.ph
  %.unr = phi i32 [ %25, %.lr.ph ], [ %64, %43 ]
  %indvars.iv.unr = phi i64 [ 3, %.lr.ph ], [ %indvars.iv.next.1, %43 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader55, label %.preheader55.loopexit.epilog-lcssa

.preheader55.loopexit.epilog-lcssa:               ; preds = %.preheader55.loopexit.unr-lcssa
  %30 = mul nsw i32 %22, %.unr
  %31 = add nsw i64 %indvars.iv.unr, -2
  %32 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = trunc i64 %33 to i32
  %35 = mul nsw i32 %23, %34
  %36 = add i32 %24, %30
  %37 = add i32 %36, %35
  %38 = and i32 %37, 1073741823
  %39 = zext nneg i32 %38 to i64
  %40 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv.unr
  store i64 %39, ptr %40, align 8, !tbaa !13
  br label %.preheader55

.preheader55:                                     ; preds = %.preheader55.loopexit.epilog-lcssa, %.preheader55.loopexit.unr-lcssa, %19
  %41 = load i32, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %.not4564 = icmp eq i32 %41, 0
  br i1 %.not4564, label %.loopexit, label %.lr.ph66

43:                                               ; preds = %43, %.lr.ph.new
  %44 = phi i32 [ %25, %.lr.ph.new ], [ %64, %43 ]
  %indvars.iv = phi i64 [ 3, %.lr.ph.new ], [ %indvars.iv.next.1, %43 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %43 ]
  %45 = mul nsw i32 %22, %44
  %46 = add nsw i64 %indvars.iv, -2
  %47 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = trunc i64 %48 to i32
  %50 = mul nsw i32 %23, %49
  %51 = add i32 %24, %45
  %52 = add i32 %51, %50
  %53 = and i32 %52, 1073741823
  %54 = zext nneg i32 %53 to i64
  %55 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv
  store i64 %54, ptr %55, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = mul i32 %22, %52
  %57 = add nsw i64 %indvars.iv, -1
  %58 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !13
  %60 = trunc i64 %59 to i32
  %61 = mul nsw i32 %23, %60
  %62 = add i32 %24, %56
  %63 = add i32 %62, %61
  %64 = and i32 %63, 1073741823
  %65 = zext nneg i32 %64 to i64
  %66 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv.next
  store i64 %65, ptr %66, align 8, !tbaa !13
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %29
  br i1 %niter.ncmp.1, label %.preheader55.loopexit.unr-lcssa, label %43, !llvm.loop !15

.lr.ph66:                                         ; preds = %.preheader55, %._crit_edge
  %.03865 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 1, %.preheader55 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %68 = load i32, ptr %2, align 4, !tbaa !9
  %69 = load i32, ptr %3, align 4, !tbaa !9
  %reass.sub = sub i32 %69, %68
  %70 = add i32 %reass.sub, 1
  %71 = load i32, ptr %1, align 4, !tbaa !9
  %.not4961 = icmp sgt i32 %.03865, %71
  br i1 %.not4961, label %._crit_edge, label %.lr.ph63.preheader

.lr.ph63.preheader:                               ; preds = %.lr.ph66
  %72 = sext i32 %.03865 to i64
  %73 = add i32 %71, 1
  %74 = sub i32 %73, %.03865
  %xtraiter149 = and i32 %74, 1
  %lcmp.mod150.not = icmp eq i32 %xtraiter149, 0
  br i1 %lcmp.mod150.not, label %.lr.ph63.prol.loopexit, label %.lr.ph63.prol

.lr.ph63.prol:                                    ; preds = %.lr.ph63.preheader
  %75 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %72
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = trunc i64 %76 to i32
  %78 = srem i32 %77, %70
  %79 = add nsw i32 %78, %68
  %80 = sext i32 %79 to i64
  store i64 %80, ptr %75, align 8, !tbaa !13
  %indvars.iv.next106.prol = add nsw i64 %72, 1
  br label %.lr.ph63.prol.loopexit

.lr.ph63.prol.loopexit:                           ; preds = %.lr.ph63.prol, %.lr.ph63.preheader
  %indvars.iv105.unr = phi i64 [ %72, %.lr.ph63.preheader ], [ %indvars.iv.next106.prol, %.lr.ph63.prol ]
  %81 = icmp eq i32 %71, %.03865
  br i1 %81, label %._crit_edge, label %.lr.ph63

.lr.ph63:                                         ; preds = %.lr.ph63.prol.loopexit, %.lr.ph63
  %indvars.iv105 = phi i64 [ %indvars.iv.next106.1, %.lr.ph63 ], [ %indvars.iv105.unr, %.lr.ph63.prol.loopexit ]
  %82 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv105
  %83 = load i64, ptr %82, align 8, !tbaa !13
  %84 = trunc i64 %83 to i32
  %85 = srem i32 %84, %70
  %86 = add nsw i32 %85, %68
  %87 = sext i32 %86 to i64
  store i64 %87, ptr %82, align 8, !tbaa !13
  %indvars.iv.next106 = add nsw i64 %indvars.iv105, 1
  %88 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv.next106
  %89 = load i64, ptr %88, align 8, !tbaa !13
  %90 = trunc i64 %89 to i32
  %91 = srem i32 %90, %70
  %92 = add nsw i32 %91, %68
  %93 = sext i32 %92 to i64
  store i64 %93, ptr %88, align 8, !tbaa !13
  %indvars.iv.next106.1 = add nsw i64 %indvars.iv105, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next106.1 to i32
  %exitcond108.not.1 = icmp eq i32 %73, %lftr.wideiv.1
  br i1 %exitcond108.not.1, label %._crit_edge, label %.lr.ph63, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph63.prol.loopexit, %.lr.ph63, %.lr.ph66
  %.1.lcssa = phi i32 [ %.03865, %.lr.ph66 ], [ %73, %.lr.ph63 ], [ %73, %.lr.ph63.prol.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %94 = load i32, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr @_ZZ4mainE1m, align 4, !tbaa !9
  %.not45 = icmp eq i32 %94, 0
  br i1 %.not45, label %.loopexit.loopexit101, label %.lr.ph66, !llvm.loop !17

.loopexit.loopexit101:                            ; preds = %._crit_edge
  %.pre124 = load i32, ptr @n, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph69, %.loopexit.loopexit101, %.preheader55
  %96 = phi i32 [ %.pre124, %.loopexit.loopexit101 ], [ %21, %.preheader55 ], [ %17, %.lr.ph69 ]
  %97 = load i32, ptr @R, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr @R, align 4, !tbaa !9
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %99
  store i32 0, ptr %100, align 4, !tbaa !9
  %.not4688 = icmp slt i32 %96, 1
  br i1 %.not4688, label %._crit_edge99.thread, label %.lr.ph93.preheader

.lr.ph93.preheader:                               ; preds = %.loopexit
  %L.promoted81 = load i32, ptr @L, align 4, !tbaa !9
  %101 = add nuw i32 %96, 1
  %wide.trip.count122 = zext i32 %101 to i64
  %.pre125 = load i64, ptr @s, align 16, !tbaa !13
  br label %.lr.ph93

.preheader:                                       ; preds = %.critedge2
  store i32 %168, ptr @R, align 4, !tbaa !9
  br label %.lr.ph98

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %.critedge2
  %102 = phi i64 [ %.pre125, %.lr.ph93.preheader ], [ %105, %.critedge2 ]
  %indvars.iv119 = phi i64 [ 1, %.lr.ph93.preheader ], [ %indvars.iv.next120, %.critedge2 ]
  %R.promoted8090 = phi i32 [ %98, %.lr.ph93.preheader ], [ %168, %.critedge2 ]
  %L.promoted8489 = phi i32 [ %L.promoted81, %.lr.ph93.preheader ], [ %L.promoted82129, %.critedge2 ]
  %103 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %indvars.iv119
  %104 = load i64, ptr %103, align 8, !tbaa !13
  %105 = add nsw i64 %104, %102
  store i64 %105, ptr %103, align 8, !tbaa !13
  %106 = add nsw i32 %L.promoted8489, 1
  %107 = icmp slt i32 %106, %R.promoted8090
  br i1 %107, label %.lr.ph71.preheader, label %.critedge

.lr.ph71.preheader:                               ; preds = %.lr.ph93
  %108 = sext i32 %L.promoted8489 to i64
  %109 = add nsw i64 %108, 1
  %110 = sext i32 %R.promoted8090 to i64
  %111 = add nsw i32 %R.promoted8090, -1
  %112 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %109
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !13
  %117 = sub nsw i64 %105, %116
  %118 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %114
  %119 = load i32, ptr %118, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !13
  %123 = sub nsw i64 %116, %122
  %.not47141 = icmp slt i64 %117, %123
  br i1 %.not47141, label %.critedge, label %.lr.ph143

.lr.ph71:                                         ; preds = %.lr.ph143
  %124 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %indvars.iv.next113
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !13
  %129 = sub nsw i64 %105, %128
  %130 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %126
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !13
  %135 = sub nsw i64 %128, %134
  %.not47 = icmp slt i64 %129, %135
  br i1 %.not47, label %.critedge.loopexit, label %.lr.ph143, !llvm.loop !18

.lr.ph143:                                        ; preds = %.lr.ph71.preheader, %.lr.ph71
  %indvars.iv112142 = phi i64 [ %indvars.iv.next113, %.lr.ph71 ], [ %109, %.lr.ph71.preheader ]
  %136 = trunc nsw i64 %indvars.iv112142 to i32
  %indvars.iv.next113 = add nsw i64 %indvars.iv112142, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next113, %110
  br i1 %exitcond115.not, label %.critedge.thread, label %.lr.ph71, !llvm.loop !18

.critedge.thread:                                 ; preds = %.lr.ph143
  store i32 %136, ptr @L, align 4, !tbaa !9
  %137 = sext i32 %111 to i64
  %138 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %indvars.iv119
  store i32 %139, ptr %140, align 4, !tbaa !9
  br label %.lr.ph75

.critedge.loopexit:                               ; preds = %.lr.ph71
  store i32 %136, ptr @L, align 4, !tbaa !9
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph71.preheader, %.lr.ph93
  %L.promoted82 = phi i32 [ %L.promoted8489, %.lr.ph93 ], [ %L.promoted8489, %.lr.ph71.preheader ], [ %136, %.critedge.loopexit ]
  %141 = sext i32 %L.promoted82 to i64
  %142 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %indvars.iv119
  store i32 %143, ptr %144, align 4, !tbaa !9
  %145 = icmp slt i32 %L.promoted82, %R.promoted8090
  br i1 %145, label %.lr.ph75, label %.critedge2

.lr.ph75:                                         ; preds = %.critedge.thread, %.critedge
  %146 = phi i32 [ %139, %.critedge.thread ], [ %143, %.critedge ]
  %147 = phi i64 [ %137, %.critedge.thread ], [ %141, %.critedge ]
  %L.promoted82128 = phi i32 [ %111, %.critedge.thread ], [ %L.promoted82, %.critedge ]
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !13
  %factor = shl i64 %105, 1
  %151 = sub i64 %factor, %150
  %152 = sext i32 %R.promoted8090 to i64
  br label %153

153:                                              ; preds = %.lr.ph75, %165
  %indvars.iv116 = phi i64 [ %152, %.lr.ph75 ], [ %indvars.iv.next117, %165 ]
  %indvars.iv.next117 = add nsw i64 %indvars.iv116, -1
  %154 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %indvars.iv.next117
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !13
  %159 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %156
  %160 = load i32, ptr %159, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !13
  %factor53 = shl i64 %158, 1
  %164 = sub i64 %factor53, %163
  %.not48 = icmp sgt i64 %151, %164
  br i1 %.not48, label %.critedge2.loopexit.split.loop.exit135, label %165

165:                                              ; preds = %153
  %166 = icmp sgt i64 %indvars.iv.next117, %147
  br i1 %166, label %153, label %.critedge2, !llvm.loop !19

.critedge2.loopexit.split.loop.exit135:           ; preds = %153
  %167 = trunc nsw i64 %indvars.iv116 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %165, %.critedge2.loopexit.split.loop.exit135, %.critedge
  %L.promoted82129 = phi i32 [ %L.promoted82, %.critedge ], [ %L.promoted82128, %.critedge2.loopexit.split.loop.exit135 ], [ %L.promoted82128, %165 ]
  %.lcssa57 = phi i32 [ %R.promoted8090, %.critedge ], [ %167, %.critedge2.loopexit.split.loop.exit135 ], [ %L.promoted82128, %165 ]
  %168 = add nsw i32 %.lcssa57, 1
  %169 = sext i32 %.lcssa57 to i64
  %170 = getelementptr inbounds [40000001 x i32], ptr @que, i64 0, i64 %169
  %171 = trunc nuw nsw i64 %indvars.iv119 to i32
  store i32 %171, ptr %170, align 4, !tbaa !9
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count122
  br i1 %exitcond123.not, label %.preheader, label %.lr.ph93, !llvm.loop !20

._crit_edge99:                                    ; preds = %.lr.ph98
  %172 = icmp ult i128 %184, 1000000000000000000
  %extract.t = trunc i128 %184 to i64
  br i1 %172, label %._crit_edge99.thread, label %187

.lr.ph98:                                         ; preds = %.preheader, %.lr.ph98
  %.097 = phi i32 [ %177, %.lr.ph98 ], [ %96, %.preheader ]
  %.03696 = phi i128 [ %184, %.lr.ph98 ], [ 0, %.preheader ]
  %173 = zext nneg i32 %.097 to i64
  %174 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !13
  %176 = getelementptr inbounds [40000001 x i32], ptr @f, i64 0, i64 %173
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [40000001 x i64], ptr @s, i64 0, i64 %178
  %180 = load i64, ptr %179, align 8, !tbaa !13
  %181 = sub nsw i64 %175, %180
  %182 = sext i64 %181 to i128
  %183 = mul nsw i128 %182, %182
  %184 = add nuw nsw i128 %183, %.03696
  %185 = icmp sgt i32 %177, 0
  br i1 %185, label %.lr.ph98, label %._crit_edge99, !llvm.loop !21

._crit_edge99.thread:                             ; preds = %.loopexit, %.loopexit.thread, %._crit_edge99
  %.036.lcssa131.off0 = phi i64 [ %extract.t, %._crit_edge99 ], [ 0, %.loopexit.thread ], [ 0, %.loopexit ]
  %186 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %.036.lcssa131.off0)
  br label %193

187:                                              ; preds = %._crit_edge99
  %.frozen = freeze i128 %184
  %188 = udiv i128 %.frozen, 1000000000000000000
  %189 = trunc i128 %188 to i64
  %190 = mul i128 %188, 1000000000000000000
  %.decomposed = sub i128 %.frozen, %190
  %191 = trunc nuw nsw i128 %.decomposed to i64
  %192 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %189, i32 noundef 18, i64 noundef %191)
  br label %193

193:                                              ; preds = %187, %._crit_edge99.thread
  %194 = load ptr, ptr @stdin, align 8, !tbaa !5
  %195 = call i32 @fclose(ptr noundef %194)
  %196 = load ptr, ptr @stdout, align 8, !tbaa !5
  %197 = call i32 @fclose(ptr noundef %196)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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