; LLVM IR from tangjz/acm-icpc :: lydsy (2910)

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

@s = external dso_local global [9 x [9 x i32]], align 16
@t = external dso_local global [9 x [9 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %11

11:                                               ; preds = %124, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %2, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %125

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

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

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

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

21:                                               ; preds = %42, %20
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 9
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %45

25:                                               ; preds = %21
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %27
  %29 = getelementptr inbounds [9 x i32], ptr %28, i64 0, i64 0
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %29, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %32)
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [9 x i32], ptr %36, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %39, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %25
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !5
  br label %21, !llvm.loop !9

45:                                               ; preds = %24
  br label %46

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

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

50:                                               ; preds = %80, %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 9
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %83

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

55:                                               ; preds = %76, %54
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = icmp slt i32 %56, 9
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %79

59:                                               ; preds = %55
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %61
  %63 = getelementptr inbounds [9 x i32], ptr %62, i64 0, i64 0
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %66)
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [9 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %73, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %59
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !5
  br label %55, !llvm.loop !12

79:                                               ; preds = %58
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !13

83:                                               ; preds = %53
  %84 = call noundef zeroext i1 @_Z5checkv()
  br i1 %84, label %85, label %87

85:                                               ; preds = %83
  %86 = call i32 @puts(ptr noundef @.str.2)
  br label %124

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

88:                                               ; preds = %116, %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = icmp slt i32 %89, 9
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %119

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %9, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %112, %92
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 9
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %115

99:                                               ; preds = %95
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %101
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [9 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [9 x i32], ptr %108, i64 0, i64 %110
  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) %105, ptr noundef nonnull align 4 dereferenceable(4) %111) #5
  br label %112

112:                                              ; preds = %99
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %9, align 4, !tbaa !5
  br label %95, !llvm.loop !14

115:                                              ; preds = %98
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %8, align 4, !tbaa !5
  br label %88, !llvm.loop !15

119:                                              ; preds = %91
  %120 = call noundef zeroext i1 @_Z5checkv()
  %121 = zext i1 %120 to i64
  %122 = select i1 %120, ptr @.str.2, ptr @.str.3
  %123 = call i32 @puts(ptr noundef %122)
  br label %124

124:                                              ; preds = %119, %85
  br label %11, !llvm.loop !16

125:                                              ; preds = %11
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %126 = load i32, ptr %1, align 4
  ret i32 %126
}

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

declare i32 @puts(ptr noundef) #3

; 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)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!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"

@s = external dso_local global [9 x [9 x i32]], align 16
@t = external dso_local global [9 x [9 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr %1, align 4, !tbaa !5
  %.not41 = icmp eq i32 %3, 0
  br i1 %.not41, label %._crit_edge, label %.preheader31

.preheader31:                                     ; preds = %0, %.preheader31.backedge
  %indvars.iv = phi i64 [ %indvars.iv.be, %.preheader31.backedge ], [ 0, %0 ]
  %5 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
  %7 = load i32, ptr %5, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr %5, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %9)
  %11 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 1
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %11, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %14)
  %16 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 2
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %16, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 12
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %19)
  %21 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 3
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %21, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %5, i64 16
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %24)
  %26 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %26, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %5, i64 20
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %29)
  %31 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 5
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %31, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 24
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %34)
  %36 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 6
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %5, i64 28
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %39)
  %41 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 7
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %41, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %5, i64 32
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %44)
  %46 = getelementptr inbounds [9 x [9 x i32]], ptr @s, i64 0, i64 %indvars.iv, i64 8
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 9
  br i1 %exitcond.not, label %.preheader, label %.preheader31.backedge

.preheader31.backedge:                            ; preds = %.preheader31, %97
  %indvars.iv.be = phi i64 [ %indvars.iv.next, %.preheader31 ], [ 0, %97 ]
  br label %.preheader31, !llvm.loop !9

.preheader:                                       ; preds = %.preheader31, %.preheader
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.preheader ], [ 0, %.preheader31 ]
  %49 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %49)
  %51 = load i32, ptr %49, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr %49, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %49, i64 4
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %53)
  %55 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 1
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %55, align 4, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %49, i64 8
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %58)
  %60 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 2
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %60, align 4, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %49, i64 12
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %63)
  %65 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 3
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %49, i64 16
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %68)
  %70 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 4
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %70, align 4, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %49, i64 20
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %73)
  %75 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 5
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %75, align 4, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %49, i64 24
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %78)
  %80 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 6
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %80, align 4, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %49, i64 28
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %83)
  %85 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 7
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr %85, align 4, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %49, i64 32
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %88)
  %90 = getelementptr inbounds [9 x [9 x i32]], ptr @t, i64 0, i64 %indvars.iv48, i64 8
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %90, align 4, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond51.not = icmp eq i64 %indvars.iv.next49, 9
  br i1 %exitcond51.not, label %93, label %.preheader, !llvm.loop !11

93:                                               ; preds = %.preheader
  %94 = call noundef zeroext i1 @_Z5checkv()
  br i1 %94, label %97, label %.loopexit.8

.loopexit.8:                                      ; preds = %93
  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) getelementptr inbounds (i8, ptr @s, i64 4), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 36)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 8), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 72)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 12), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 108)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 16), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 144)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 20), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 180)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 24), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 216)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 28), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 252)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 32), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 288)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 44), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 76)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 48), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 112)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 52), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 148)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 56), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 184)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 60), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 220)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 64), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 256)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 68), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 292)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 84), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 116)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 88), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 152)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 92), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 188)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 96), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 224)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 100), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 260)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 104), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 296)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 124), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 156)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 128), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 192)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 132), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 228)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 136), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 264)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 140), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 300)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 164), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 196)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 168), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 232)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 172), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 268)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 176), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 304)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 204), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 236)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 208), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 272)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 212), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 308)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 244), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 276)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 248), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 312)) #5
  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) getelementptr inbounds (i8, ptr @s, i64 284), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @s, i64 316)) #5
  %95 = call noundef zeroext i1 @_Z5checkv()
  %96 = select i1 %95, ptr @.str.2, ptr @.str.3
  br label %97

97:                                               ; preds = %93, %.loopexit.8
  %.sink = phi ptr [ %96, %.loopexit.8 ], [ @.str.2, %93 ]
  %98 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.sink)
  %99 = load i32, ptr %1, align 4, !tbaa !5
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %99, 0
  br i1 %.not, label %._crit_edge, label %.preheader31.backedge

._crit_edge:                                      ; preds = %97, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass