; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1059B)

; 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
@s = external dso_local global [1001 x [1001 x i8]], align 16
@t = external dso_local global [1001 x [1001 x i8]], 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 [3 x i8], align 1
@.str.3 = 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 i8, align 1
  %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
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

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

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %21
  %23 = getelementptr inbounds [1001 x i8], ptr %22, i64 0, i64 0
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %37, %19
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr @m, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1001 x i8], ptr %33, i64 0, i64 %35
  store i8 46, ptr %36, align 1, !tbaa !9
  br label %37

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

40:                                               ; preds = %29
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !12

44:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %148, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %151

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %144, %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %147

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  store i8 1, ptr %7, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %101, %58
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = icmp sle i32 %60, 1
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %104

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 -1, ptr %9, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %97, %63
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = icmp sle i32 %65, 1
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %100

68:                                               ; preds = %64
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %74, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %88

74:                                               ; preds = %71, %68
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = add nsw i32 %75, %76
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %78
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = add nsw i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1001 x i8], ptr %79, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = sext i8 %85 to i32
  %87 = icmp eq i32 %86, 35
  br label %88

88:                                               ; preds = %74, %71
  %89 = phi i1 [ true, %71 ], [ %87, %74 ]
  %90 = zext i1 %89 to i32
  %91 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %92 = trunc i8 %91 to i1
  %93 = zext i1 %92 to i32
  %94 = and i32 %93, %90
  %95 = icmp ne i32 %94, 0
  %96 = zext i1 %95 to i8
  store i8 %96, ptr %7, align 1, !tbaa !13
  br label %97

97:                                               ; preds = %88
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !5
  br label %64, !llvm.loop !17

100:                                              ; preds = %67
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !18

104:                                              ; preds = %62
  %105 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %106 = trunc i8 %105 to i1
  br i1 %106, label %107, label %143

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 -1, ptr %10, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %139, %107
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = icmp sle i32 %109, 1
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %142

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 -1, ptr %11, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %135, %112
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = icmp sle i32 %114, 1
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %138

117:                                              ; preds = %113
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %123, label %120

120:                                              ; preds = %117
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %134

123:                                              ; preds = %120, %117
  %124 = load i32, ptr %5, align 4, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = add nsw i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %127
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = add nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1001 x i8], ptr %128, i64 0, i64 %132
  store i8 35, ptr %133, align 1, !tbaa !9
  br label %134

134:                                              ; preds = %123, %120
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %11, align 4, !tbaa !5
  br label %113, !llvm.loop !19

138:                                              ; preds = %116
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !5
  br label %108, !llvm.loop !20

142:                                              ; preds = %111
  br label %143

143:                                              ; preds = %142, %104
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %6, align 4, !tbaa !5
  br label %52, !llvm.loop !21

147:                                              ; preds = %57
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %5, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !22

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

152:                                              ; preds = %171, %151
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 26, ptr %3, align 4
  br label %174

157:                                              ; preds = %152
  %158 = load i32, ptr %12, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %159
  %161 = getelementptr inbounds [1001 x i8], ptr %160, i64 0, i64 0
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %163
  %165 = getelementptr inbounds [1001 x i8], ptr %164, i64 0, i64 0
  %166 = call i32 @strcmp(ptr noundef %161, ptr noundef %165) #5
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %157
  %169 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %174

170:                                              ; preds = %157
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %12, align 4, !tbaa !5
  br label %152, !llvm.loop !23

174:                                              ; preds = %168, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %175 = load i32, ptr %3, align 4
  switch i32 %175, label %180 [
    i32 26, label %176
    i32 1, label %178
  ]

176:                                              ; preds = %174
  %177 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %178

178:                                              ; preds = %176, %174
  %179 = load i32, ptr %1, align 4
  ret i32 %179

180:                                              ; preds = %174
  unreachable
}

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: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

declare i32 @puts(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 = { nounwind willreturn memory(read) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !11}


; 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
@s = external dso_local global [1001 x [1001 x i8]], align 16
@t = external dso_local global [1001 x [1001 x i8]], 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 [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

.preheader62:                                     ; preds = %._crit_edge
  %4 = add i32 %69, -1
  %5 = icmp sgt i32 %69, 2
  br i1 %5, label %.preheader61.lr.ph, label %.preheader

.preheader61.lr.ph:                               ; preds = %.preheader62
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 2
  br i1 %7, label %.preheader61.us.preheader, label %.lr.ph77.preheader

.preheader61.us.preheader:                        ; preds = %.preheader61.lr.ph
  %8 = add nsw i32 %6, -1
  %wide.trip.count91 = zext nneg i32 %4 to i64
  %wide.trip.count = zext i32 %8 to i64
  br label %.preheader61.us

.preheader61.us:                                  ; preds = %.preheader61.us.preheader, %._crit_edge74.us
  %indvars.iv88 = phi i64 [ 1, %.preheader61.us.preheader ], [ %10, %._crit_edge74.us ]
  %9 = add nsw i64 %indvars.iv88, -1
  %10 = add nuw nsw i64 %indvars.iv88, 1
  br label %25

.loopexit.us:                                     ; preds = %.loopexit.us.loopexit, %25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge74.us, label %25, !llvm.loop !9

.loopexit.us.loopexit:                            ; preds = %25
  %11 = add nsw i64 %indvars.iv, -1
  %12 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %9, i64 %11
  store i8 35, ptr %12, align 1, !tbaa !11
  %13 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %9, i64 %indvars.iv
  store i8 35, ptr %13, align 1, !tbaa !11
  %14 = add nuw nsw i64 %indvars.iv, 1
  %15 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %9, i64 %14
  store i8 35, ptr %15, align 1, !tbaa !11
  %16 = add nsw i64 %indvars.iv, -1
  %17 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %indvars.iv88, i64 %16
  store i8 35, ptr %17, align 1, !tbaa !11
  %18 = add nuw nsw i64 %indvars.iv, 1
  %19 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %indvars.iv88, i64 %18
  store i8 35, ptr %19, align 1, !tbaa !11
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %10, i64 %20
  store i8 35, ptr %21, align 1, !tbaa !11
  %22 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %10, i64 %indvars.iv
  store i8 35, ptr %22, align 1, !tbaa !11
  %23 = add nuw nsw i64 %indvars.iv, 1
  %24 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %10, i64 %23
  store i8 35, ptr %24, align 1, !tbaa !11
  br label %.loopexit.us

25:                                               ; preds = %.loopexit.us, %.preheader61.us
  %indvars.iv = phi i64 [ 1, %.preheader61.us ], [ %indvars.iv.next, %.loopexit.us ]
  %26 = add nsw i64 %indvars.iv, -1
  %27 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %9, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = icmp eq i8 %28, 35
  %30 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %9, i64 %indvars.iv
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = icmp eq i8 %31, 35
  %33 = add nuw nsw i64 %indvars.iv, 1
  %34 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %9, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = icmp eq i8 %35, 35
  %37 = add nsw i64 %indvars.iv, -1
  %38 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %indvars.iv88, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = icmp eq i8 %39, 35
  %41 = add nuw nsw i64 %indvars.iv, 1
  %42 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %indvars.iv88, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = icmp eq i8 %43, 35
  %45 = add nsw i64 %indvars.iv, -1
  %46 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %10, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = icmp eq i8 %47, 35
  %49 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %10, i64 %indvars.iv
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = icmp eq i8 %50, 35
  %52 = add nuw nsw i64 %indvars.iv, 1
  %53 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %10, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !11
  %55 = icmp eq i8 %54, 35
  %56 = select i1 %55, i1 %51, i1 false
  %57 = select i1 %56, i1 %48, i1 false
  %58 = select i1 %57, i1 %44, i1 false
  %59 = select i1 %58, i1 %40, i1 false
  %60 = select i1 %59, i1 %36, i1 false
  %61 = select i1 %60, i1 %32, i1 false
  %62 = select i1 %61, i1 %29, i1 false
  br i1 %62, label %.loopexit.us.loopexit, label %.loopexit.us

._crit_edge74.us:                                 ; preds = %.loopexit.us
  %exitcond92.not = icmp eq i64 %10, %wide.trip.count91
  br i1 %exitcond92.not, label %.preheader, label %.preheader61.us, !llvm.loop !12

.lr.ph66:                                         ; preds = %0, %._crit_edge
  %indvar = phi i64 [ %indvar.next, %._crit_edge ], [ 0, %0 ]
  %63 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %indvar
  %64 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %63)
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph66
  %67 = mul nuw nsw i64 %indvar, 1001
  %scevgep = getelementptr i8, ptr @t, i64 %67
  %68 = zext nneg i32 %65 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 46, i64 %68, i1 false), !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph66
  %indvar.next = add nuw nsw i64 %indvar, 1
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvar.next, %70
  br i1 %71, label %.lr.ph66, label %.preheader62, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge74.us, %.preheader62
  %72 = icmp sgt i32 %69, 0
  br i1 %72, label %.lr.ph77.preheader, label %._crit_edge78

.lr.ph77.preheader:                               ; preds = %.preheader61.lr.ph, %.preheader
  %wide.trip.count96 = zext nneg i32 %69 to i64
  br label %.lr.ph77

73:                                               ; preds = %.lr.ph77
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge78, label %.lr.ph77, !llvm.loop !14

.lr.ph77:                                         ; preds = %.lr.ph77.preheader, %73
  %indvars.iv93 = phi i64 [ 0, %.lr.ph77.preheader ], [ %indvars.iv.next94, %73 ]
  %74 = getelementptr inbounds [1001 x [1001 x i8]], ptr @s, i64 0, i64 %indvars.iv93
  %75 = getelementptr inbounds [1001 x [1001 x i8]], ptr @t, i64 0, i64 %indvars.iv93
  %76 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %74, ptr noundef nonnull dereferenceable(1) %75) #4
  %.not = icmp eq i32 %76, 0
  br i1 %.not, label %73, label %._crit_edge78

._crit_edge78:                                    ; preds = %73, %.lr.ph77, %.preheader, %0
  %.str.2.sink = phi ptr [ @.str.3, %0 ], [ @.str.3, %.preheader ], [ @.str.2, %.lr.ph77 ], [ @.str.3, %73 ]
  %77 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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