; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (5719)

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

@b = external dso_local global [100005 x i32], align 16
@c = external dso_local global [100005 x i32], align 16
@dp = external dso_local global [100005 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %12

12:                                               ; preds = %247, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %248

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 999999, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %55, %16
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %58

23:                                               ; preds = %18
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %26)
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = icmp sgt i32 %31, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %23
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %34, %23
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 1
  br i1 %40, label %48, label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = icmp sgt i32 %45, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %41, %35
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %48, %41
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %51
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %4, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %49
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %18, !llvm.loop !9

58:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %107, %58
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %110

64:                                               ; preds = %59
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %66
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %67)
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %64
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %75, %64
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp slt i32 %80, 1
  br i1 %81, label %89, label %82

82:                                               ; preds = %76
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = icmp sgt i32 %86, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %82, %76
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %89, %82
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp slt i32 %94, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %90
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %100, %90
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %103
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %5, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %101
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !11

110:                                              ; preds = %63
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %117

113:                                              ; preds = %110
  %114 = load i32, ptr getelementptr inbounds ([100005 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  %115 = load i32, ptr getelementptr inbounds ([100005 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
  %116 = icmp ne i32 %114, %115
  br i1 %116, label %117, label %119

117:                                              ; preds = %113, %110
  %118 = call i32 @puts(ptr noundef @.str.1)
  br label %247

119:                                              ; preds = %113
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 800040, i1 false)
  store i64 1, ptr getelementptr inbounds ([100005 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 2, ptr %10, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %238, %119
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = icmp sle i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %241

125:                                              ; preds = %120
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sub nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %129, %134
  br i1 %135, label %136, label %181

136:                                              ; preds = %125
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = icmp eq i32 %140, %145
  br i1 %146, label %147, label %181

147:                                              ; preds = %136
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = icmp ne i32 %151, %155
  br i1 %156, label %157, label %181

157:                                              ; preds = %147
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %160
  %162 = load i64, ptr %161, align 8, !tbaa !12
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = sub nsw i32 %166, %170
  %172 = add nsw i32 %171, 1
  %173 = load i32, ptr %9, align 4, !tbaa !5
  %174 = sub nsw i32 %172, %173
  %175 = sext i32 %174 to i64
  %176 = mul nsw i64 %162, %175
  %177 = srem i64 %176, 998244353
  %178 = load i32, ptr %10, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %179
  store i64 %177, ptr %180, align 8, !tbaa !12
  br label %235

181:                                              ; preds = %147, %136, %125
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = icmp slt i32 %185, %190
  br i1 %191, label %192, label %203

192:                                              ; preds = %181
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = sub nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %10, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = icmp eq i32 %197, %201
  br i1 %202, label %225, label %203

203:                                              ; preds = %192, %181
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = icmp eq i32 %207, %212
  br i1 %213, label %214, label %234

214:                                              ; preds = %203
  %215 = load i32, ptr %10, align 4, !tbaa !5
  %216 = sub nsw i32 %215, 1
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = load i32, ptr %10, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = icmp slt i32 %219, %223
  br i1 %224, label %225, label %234

225:                                              ; preds = %214, %192
  %226 = load i32, ptr %10, align 4, !tbaa !5
  %227 = sub nsw i32 %226, 1
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %228
  %230 = load i64, ptr %229, align 8, !tbaa !12
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %232
  store i64 %230, ptr %233, align 8, !tbaa !12
  br label %234

234:                                              ; preds = %225, %214, %203
  br label %235

235:                                              ; preds = %234, %157
  %236 = load i32, ptr %9, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %9, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %235
  %239 = load i32, ptr %10, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  store i32 %240, ptr %10, align 4, !tbaa !5
  br label %120, !llvm.loop !14

241:                                              ; preds = %124
  %242 = load i32, ptr %3, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !12
  %246 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %245)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %247

247:                                              ; preds = %241, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %12, !llvm.loop !15

248:                                              ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

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

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

declare i32 @puts(ptr noundef) #2

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

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

@b = external dso_local global [100005 x i32], align 16
@c = external dso_local global [100005 x i32], align 16
@dp = external dso_local local_unnamed_addr global [100005 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr %1, align 4, !tbaa !5
  %.not80 = icmp eq i32 %6, 0
  br i1 %.not80, label %._crit_edge83, label %.lr.ph82

.lr.ph82:                                         ; preds = %0, %81
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 999999, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 -1, ptr %4, align 4, !tbaa !5
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %.not5064 = icmp slt i32 %9, 1
  br i1 %.not5064, label %._crit_edge.thread, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %.not5167 = icmp slt i32 %21, 1
  br i1 %.not5167, label %._crit_edge, label %.lr.ph70

.lr.ph:                                           ; preds = %.lr.ph82, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph82 ]
  %.04465 = phi i32 [ %.2, %.lr.ph ], [ 1, %.lr.ph82 ]
  %10 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %12 = load i32, ptr %10, align 4, !tbaa !5
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = icmp sgt i32 %12, %13
  %15 = icmp slt i32 %12, 1
  %16 = load i32, ptr %2, align 4
  %17 = icmp sgt i32 %12, %16
  %or.cond = select i1 %15, i1 true, i1 %17
  %18 = select i1 %or.cond, i1 true, i1 %14
  %.2 = select i1 %18, i32 0, i32 %.04465
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %20, ptr %3, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %.not50.not = icmp slt i64 %indvars.iv, %22
  br i1 %.not50.not, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph70, %.preheader
  %.3.lcssa = phi i32 [ %.2, %.preheader ], [ %.6, %.lr.ph70 ]
  %.lcssa = phi i32 [ %21, %.preheader ], [ %39, %.lr.ph70 ]
  %.not52 = icmp eq i32 %.3.lcssa, 0
  br i1 %.not52, label %43, label %._crit_edge.thread

.lr.ph70:                                         ; preds = %.preheader, %.lr.ph70
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph70 ], [ 1, %.preheader ]
  %.368 = phi i32 [ %.6, %.lr.ph70 ], [ %.2, %.preheader ]
  %23 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %indvars.iv86
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %23)
  %25 = load i32, ptr %23, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  %28 = icmp slt i32 %25, 1
  %29 = load i32, ptr %2, align 4
  %30 = icmp sgt i32 %25, %29
  %31 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv86
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp slt i32 %25, %32
  %34 = or i1 %28, %33
  %35 = select i1 %34, i1 true, i1 %30
  %36 = select i1 %35, i1 true, i1 %27
  %.6 = select i1 %36, i32 0, i32 %.368
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %4, align 4, !tbaa !5
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %.not51.not = icmp slt i64 %indvars.iv86, %40
  br i1 %.not51.not, label %.lr.ph70, label %._crit_edge, !llvm.loop !11

._crit_edge.thread:                               ; preds = %.lr.ph82, %._crit_edge
  %.lcssa97 = phi i32 [ %.lcssa, %._crit_edge ], [ %9, %.lr.ph82 ]
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), align 4, !tbaa !5
  %.not53 = icmp eq i32 %41, %42
  br i1 %.not53, label %45, label %43

43:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %44 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %81

45:                                               ; preds = %._crit_edge.thread
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) @dp, i8 0, i64 800040, i1 false)
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !12
  %.not5473 = icmp slt i32 %.lcssa97, 2
  br i1 %.not5473, label %._crit_edge79, label %.lr.ph78.preheader

.lr.ph78.preheader:                               ; preds = %45
  %46 = add nuw i32 %.lcssa97, 1
  %wide.trip.count = zext i32 %46 to i64
  br label %.lr.ph78

._crit_edge79:                                    ; preds = %79, %45
  %47 = sext i32 %.lcssa97 to i64
  %48 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !12
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %49)
  br label %81

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %79
  %51 = phi i32 [ %41, %.lr.ph78.preheader ], [ %53, %79 ]
  %indvars.iv89 = phi i64 [ 2, %.lr.ph78.preheader ], [ %indvars.iv.next90, %79 ]
  %.04174 = phi i32 [ 1, %.lr.ph78.preheader ], [ %80, %79 ]
  %52 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %indvars.iv89
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i64 %indvars.iv89, -1
  %55 = icmp eq i32 %53, %51
  %56 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv89
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %54
  %59 = load i32, ptr %58, align 4, !tbaa !5
  br i1 %55, label %60, label %.thread61

60:                                               ; preds = %.lr.ph78
  %61 = icmp ne i32 %57, %59
  %.not55 = icmp eq i32 %57, %51
  %or.cond60 = or i1 %.not55, %61
  br i1 %or.cond60, label %71, label %62

62:                                               ; preds = %60
  %63 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %54
  %64 = load i64, ptr %63, align 8, !tbaa !12
  %65 = add i32 %51, 1
  %66 = add i32 %.04174, %57
  %67 = sub i32 %65, %66
  %68 = sext i32 %67 to i64
  %69 = mul nsw i64 %64, %68
  %70 = srem i64 %69, 998244353
  br label %.sink.split

71:                                               ; preds = %60
  %72 = icmp slt i32 %57, %59
  br i1 %72, label %75, label %.thread61

.thread61:                                        ; preds = %.lr.ph78, %71
  %73 = icmp eq i32 %57, %59
  %74 = icmp slt i32 %51, %53
  %or.cond62 = and i1 %74, %73
  br i1 %or.cond62, label %75, label %79

75:                                               ; preds = %.thread61, %71
  %76 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %54
  %77 = load i64, ptr %76, align 8, !tbaa !12
  br label %.sink.split

.sink.split:                                      ; preds = %62, %75
  %.sink = phi i64 [ %77, %75 ], [ %70, %62 ]
  %78 = getelementptr inbounds [100005 x i64], ptr @dp, i64 0, i64 %indvars.iv89
  store i64 %.sink, ptr %78, align 8, !tbaa !12
  br label %79

79:                                               ; preds = %.sink.split, %.thread61
  %80 = add nuw nsw i32 %.04174, 1
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge79, label %.lr.ph78, !llvm.loop !14

81:                                               ; preds = %._crit_edge79, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %82, 0
  br i1 %.not, label %._crit_edge83, label %.lr.ph82, !llvm.loop !15

._crit_edge83:                                    ; preds = %81, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass