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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [211985 x i32], align 16
@s = external dso_local global [513 x [513 x i32]], align 16
@ans = external dso_local global i32, align 4
@.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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  store i32 %17, ptr %2, align 4, !tbaa !5
  br label %18

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

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

22:                                               ; preds = %18
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @a, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  br label %27

27:                                               ; preds = %36, %22
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = shl i32 1, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [211985 x i32], ptr @a, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = icmp sle i32 %29, %33
  br i1 %34, label %35, label %39

35:                                               ; preds = %27
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @m, align 4, !tbaa !5
  br label %27, !llvm.loop !9

39:                                               ; preds = %27
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !11

43:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = ashr i32 %44, 1
  store i32 %45, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sub nsw i32 %46, %47
  store i32 %48, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = shl i32 1, %49
  %51 = sub nsw i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %63, %43
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %66

57:                                               ; preds = %52
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [513 x i32], ptr @s, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %57
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %6, align 4, !tbaa !5
  br label %52, !llvm.loop !12

66:                                               ; preds = %56
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sub nsw i32 1000000007, %67
  store i32 %68, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %142, %66
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %145

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [211985 x i32], ptr @a, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = ashr i32 %78, %79
  store i32 %80, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [211985 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = and i32 %84, %85
  store i32 %86, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = sub nsw i32 %87, %88
  store i32 %89, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %90 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %90, ptr %13, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %103, %74
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %91
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %108

95:                                               ; preds = %91
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %97
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [513 x i32], ptr %98, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef %102)
  br label %103

103:                                              ; preds = %95
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = and i32 %105, %106
  store i32 %107, ptr %13, align 4, !tbaa !5
  br label %91, !llvm.loop !13

108:                                              ; preds = %94
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [513 x i32], ptr @s, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef %112)
  %113 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %113)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %114 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %114, ptr %14, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %129, %108
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %134

119:                                              ; preds = %115
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %121
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = or i32 %123, %124
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [513 x i32], ptr %122, i64 0, i64 %126
  %128 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %127, i32 noundef %128)
  br label %129

129:                                              ; preds = %119
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = sub nsw i32 %130, 1
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = and i32 %131, %132
  store i32 %133, ptr %14, align 4, !tbaa !5
  br label %115, !llvm.loop !14

134:                                              ; preds = %118
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %136
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [513 x i32], ptr %137, i64 0, i64 %139
  %141 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %140, i32 noundef %141)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %142

142:                                              ; preds = %134
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %7, align 4, !tbaa !5
  br label %69, !llvm.loop !15

145:                                              ; preds = %73
  %146 = load i32, ptr @ans, align 4, !tbaa !5
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %146)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %148 = load i32, ptr %1, align 4
  ret i32 %148
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [211985 x i32], align 16
@s = external dso_local global [513 x [513 x i32]], align 16
@ans = external dso_local global i32, align 4
@.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 {
  %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 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph46.preheader, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

.lr.ph46.preheader:                               ; preds = %0
  %5 = zext nneg i32 %3 to i64
  br label %.lr.ph46

..loopexit_crit_edge:                             ; preds = %.lr.ph
  store i32 %22, ptr @m, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %..loopexit_crit_edge, %.lr.ph46
  %6 = phi i32 [ %22, %..loopexit_crit_edge ], [ %m.promoted, %.lr.ph46 ]
  %7 = icmp sgt i64 %indvars.iv, 1
  br i1 %7, label %.lr.ph46, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %.._crit_edge_crit_edge
  %8 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %6, %.loopexit ]
  %9 = ashr i32 %8, 1
  %10 = sub nsw i32 %8, %9
  %notmask = shl nsw i32 -1, %10
  %11 = sub i32 0, %notmask
  %wide.trip.count = zext i32 %11 to i64
  %min.iters.check = icmp ult i32 %11, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %._crit_edge
  %indvars.iv63.ph = phi i64 [ 0, %._crit_edge ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %._crit_edge
  %n.vec = and i64 %wide.trip.count, 4294967288
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %12 = getelementptr inbounds [513 x i32], ptr @s, i64 0, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <4 x i32>, ptr %12, align 16, !tbaa !5
  %wide.load75 = load <4 x i32>, ptr %13, align 16, !tbaa !5
  %14 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %15 = add nsw <4 x i32> %wide.load75, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %14, ptr %12, align 16, !tbaa !5
  store <4 x i32> %15, ptr %13, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit76, label %scalar.ph.preheader

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %.loopexit
  %indvars.iv = phi i64 [ %5, %.lr.ph46.preheader ], [ %indvars.iv.next, %.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %17 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv.next
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %17)
  %19 = load i32, ptr %17, align 4, !tbaa !5
  %m.promoted = load i32, ptr @m, align 4, !tbaa !5
  %20 = shl nuw i32 1, %m.promoted
  %.not4243 = icmp sgt i32 %20, %19
  br i1 %.not4243, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph46, %.lr.ph
  %21 = phi i32 [ %22, %.lr.ph ], [ %m.promoted, %.lr.ph46 ]
  %22 = add nsw i32 %21, 1
  %23 = shl nuw i32 1, %22
  %.not42 = icmp sgt i32 %23, %19
  br i1 %.not42, label %..loopexit_crit_edge, label %.lr.ph, !llvm.loop !14

.loopexit76:                                      ; preds = %scalar.ph, %middle.block
  %24 = xor i32 %notmask, -1
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sub nsw i32 1000000007, %25
  store i32 %26, ptr @ans, align 4, !tbaa !5
  %27 = icmp sgt i32 %25, 0
  br i1 %27, label %.lr.ph60, label %._crit_edge61

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %scalar.ph ], [ %indvars.iv63.ph, %scalar.ph.preheader ]
  %28 = getelementptr inbounds [513 x i32], ptr @s, i64 0, i64 %indvars.iv63
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit76, label %scalar.ph, !llvm.loop !15

._crit_edge61.loopexit:                           ; preds = %._crit_edge57
  %.pre69 = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit, %.loopexit76
  %31 = phi i32 [ %.pre69, %._crit_edge61.loopexit ], [ %26, %.loopexit76 ]
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %31)
  ret i32 0

.lr.ph60:                                         ; preds = %.loopexit76, %._crit_edge57
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %._crit_edge57 ], [ 0, %.loopexit76 ]
  %33 = getelementptr inbounds [211985 x i32], ptr @a, i64 0, i64 %indvars.iv66
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = ashr i32 %34, %10
  %36 = and i32 %34, %24
  %37 = sub nsw i32 %24, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  %.not4048 = icmp eq i32 %35, 0
  %.pre70 = zext nneg i32 %36 to i64
  br i1 %.not4048, label %._crit_edge52, label %.lr.ph51

._crit_edge52:                                    ; preds = %.lr.ph51, %.lr.ph60
  %38 = getelementptr inbounds [513 x i32], ptr @s, i64 0, i64 %.pre70
  %39 = load i32, ptr %38, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %39)
  %40 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %40)
  %.not4153 = icmp eq i32 %37, 0
  %.pre71 = sext i32 %35 to i64
  br i1 %.not4153, label %._crit_edge57, label %.lr.ph56

.lr.ph51:                                         ; preds = %.lr.ph60, %.lr.ph51
  %.03549 = phi i32 [ %45, %.lr.ph51 ], [ %35, %.lr.ph60 ]
  %41 = sext i32 %.03549 to i64
  %42 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %41, i64 %.pre70
  %43 = load i32, ptr %42, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %43)
  %44 = add nsw i32 %.03549, -1
  %45 = and i32 %44, %35
  %.not40 = icmp eq i32 %45, 0
  br i1 %.not40, label %._crit_edge52, label %.lr.ph51, !llvm.loop !16

._crit_edge57:                                    ; preds = %.lr.ph56, %._crit_edge52
  %46 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %.pre71, i64 %.pre70
  %47 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %46, i32 noundef %47)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next67, %49
  br i1 %50, label %.lr.ph60, label %._crit_edge61.loopexit, !llvm.loop !17

.lr.ph56:                                         ; preds = %._crit_edge52, %.lr.ph56
  %.054 = phi i32 [ %56, %.lr.ph56 ], [ %37, %._crit_edge52 ]
  %51 = or i32 %.054, %36
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [513 x [513 x i32]], ptr @s, i64 0, i64 %.pre71, i64 %52
  %54 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %53, i32 noundef %54)
  %55 = add nsw i32 %.054, -1
  %56 = and i32 %55, %37
  %.not41 = icmp eq i32 %56, 0
  br i1 %.not41, label %._crit_edge57, label %.lr.ph56, !llvm.loop !18
}

; 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: 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: 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 = { 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}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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