; LLVM IR from tangjz/acm-icpc :: codeforces/complete (934A)

; 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 [51 x i32], align 16
@b = external dso_local global [51 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 [6 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 i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

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

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

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @a, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @a, i64 %27
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %28)
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 4
  br i1 %30, label %31, label %42

31:                                               ; preds = %25
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 2
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr getelementptr inbounds ([51 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr getelementptr inbounds ([51 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !5
  store i32 4, ptr @n, align 4, !tbaa !5
  br label %42

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

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

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %56

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr @b, i64 %50
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %51)
  br label %53

53:                                               ; preds = %48
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !5
  br label %43, !llvm.loop !11

56:                                               ; preds = %47
  %57 = load i32, ptr @m, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr @b, i64 %58
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @b, ptr noundef %59)
  %60 = load i32, ptr @m, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 2
  br i1 %61, label %62, label %68

62:                                               ; preds = %56
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [51 x i32], ptr @b, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %67, ptr getelementptr inbounds ([51 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
  store i32 2, ptr @m, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %62, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 2000000000000000000, ptr %4, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %115, %68
  %70 = load i32, ptr %5, 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 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %118

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 -2000000000000000000, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %109, %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %75
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = icmp ne i32 %81, %82
  br i1 %83, label %84, label %108

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %104, %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = load i32, ptr @m, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

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

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [51 x i32], ptr @b, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = mul nsw i64 %95, %100
  store i64 %101, ptr %10, align 8, !tbaa !12
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %103 = load i64, ptr %102, align 8, !tbaa !12
  store i64 %103, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %104

104:                                              ; preds = %90
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !5
  br label %85, !llvm.loop !14

107:                                              ; preds = %89
  br label %108

108:                                              ; preds = %107, %80
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %8, align 4, !tbaa !5
  br label %75, !llvm.loop !15

112:                                              ; preds = %79
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %114 = load i64, ptr %113, align 8, !tbaa !12
  store i64 %114, ptr %4, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %115

115:                                              ; preds = %112
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %69, !llvm.loop !16

118:                                              ; preds = %73
  %119 = load i64, ptr %4, align 8, !tbaa !12
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %119)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %121 = load i32, ptr %1, align 4
  ret i32 %121
}

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 uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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 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 = { 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 #5 = { nounwind }

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

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


; 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 [51 x i32], align 16
@b = external dso_local global [51 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 [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre60 = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre60, %.._crit_edge_crit_edge ], [ %13, %.lr.ph ]
  %7 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 4
  br i1 %9, label %15, label %24

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !9

15:                                               ; preds = %._crit_edge
  %16 = add nsw i32 %8, -2
  %17 = zext nneg i32 %16 to i64
  %18 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %20 = add nsw i32 %8, -1
  %21 = zext nneg i32 %20 to i64
  %22 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %23, ptr getelementptr inbounds (i8, ptr @a, i64 12), align 4, !tbaa !5
  store i32 4, ptr @n, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %15, %._crit_edge
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph29, label %.._crit_edge30_crit_edge

.._crit_edge30_crit_edge:                         ; preds = %24
  %.pre61 = sext i32 %25 to i64
  br label %._crit_edge30

._crit_edge30:                                    ; preds = %.lr.ph29, %.._crit_edge30_crit_edge
  %.pre-phi62 = phi i64 [ %.pre61, %.._crit_edge30_crit_edge ], [ %33, %.lr.ph29 ]
  %27 = getelementptr inbounds i32, ptr @b, i64 %.pre-phi62
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @b, ptr noundef nonnull %27)
  %28 = load i32, ptr @m, align 4
  %29 = icmp sgt i32 %28, 2
  br i1 %29, label %35, label %40

.lr.ph29:                                         ; preds = %24, %.lr.ph29
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.lr.ph29 ], [ 0, %24 ]
  %30 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv47
  %31 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %30)
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next48, %33
  br i1 %34, label %.lr.ph29, label %._crit_edge30, !llvm.loop !11

35:                                               ; preds = %._crit_edge30
  %36 = add nsw i32 %28, -1
  %37 = zext nneg i32 %36 to i64
  %38 = getelementptr inbounds [51 x i32], ptr @b, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr getelementptr inbounds (i8, ptr @b, i64 4), align 4, !tbaa !5
  store i32 2, ptr @m, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %35, %._crit_edge30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  store i64 2000000000000000000, ptr %1, align 8, !tbaa !12
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph41, label %._crit_edge42

._crit_edge42:                                    ; preds = %._crit_edge38, %40
  %43 = phi i64 [ 2000000000000000000, %40 ], [ %48, %._crit_edge38 ]
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %43)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph41:                                         ; preds = %40, %._crit_edge38
  %45 = phi i32 [ %49, %._crit_edge38 ], [ %41, %40 ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %._crit_edge38 ], [ 0, %40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  store i64 -2000000000000000000, ptr %2, align 8, !tbaa !12
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph37.preheader, label %._crit_edge38

.lr.ph37.preheader:                               ; preds = %.lr.ph41
  %.pre = load i32, ptr @m, align 4
  br label %.lr.ph37

._crit_edge38:                                    ; preds = %.loopexit, %.lr.ph41
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %48 = load i64, ptr %47, align 8, !tbaa !12
  store i64 %48, ptr %1, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next57, %50
  br i1 %51, label %.lr.ph41, label %._crit_edge42, !llvm.loop !14

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %.loopexit
  %52 = phi i32 [ %45, %.lr.ph37.preheader ], [ %68, %.loopexit ]
  %53 = phi i32 [ %.pre, %.lr.ph37.preheader ], [ %69, %.loopexit ]
  %indvars.iv53 = phi i64 [ 0, %.lr.ph37.preheader ], [ %indvars.iv.next54, %.loopexit ]
  %.not = icmp ne i64 %indvars.iv56, %indvars.iv53
  %54 = icmp sgt i32 %53, 0
  %or.cond = select i1 %.not, i1 %54, i1 false
  br i1 %or.cond, label %.lr.ph33, label %.loopexit

.lr.ph33:                                         ; preds = %.lr.ph37
  %55 = getelementptr inbounds [51 x i32], ptr @a, i64 0, i64 %indvars.iv53
  br label %56

56:                                               ; preds = %.lr.ph33, %56
  %indvars.iv50 = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next51, %56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %57 = load i32, ptr %55, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [51 x i32], ptr @b, i64 0, i64 %indvars.iv50
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %61, %58
  store i64 %62, ptr %3, align 8, !tbaa !12
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %64 = load i64, ptr %63, align 8, !tbaa !12
  store i64 %64, ptr %2, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %65 = load i32, ptr @m, align 4
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next51, %66
  br i1 %67, label %56, label %.loopexit.loopexit, !llvm.loop !15

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

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph37
  %68 = phi i32 [ %.pre59, %.loopexit.loopexit ], [ %52, %.lr.ph37 ]
  %69 = phi i32 [ %65, %.loopexit.loopexit ], [ %53, %.lr.ph37 ]
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %70 = sext i32 %68 to i64
  %71 = icmp slt i64 %indvars.iv.next54, %70
  br i1 %71, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16
}

; 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 uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 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 = { 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 #5 = { nounwind }

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

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


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