; LLVM IR from reyadussalahin/problem-solving :: string/hashing/spoj/FNHAY (Solution)

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

@txt = external dso_local global [2000010 x i8], align 16
@pat = external dso_local global [2000010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  br label %13

13:                                               ; preds = %123, %0
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %124

16:                                               ; preds = %13
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @pat, ptr noundef @txt)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %18 = call i64 @strlen(ptr noundef @pat) #5
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %20 = call i64 @strlen(ptr noundef @txt) #5
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 47, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 1, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %32, %16
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %35

27:                                               ; preds = %22
  %28 = load i64, ptr %6, align 8, !tbaa !9
  %29 = load i64, ptr %5, align 8, !tbaa !9
  %30 = mul nsw i64 %28, %29
  %31 = srem i64 %30, 1000000007
  store i64 %31, ptr %6, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %27
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %7, align 4, !tbaa !5
  br label %22, !llvm.loop !11

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

36:                                               ; preds = %55, %35
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %58

41:                                               ; preds = %36
  %42 = load i64, ptr %8, align 8, !tbaa !9
  %43 = load i64, ptr %5, align 8, !tbaa !9
  %44 = mul nsw i64 %42, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [2000010 x i8], ptr @pat, i64 0, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !13
  %49 = sext i8 %48 to i32
  %50 = sub nsw i32 %49, 97
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = add nsw i64 %44, %52
  %54 = srem i64 %53, 1000000007
  store i64 %54, ptr %8, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %41
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %9, align 4, !tbaa !5
  br label %36, !llvm.loop !14

58:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  store i8 0, ptr %11, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %115, %58
  %60 = load i32, ptr %12, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %118

64:                                               ; preds = %59
  %65 = load i64, ptr %10, align 8, !tbaa !9
  %66 = load i64, ptr %5, align 8, !tbaa !9
  %67 = mul nsw i64 %65, %66
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2000010 x i8], ptr @txt, i64 0, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !13
  %72 = sext i8 %71 to i32
  %73 = sub nsw i32 %72, 97
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = add nsw i64 %67, %75
  %77 = srem i64 %76, 1000000007
  store i64 %77, ptr %10, align 8, !tbaa !9
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = icmp sge i32 %78, %79
  br i1 %80, label %81, label %99

81:                                               ; preds = %64
  %82 = load i64, ptr %10, align 8, !tbaa !9
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sub nsw i32 %83, %84
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [2000010 x i8], ptr @txt, i64 0, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !13
  %89 = sext i8 %88 to i32
  %90 = sub nsw i32 %89, 97
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = load i64, ptr %6, align 8, !tbaa !9
  %94 = mul nsw i64 %92, %93
  %95 = srem i64 %94, 1000000007
  %96 = sub nsw i64 %82, %95
  %97 = add nsw i64 %96, 1000000007
  %98 = srem i64 %97, 1000000007
  store i64 %98, ptr %10, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %81, %64
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = icmp sge i32 %100, %102
  br i1 %103, label %104, label %114

104:                                              ; preds = %99
  %105 = load i64, ptr %10, align 8, !tbaa !9
  %106 = load i64, ptr %8, align 8, !tbaa !9
  %107 = icmp eq i64 %105, %106
  br i1 %107, label %108, label %114

108:                                              ; preds = %104
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  %112 = add nsw i32 %111, 1
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %112)
  store i8 1, ptr %11, align 1, !tbaa !15
  br label %114

114:                                              ; preds = %108, %104, %99
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %12, align 4, !tbaa !5
  br label %59, !llvm.loop !17

118:                                              ; preds = %63
  %119 = load i8, ptr %11, align 1, !tbaa !15, !range !18, !noundef !19
  %120 = trunc i8 %119 to i1
  br i1 %120, label %123, label %121

121:                                              ; preds = %118
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %123

123:                                              ; preds = %121, %118
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %13, !llvm.loop !20

124:                                              ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !12}


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

@txt = external dso_local global [2000010 x i8], align 16
@pat = external dso_local global [2000010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = icmp eq i32 %2, 1
  br i1 %3, label %.lr.ph53, label %._crit_edge54

.lr.ph53:                                         ; preds = %0, %._crit_edge.thread
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @pat, ptr noundef nonnull @txt)
  %5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @pat) #5
  %6 = trunc i64 %5 to i32
  %7 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @txt) #5
  %8 = trunc i64 %7 to i32
  %9 = icmp sgt i32 %6, 0
  br i1 %9, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph53
  %xtraiter = and i32 %6, 3
  %10 = icmp ult i32 %6, 4
  br i1 %10, label %.preheader40.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i32 %6, 2147483644
  br label %.lr.ph

.preheader40.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %21, %.lr.ph ]
  %.03641.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %21, %.lr.ph ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader40, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader40.unr-lcssa, %.lr.ph.epil
  %.03641.epil = phi i64 [ %12, %.lr.ph.epil ], [ %.03641.unr, %.preheader40.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader40.unr-lcssa ]
  %11 = mul nsw i64 %.03641.epil, 47
  %12 = srem i64 %11, 1000000007
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader40, label %.lr.ph.epil, !llvm.loop !5

.preheader40:                                     ; preds = %.lr.ph.epil, %.preheader40.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %.preheader40.unr-lcssa ], [ %12, %.lr.ph.epil ]
  br i1 %9, label %.lr.ph45.preheader, label %.preheader

.lr.ph45.preheader:                               ; preds = %.preheader40
  %wide.trip.count = and i64 %5, 2147483647
  %xtraiter83 = and i64 %5, 1
  %13 = icmp eq i64 %wide.trip.count, 1
  br i1 %13, label %.preheader.loopexit.unr-lcssa, label %.lr.ph45.preheader.new

.lr.ph45.preheader.new:                           ; preds = %.lr.ph45.preheader
  %unroll_iter87 = sub nsw i64 %wide.trip.count, %xtraiter83
  br label %.lr.ph45

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.03641 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %21, %.lr.ph ]
  %niter = phi i32 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %14 = mul nsw i64 %.03641, 47
  %15 = srem i64 %14, 1000000007
  %16 = mul nsw i64 %15, 47
  %17 = srem i64 %16, 1000000007
  %18 = mul nsw i64 %17, 47
  %19 = srem i64 %18, 1000000007
  %20 = mul nsw i64 %19, 47
  %21 = srem i64 %20, 1000000007
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader40.unr-lcssa, label %.lr.ph, !llvm.loop !7

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph45, %.lr.ph45.preheader
  %.lcssa78.ph = phi i64 [ poison, %.lr.ph45.preheader ], [ %46, %.lr.ph45 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next.1, %.lr.ph45 ]
  %.03443.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %46, %.lr.ph45 ]
  %lcmp.mod85.not = icmp eq i64 %xtraiter83, 0
  br i1 %lcmp.mod85.not, label %.preheader, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %22 = mul nsw i64 %.03443.unr, 47
  %23 = getelementptr inbounds [2000010 x i8], ptr @pat, i64 0, i64 %indvars.iv.unr
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = sext i8 %24 to i64
  %26 = add nsw i64 %22, -96
  %27 = add nsw i64 %26, %25
  %28 = srem i64 %27, 1000000007
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph45.epil, %.preheader.loopexit.unr-lcssa, %.lr.ph53, %.preheader40
  %.036.lcssa64 = phi i64 [ %.lcssa, %.preheader40 ], [ 1, %.lr.ph53 ], [ %.lcssa, %.preheader.loopexit.unr-lcssa ], [ %.lcssa, %.lr.ph45.epil ]
  %.034.lcssa = phi i64 [ 0, %.preheader40 ], [ 0, %.lr.ph53 ], [ %.lcssa78.ph, %.preheader.loopexit.unr-lcssa ], [ %28, %.lr.ph45.epil ]
  %29 = icmp sgt i32 %8, 0
  br i1 %29, label %.lr.ph50, label %.critedge

.lr.ph50:                                         ; preds = %.preheader
  %sext = shl i64 %5, 32
  %30 = ashr exact i64 %sext, 32
  %31 = shl i64 %5, 32
  %sext62 = add i64 %31, -4294967296
  %32 = ashr exact i64 %sext62, 32
  %wide.trip.count60 = and i64 %7, 2147483647
  br label %.outer

.outer:                                           ; preds = %.thread, %.lr.ph50
  %indvars.iv58.ph = phi i64 [ %indvars.iv.next5966, %.thread ], [ 0, %.lr.ph50 ]
  %.03048.ph = phi i1 [ true, %.thread ], [ false, %.lr.ph50 ]
  %.03147.ph = phi i64 [ %.132, %.thread ], [ 0, %.lr.ph50 ]
  br label %47

.lr.ph45:                                         ; preds = %.lr.ph45, %.lr.ph45.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %indvars.iv.next.1, %.lr.ph45 ]
  %.03443 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %46, %.lr.ph45 ]
  %niter88 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter88.next.1, %.lr.ph45 ]
  %33 = mul nsw i64 %.03443, 47
  %34 = getelementptr inbounds [2000010 x i8], ptr @pat, i64 0, i64 %indvars.iv
  %35 = load i8, ptr %34, align 2, !tbaa !9
  %36 = sext i8 %35 to i64
  %37 = add nsw i64 %33, -96
  %38 = add nsw i64 %37, %36
  %39 = srem i64 %38, 1000000007
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %40 = mul nsw i64 %39, 47
  %41 = getelementptr inbounds [2000010 x i8], ptr @pat, i64 0, i64 %indvars.iv.next
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = sext i8 %42 to i64
  %44 = add nsw i64 %40, -96
  %45 = add nsw i64 %44, %43
  %46 = srem i64 %45, 1000000007
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter88.next.1 = add i64 %niter88, 2
  %niter88.ncmp.1 = icmp eq i64 %niter88.next.1, %unroll_iter87
  br i1 %niter88.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph45, !llvm.loop !12

._crit_edge:                                      ; preds = %68
  br i1 %.03048.ph, label %._crit_edge.thread, label %.critedge

47:                                               ; preds = %.outer, %68
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %68 ], [ %indvars.iv58.ph, %.outer ]
  %.03147 = phi i64 [ %.132, %68 ], [ %.03147.ph, %.outer ]
  %48 = mul nsw i64 %.03147, 47
  %49 = getelementptr inbounds [2000010 x i8], ptr @txt, i64 0, i64 %indvars.iv58
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = sext i8 %50 to i64
  %52 = add nsw i64 %48, -96
  %53 = add nsw i64 %52, %51
  %54 = srem i64 %53, 1000000007
  %.not = icmp slt i64 %indvars.iv58, %30
  br i1 %.not, label %66, label %55

55:                                               ; preds = %47
  %56 = sub nsw i64 %indvars.iv58, %30
  %57 = getelementptr inbounds [2000010 x i8], ptr @txt, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = sext i8 %58 to i64
  %60 = add nsw i64 %59, -96
  %61 = mul nsw i64 %60, %.036.lcssa64
  %62 = srem i64 %61, 1000000007
  %63 = add nsw i64 %54, 1000000007
  %64 = sub nsw i64 %63, %62
  %65 = srem i64 %64, 1000000007
  br label %66

66:                                               ; preds = %55, %47
  %.132 = phi i64 [ %65, %55 ], [ %54, %47 ]
  %.not38 = icmp sge i64 %indvars.iv58, %32
  %67 = icmp eq i64 %.132, %.034.lcssa
  %or.cond = select i1 %.not38, i1 %67, i1 false
  br i1 %or.cond, label %.thread, label %68

68:                                               ; preds = %66
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge, label %47, !llvm.loop !13

.thread:                                          ; preds = %66
  %69 = trunc nuw nsw i64 %indvars.iv58 to i32
  %reass.sub = sub i32 %69, %6
  %70 = add i32 %reass.sub, 1
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70)
  %indvars.iv.next5966 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not67 = icmp eq i64 %indvars.iv.next5966, %wide.trip.count60
  br i1 %exitcond61.not67, label %._crit_edge.thread, label %.outer, !llvm.loop !13

.critedge:                                        ; preds = %.preheader, %._crit_edge
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.thread, %.critedge, %._crit_edge
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %.lr.ph53, label %._crit_edge54, !llvm.loop !14

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.unroll.disable"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!10, !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = distinct !{!12, !8}
!13 = distinct !{!13, !8}
!14 = distinct !{!14, !8}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass