; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/214 Division 2/Problem E (E)

; 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
@k = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@s = external dso_local global [100100 x i32], align 16
@a = external dso_local global [2010 x [2010 x i32]], align 16
@mxx1 = external dso_local global [10 x i32], align 16
@mxx2 = external dso_local global [10 x i32], align 16
@mnn1 = external dso_local global [10 x i32], align 16
@mnn2 = external dso_local global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %33, %0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %23, 10
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %36

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %28
  store i32 1000000000, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %31
  store i32 1000000000, ptr %32, align 4, !tbaa !5
  br label %33

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

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

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

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

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

43:                                               ; preds = %107, %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2010 x [2010 x i32]], ptr @a, i64 0, i64 %50
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2010 x i32], ptr %51, i64 0, i64 %53
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [2010 x [2010 x i32]], ptr @a, i64 0, i64 %57
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2010 x i32], ptr %58, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  store i32 %68, ptr %7, align 4, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %65, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sub nsw i32 %77, %78
  store i32 %79, ptr %8, align 4, !tbaa !5
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %76, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = add nsw i32 %88, %89
  store i32 %90, ptr %9, align 4, !tbaa !5
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %87, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sub nsw i32 %99, %100
  store i32 %101, ptr %10, align 4, !tbaa !5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %98, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %107

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

110:                                              ; preds = %47
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !12

114:                                              ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %125, %114
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = load i32, ptr @t, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %128

120:                                              ; preds = %115
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %122
  %124 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %123)
  br label %125

125:                                              ; preds = %120
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !5
  br label %115, !llvm.loop !13

128:                                              ; preds = %119
  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
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %188, %128
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = load i32, ptr @t, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %191

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %135 = load i32, ptr %13, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  store i32 %139, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  store i32 %143, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr %15, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sub nsw i32 %147, %151
  store i32 %152, ptr %16, align 4, !tbaa !5
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %154 = load i32, ptr %153, align 4, !tbaa !5
  store i32 %154, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = load i32, ptr %15, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sub nsw i32 %158, %162
  store i32 %163, ptr %17, align 4, !tbaa !5
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %165 = load i32, ptr %164, align 4, !tbaa !5
  store i32 %165, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = sub nsw i32 %169, %173
  store i32 %174, ptr %18, align 4, !tbaa !5
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %176 = load i32, ptr %175, align 4, !tbaa !5
  store i32 %176, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %177 = load i32, ptr %15, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %14, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = sub nsw i32 %180, %184
  store i32 %185, ptr %19, align 4, !tbaa !5
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %187 = load i32, ptr %186, align 4, !tbaa !5
  store i32 %187, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %188

188:                                              ; preds = %134
  %189 = load i32, ptr %13, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %13, align 4, !tbaa !5
  br label %129, !llvm.loop !14

191:                                              ; preds = %133
  %192 = load i32, ptr %12, align 4, !tbaa !5
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %192)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %194 = load i32, ptr %1, align 4
  ret i32 %194
}

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

; 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

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}


; 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
@k = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@s = external dso_local global [100100 x i32], align 16
@a = external dso_local global [2010 x [2010 x i32]], align 16
@mxx1 = external dso_local global [10 x i32], align 16
@mxx2 = external dso_local global [10 x i32], align 16
@mnn1 = external dso_local global [10 x i32], align 16
@mnn2 = external dso_local global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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 {
.preheader50:
  %0 = alloca i32, align 4
  %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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t)
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr getelementptr inbounds (i8, ptr @mnn2, i64 4), align 4, !tbaa !5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr getelementptr inbounds (i8, ptr @mnn1, i64 4), align 4, !tbaa !5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr getelementptr inbounds (i8, ptr @mnn2, i64 20), align 4, !tbaa !5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr getelementptr inbounds (i8, ptr @mnn1, i64 20), align 4, !tbaa !5
  store i32 1000000000, ptr getelementptr inbounds (i8, ptr @mnn2, i64 36), align 4, !tbaa !5
  store i32 1000000000, ptr getelementptr inbounds (i8, ptr @mnn1, i64 36), align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not54 = icmp slt i32 %11, 1
  %12 = load i32, ptr @m, align 4
  %13 = icmp slt i32 %12, 1
  %or.cond = select i1 %.not54, i1 true, i1 %13
  br i1 %or.cond, label %.preheader, label %.preheader49

.preheader49:                                     ; preds = %.preheader50, %._crit_edge
  %14 = phi i32 [ %18, %._crit_edge ], [ %11, %.preheader50 ]
  %15 = phi i32 [ %19, %._crit_edge ], [ %12, %.preheader50 ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %._crit_edge ], [ 1, %.preheader50 ]
  %.not4852 = icmp slt i32 %15, 1
  br i1 %.not4852, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %._crit_edge, %.preheader50
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph57, label %._crit_edge58.thread

._crit_edge58.thread:                             ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %._crit_edge62

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader49
  %18 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %14, %.preheader49 ]
  %19 = phi i32 [ %41, %._crit_edge.loopexit ], [ %15, %.preheader49 ]
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %20 = sext i32 %18 to i64
  %.not.not = icmp slt i64 %indvars.iv66, %20
  br i1 %.not.not, label %.preheader49, label %.preheader, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader49, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader49 ]
  %21 = getelementptr inbounds [2010 x [2010 x i32]], ptr @a, i64 0, i64 %indvars.iv66, i64 %indvars.iv
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %21)
  %23 = load i32, ptr %21, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #4
  %26 = add nuw nsw i64 %indvars.iv, %indvars.iv66
  %27 = trunc nuw i64 %26 to i32
  store i32 %27, ptr %0, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %0)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #4
  %30 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %31 = sub nsw i64 %indvars.iv66, %indvars.iv
  %32 = trunc nsw i64 %31 to i32
  store i32 %32, ptr %1, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %35 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 %27, ptr %2, align 4, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %37 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %37, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %38 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 %32, ptr %3, align 4, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %38, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %.not48.not = icmp slt i64 %indvars.iv, %42
  br i1 %.not48.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge58:                                    ; preds = %.lr.ph57
  %43 = icmp sgt i32 %46, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br i1 %43, label %.lr.ph61, label %._crit_edge62

.lr.ph57:                                         ; preds = %.preheader, %.lr.ph57
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph57 ], [ 0, %.preheader ]
  %44 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %indvars.iv69
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %44)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %46 = load i32, ptr @t, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next70, %47
  br i1 %48, label %.lr.ph57, label %._crit_edge58, !llvm.loop !13

._crit_edge62:                                    ; preds = %.lr.ph61, %._crit_edge58.thread, %._crit_edge58
  %49 = phi i32 [ 0, %._crit_edge58 ], [ 0, %._crit_edge58.thread ], [ %84, %.lr.ph61 ]
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %49)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret i32 0

.lr.ph61:                                         ; preds = %._crit_edge58, %.lr.ph61
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph61 ], [ 1, %._crit_edge58 ]
  %51 = add nsw i64 %indvars.iv72, -1
  %52 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %indvars.iv72
  %55 = load i32, ptr %54, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %56 = sext i32 %53 to i64
  %57 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %55 to i64
  %60 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sub nsw i32 %58, %61
  store i32 %62, ptr %5, align 4, !tbaa !5
  %63 = 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) %5)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %65 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %56
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = getelementptr inbounds [10 x i32], ptr @mnn2, i64 0, i64 %59
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sub nsw i32 %66, %68
  store i32 %69, ptr %6, align 4, !tbaa !5
  %70 = 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) %6)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %72 = getelementptr inbounds [10 x i32], ptr @mxx1, i64 0, i64 %59
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = getelementptr inbounds [10 x i32], ptr @mnn1, i64 0, i64 %56
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sub nsw i32 %73, %75
  store i32 %76, ptr %7, align 4, !tbaa !5
  %77 = 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) %7)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %79 = getelementptr inbounds [10 x i32], ptr @mxx2, i64 0, i64 %59
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %74, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  store i32 %82, ptr %8, align 4, !tbaa !5
  %83 = 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) %8)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %85 = load i32, ptr @t, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next73, %86
  br i1 %87, label %.lr.ph61, label %._crit_edge62, !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: 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 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: 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: 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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