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

; 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
@lim = external dso_local global [5 x i32], align 16
@bin = external dso_local global [1001 x [1001 x i32]], align 16
@ans = external dso_local global i32, align 4
@f = external dso_local global [5 x [1001 x i64]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = ashr i32 %16, 2
  store i32 %17, ptr @lim, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

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

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

22:                                               ; preds = %18
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @lim, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5 x i32], ptr @lim, i64 0, i64 %28
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr @lim, align 16, !tbaa !5
  br label %32

32:                                               ; preds = %22
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

35:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %36

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

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

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %43
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1001 x i32], ptr %44, i64 0, i64 %46
  store i32 1, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %49
  %51 = getelementptr inbounds [1001 x i32], ptr %50, i64 0, i64 0
  store i32 1, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %81, %41
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %84

57:                                               ; preds = %52
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1001 x i32], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %67
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1001 x i32], ptr %68, i64 0, i64 %70
  store i32 %65, ptr %71, align 4, !tbaa !5
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1001 x i32], ptr %75, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %71, i32 noundef %80)
  br label %81

81:                                               ; preds = %57
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %5, align 4, !tbaa !5
  br label %52, !llvm.loop !11

84:                                               ; preds = %56
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !12

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

89:                                               ; preds = %226, %88
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = load i32, ptr @lim, align 16, !tbaa !5
  %92 = icmp sle i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %229

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = shl i32 %96, 2
  %98 = sub nsw i32 %95, %97
  store i32 %98, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %99, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %102
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1001 x i32], ptr %103, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  store i64 %108, ptr @f, align 16, !tbaa !13
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = and i32 %109, 1
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %94
  %113 = load i64, ptr @f, align 16, !tbaa !13
  %114 = sub i64 998244353, %113
  store i64 %114, ptr @f, align 16, !tbaa !13
  br label %115

115:                                              ; preds = %112, %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %214, %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = icmp slt i32 %117, 5
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %217

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5 x i32], ptr @lim, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %121, %125
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sub nsw i32 %126, %127
  store i32 %128, ptr %11, align 4, !tbaa !5
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %130 = load i32, ptr %129, align 4, !tbaa !5
  store i32 %130, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 %132
  %134 = getelementptr inbounds [1001 x i64], ptr %133, i64 0, i64 0
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = mul i64 %137, 8
  call void @llvm.memset.p0.i64(ptr align 8 %134, i8 0, i64 %138, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %209, %120
  %140 = load i32, ptr %12, align 4, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = icmp sle i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %212

144:                                              ; preds = %139
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 %147
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1001 x i64], ptr %148, i64 0, i64 %150
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %151)
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 %154
  %156 = load i32, ptr %12, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [1001 x i64], ptr %155, i64 0, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !13
  %160 = icmp ne i64 %159, 0
  br i1 %160, label %162, label %161

161:                                              ; preds = %144
  br label %209

162:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %163 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %163, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %164 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %164, ptr %14, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %203, %162
  %166 = load i32, ptr %13, align 4, !tbaa !5
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [5 x i32], ptr @lim, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = icmp sle i32 %166, %170
  br i1 %171, label %172, label %176

172:                                              ; preds = %165
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br label %176

176:                                              ; preds = %172, %165
  %177 = phi i1 [ false, %165 ], [ %175, %172 ]
  br i1 %177, label %179, label %178

178:                                              ; preds = %176
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %208

179:                                              ; preds = %176
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 %181
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1001 x i64], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 %188
  %190 = load i32, ptr %12, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [1001 x i64], ptr %189, i64 0, i64 %191
  %193 = load i64, ptr %192, align 8, !tbaa !13
  %194 = load i32, ptr %14, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %195
  %197 = load i32, ptr %12, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1001 x i32], ptr %196, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = mul i64 %193, %201
  call void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8) %185, i64 noundef %202)
  br label %203

203:                                              ; preds = %179
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %13, align 4, !tbaa !5
  %206 = load i32, ptr %14, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %14, align 4, !tbaa !5
  br label %165, !llvm.loop !15

208:                                              ; preds = %178
  br label %209

209:                                              ; preds = %208, %161
  %210 = load i32, ptr %12, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %12, align 4, !tbaa !5
  br label %139, !llvm.loop !16

212:                                              ; preds = %143
  %213 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %213, ptr %8, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %212
  %215 = load i32, ptr %10, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %10, align 4, !tbaa !5
  br label %116, !llvm.loop !17

217:                                              ; preds = %119
  %218 = load i32, ptr %7, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [1001 x i64], ptr getelementptr inbounds ([5 x [1001 x i64]], ptr @f, i64 0, i64 4), i64 0, i64 %219
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %220)
  %221 = load i32, ptr %7, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [1001 x i64], ptr getelementptr inbounds ([5 x [1001 x i64]], ptr @f, i64 0, i64 4), i64 0, i64 %222
  %224 = load i64, ptr %223, align 8, !tbaa !13
  %225 = trunc i64 %224 to i32
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %225)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %226

226:                                              ; preds = %217
  %227 = load i32, ptr %6, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %6, align 4, !tbaa !5
  br label %89, !llvm.loop !18

229:                                              ; preds = %93
  %230 = load i32, ptr @ans, align 4, !tbaa !5
  %231 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %230)
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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
@lim = external dso_local global [5 x i32], align 16
@bin = external dso_local global [1001 x [1001 x i32]], align 16
@ans = external dso_local global i32, align 4
@f = external dso_local global [5 x [1001 x i64]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader66:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = ashr i32 %3, 2
  store i32 %4, ptr @lim, align 16, !tbaa !5
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 4))
  %6 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @lim, i64 4))
  %7 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %7, ptr @lim, align 16, !tbaa !5
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 8))
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @lim, i64 8))
  %10 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %10, ptr @lim, align 16, !tbaa !5
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 12))
  %12 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @lim, i64 12))
  %13 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %13, ptr @lim, align 16, !tbaa !5
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @lim, i64 16))
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @lim, i64 16))
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr @lim, align 16, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %.not69 = icmp slt i32 %17, 0
  br i1 %.not69, label %.preheader65, label %.lr.ph71

.preheader65.loopexit:                            ; preds = %._crit_edge
  %.pre106 = load i32, ptr @lim, align 16, !tbaa !5
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.loopexit, %.preheader66
  %18 = phi i32 [ %.pre106, %.preheader65.loopexit ], [ %16, %.preheader66 ]
  %.not6183 = icmp slt i32 %18, 0
  br i1 %.not6183, label %._crit_edge86, label %.lr.ph79

.lr.ph71:                                         ; preds = %.preheader66, %._crit_edge
  %19 = phi i32 [ %24, %._crit_edge ], [ %17, %.preheader66 ]
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %._crit_edge ], [ 0, %.preheader66 ]
  %20 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv89
  %21 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv89, i64 %indvars.iv89
  store i32 1, ptr %21, align 4, !tbaa !5
  store i32 1, ptr %20, align 4, !tbaa !5
  %22 = icmp ugt i64 %indvars.iv89, 1
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph71
  %23 = add nsw i64 %indvars.iv89, -1
  br label %26

._crit_edge.loopexit:                             ; preds = %26
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph71
  %24 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %19, %.lr.ph71 ]
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %25 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv89, %25
  br i1 %.not.not, label %.lr.ph71, label %.preheader65.loopexit, !llvm.loop !9

26:                                               ; preds = %.lr.ph, %26
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %26 ]
  %27 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %23, i64 %indvars.iv
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv89, i64 %indvars.iv
  store i32 %28, ptr %29, align 4, !tbaa !5
  %30 = add nsw i64 %indvars.iv, -1
  %31 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %23, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  tail call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %32)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv89
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %26, !llvm.loop !11

._crit_edge86:                                    ; preds = %._crit_edge80.3, %.preheader65
  %33 = load i32, ptr @ans, align 4, !tbaa !5
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %33)
  ret i32 0

.lr.ph79:                                         ; preds = %.preheader65, %._crit_edge80.3
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge80.3 ], [ 0, %.preheader65 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = trunc nuw nsw i64 %indvars.iv103 to i32
  %37 = shl i32 %36, 2
  %38 = sub nsw i32 %35, %37
  store i32 %38, ptr %0, align 4, !tbaa !5
  %39 = add nsw i32 %38, %36
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %40, i64 %indvars.iv103
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = and i32 %36, 1
  %.not62 = icmp eq i32 %44, 0
  %45 = sub nsw i64 998244353, %43
  %spec.select = select i1 %.not62, i64 %43, i64 %45
  store i64 %spec.select, ptr @f, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 4), align 4, !tbaa !5
  %47 = trunc i64 %indvars.iv103 to i32
  %48 = sub i32 %46, %47
  store i32 %48, ptr %1, align 4, !tbaa !5
  %49 = 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) %0)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %51 = add i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = shl nsw i64 %52, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @f, i64 8008), i8 0, i64 %53, i1 false)
  %54 = sext i32 %50 to i64
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) @f)
  %55 = load i64, ptr @f, align 16, !tbaa !12
  %.not64 = icmp eq i64 %55, 0
  br i1 %.not64, label %._crit_edge80, label %.preheader

._crit_edge80:                                    ; preds = %.lr.ph74, %.lr.ph79, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 8), align 8, !tbaa !5
  %57 = sub i32 %50, %36
  %58 = add i32 %57, %56
  store i32 %58, ptr %1, align 4, !tbaa !5
  %59 = 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) %0)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %61 = add i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = shl nsw i64 %62, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @f, i64 16016), i8 0, i64 %63, i1 false)
  %.not6375.1 = icmp slt i32 %50, 0
  br i1 %.not6375.1, label %._crit_edge80.1, label %.lr.ph79.1

.lr.ph79.1:                                       ; preds = %._crit_edge80
  %64 = sext i32 %60 to i64
  %wide.trip.count.1 = zext i32 %51 to i64
  br label %65

65:                                               ; preds = %.loopexit.1, %.lr.ph79.1
  %indvars.iv92.1 = phi i64 [ 0, %.lr.ph79.1 ], [ %indvars.iv.next93.1, %.loopexit.1 ]
  %66 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 1, i64 %indvars.iv92.1
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %66)
  %67 = load i64, ptr %66, align 8, !tbaa !12
  %.not64.1 = icmp eq i64 %67, 0
  br i1 %.not64.1, label %.loopexit.1, label %.preheader.1

.preheader.1:                                     ; preds = %65
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 8), align 8, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp sle i64 %indvars.iv103, %69
  %71 = icmp sle i64 %indvars.iv92.1, %64
  %72 = select i1 %70, i1 %71, i1 false
  br i1 %72, label %.lr.ph74.1, label %.loopexit.1

.lr.ph74.1:                                       ; preds = %.preheader.1, %.lr.ph74.1
  %indvars.iv94.1 = phi i64 [ %indvars.iv.next95.1, %.lr.ph74.1 ], [ %indvars.iv92.1, %.preheader.1 ]
  %.05372.1 = phi i32 [ %79, %.lr.ph74.1 ], [ %36, %.preheader.1 ]
  %73 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 2, i64 %indvars.iv94.1
  %74 = load i64, ptr %66, align 8, !tbaa !12
  %75 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv94.1, i64 %indvars.iv92.1
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = mul i64 %74, %77
  call void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8) %73, i64 noundef %78)
  %79 = add nuw nsw i32 %.05372.1, 1
  %indvars.iv.next95.1 = add nuw nsw i64 %indvars.iv94.1, 1
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 8), align 8, !tbaa !5
  %81 = icmp slt i32 %.05372.1, %80
  %82 = icmp slt i64 %indvars.iv94.1, %64
  %83 = select i1 %81, i1 %82, i1 false
  br i1 %83, label %.lr.ph74.1, label %.loopexit.1, !llvm.loop !14

.loopexit.1:                                      ; preds = %.lr.ph74.1, %.preheader.1, %65
  %indvars.iv.next93.1 = add nuw nsw i64 %indvars.iv92.1, 1
  %exitcond98.1.not = icmp eq i64 %indvars.iv.next93.1, %wide.trip.count.1
  br i1 %exitcond98.1.not, label %._crit_edge80.1, label %65, !llvm.loop !15

._crit_edge80.1:                                  ; preds = %.loopexit.1, %._crit_edge80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %84 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 12), align 4, !tbaa !5
  %85 = sub i32 %60, %36
  %86 = add i32 %85, %84
  store i32 %86, ptr %1, align 4, !tbaa !5
  %87 = 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) %0)
  %88 = load i32, ptr %87, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %89 = add i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = shl nsw i64 %90, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @f, i64 24024), i8 0, i64 %91, i1 false)
  %.not6375.2 = icmp slt i32 %60, 0
  br i1 %.not6375.2, label %._crit_edge80.2, label %.lr.ph79.2

.lr.ph79.2:                                       ; preds = %._crit_edge80.1
  %92 = sext i32 %88 to i64
  %wide.trip.count.2 = zext i32 %61 to i64
  br label %93

93:                                               ; preds = %.loopexit.2, %.lr.ph79.2
  %indvars.iv92.2 = phi i64 [ 0, %.lr.ph79.2 ], [ %indvars.iv.next93.2, %.loopexit.2 ]
  %94 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 2, i64 %indvars.iv92.2
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %94)
  %95 = load i64, ptr %94, align 8, !tbaa !12
  %.not64.2 = icmp eq i64 %95, 0
  br i1 %.not64.2, label %.loopexit.2, label %.preheader.2

.preheader.2:                                     ; preds = %93
  %96 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 12), align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = icmp sle i64 %indvars.iv103, %97
  %99 = icmp sle i64 %indvars.iv92.2, %92
  %100 = select i1 %98, i1 %99, i1 false
  br i1 %100, label %.lr.ph74.2, label %.loopexit.2

.lr.ph74.2:                                       ; preds = %.preheader.2, %.lr.ph74.2
  %indvars.iv94.2 = phi i64 [ %indvars.iv.next95.2, %.lr.ph74.2 ], [ %indvars.iv92.2, %.preheader.2 ]
  %.05372.2 = phi i32 [ %107, %.lr.ph74.2 ], [ %36, %.preheader.2 ]
  %101 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 3, i64 %indvars.iv94.2
  %102 = load i64, ptr %94, align 8, !tbaa !12
  %103 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv94.2, i64 %indvars.iv92.2
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul i64 %102, %105
  call void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8) %101, i64 noundef %106)
  %107 = add nuw nsw i32 %.05372.2, 1
  %indvars.iv.next95.2 = add nuw nsw i64 %indvars.iv94.2, 1
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 12), align 4, !tbaa !5
  %109 = icmp slt i32 %.05372.2, %108
  %110 = icmp slt i64 %indvars.iv94.2, %92
  %111 = select i1 %109, i1 %110, i1 false
  br i1 %111, label %.lr.ph74.2, label %.loopexit.2, !llvm.loop !14

.loopexit.2:                                      ; preds = %.lr.ph74.2, %.preheader.2, %93
  %indvars.iv.next93.2 = add nuw nsw i64 %indvars.iv92.2, 1
  %exitcond98.2.not = icmp eq i64 %indvars.iv.next93.2, %wide.trip.count.2
  br i1 %exitcond98.2.not, label %._crit_edge80.2, label %93, !llvm.loop !15

._crit_edge80.2:                                  ; preds = %.loopexit.2, %._crit_edge80.1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %112 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 16), align 16, !tbaa !5
  %113 = sub i32 %88, %36
  %114 = add i32 %113, %112
  store i32 %114, ptr %1, align 4, !tbaa !5
  %115 = 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) %0)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %117 = add nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = shl nsw i64 %118, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @f, i64 32032), i8 0, i64 %119, i1 false)
  %.not6375.3 = icmp slt i32 %88, 0
  br i1 %.not6375.3, label %._crit_edge80.3, label %.lr.ph79.3

.lr.ph79.3:                                       ; preds = %._crit_edge80.2
  %120 = sext i32 %116 to i64
  %wide.trip.count.3 = zext i32 %89 to i64
  br label %121

121:                                              ; preds = %.loopexit.3, %.lr.ph79.3
  %indvars.iv92.3 = phi i64 [ 0, %.lr.ph79.3 ], [ %indvars.iv.next93.3, %.loopexit.3 ]
  %122 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 3, i64 %indvars.iv92.3
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %122)
  %123 = load i64, ptr %122, align 8, !tbaa !12
  %.not64.3 = icmp eq i64 %123, 0
  br i1 %.not64.3, label %.loopexit.3, label %.preheader.3

.preheader.3:                                     ; preds = %121
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 16), align 16, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = icmp sle i64 %indvars.iv103, %125
  %127 = icmp sle i64 %indvars.iv92.3, %120
  %128 = select i1 %126, i1 %127, i1 false
  br i1 %128, label %.lr.ph74.3, label %.loopexit.3

.lr.ph74.3:                                       ; preds = %.preheader.3, %.lr.ph74.3
  %indvars.iv94.3 = phi i64 [ %indvars.iv.next95.3, %.lr.ph74.3 ], [ %indvars.iv92.3, %.preheader.3 ]
  %.05372.3 = phi i32 [ %135, %.lr.ph74.3 ], [ %36, %.preheader.3 ]
  %129 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 4, i64 %indvars.iv94.3
  %130 = load i64, ptr %122, align 8, !tbaa !12
  %131 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv94.3, i64 %indvars.iv92.3
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = mul i64 %130, %133
  call void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8) %129, i64 noundef %134)
  %135 = add nuw nsw i32 %.05372.3, 1
  %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94.3, 1
  %136 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 16), align 16, !tbaa !5
  %137 = icmp slt i32 %.05372.3, %136
  %138 = icmp slt i64 %indvars.iv94.3, %120
  %139 = select i1 %137, i1 %138, i1 false
  br i1 %139, label %.lr.ph74.3, label %.loopexit.3, !llvm.loop !14

.loopexit.3:                                      ; preds = %.lr.ph74.3, %.preheader.3, %121
  %indvars.iv.next93.3 = add nuw nsw i64 %indvars.iv92.3, 1
  %exitcond98.3.not = icmp eq i64 %indvars.iv.next93.3, %wide.trip.count.3
  br i1 %exitcond98.3.not, label %._crit_edge80.3, label %121, !llvm.loop !15

._crit_edge80.3:                                  ; preds = %.loopexit.3, %._crit_edge80.2
  %140 = load i32, ptr %0, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1001 x i64], ptr getelementptr inbounds (i8, ptr @f, i64 32032), i64 0, i64 %141
  call void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8) %142)
  %143 = load i32, ptr %0, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1001 x i64], ptr getelementptr inbounds (i8, ptr @f, i64 32032), i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !12
  %147 = trunc i64 %146 to i32
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %147)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #5
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %148 = load i32, ptr @lim, align 16, !tbaa !5
  %149 = sext i32 %148 to i64
  %.not61.not = icmp slt i64 %indvars.iv103, %149
  br i1 %.not61.not, label %.lr.ph79, label %._crit_edge86, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph79
  %150 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 4), align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = icmp sle i64 %indvars.iv103, %151
  %153 = icmp sgt i32 %50, -1
  %154 = select i1 %152, i1 %153, i1 false
  br i1 %154, label %.lr.ph74, label %._crit_edge80

.lr.ph74:                                         ; preds = %.preheader, %.lr.ph74
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph74 ], [ 0, %.preheader ]
  %.05372 = phi i32 [ %161, %.lr.ph74 ], [ %36, %.preheader ]
  %155 = getelementptr inbounds [5 x [1001 x i64]], ptr @f, i64 0, i64 1, i64 %indvars.iv94
  %156 = load i64, ptr @f, align 16, !tbaa !12
  %157 = getelementptr inbounds [1001 x [1001 x i32]], ptr @bin, i64 0, i64 %indvars.iv94, i64 0
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = mul i64 %156, %159
  call void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8) %155, i64 noundef %160)
  %161 = add nuw nsw i32 %.05372, 1
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @lim, i64 4), align 4, !tbaa !5
  %163 = icmp slt i32 %.05372, %162
  %164 = icmp slt i64 %indvars.iv94, %54
  %165 = select i1 %163, i1 %164, i1 false
  br i1 %165, label %.lr.ph74, label %._crit_edge80, !llvm.loop !14
}

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

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

; Function Attrs: 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) #2

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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_fixRy(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRyy(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3

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

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass