; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-04 (A - Where is the Boundary - dby)

; 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
@buf = external dso_local global [103 x [10004 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 [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %46, %0
  %13 = load i32, ptr %5, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %19
  %21 = getelementptr inbounds [10004 x i8], ptr %20, i64 0, i64 0
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %42, %17
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %30
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [10004 x i8], ptr %31, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  %37 = icmp eq i32 %36, 87
  br i1 %37, label %38, label %41

38:                                               ; preds = %28
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %38, %28
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %23, !llvm.loop !10

45:                                               ; preds = %27
  br label %46

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

49:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %50 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %50, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %93, %49
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %96

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

57:                                               ; preds = %80, %56
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %64
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10004 x i8], ptr %65, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 87
  br i1 %72, label %73, label %76

73:                                               ; preds = %62
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %8, align 4, !tbaa !5
  br label %79

76:                                               ; preds = %62
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %76, %73
  br label %80

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

83:                                               ; preds = %61
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %87, label %92

87:                                               ; preds = %83
  %88 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %88, ptr %2, align 4, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %89, ptr %3, align 4, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %4, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %87, %83
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !5
  br label %51, !llvm.loop !14

96:                                               ; preds = %55
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %97, i32 noundef %98)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %100 = load i32, ptr %1, align 4
  ret i32 %100
}

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

declare i32 @printf(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 }

!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 = distinct !{!13, !11}
!14 = distinct !{!14, !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
@buf = external dso_local global [103 x [10004 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 [7 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 @m, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph42, label %..preheader36_crit_edge

..preheader36_crit_edge:                          ; preds = %0
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader36

.preheader36:                                     ; preds = %._crit_edge, %..preheader36_crit_edge
  %4 = phi i32 [ %.pre, %..preheader36_crit_edge ], [ %56, %._crit_edge ]
  %.033.lcssa = phi i32 [ 0, %..preheader36_crit_edge ], [ %.134.lcssa, %._crit_edge ]
  %.lcssa = phi i32 [ %2, %..preheader36_crit_edge ], [ %69, %._crit_edge ]
  %.not50 = icmp sgt i32 %4, 0
  %5 = icmp sgt i32 %.lcssa, 0
  %or.cond = and i1 %.not50, %5
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge56

.preheader.us.preheader:                          ; preds = %.preheader36
  %6 = add nuw i32 %4, 1
  %wide.trip.count74 = zext i32 %6 to i64
  %wide.trip.count69 = zext nneg i32 %.lcssa to i64
  %min.iters.check84 = icmp ult i32 %.lcssa, 8
  %n.vec87 = and i64 %wide.trip.count69, 2147483640
  %cmp.n95 = icmp eq i64 %n.vec87, %wide.trip.count69
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge48.us
  %indvars.iv71 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next72, %._crit_edge48.us ]
  %.02654.us = phi i32 [ %.033.lcssa, %.preheader.us.preheader ], [ %.2.us.lcssa, %._crit_edge48.us ]
  %.02953.us = phi i32 [ 1, %.preheader.us.preheader ], [ %.130.us, %._crit_edge48.us ]
  %.03152.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.132.us, %._crit_edge48.us ]
  %.351.us = phi i32 [ %.033.lcssa, %.preheader.us.preheader ], [ %.4.us, %._crit_edge48.us ]
  %7 = add nsw i64 %indvars.iv71, -1
  br i1 %min.iters.check84, label %scalar.ph83.preheader, label %vector.ph85

vector.ph85:                                      ; preds = %.preheader.us
  %8 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.02654.us, i64 0
  br label %vector.body89

vector.body89:                                    ; preds = %vector.body89, %vector.ph85
  %index90 = phi i64 [ 0, %vector.ph85 ], [ %index.next93, %vector.body89 ]
  %vec.phi91 = phi <4 x i32> [ %8, %vector.ph85 ], [ %44, %vector.body89 ]
  %vec.phi92 = phi <4 x i32> [ zeroinitializer, %vector.ph85 ], [ %45, %vector.body89 ]
  %9 = or disjoint i64 %index90, 1
  %10 = or disjoint i64 %index90, 2
  %11 = or disjoint i64 %index90, 3
  %12 = or disjoint i64 %index90, 4
  %13 = or disjoint i64 %index90, 5
  %14 = or disjoint i64 %index90, 6
  %15 = or disjoint i64 %index90, 7
  %16 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %index90, i64 %7
  %17 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %9, i64 %7
  %18 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %10, i64 %7
  %19 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %11, i64 %7
  %20 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %12, i64 %7
  %21 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %13, i64 %7
  %22 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %14, i64 %7
  %23 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %15, i64 %7
  %24 = load i8, ptr %16, align 1, !tbaa !9
  %25 = load i8, ptr %17, align 1, !tbaa !9
  %26 = load i8, ptr %18, align 1, !tbaa !9
  %27 = load i8, ptr %19, align 1, !tbaa !9
  %28 = insertelement <4 x i8> poison, i8 %24, i64 0
  %29 = insertelement <4 x i8> %28, i8 %25, i64 1
  %30 = insertelement <4 x i8> %29, i8 %26, i64 2
  %31 = insertelement <4 x i8> %30, i8 %27, i64 3
  %32 = load i8, ptr %20, align 1, !tbaa !9
  %33 = load i8, ptr %21, align 1, !tbaa !9
  %34 = load i8, ptr %22, align 1, !tbaa !9
  %35 = load i8, ptr %23, align 1, !tbaa !9
  %36 = insertelement <4 x i8> poison, i8 %32, i64 0
  %37 = insertelement <4 x i8> %36, i8 %33, i64 1
  %38 = insertelement <4 x i8> %37, i8 %34, i64 2
  %39 = insertelement <4 x i8> %38, i8 %35, i64 3
  %40 = icmp eq <4 x i8> %31, <i8 87, i8 87, i8 87, i8 87>
  %41 = icmp eq <4 x i8> %39, <i8 87, i8 87, i8 87, i8 87>
  %42 = select <4 x i1> %40, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
  %43 = select <4 x i1> %41, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
  %44 = add <4 x i32> %42, %vec.phi91
  %45 = add <4 x i32> %43, %vec.phi92
  %index.next93 = add nuw i64 %index90, 8
  %46 = icmp eq i64 %index.next93, %n.vec87
  br i1 %46, label %middle.block82, label %vector.body89, !llvm.loop !10

middle.block82:                                   ; preds = %vector.body89
  %bin.rdx94 = add <4 x i32> %45, %44
  %47 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx94)
  br i1 %cmp.n95, label %._crit_edge48.us, label %scalar.ph83.preheader

scalar.ph83.preheader:                            ; preds = %middle.block82, %.preheader.us
  %indvars.iv66.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec87, %middle.block82 ]
  %.145.us.ph = phi i32 [ %.02654.us, %.preheader.us ], [ %47, %middle.block82 ]
  br label %scalar.ph83

scalar.ph83:                                      ; preds = %scalar.ph83.preheader, %scalar.ph83
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %scalar.ph83 ], [ %indvars.iv66.ph, %scalar.ph83.preheader ]
  %.145.us = phi i32 [ %.2.us, %scalar.ph83 ], [ %.145.us.ph, %scalar.ph83.preheader ]
  %48 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %indvars.iv66, i64 %7
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = icmp eq i8 %49, 87
  %.2.v.us = select i1 %50, i32 -1, i32 1
  %.2.us = add nsw i32 %.2.v.us, %.145.us
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
  br i1 %exitcond70.not, label %._crit_edge48.us, label %scalar.ph83, !llvm.loop !14

._crit_edge48.us:                                 ; preds = %scalar.ph83, %middle.block82
  %.2.us.lcssa = phi i32 [ %47, %middle.block82 ], [ %.2.us, %scalar.ph83 ]
  %51 = icmp slt i32 %.2.us.lcssa, %.351.us
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %.4.us = tail call i32 @llvm.smin.i32(i32 %.2.us.lcssa, i32 %.351.us)
  %52 = trunc nuw nsw i64 %indvars.iv71 to i32
  %.132.us = select i1 %51, i32 %52, i32 %.03152.us
  %53 = trunc nsw i64 %indvars.iv.next72 to i32
  %.130.us = select i1 %51, i32 %53, i32 %.02953.us
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge56, label %.preheader.us, !llvm.loop !15

.lr.ph42:                                         ; preds = %0, %._crit_edge
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %._crit_edge ], [ 0, %0 ]
  %.03339 = phi i32 [ %.134.lcssa, %._crit_edge ], [ 0, %0 ]
  %54 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %indvars.iv63
  %55 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %54)
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph42
  %wide.trip.count = zext nneg i32 %56 to i64
  %min.iters.check = icmp ult i32 %56, 8
  br i1 %min.iters.check, label %.lr.ph.preheader100, label %vector.ph

.lr.ph.preheader100:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.13437.ph = phi i32 [ %.03339, %.lr.ph.preheader ], [ %68, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %58 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03339, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %58, %vector.ph ], [ %65, %vector.body ]
  %vec.phi80 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %66, %vector.body ]
  %59 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %indvars.iv63, i64 %index
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %wide.load = load <4 x i8>, ptr %59, align 4, !tbaa !9
  %wide.load81 = load <4 x i8>, ptr %60, align 4, !tbaa !9
  %61 = icmp eq <4 x i8> %wide.load, <i8 87, i8 87, i8 87, i8 87>
  %62 = icmp eq <4 x i8> %wide.load81, <i8 87, i8 87, i8 87, i8 87>
  %63 = zext <4 x i1> %61 to <4 x i32>
  %64 = zext <4 x i1> %62 to <4 x i32>
  %65 = add <4 x i32> %vec.phi, %63
  %66 = add <4 x i32> %vec.phi80, %64
  %index.next = add nuw i64 %index, 8
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %66, %65
  %68 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader100

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.lr.ph42
  %.134.lcssa = phi i32 [ %.03339, %.lr.ph42 ], [ %68, %middle.block ], [ %spec.select, %.lr.ph ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %69 = load i32, ptr @m, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next64, %70
  br i1 %71, label %.lr.ph42, label %.preheader36, !llvm.loop !17

.lr.ph:                                           ; preds = %.lr.ph.preheader100, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader100 ]
  %.13437 = phi i32 [ %spec.select, %.lr.ph ], [ %.13437.ph, %.lr.ph.preheader100 ]
  %72 = getelementptr inbounds [103 x [10004 x i8]], ptr @buf, i64 0, i64 %indvars.iv63, i64 %indvars.iv
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = icmp eq i8 %73, 87
  %75 = zext i1 %74 to i32
  %spec.select = add nsw i32 %.13437, %75
  %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_edge, label %.lr.ph, !llvm.loop !18

._crit_edge56:                                    ; preds = %._crit_edge48.us, %.preheader36
  %.031.lcssa = phi i32 [ 0, %.preheader36 ], [ %.132.us, %._crit_edge48.us ]
  %.029.lcssa = phi i32 [ 1, %.preheader36 ], [ %.130.us, %._crit_edge48.us ]
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.031.lcssa, i32 noundef %.029.lcssa)
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #2

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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !13, !12}


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