; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (2612)

; 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
@map = external dso_local global [210 x [210 x i8]], align 16
@vis = external dso_local global [210 x [210 x i32]], align 16
@dis = external dso_local global [210 x [210 x [2 x i32]]], align 16
@flag = external dso_local global i32, align 4
@.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 [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3bfsii(i32 noundef, i32 noundef) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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
  store i32 0, ptr %1, align 4
  br label %9

9:                                                ; preds = %143, %0
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %11 = xor i32 %10, -1
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %147

13:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 16 @dis, i8 63, i64 352800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %25, %13
  %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
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %28

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

25:                                               ; preds = %19
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

29:                                               ; preds = %72, %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

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

35:                                               ; preds = %68, %34
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %71

40:                                               ; preds = %35
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [210 x i8], ptr %43, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 89
  br i1 %49, label %50, label %53

50:                                               ; preds = %40
  store i32 0, ptr @flag, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 176400, i1 false)
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3bfsii(i32 noundef %51, i32 noundef %52)
  br label %67

53:                                               ; preds = %40
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [210 x i8], ptr %56, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 77
  br i1 %62, label %63, label %66

63:                                               ; preds = %53
  store i32 1, ptr @flag, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 176400, i1 false)
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3bfsii(i32 noundef %64, i32 noundef %65)
  br label %66

66:                                               ; preds = %63, %53
  br label %67

67:                                               ; preds = %66, %50
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !12

71:                                               ; preds = %39
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !13

75:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1061109567, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %76

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

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

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

82:                                               ; preds = %136, %81
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = load i32, ptr @m, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

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

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %89
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [210 x i8], ptr %90, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !11
  %95 = sext i8 %94 to i32
  %96 = icmp eq i32 %95, 64
  br i1 %96, label %97, label %135

97:                                               ; preds = %87
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %100
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [210 x [2 x i32]], ptr %101, i64 0, i64 %103
  %105 = getelementptr inbounds [2 x i32], ptr %104, i64 0, i64 0
  %106 = load i32, ptr %105, align 8, !tbaa !5
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %108
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [210 x [2 x i32]], ptr %109, i64 0, i64 %111
  %113 = getelementptr inbounds [2 x i32], ptr %112, i64 0, i64 1
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %106, %114
  %116 = icmp sgt i32 %98, %115
  br i1 %116, label %117, label %135

117:                                              ; preds = %97
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %119
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [210 x [2 x i32]], ptr %120, i64 0, i64 %122
  %124 = getelementptr inbounds [2 x i32], ptr %123, i64 0, i64 0
  %125 = load i32, ptr %124, align 8, !tbaa !5
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %127
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [210 x [2 x i32]], ptr %128, i64 0, i64 %130
  %132 = getelementptr inbounds [2 x i32], ptr %131, i64 0, i64 1
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %125, %133
  store i32 %134, ptr %6, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %117, %97, %87
  br label %136

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

139:                                              ; preds = %86
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %7, align 4, !tbaa !5
  br label %76, !llvm.loop !15

143:                                              ; preds = %80
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = mul nsw i32 %144, 11
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %145)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %9, !llvm.loop !16

147:                                              ; preds = %9
  %148 = load i32, ptr %1, align 4
  ret i32 %148
}

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

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

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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@map = external dso_local global [210 x [210 x i8]], align 16
@vis = external dso_local local_unnamed_addr global [210 x [210 x i32]], align 16
@dis = external dso_local local_unnamed_addr global [210 x [210 x [2 x i32]]], align 16
@flag = external dso_local local_unnamed_addr global i32, align 4
@.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 [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3bfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %.not56 = icmp eq i32 %1, -1
  br i1 %.not56, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %0, %._crit_edge53
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(352800) @dis, i8 63, i64 352800, i1 false)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge53

.preheader41:                                     ; preds = %.lr.ph
  %4 = icmp sgt i32 %9, 0
  %5 = load i32, ptr @m, align 4
  %6 = icmp sgt i32 %5, 0
  %or.cond = select i1 %4, i1 %6, i1 false
  br i1 %or.cond, label %.preheader39, label %._crit_edge53

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

.preheader40:                                     ; preds = %._crit_edge
  %12 = icmp sgt i32 %47, 0
  br i1 %12, label %.preheader.lr.ph, label %._crit_edge53

.preheader.lr.ph:                                 ; preds = %.preheader40
  %.pr = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sgt i32 %.pr, 0
  br i1 %13, label %.preheader.us.preheader, label %._crit_edge53

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count76 = zext nneg i32 %47 to i64
  %wide.trip.count = zext nneg i32 %.pr to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %14 = icmp eq i32 %.pr, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge49.us
  %indvars.iv73 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next74, %._crit_edge49.us ]
  %.03351.us = phi i32 [ 1061109567, %.preheader.us.preheader ], [ %.2.us.lcssa, %._crit_edge49.us ]
  br i1 %14, label %._crit_edge49.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %34
  %indvars.iv70 = phi i64 [ %indvars.iv.next71.1, %34 ], [ 0, %.preheader.us ]
  %.146.us = phi i32 [ %.2.us.1, %34 ], [ %.03351.us, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %34 ], [ 0, %.preheader.us ]
  %15 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %indvars.iv73, i64 %indvars.iv70
  %16 = load i8, ptr %15, align 2, !tbaa !11
  %17 = icmp eq i8 %16, 64
  br i1 %17, label %18, label %24

18:                                               ; preds = %.preheader.us.new
  %19 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %indvars.iv73, i64 %indvars.iv70
  %20 = load i32, ptr %19, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %19, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = add nsw i32 %22, %20
  %spec.select.us = tail call i32 @llvm.smin.i32(i32 %.146.us, i32 %23)
  br label %24

24:                                               ; preds = %18, %.preheader.us.new
  %.2.us = phi i32 [ %.146.us, %.preheader.us.new ], [ %spec.select.us, %18 ]
  %indvars.iv.next71 = or disjoint i64 %indvars.iv70, 1
  %25 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %indvars.iv73, i64 %indvars.iv.next71
  %26 = load i8, ptr %25, align 1, !tbaa !11
  %27 = icmp eq i8 %26, 64
  br i1 %27, label %28, label %34

28:                                               ; preds = %24
  %29 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %indvars.iv73, i64 %indvars.iv.next71
  %30 = load i32, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %29, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, %30
  %spec.select.us.1 = tail call i32 @llvm.smin.i32(i32 %.2.us, i32 %33)
  br label %34

34:                                               ; preds = %28, %24
  %.2.us.1 = phi i32 [ %.2.us, %24 ], [ %spec.select.us.1, %28 ]
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge49.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !12

._crit_edge49.us.unr-lcssa:                       ; preds = %34, %.preheader.us
  %.2.us.lcssa.ph = phi i32 [ poison, %.preheader.us ], [ %.2.us.1, %34 ]
  %indvars.iv70.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next71.1, %34 ]
  %.146.us.unr = phi i32 [ %.03351.us, %.preheader.us ], [ %.2.us.1, %34 ]
  br i1 %lcmp.mod.not, label %._crit_edge49.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge49.us.unr-lcssa
  %35 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %indvars.iv73, i64 %indvars.iv70.unr
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = icmp eq i8 %36, 64
  br i1 %37, label %38, label %._crit_edge49.us

38:                                               ; preds = %.epil.preheader
  %39 = getelementptr inbounds [210 x [210 x [2 x i32]]], ptr @dis, i64 0, i64 %indvars.iv73, i64 %indvars.iv70.unr
  %40 = load i32, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %39, i64 4
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %40
  %spec.select.us.epil = tail call i32 @llvm.smin.i32(i32 %.146.us.unr, i32 %43)
  br label %._crit_edge49.us

._crit_edge49.us:                                 ; preds = %.epil.preheader, %38, %._crit_edge49.us.unr-lcssa
  %.2.us.lcssa = phi i32 [ %.2.us.lcssa.ph, %._crit_edge49.us.unr-lcssa ], [ %.146.us.unr, %.epil.preheader ], [ %spec.select.us.epil, %38 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
  br i1 %exitcond77.not, label %._crit_edge53, label %.preheader.us, !llvm.loop !13

.preheader39:                                     ; preds = %.preheader41, %._crit_edge
  %44 = phi i32 [ %47, %._crit_edge ], [ %9, %.preheader41 ]
  %45 = phi i32 [ %48, %._crit_edge ], [ %5, %.preheader41 ]
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %._crit_edge ], [ 0, %.preheader41 ]
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph44.preheader, label %._crit_edge

.lr.ph44.preheader:                               ; preds = %.preheader39
  %.sink = trunc i64 %indvars.iv67 to i32
  br label %.lr.ph44

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader39
  %47 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %44, %.preheader39 ]
  %48 = phi i32 [ %56, %._crit_edge.loopexit ], [ %45, %.preheader39 ]
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %49 = sext i32 %47 to i64
  %50 = icmp slt i64 %indvars.iv.next68, %49
  br i1 %50, label %.preheader39, label %.preheader40, !llvm.loop !14

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %55
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %55 ], [ 0, %.lr.ph44.preheader ]
  %51 = getelementptr inbounds [210 x [210 x i8]], ptr @map, i64 0, i64 %indvars.iv67, i64 %indvars.iv64
  %52 = load i8, ptr %51, align 1, !tbaa !11
  switch i8 %52, label %55 [
    i8 89, label %.sink.split
    i8 77, label %53
  ]

53:                                               ; preds = %.lr.ph44
  br label %.sink.split

.sink.split:                                      ; preds = %.lr.ph44, %53
  %.sink86 = phi i32 [ 1, %53 ], [ 0, %.lr.ph44 ]
  store i32 %.sink86, ptr @flag, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(176400) @vis, i8 0, i64 176400, i1 false)
  %54 = trunc nuw nsw i64 %indvars.iv64 to i32
  tail call void @_Z3bfsii(i32 noundef %.sink, i32 noundef %54)
  br label %55

55:                                               ; preds = %.sink.split, %.lr.ph44
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next65, %57
  br i1 %58, label %.lr.ph44, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge53:                                    ; preds = %._crit_edge49.us, %.lr.ph58, %.preheader41, %.preheader.lr.ph, %.preheader40
  %.033.lcssa = phi i32 [ 1061109567, %.preheader40 ], [ 1061109567, %.preheader.lr.ph ], [ 1061109567, %.preheader41 ], [ 1061109567, %.lr.ph58 ], [ %.2.us.lcssa, %._crit_edge49.us ]
  %59 = mul nsw i32 %.033.lcssa, 11
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %59)
  %61 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %.not = icmp eq i32 %61, -1
  br i1 %.not, label %._crit_edge59, label %.lr.ph58, !llvm.loop !17

._crit_edge59:                                    ; preds = %._crit_edge53, %0
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

attributes #0 = { 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 #1 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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