; LLVM IR from tangjz/acm-icpc :: leetcode/extra/Pony.ai_005-新增的专线 (main)

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

@_ZZ4mainE3dis = external hidden global [1001 x [1001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %43, %0
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %46

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

25:                                               ; preds = %39, %24
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %42

30:                                               ; preds = %25
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %32
  %34 = getelementptr inbounds [1001 x i32], ptr %33, i64 0, i64 0
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %34, i64 %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %37)
  br label %39

39:                                               ; preds = %30
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !5
  br label %25, !llvm.loop !9

42:                                               ; preds = %29
  br label %43

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

46:                                               ; preds = %23
  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
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6, ptr noundef %7, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  store i32 %49, ptr %10, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %133, %46
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %134

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = add nsw i32 %55, %56
  %58 = add nsw i32 %57, 1
  %59 = ashr i32 %58, 1
  store i32 %59, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %119, %54
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %122

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %115, %65
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

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

71:                                               ; preds = %66
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %73
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1001 x i32], ptr %74, i64 0, i64 %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %78 = load i32, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %80
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1001 x i32], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %87
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1001 x i32], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %85, %92
  store i32 %93, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %95
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1001 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %102
  %104 = load i32, ptr %14, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1001 x i32], ptr %103, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = add nsw i32 %100, %107
  store i32 %108, ptr %17, align 4, !tbaa !5
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %78, %110
  store i32 %111, ptr %15, align 4, !tbaa !5
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %77, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %113 = 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) %112)
  %114 = load i32, ptr %113, align 4, !tbaa !5
  store i32 %114, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %115

115:                                              ; preds = %71
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %14, align 4, !tbaa !5
  br label %66, !llvm.loop !12

118:                                              ; preds = %70
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %13, align 4, !tbaa !5
  br label %60, !llvm.loop !13

122:                                              ; preds = %64
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = add nsw i32 %123, %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %122
  %129 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %129, ptr %9, align 4, !tbaa !5
  br label %133

130:                                              ; preds = %122
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %130, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %50, !llvm.loop !14

134:                                              ; preds = %50
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %135)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 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 %2) #4
  %137 = load i32, ptr %1, align 4
  ret i32 %137
}

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

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

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

; 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, ...) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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"

@_ZZ4mainE3dis = external hidden global [1001 x [1001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 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 {
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader32, label %._crit_edge35

.preheader32:                                     ; preds = %0, %._crit_edge
  %12 = phi i32 [ %27, %._crit_edge ], [ %10, %0 ]
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %._crit_edge ], [ 0, %0 ]
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %.preheader32.._crit_edge_crit_edge

.preheader32.._crit_edge_crit_edge:               ; preds = %.preheader32
  %.pre59 = sext i32 %12 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader32
  %14 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %indvars.iv50
  br label %29

._crit_edge35:                                    ; preds = %._crit_edge, %0
  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
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph44, label %._crit_edge45

.lr.ph44:                                         ; preds = %._crit_edge35
  %18 = add nsw i32 %16, -1
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph44.split, label %.lr.ph44.split.us

.lr.ph44.split.us:                                ; preds = %.lr.ph44, %.lr.ph44.split.us
  %.02742.us = phi i32 [ %.1.us, %.lr.ph44.split.us ], [ %18, %.lr.ph44 ]
  %.02841.us = phi i32 [ %.129.us, %.lr.ph44.split.us ], [ -1, %.lr.ph44 ]
  %21 = add nsw i32 %.02841.us, 1
  %22 = add i32 %21, %.02742.us
  %23 = lshr i32 %22, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %24 = icmp slt i32 %23, %16
  %25 = add nsw i32 %23, -1
  %.129.us = select i1 %24, i32 %23, i32 %.02841.us
  %.1.us = select i1 %24, i32 %.02742.us, i32 %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %26 = icmp slt i32 %.129.us, %.1.us
  br i1 %26, label %.lr.ph44.split.us, label %._crit_edge45, !llvm.loop !9

._crit_edge:                                      ; preds = %29, %.preheader32.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre59, %.preheader32.._crit_edge_crit_edge ], [ %33, %29 ]
  %27 = phi i32 [ %12, %.preheader32.._crit_edge_crit_edge ], [ %32, %29 ]
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %28 = icmp slt i64 %indvars.iv.next51, %.pre-phi
  br i1 %28, label %.preheader32, label %._crit_edge35, !llvm.loop !11

29:                                               ; preds = %.lr.ph, %29
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %29 ]
  %30 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next, %33
  br i1 %34, label %29, label %._crit_edge, !llvm.loop !13

.lr.ph44.split:                                   ; preds = %.lr.ph44, %._crit_edge40
  %35 = phi i32 [ %48, %._crit_edge40 ], [ %16, %.lr.ph44 ]
  %36 = phi i32 [ %50, %._crit_edge40 ], [ %19, %.lr.ph44 ]
  %37 = phi i32 [ %51, %._crit_edge40 ], [ %19, %.lr.ph44 ]
  %38 = phi i32 [ %52, %._crit_edge40 ], [ %19, %.lr.ph44 ]
  %.02742 = phi i32 [ %.1, %._crit_edge40 ], [ %18, %.lr.ph44 ]
  %.02841 = phi i32 [ %.129, %._crit_edge40 ], [ -1, %.lr.ph44 ]
  %39 = add nsw i32 %.02841, 1
  %40 = add i32 %39, %.02742
  %41 = lshr i32 %40, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  %42 = icmp sgt i32 %38, 0
  br i1 %42, label %.preheader.lr.ph, label %._crit_edge40

.preheader.lr.ph:                                 ; preds = %.lr.ph44.split
  %43 = icmp sgt i32 %37, 0
  br i1 %43, label %.preheader, label %._crit_edge40

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge38
  %44 = phi i32 [ %57, %._crit_edge38 ], [ 0, %.preheader.lr.ph ]
  %45 = phi i32 [ %58, %._crit_edge38 ], [ %36, %.preheader.lr.ph ]
  %46 = phi i32 [ %58, %._crit_edge38 ], [ %37, %.preheader.lr.ph ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %._crit_edge38 ], [ 0, %.preheader.lr.ph ]
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph37, label %.preheader.._crit_edge38_crit_edge

.preheader.._crit_edge38_crit_edge:               ; preds = %.preheader
  %.pre60 = sext i32 %45 to i64
  br label %._crit_edge38

._crit_edge40.loopexit:                           ; preds = %._crit_edge38
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %._crit_edge40

._crit_edge40:                                    ; preds = %.preheader.lr.ph, %._crit_edge40.loopexit, %.lr.ph44.split
  %48 = phi i32 [ %.pre, %._crit_edge40.loopexit ], [ %35, %.lr.ph44.split ], [ %35, %.preheader.lr.ph ]
  %49 = phi i32 [ %57, %._crit_edge40.loopexit ], [ 0, %.lr.ph44.split ], [ 0, %.preheader.lr.ph ]
  %50 = phi i32 [ %58, %._crit_edge40.loopexit ], [ %36, %.lr.ph44.split ], [ %36, %.preheader.lr.ph ]
  %51 = phi i32 [ %58, %._crit_edge40.loopexit ], [ %37, %.lr.ph44.split ], [ %37, %.preheader.lr.ph ]
  %52 = phi i32 [ %58, %._crit_edge40.loopexit ], [ %38, %.lr.ph44.split ], [ %37, %.preheader.lr.ph ]
  %53 = add nsw i32 %49, %41
  %54 = icmp slt i32 %53, %48
  %55 = add nsw i32 %41, -1
  %.129 = select i1 %54, i32 %41, i32 %.02841
  %.1 = select i1 %54, i32 %.02742, i32 %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %56 = icmp slt i32 %.129, %.1
  br i1 %56, label %.lr.ph44.split, label %._crit_edge45, !llvm.loop !14

._crit_edge38:                                    ; preds = %.lr.ph37, %.preheader.._crit_edge38_crit_edge
  %.pre-phi61 = phi i64 [ %.pre60, %.preheader.._crit_edge38_crit_edge ], [ %82, %.lr.ph37 ]
  %57 = phi i32 [ %44, %.preheader.._crit_edge38_crit_edge ], [ %80, %.lr.ph37 ]
  %58 = phi i32 [ %45, %.preheader.._crit_edge38_crit_edge ], [ %81, %.lr.ph37 ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %59 = icmp slt i64 %indvars.iv.next57, %.pre-phi61
  br i1 %59, label %.preheader, label %._crit_edge40.loopexit, !llvm.loop !15

.lr.ph37:                                         ; preds = %.preheader, %.lr.ph37
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph37 ], [ 0, %.preheader ]
  %60 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %indvars.iv56, i64 %indvars.iv53
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %62, i64 %indvars.iv56
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %66, i64 %indvars.iv53
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nsw i32 %68, %64
  store i32 %69, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %70 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %66, i64 %indvars.iv56
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ4mainE3dis, i64 0, i64 %62, i64 %indvars.iv53
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, %71
  store i32 %74, ptr %8, align 4, !tbaa !5
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, %41
  store i32 %77, ptr %6, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %60, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %78)
  %80 = load i32, ptr %79, align 4, !tbaa !5
  store i32 %80, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next54, %82
  br i1 %83, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16

._crit_edge45:                                    ; preds = %.lr.ph44.split.us, %._crit_edge40, %._crit_edge35
  %.028.lcssa = phi i32 [ -1, %._crit_edge35 ], [ %.129, %._crit_edge40 ], [ %.129.us, %.lr.ph44.split.us ]
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.028.lcssa)
  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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

; 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 #2

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


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