; LLVM IR from tangjz/acm-icpc :: hackerrank (pmix)

; 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
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@buf = external dso_local global [2 x [1000001 x i8]], align 16
@.str = 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
  store i32 0, ptr %1, align 4
  %8 = load i32, ptr @cur, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %9
  %11 = getelementptr inbounds [1000001 x i8], ptr %10, i64 0, i64 0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

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

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %32

18:                                               ; preds = %13
  %19 = load i32, ptr @cur, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000001 x i8], ptr %21, i64 0, i64 %23
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = sub nsw i32 %26, 65
  %28 = trunc i32 %27 to i8
  store i8 %28, ptr %24, align 1, !tbaa !9
  br label %29

29:                                               ; preds = %18
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !10

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

33:                                               ; preds = %93, %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = and i32 %39, %40
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  br label %93

44:                                               ; preds = %38
  %45 = load i32, ptr @pre, align 4, !tbaa !5
  %46 = xor i32 %45, 1
  store i32 %46, ptr @pre, align 4, !tbaa !5
  %47 = load i32, ptr @cur, align 4, !tbaa !5
  %48 = xor i32 %47, 1
  store i32 %48, ptr @cur, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = srem i32 %49, %50
  store i32 %51, ptr %6, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %90, %44
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr @pre, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1000001 x i8], ptr %60, i64 0, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !9
  %65 = sext i8 %64 to i32
  %66 = load i32, ptr @pre, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000001 x i8], ptr %68, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = sext i8 %72 to i32
  %74 = xor i32 %65, %73
  %75 = trunc i32 %74 to i8
  %76 = load i32, ptr @cur, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %77
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1000001 x i8], ptr %78, i64 0, i64 %80
  store i8 %75, ptr %81, align 1, !tbaa !9
  br label %82

82:                                               ; preds = %57
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = icmp eq i32 %86, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %82
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %89, %82
  %91 = phi i1 [ false, %82 ], [ false, %89 ]
  br label %52, !llvm.loop !12

92:                                               ; preds = %56
  br label %93

93:                                               ; preds = %92, %43
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = shl i32 %94, 1
  store i32 %95, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !13

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

97:                                               ; preds = %113, %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

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

102:                                              ; preds = %97
  %103 = load i32, ptr @cur, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %104
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1000001 x i8], ptr %105, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !9
  %110 = sext i8 %109 to i32
  %111 = add nsw i32 %110, 65
  %112 = trunc i32 %111 to i8
  store i8 %112, ptr %108, align 1, !tbaa !9
  br label %113

113:                                              ; preds = %102
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %7, align 4, !tbaa !5
  br label %97, !llvm.loop !14

116:                                              ; preds = %101
  %117 = load i32, ptr @cur, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %118
  %120 = getelementptr inbounds [1000001 x i8], ptr %119, i64 0, i64 0
  %121 = call i32 @puts(ptr noundef %120)
  ret i32 0
}

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 @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 }

!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
@cur = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global i32, align 4
@buf = external dso_local global [2 x [1000001 x i8]], align 16
@.str = 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 = load i32, ptr @cur, align 4, !tbaa !5
  %2 = sext i32 %1 to i64
  %3 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %2
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull %3)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.fr32 = freeze i32 %5
  %6 = icmp sgt i32 %.fr32, 0
  br i1 %6, label %iter.check, label %.preheader22.thread

iter.check:                                       ; preds = %0
  %7 = load i32, ptr @cur, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %wide.trip.count = zext nneg i32 %.fr32 to i64
  %min.iters.check = icmp ult i32 %.fr32, 8
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check56 = icmp ult i32 %.fr32, 32
  br i1 %min.iters.check56, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 2147483616
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %9 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %8, i64 %index
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !9
  %wide.load57 = load <16 x i8>, ptr %10, align 1, !tbaa !9
  %11 = add <16 x i8> %wide.load, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65>
  %12 = add <16 x i8> %wide.load57, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65>
  store <16 x i8> %11, ptr %9, align 1, !tbaa !9
  store <16 x i8> %12, ptr %10, align 1, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader22, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec59, %vec.epilog.middle.block ]
  br label %vec.epilog.scalar.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec59 = and i64 %wide.trip.count, 2147483640
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index60 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next62, %vec.epilog.vector.body ]
  %14 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %8, i64 %index60
  %wide.load61 = load <8 x i8>, ptr %14, align 1, !tbaa !9
  %15 = add <8 x i8> %wide.load61, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65>
  store <8 x i8> %15, ptr %14, align 1, !tbaa !9
  %index.next62 = add nuw i64 %index60, 8
  %16 = icmp eq i64 %index.next62, %n.vec59
  br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n63 = icmp eq i64 %n.vec59, %wide.trip.count
  br i1 %cmp.n63, label %.preheader22, label %vec.epilog.scalar.ph.preheader

.preheader22:                                     ; preds = %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %.not27 = icmp slt i32 %17, 1
  br i1 %.not27, label %.preheader22..preheader_crit_edge, label %.lr.ph29

.preheader22.thread:                              ; preds = %0
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %.not2747 = icmp slt i32 %18, 1
  br i1 %.not2747, label %.preheader22..preheader_crit_edge, label %.lr.ph29.thread

.lr.ph29.thread:                                  ; preds = %.preheader22.thread
  %cur.promoted48 = load i32, ptr @cur, align 4, !tbaa !5
  %pre.promoted49 = load i32, ptr @pre, align 4, !tbaa !5
  br label %.lr.ph29.split.preheader

.preheader22..preheader_crit_edge:                ; preds = %.preheader22.thread, %.preheader22
  %.pre.pre = load i32, ptr @cur, align 4, !tbaa !5
  br label %.preheader

.lr.ph29:                                         ; preds = %.preheader22
  %cur.promoted = load i32, ptr @cur, align 4, !tbaa !5
  %pre.promoted = load i32, ptr @pre, align 4, !tbaa !5
  br i1 %6, label %.lr.ph29.split.us.preheader, label %.lr.ph29.split.preheader

.lr.ph29.split.preheader:                         ; preds = %.lr.ph29.thread, %.lr.ph29
  %pre.promoted51 = phi i32 [ %pre.promoted49, %.lr.ph29.thread ], [ %pre.promoted, %.lr.ph29 ]
  %cur.promoted50 = phi i32 [ %cur.promoted48, %.lr.ph29.thread ], [ %cur.promoted, %.lr.ph29 ]
  %19 = phi i32 [ %18, %.lr.ph29.thread ], [ %17, %.lr.ph29 ]
  br label %.lr.ph29.split

.lr.ph29.split.us.preheader:                      ; preds = %.lr.ph29
  %wide.trip.count38 = zext nneg i32 %.fr32 to i64
  %xtraiter = and i64 %wide.trip.count38, 1
  %20 = icmp eq i32 %.fr32, 1
  %unroll_iter = and i64 %wide.trip.count38, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph29.split.us

.lr.ph29.split.us:                                ; preds = %.lr.ph29.split.us.preheader, %..loopexit_crit_edge.us
  %.01828.us = phi i32 [ %56, %..loopexit_crit_edge.us ], [ 1, %.lr.ph29.split.us.preheader ]
  %21 = phi i32 [ %55, %..loopexit_crit_edge.us ], [ %pre.promoted, %.lr.ph29.split.us.preheader ]
  %22 = phi i32 [ %54, %..loopexit_crit_edge.us ], [ %cur.promoted, %.lr.ph29.split.us.preheader ]
  %23 = and i32 %17, %.01828.us
  %.not21.us = icmp eq i32 %23, 0
  br i1 %.not21.us, label %..loopexit_crit_edge.us, label %.lr.ph26.us

.lr.ph26.us:                                      ; preds = %.lr.ph29.split.us
  %24 = xor i32 %21, 1
  store i32 %24, ptr @pre, align 4, !tbaa !5
  %25 = xor i32 %22, 1
  store i32 %25, ptr @cur, align 4, !tbaa !5
  %26 = srem i32 %.01828.us, %.fr32
  %27 = sext i32 %24 to i64
  %28 = sext i32 %25 to i64
  br i1 %20, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.lr.ph26.us.new

.lr.ph26.us.new:                                  ; preds = %.lr.ph26.us, %.lr.ph26.us.new
  %indvars.iv35 = phi i64 [ %indvars.iv.next36.1, %.lr.ph26.us.new ], [ 0, %.lr.ph26.us ]
  %.01625.us = phi i32 [ %spec.store.select.us.1, %.lr.ph26.us.new ], [ %26, %.lr.ph26.us ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph26.us.new ], [ 0, %.lr.ph26.us ]
  %29 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %indvars.iv35
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = sext i32 %.01625.us to i64
  %32 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = xor i8 %33, %30
  %35 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %28, i64 %indvars.iv35
  store i8 %34, ptr %35, align 1, !tbaa !9
  %indvars.iv.next36 = or disjoint i64 %indvars.iv35, 1
  %36 = add nsw i32 %.01625.us, 1
  %37 = icmp eq i32 %36, %.fr32
  %spec.store.select.us = select i1 %37, i32 0, i32 %36
  %38 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %indvars.iv.next36
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = sext i32 %spec.store.select.us to i64
  %41 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = xor i8 %42, %39
  %44 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %28, i64 %indvars.iv.next36
  store i8 %43, ptr %44, align 1, !tbaa !9
  %indvars.iv.next36.1 = add nuw nsw i64 %indvars.iv35, 2
  %45 = add nsw i32 %spec.store.select.us, 1
  %46 = icmp eq i32 %45, %.fr32
  %spec.store.select.us.1 = select i1 %46, i32 0, i32 %45
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.lr.ph26.us.new, !llvm.loop !15

..loopexit_crit_edge.us.loopexit.unr-lcssa:       ; preds = %.lr.ph26.us.new, %.lr.ph26.us
  %indvars.iv35.unr = phi i64 [ 0, %.lr.ph26.us ], [ %indvars.iv.next36.1, %.lr.ph26.us.new ]
  %.01625.us.unr = phi i32 [ %26, %.lr.ph26.us ], [ %spec.store.select.us.1, %.lr.ph26.us.new ]
  br i1 %lcmp.mod.not, label %..loopexit_crit_edge.us, label %..loopexit_crit_edge.us.loopexit.epilog-lcssa

..loopexit_crit_edge.us.loopexit.epilog-lcssa:    ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa
  %47 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %indvars.iv35.unr
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = sext i32 %.01625.us.unr to i64
  %50 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %27, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !9
  %52 = xor i8 %51, %48
  %53 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %28, i64 %indvars.iv35.unr
  store i8 %52, ptr %53, align 1, !tbaa !9
  br label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %..loopexit_crit_edge.us.loopexit.epilog-lcssa, %..loopexit_crit_edge.us.loopexit.unr-lcssa, %.lr.ph29.split.us
  %54 = phi i32 [ %22, %.lr.ph29.split.us ], [ %25, %..loopexit_crit_edge.us.loopexit.unr-lcssa ], [ %25, %..loopexit_crit_edge.us.loopexit.epilog-lcssa ]
  %55 = phi i32 [ %21, %.lr.ph29.split.us ], [ %24, %..loopexit_crit_edge.us.loopexit.unr-lcssa ], [ %24, %..loopexit_crit_edge.us.loopexit.epilog-lcssa ]
  %56 = shl i32 %.01828.us, 1
  %.not.us = icmp sgt i32 %56, %17
  br i1 %.not.us, label %.preheader, label %.lr.ph29.split.us, !llvm.loop !16

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %vec.epilog.scalar.ph ], [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ]
  %57 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %8, i64 %indvars.iv
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = add i8 %58, -65
  store i8 %59, ptr %57, align 1, !tbaa !9
  %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 %.preheader22, label %vec.epilog.scalar.ph, !llvm.loop !17

.preheader:                                       ; preds = %74, %..loopexit_crit_edge.us, %.preheader22..preheader_crit_edge
  %.pre = phi i32 [ %.pre.pre, %.preheader22..preheader_crit_edge ], [ %54, %..loopexit_crit_edge.us ], [ %75, %74 ]
  %60 = sext i32 %.pre to i64
  br i1 %6, label %iter.check67, label %._crit_edge

iter.check67:                                     ; preds = %.preheader
  %wide.trip.count43 = zext nneg i32 %.fr32 to i64
  %min.iters.check65 = icmp ult i32 %.fr32, 8
  br i1 %min.iters.check65, label %vec.epilog.scalar.ph80.preheader, label %vector.main.loop.iter.check69

vector.main.loop.iter.check69:                    ; preds = %iter.check67
  %min.iters.check68 = icmp ult i32 %.fr32, 32
  br i1 %min.iters.check68, label %vec.epilog.ph81, label %vector.ph70

vector.ph70:                                      ; preds = %vector.main.loop.iter.check69
  %n.vec72 = and i64 %wide.trip.count43, 2147483616
  br label %vector.body73

vector.body73:                                    ; preds = %vector.body73, %vector.ph70
  %index74 = phi i64 [ 0, %vector.ph70 ], [ %index.next77, %vector.body73 ]
  %61 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %60, i64 %index74
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load75 = load <16 x i8>, ptr %61, align 1, !tbaa !9
  %wide.load76 = load <16 x i8>, ptr %62, align 1, !tbaa !9
  %63 = add <16 x i8> %wide.load75, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
  %64 = add <16 x i8> %wide.load76, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
  store <16 x i8> %63, ptr %61, align 1, !tbaa !9
  store <16 x i8> %64, ptr %62, align 1, !tbaa !9
  %index.next77 = add nuw i64 %index74, 32
  %65 = icmp eq i64 %index.next77, %n.vec72
  br i1 %65, label %middle.block64, label %vector.body73, !llvm.loop !18

middle.block64:                                   ; preds = %vector.body73
  %cmp.n78 = icmp eq i64 %n.vec72, %wide.trip.count43
  br i1 %cmp.n78, label %._crit_edge, label %vec.epilog.iter.check82

vec.epilog.iter.check82:                          ; preds = %middle.block64
  %n.vec.remaining83 = and i64 %wide.trip.count43, 24
  %min.epilog.iters.check84 = icmp eq i64 %n.vec.remaining83, 0
  br i1 %min.epilog.iters.check84, label %vec.epilog.scalar.ph80.preheader, label %vec.epilog.ph81

vec.epilog.scalar.ph80.preheader:                 ; preds = %vec.epilog.middle.block79, %iter.check67, %vec.epilog.iter.check82
  %indvars.iv40.ph = phi i64 [ 0, %iter.check67 ], [ %n.vec72, %vec.epilog.iter.check82 ], [ %n.vec87, %vec.epilog.middle.block79 ]
  br label %vec.epilog.scalar.ph80

vec.epilog.ph81:                                  ; preds = %vector.main.loop.iter.check69, %vec.epilog.iter.check82
  %vec.epilog.resume.val85 = phi i64 [ %n.vec72, %vec.epilog.iter.check82 ], [ 0, %vector.main.loop.iter.check69 ]
  %n.vec87 = and i64 %wide.trip.count43, 2147483640
  br label %vec.epilog.vector.body89

vec.epilog.vector.body89:                         ; preds = %vec.epilog.vector.body89, %vec.epilog.ph81
  %index90 = phi i64 [ %vec.epilog.resume.val85, %vec.epilog.ph81 ], [ %index.next92, %vec.epilog.vector.body89 ]
  %66 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %60, i64 %index90
  %wide.load91 = load <8 x i8>, ptr %66, align 1, !tbaa !9
  %67 = add <8 x i8> %wide.load91, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
  store <8 x i8> %67, ptr %66, align 1, !tbaa !9
  %index.next92 = add nuw i64 %index90, 8
  %68 = icmp eq i64 %index.next92, %n.vec87
  br i1 %68, label %vec.epilog.middle.block79, label %vec.epilog.vector.body89, !llvm.loop !19

vec.epilog.middle.block79:                        ; preds = %vec.epilog.vector.body89
  %cmp.n93 = icmp eq i64 %n.vec87, %wide.trip.count43
  br i1 %cmp.n93, label %._crit_edge, label %vec.epilog.scalar.ph80.preheader

.lr.ph29.split:                                   ; preds = %.lr.ph29.split.preheader, %74
  %.01828 = phi i32 [ %77, %74 ], [ 1, %.lr.ph29.split.preheader ]
  %69 = phi i32 [ %76, %74 ], [ %pre.promoted51, %.lr.ph29.split.preheader ]
  %70 = phi i32 [ %75, %74 ], [ %cur.promoted50, %.lr.ph29.split.preheader ]
  %71 = and i32 %19, %.01828
  %.not21 = icmp eq i32 %71, 0
  br i1 %.not21, label %74, label %.loopexit

.loopexit:                                        ; preds = %.lr.ph29.split
  %72 = xor i32 %69, 1
  store i32 %72, ptr @pre, align 4, !tbaa !5
  %73 = xor i32 %70, 1
  store i32 %73, ptr @cur, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %.loopexit, %.lr.ph29.split
  %75 = phi i32 [ %73, %.loopexit ], [ %70, %.lr.ph29.split ]
  %76 = phi i32 [ %72, %.loopexit ], [ %69, %.lr.ph29.split ]
  %77 = shl i32 %.01828, 1
  %.not = icmp sgt i32 %77, %19
  br i1 %.not, label %.preheader, label %.lr.ph29.split, !llvm.loop !16

._crit_edge:                                      ; preds = %vec.epilog.scalar.ph80, %middle.block64, %vec.epilog.middle.block79, %.preheader
  %78 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %60
  %79 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %78)
  ret i32 0

vec.epilog.scalar.ph80:                           ; preds = %vec.epilog.scalar.ph80.preheader, %vec.epilog.scalar.ph80
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %vec.epilog.scalar.ph80 ], [ %indvars.iv40.ph, %vec.epilog.scalar.ph80.preheader ]
  %80 = getelementptr inbounds [2 x [1000001 x i8]], ptr @buf, i64 0, i64 %60, i64 %indvars.iv40
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = add i8 %81, 65
  store i8 %82, ptr %80, align 1, !tbaa !9
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %exitcond44.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count43
  br i1 %exitcond44.not, label %._crit_edge, label %vec.epilog.scalar.ph80, !llvm.loop !20
}

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

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

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

!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, !12, !13}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11, !13, !12}
!18 = distinct !{!18, !11, !12, !13}
!19 = distinct !{!19, !11, !12, !13}
!20 = distinct !{!20, !11, !13, !12}


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