; LLVM IR from UtkarshPathrabe/Competitive-Coding :: SPOJ Solutions (CRSCNTRY)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [2001 x i32], align 16
  %10 = alloca [2001 x i32], align 16
  %11 = alloca [2 x [2 x i32]], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8004, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8004, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %13

13:                                               ; preds = %153, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %156

17:                                               ; preds = %13
  store i32 1, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %21, %17
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %28

21:                                               ; preds = %18
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %6, align 4, !tbaa !5
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [2001 x i32], ptr %9, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  br label %18, !llvm.loop !9

28:                                               ; preds = %18
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %152, %28
  br label %30

30:                                               ; preds = %29
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  br label %153

35:                                               ; preds = %30
  store i32 0, ptr %7, align 4, !tbaa !5
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %7, align 4, !tbaa !5
  %39 = sext i32 %37 to i64
  %40 = getelementptr inbounds [2001 x i32], ptr %10, i64 0, i64 %39
  store i32 %36, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %44, %35
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [2001 x i32], ptr %10, i64 0, i64 %49
  store i32 %46, ptr %50, align 4, !tbaa !5
  br label %41, !llvm.loop !11

51:                                               ; preds = %41
  %52 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 1
  %53 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 1
  store i32 0, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 1
  %55 = getelementptr inbounds [2 x i32], ptr %54, i64 0, i64 0
  store i32 0, ptr %55, align 8, !tbaa !5
  %56 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 0
  %57 = getelementptr inbounds [2 x i32], ptr %56, i64 0, i64 1
  store i32 0, ptr %57, align 4, !tbaa !5
  %58 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 0
  %59 = getelementptr inbounds [2 x i32], ptr %58, i64 0, i64 0
  store i32 0, ptr %59, align 16, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %136, %51
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %139

64:                                               ; preds = %60
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %132, %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %135

69:                                               ; preds = %65
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = srem i32 %70, 2
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2001 x i32], ptr %9, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = srem i32 %75, 2
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2001 x i32], ptr %10, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %74, %79
  br i1 %80, label %81, label %102

81:                                               ; preds = %69
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = srem i32 %83, 2
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %85
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  %89 = srem i32 %88, 2
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [2 x i32], ptr %86, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 1, %92
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = srem i32 %94, 2
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %96
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = srem i32 %98, 2
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [2 x i32], ptr %97, i64 0, i64 %100
  store i32 %93, ptr %101, align 4, !tbaa !5
  br label %131

102:                                              ; preds = %69
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sub nsw i32 %103, 1
  %105 = srem i32 %104, 2
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %106
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = srem i32 %108, 2
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2 x i32], ptr %107, i64 0, i64 %110
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = srem i32 %112, 2
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %114
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = srem i32 %117, 2
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2 x i32], ptr %115, i64 0, i64 %119
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %111, ptr noundef nonnull align 4 dereferenceable(4) %120)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = srem i32 %123, 2
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %125
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = srem i32 %127, 2
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [2 x i32], ptr %126, i64 0, i64 %129
  store i32 %122, ptr %130, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %102, %81
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %4, align 4, !tbaa !5
  br label %65, !llvm.loop !12

135:                                              ; preds = %65
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !13

139:                                              ; preds = %60
  %140 = load i32, ptr %3, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = srem i32 %141, 2
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [2 x [2 x i32]], ptr %11, i64 0, i64 %143
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = srem i32 %146, 2
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [2 x i32], ptr %144, i64 0, i64 %148
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %149)
  %151 = load i32, ptr %150, align 4, !tbaa !5
  store i32 %151, ptr %8, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %139
  br label %29, !llvm.loop !14

153:                                              ; preds = %34
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %154)
  br label %13, !llvm.loop !15

156:                                              ; preds = %13
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8004, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8004, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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}
!15 = distinct !{!15, !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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [2001 x i32], align 16
  %5 = alloca [2001 x i32], align 16
  %6 = alloca [2 x [2 x i32]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr %1, align 4, !tbaa !5
  %.not34 = icmp eq i32 %8, 0
  br i1 %.not34, label %._crit_edge38, label %.lr.ph37

.lr.ph37:                                         ; preds = %0, %._crit_edge
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %13

.preheader29:                                     ; preds = %13
  store i32 0, ptr %3, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %._crit_edge, label %.lr.ph

13:                                               ; preds = %.lr.ph37, %13
  %indvars.iv47 = phi i32 [ 1, %.lr.ph37 ], [ %indvars.iv.next48, %13 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next, %13 ]
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = getelementptr inbounds [2001 x i32], ptr %4, i64 0, i64 %indvars.iv
  store i32 %15, ptr %16, align 4, !tbaa !5
  %.not27 = icmp eq i32 %15, 0
  %indvars.iv.next48 = add nuw i32 %indvars.iv47, 1
  br i1 %.not27, label %.preheader29, label %13, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader29, %56
  %17 = phi i32 [ %63, %56 ], [ %11, %.preheader29 ]
  store i32 %17, ptr %5, align 16, !tbaa !5
  br label %18

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv45 = phi i32 [ 1, %.lr.ph ], [ %indvars.iv.next46, %18 ]
  %indvars.iv43 = phi i32 [ 2, %.lr.ph ], [ %indvars.iv.next44, %18 ]
  %indvars.iv40 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next41, %18 ]
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %21 = getelementptr inbounds [2001 x i32], ptr %5, i64 0, i64 %indvars.iv40
  store i32 %20, ptr %21, align 4, !tbaa !5
  %.not28 = icmp eq i32 %20, 0
  %indvars.iv.next44 = add nuw i32 %indvars.iv43, 1
  %indvars.iv.next46 = add nuw i32 %indvars.iv45, 1
  br i1 %.not28, label %22, label %18, !llvm.loop !11

22:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  br label %.preheader

.preheader:                                       ; preds = %22, %54
  %.02533 = phi i32 [ 0, %22 ], [ %55, %54 ]
  %23 = and i32 %.02533, 1
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds [2001 x i32], ptr %4, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %.02533, -1
  %28 = srem i32 %27, 2
  %29 = sext i32 %28 to i64
  br label %30

30:                                               ; preds = %.preheader, %51
  %.332 = phi i32 [ 0, %.preheader ], [ %53, %51 ]
  %31 = and i32 %.332, 1
  %32 = zext nneg i32 %31 to i64
  %33 = getelementptr inbounds [2001 x i32], ptr %5, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp eq i32 %26, %34
  br i1 %35, label %36, label %43

36:                                               ; preds = %30
  %37 = add nsw i32 %.332, -1
  %38 = srem i32 %37, 2
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [2 x [2 x i32]], ptr %6, i64 0, i64 %29, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  br label %51

43:                                               ; preds = %30
  %44 = getelementptr inbounds [2 x [2 x i32]], ptr %6, i64 0, i64 %29, i64 %32
  %45 = add nsw i32 %.332, -1
  %46 = srem i32 %45, 2
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [2 x [2 x i32]], ptr %6, i64 0, i64 %24, i64 %47
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %36, %43
  %.sink = phi i32 [ %42, %36 ], [ %50, %43 ]
  %52 = getelementptr inbounds [2 x [2 x i32]], ptr %6, i64 0, i64 %24, i64 %32
  store i32 %.sink, ptr %52, align 4
  %53 = add nuw i32 %.332, 1
  %exitcond.not = icmp eq i32 %53, %indvars.iv43
  br i1 %exitcond.not, label %54, label %30, !llvm.loop !12

54:                                               ; preds = %51
  %55 = add nuw i32 %.02533, 1
  %exitcond49.not = icmp eq i32 %55, %indvars.iv47
  br i1 %exitcond49.not, label %56, label %.preheader, !llvm.loop !13

56:                                               ; preds = %54
  %57 = and i32 %indvars.iv45, 1
  %58 = zext nneg i32 %57 to i64
  %59 = getelementptr inbounds [2 x [2 x i32]], ptr %6, i64 0, i64 %24, i64 %58
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  store i32 %61, ptr %3, align 4, !tbaa !5
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %56, %.preheader29
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %65)
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %._crit_edge38, label %.lr.ph37, !llvm.loop !15

._crit_edge38:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  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: 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: nofree nounwind
declare noundef i32 @printf(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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass