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

; 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 [300 x [300 x i32]], align 16
@bit = external dso_local global [100 x [300 x [300 x i32]]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

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

13:                                               ; preds = %48, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %44, %18
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %47

23:                                               ; preds = %19
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [300 x i32], ptr %26, i64 0, i64 %28
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %29)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [300 x i32], ptr %33, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %39
  %41 = getelementptr inbounds [300 x [300 x i32]], ptr %40, i64 0, i64 0
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3addPA300_iiii(ptr noundef %41, i32 noundef %42, i32 noundef %43, i32 noundef 1)
  br label %44

44:                                               ; preds = %23
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %19, !llvm.loop !9

47:                                               ; preds = %19
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

51:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
  br label %53

53:                                               ; preds = %145, %51
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %4, align 4, !tbaa !5
  %56 = icmp ne i32 %54, 0
  br i1 %56, label %57, label %146

57:                                               ; preds = %53
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %100

61:                                               ; preds = %57
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %6, ptr noundef %7, ptr noundef %10)
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %10, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [300 x i32], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %76
  %78 = getelementptr inbounds [300 x [300 x i32]], ptr %77, i64 0, i64 0
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3addPA300_iiii(ptr noundef %78, i32 noundef %79, i32 noundef %80, i32 noundef -1)
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [300 x i32], ptr %84, i64 0, i64 %86
  store i32 %81, ptr %87, align 4, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [300 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %95
  %97 = getelementptr inbounds [300 x [300 x i32]], ptr %96, i64 0, i64 0
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3addPA300_iiii(ptr noundef %97, i32 noundef %98, i32 noundef %99, i32 noundef 1)
  br label %145

100:                                              ; preds = %57
  %101 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %6, ptr noundef %8, ptr noundef %7, ptr noundef %9, ptr noundef %10)
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 2
  store i32 %103, ptr %6, align 4, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = add nsw i32 %104, -1
  store i32 %105, ptr %8, align 4, !tbaa !5
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 2
  store i32 %107, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %113
  %115 = getelementptr inbounds [300 x [300 x i32]], ptr %114, i64 0, i64 0
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = call noundef i32 @_Z3sumPA300_iii(ptr noundef %115, i32 noundef %116, i32 noundef %117)
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %120
  %122 = getelementptr inbounds [300 x [300 x i32]], ptr %121, i64 0, i64 0
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = call noundef i32 @_Z3sumPA300_iii(ptr noundef %122, i32 noundef %123, i32 noundef %124)
  %126 = sub nsw i32 %118, %125
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %128
  %130 = getelementptr inbounds [300 x [300 x i32]], ptr %129, i64 0, i64 0
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = call noundef i32 @_Z3sumPA300_iii(ptr noundef %130, i32 noundef %131, i32 noundef %132)
  %134 = sub nsw i32 %126, %133
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %136
  %138 = getelementptr inbounds [300 x [300 x i32]], ptr %137, i64 0, i64 0
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = call noundef i32 @_Z3sumPA300_iii(ptr noundef %138, i32 noundef %139, i32 noundef %140)
  %142 = add nsw i32 %134, %141
  store i32 %142, ptr %11, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %143)
  br label %145

145:                                              ; preds = %100, %61
  br label %53, !llvm.loop !12

146:                                              ; preds = %53
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  ret i32 0
}

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

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

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


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [300 x [300 x i32]], align 16
@bit = external dso_local global [100 x [300 x [300 x i32]]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  %11 = load i32, ptr @m, align 4
  %12 = icmp sgt i32 %11, 0
  %or.cond = select i1 %10, i1 %12, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge16

.preheader:                                       ; preds = %0, %._crit_edge
  %13 = phi i32 [ %31, %._crit_edge ], [ %9, %0 ]
  %14 = phi i32 [ %32, %._crit_edge ], [ %11, %0 ]
  %indvars.iv23 = phi i64 [ %indvars.iv.next24, %._crit_edge ], [ 0, %0 ]
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %16 = trunc nuw nsw i64 %indvars.iv23 to i32
  br label %20

._crit_edge16:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %1, align 4, !tbaa !5
  %.not17 = icmp eq i32 %18, 0
  br i1 %.not17, label %._crit_edge20, label %.lr.ph19

20:                                               ; preds = %.lr.ph, %20
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %20 ]
  %21 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %indvars.iv23, i64 %indvars.iv
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %21)
  %23 = load i32, ptr %21, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %21, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %25
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_Z3addPA300_iiii(ptr noundef nonnull %26, i32 noundef %16, i32 noundef %27, i32 noundef 1)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %20, label %._crit_edge.loopexit, !llvm.loop !9

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %31 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %13, %.preheader ]
  %32 = phi i32 [ %28, %._crit_edge.loopexit ], [ %14, %.preheader ]
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %33 = sext i32 %31 to i64
  %34 = icmp slt i64 %indvars.iv.next24, %33
  br i1 %34, label %.preheader, label %._crit_edge16, !llvm.loop !11

.lr.ph19:                                         ; preds = %._crit_edge16, %97
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 1
  br i1 %37, label %38, label %60

38:                                               ; preds = %.lr.ph19
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %7)
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %41 to i64
  %47 = sext i32 %43 to i64
  %48 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %46, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %50
  call void @_Z3addPA300_iiii(ptr noundef nonnull %51, i32 noundef %41, i32 noundef %43, i32 noundef -1)
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [300 x [300 x i32]], ptr @a, i64 0, i64 %54, i64 %56
  store i32 %52, ptr %57, align 4, !tbaa !5
  %58 = sext i32 %52 to i64
  %59 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %58
  call void @_Z3addPA300_iiii(ptr noundef nonnull %59, i32 noundef %53, i32 noundef %55, i32 noundef 1)
  br label %97

60:                                               ; preds = %.lr.ph19
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, -2
  store i32 %63, ptr %3, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr %5, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = add nsw i32 %66, -2
  store i32 %67, ptr %4, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %72
  %74 = call noundef i32 @_Z3sumPA300_iii(ptr noundef nonnull %73, i32 noundef %65, i32 noundef %69)
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = call noundef i32 @_Z3sumPA300_iii(ptr noundef nonnull %77, i32 noundef %78, i32 noundef %79)
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = call noundef i32 @_Z3sumPA300_iii(ptr noundef nonnull %83, i32 noundef %84, i32 noundef %85)
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100 x [300 x [300 x i32]]], ptr @bit, i64 0, i64 %88
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = call noundef i32 @_Z3sumPA300_iii(ptr noundef nonnull %89, i32 noundef %90, i32 noundef %91)
  %93 = add i32 %80, %86
  %94 = sub i32 %74, %93
  %95 = add nsw i32 %94, %92
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %95)
  br label %97

97:                                               ; preds = %60, %38
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %98, 0
  br i1 %.not, label %._crit_edge20, label %.lr.ph19, !llvm.loop !13

._crit_edge20:                                    ; preds = %97, %._crit_edge16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0
}

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { 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 #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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass