; LLVM IR from tangjz/acm-icpc :: 51nod (1671)

; 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
@l = external dso_local global [1000010 x i32], align 16
@r = external dso_local global [1000010 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@__const.main.v = external hidden unnamed_addr constant [4 x i32], align 16
@.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 [4 x i32], align 16
  %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
  br label %12

12:                                               ; preds = %161, %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %14 = icmp eq i32 %13, 2
  br i1 %14, label %15, label %164

15:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %46, %15
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @l, i64 %23
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @r, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %24, ptr noundef %27)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp sgt i32 %32, %36
  br i1 %37, label %38, label %45

38:                                               ; preds = %21
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %43
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %44) #5
  br label %45

45:                                               ; preds = %38, %21
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

49:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  store i32 %51, ptr %4, align 4, !tbaa !5
  br label %52

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

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %57, %58
  %60 = ashr i32 %59, 1
  store i32 %60, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.main.v, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %140, %56
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %61
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sub nsw i32 %70, %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = icmp sgt i32 %75, %76
  br i1 %77, label %78, label %139

78:                                               ; preds = %66
  %79 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %83, %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sub nsw i32 %88, %89
  store i32 %90, ptr %8, align 4, !tbaa !5
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 0
  store i32 %92, ptr %93, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %94 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %98, %102
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = add nsw i32 %103, %104
  store i32 %105, ptr %9, align 4, !tbaa !5
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 1
  store i32 %107, ptr %108, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %109 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sub nsw i32 %113, %117
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  store i32 %120, ptr %10, align 4, !tbaa !5
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %109, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 2
  store i32 %122, ptr %123, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %124 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sub nsw i32 %128, %132
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  store i32 %135, ptr %11, align 4, !tbaa !5
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %124, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 3
  store i32 %137, ptr %138, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %139

139:                                              ; preds = %78, %66
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %7, align 4, !tbaa !5
  br label %61, !llvm.loop !11

143:                                              ; preds = %65
  %144 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 0
  %145 = load i32, ptr %144, align 16, !tbaa !5
  %146 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 1
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = icmp sle i32 %145, %147
  br i1 %148, label %149, label %157

149:                                              ; preds = %143
  %150 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 2
  %151 = load i32, ptr %150, align 8, !tbaa !5
  %152 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 3
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp sle i32 %151, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %149
  %156 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %156, ptr %4, align 4, !tbaa !5
  br label %160

157:                                              ; preds = %149, %143
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %3, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %157, %155
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %52, !llvm.loop !12

161:                                              ; preds = %52
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %162)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %12, !llvm.loop !13

164:                                              ; preds = %12
  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 void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!13, !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
@l = external dso_local global [1000010 x i32], align 16
@r = external dso_local global [1000010 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@__const.main.v = external hidden unnamed_addr constant [4 x i32], align 16
@.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 [4 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %7 = icmp eq i32 %6, 2
  br i1 %7, label %.preheader.lr.ph, label %._crit_edge51

.preheader.lr.ph:                                 ; preds = %0
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = getelementptr inbounds i8, ptr %1, i64 12
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge50
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %36, %.preheader
  %13 = phi i32 [ %11, %.preheader ], [ %37, %36 ]
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %._crit_edge
  %16 = add nsw i32 %14, -1
  %17 = icmp sgt i32 %13, 0
  br i1 %17, label %.lr.ph49.split, label %.lr.ph49.split.us

.lr.ph49.split.us:                                ; preds = %.lr.ph49, %27
  %.03347.us = phi i32 [ %.1.us, %27 ], [ %16, %.lr.ph49 ]
  %.03446.us = phi i32 [ %.135.us, %27 ], [ 0, %.lr.ph49 ]
  %18 = add nuw nsw i32 %.03347.us, %.03446.us
  %19 = lshr i32 %18, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %1, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.v, i64 16, i1 false)
  %20 = load i32, ptr %1, align 16, !tbaa !5
  %21 = load i32, ptr %8, align 4, !tbaa !5
  %.not.us = icmp sgt i32 %20, %21
  br i1 %.not.us, label %25, label %22

22:                                               ; preds = %.lr.ph49.split.us
  %23 = load i32, ptr %9, align 8, !tbaa !5
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %.not37.us = icmp sgt i32 %23, %24
  br i1 %.not37.us, label %25, label %27

25:                                               ; preds = %22, %.lr.ph49.split.us
  %26 = add nuw nsw i32 %19, 1
  br label %27

27:                                               ; preds = %25, %22
  %.135.us = phi i32 [ %26, %25 ], [ %.03446.us, %22 ]
  %.1.us = phi i32 [ %.03347.us, %25 ], [ %19, %22 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  %28 = icmp slt i32 %.135.us, %.1.us
  br i1 %28, label %.lr.ph49.split.us, label %._crit_edge50, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %36
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 0, %.preheader ]
  %29 = getelementptr inbounds i32, ptr @l, i64 %indvars.iv
  %30 = getelementptr inbounds i32, ptr @r, i64 %indvars.iv
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %29, ptr noundef nonnull %30)
  %32 = load i32, ptr %29, align 4, !tbaa !5
  %33 = load i32, ptr %30, align 4, !tbaa !5
  %34 = icmp sgt i32 %32, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %.lr.ph
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 4 dereferenceable(4) %30) #5
  br label %36

36:                                               ; preds = %.lr.ph, %35
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next, %38
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph49.split:                                   ; preds = %.lr.ph49, %88
  %40 = phi i32 [ %45, %88 ], [ %13, %.lr.ph49 ]
  %41 = phi i32 [ %46, %88 ], [ %13, %.lr.ph49 ]
  %.03347 = phi i32 [ %.1, %88 ], [ %16, %.lr.ph49 ]
  %.03446 = phi i32 [ %.135, %88 ], [ 0, %.lr.ph49 ]
  %42 = add nuw nsw i32 %.03347, %.03446
  %43 = lshr i32 %42, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %1, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.v, i64 16, i1 false)
  %44 = icmp sgt i32 %41, 0
  br i1 %44, label %.lr.ph44, label %._crit_edge45

._crit_edge45:                                    ; preds = %79, %.lr.ph49.split
  %45 = phi i32 [ %40, %.lr.ph49.split ], [ %80, %79 ]
  %46 = phi i32 [ %41, %.lr.ph49.split ], [ %80, %79 ]
  %47 = load i32, ptr %1, align 16, !tbaa !5
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %.not = icmp sgt i32 %47, %48
  br i1 %.not, label %86, label %83

.lr.ph44:                                         ; preds = %.lr.ph49.split, %79
  %49 = phi i32 [ %80, %79 ], [ %40, %.lr.ph49.split ]
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %79 ], [ 0, %.lr.ph49.split ]
  %50 = getelementptr inbounds [1000010 x i32], ptr @r, i64 0, i64 %indvars.iv54
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [1000010 x i32], ptr @l, i64 0, i64 %indvars.iv54
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sub nsw i32 %51, %53
  %55 = icmp sgt i32 %54, %43
  br i1 %55, label %56, label %79

56:                                               ; preds = %.lr.ph44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %57 = sub i32 %51, %43
  %58 = add i32 %57, %53
  store i32 %58, ptr %2, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %1, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %61 = load i32, ptr %52, align 4, !tbaa !5
  %62 = load i32, ptr %50, align 4, !tbaa !5
  %63 = add i32 %61, %43
  %64 = add i32 %63, %62
  store i32 %64, ptr %3, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %67 = load i32, ptr %50, align 4, !tbaa !5
  %68 = load i32, ptr %52, align 4, !tbaa !5
  %69 = add i32 %43, %68
  %70 = sub i32 %67, %69
  store i32 %70, ptr %4, align 4, !tbaa !5
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %73 = load i32, ptr %50, align 4, !tbaa !5
  %74 = load i32, ptr %52, align 4, !tbaa !5
  %75 = add i32 %73, %43
  %76 = sub i32 %75, %74
  store i32 %76, ptr %5, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %.lr.ph44, %56
  %80 = phi i32 [ %49, %.lr.ph44 ], [ %.pre, %56 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next55, %81
  br i1 %82, label %.lr.ph44, label %._crit_edge45, !llvm.loop !12

83:                                               ; preds = %._crit_edge45
  %84 = load i32, ptr %9, align 8, !tbaa !5
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %.not37 = icmp sgt i32 %84, %85
  br i1 %.not37, label %86, label %88

86:                                               ; preds = %83, %._crit_edge45
  %87 = add nuw nsw i32 %43, 1
  br label %88

88:                                               ; preds = %83, %86
  %.135 = phi i32 [ %87, %86 ], [ %.03446, %83 ]
  %.1 = phi i32 [ %.03347, %86 ], [ %43, %83 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  %89 = icmp slt i32 %.135, %.1
  br i1 %89, label %.lr.ph49.split, label %._crit_edge50, !llvm.loop !13

._crit_edge50:                                    ; preds = %27, %88, %._crit_edge
  %.034.lcssa = phi i32 [ 0, %._crit_edge ], [ %.135, %88 ], [ %.135.us, %27 ]
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.034.lcssa)
  %91 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %92 = icmp eq i32 %91, 2
  br i1 %92, label %.preheader, label %._crit_edge51, !llvm.loop !15

._crit_edge51:                                    ; preds = %._crit_edge50, %0
  ret i32 0
}

; 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 void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}


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