; LLVM IR from chirag-singhal/Coding-Interview-101 :: Miscellaneous/Codechef/seplong (3)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @vietaFormula(ptr noundef, i32 noundef, ptr 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: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca [8001 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [8001 x i32], align 16
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca [8001 x i64], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 32004, ptr %5) #5
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 32004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32004, ptr %8) #5
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 32004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %41, %0
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %44

22:                                               ; preds = %17
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [8001 x i32], ptr %8, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %35

29:                                               ; preds = %22
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %7, align 4, !tbaa !9
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [8001 x i32], ptr %5, i64 0, i64 %33
  store i32 %30, ptr %34, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %29, %22
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [8001 x i32], ptr %8, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !9
  br label %17, !llvm.loop !11

44:                                               ; preds = %21
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = call ptr @llvm.stacksave.p0()
  store ptr %47, ptr %10, align 8
  %48 = alloca i32, i64 %46, align 16
  store i64 %46, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 64008, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 64008, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %65, %44
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %68

54:                                               ; preds = %49
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [8001 x i32], ptr %5, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [8001 x i32], ptr %8, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %48, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %54
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %13, align 4, !tbaa !9
  br label %49, !llvm.loop !13

68:                                               ; preds = %53
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = getelementptr inbounds [8001 x i64], ptr %12, i64 0, i64 0
  call void @vietaFormula(ptr noundef %48, i32 noundef %69, ptr noundef %70)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %107, %68
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = load i32, ptr %3, align 4, !tbaa !9
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %71
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = icmp sle i32 %76, %77
  br label %79

79:                                               ; preds = %75, %71
  %80 = phi i1 [ false, %71 ], [ %78, %75 ]
  br i1 %80, label %82, label %81

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %110

82:                                               ; preds = %79
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = srem i32 %83, 2
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %96

86:                                               ; preds = %82
  %87 = load i64, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = sub nsw i32 %88, %89
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [8001 x i64], ptr %12, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = sub nsw i64 %87, %93
  %95 = srem i64 %94, 1000000007
  store i64 %95, ptr %4, align 8, !tbaa !5
  br label %106

96:                                               ; preds = %82
  %97 = load i64, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = load i32, ptr %14, align 4, !tbaa !9
  %100 = sub nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [8001 x i64], ptr %12, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = add nsw i64 %97, %103
  %105 = srem i64 %104, 1000000007
  store i64 %105, ptr %4, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %96, %86
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %14, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %14, align 4, !tbaa !9
  br label %71, !llvm.loop !14

110:                                              ; preds = %81
  %111 = load i64, ptr %4, align 8, !tbaa !5
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %111)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 64008, ptr %12) #5
  %113 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %113)
  call void @llvm.lifetime.end.p0(i64 32004, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 32004, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %114 = load i32, ptr %1, align 4
  ret i32 %114
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @vietaFormula(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [0 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [8001 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca [8001 x i32], align 16
  %7 = alloca [8001 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 32004, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32004) %4, i8 0, i64 32004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32004, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32004) %6, i8 0, i64 32004, i1 false)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %12 = call ptr @llvm.stacksave.p0()
  call void @llvm.lifetime.start.p0(i64 64008, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64008) %7, i8 0, i64 64008, i1 false)
  br label %._crit_edge33

._crit_edge:                                      ; preds = %28
  %13 = zext i32 %29 to i64
  %14 = call ptr @llvm.stacksave.p0()
  %15 = alloca i32, i64 %13, align 16
  call void @llvm.lifetime.start.p0(i64 64008, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64008) %7, i8 0, i64 64008, i1 false)
  %16 = icmp sgt i32 %29, 0
  br i1 %16, label %.lr.ph32.preheader, label %._crit_edge33

.lr.ph32.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %13, 3
  %17 = icmp ult i32 %29, 4
  br i1 %17, label %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32.preheader.new

.lr.ph32.preheader.new:                           ; preds = %.lr.ph32.preheader
  %unroll_iter = and i64 %13, 2147483644
  br label %.lr.ph32

.lr.ph:                                           ; preds = %0, %28
  %.02529 = phi i32 [ %31, %28 ], [ 0, %0 ]
  %.02628 = phi i32 [ %29, %28 ], [ 0, %0 ]
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %28

24:                                               ; preds = %.lr.ph
  %25 = add nsw i32 %.02628, 1
  %26 = sext i32 %.02628 to i64
  %27 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %26
  store i32 %19, ptr %27, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %24, %.lr.ph
  %.127 = phi i32 [ %25, %24 ], [ %.02628, %.lr.ph ]
  %29 = freeze i32 %.127
  %30 = add nsw i32 %22, 1
  store i32 %30, ptr %21, align 4, !tbaa !5
  %31 = add nuw nsw i32 %.02529, 1
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge33.loopexit.unr-lcssa:                 ; preds = %.lr.ph32, %.lr.ph32.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph32.preheader ], [ %indvars.iv.next.3, %.lr.ph32 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge33, label %.lr.ph32.epil

.lr.ph32.epil:                                    ; preds = %._crit_edge33.loopexit.unr-lcssa, %.lr.ph32.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph32.epil ], [ %indvars.iv.unr, %._crit_edge33.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph32.epil ], [ 0, %._crit_edge33.loopexit.unr-lcssa ]
  %34 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %indvars.iv.epil
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.epil
  store i32 %38, ptr %39, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge33, label %.lr.ph32.epil, !llvm.loop !11

._crit_edge33:                                    ; preds = %._crit_edge33.loopexit.unr-lcssa, %.lr.ph32.epil, %._crit_edge.thread, %._crit_edge
  %40 = phi ptr [ %1, %._crit_edge.thread ], [ %15, %._crit_edge ], [ %15, %.lr.ph32.epil ], [ %15, %._crit_edge33.loopexit.unr-lcssa ]
  %41 = phi ptr [ %12, %._crit_edge.thread ], [ %14, %._crit_edge ], [ %14, %.lr.ph32.epil ], [ %14, %._crit_edge33.loopexit.unr-lcssa ]
  %.026.lcssa48 = phi i32 [ 0, %._crit_edge.thread ], [ %29, %._crit_edge ], [ %29, %.lr.ph32.epil ], [ %29, %._crit_edge33.loopexit.unr-lcssa ]
  call void @vietaFormula(ptr noundef nonnull %40, i32 noundef %.026.lcssa48, ptr noundef nonnull %7)
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %invariant.smin = call i32 @llvm.smin.i32(i32 %42, i32 %.026.lcssa48)
  %43 = icmp sgt i32 %invariant.smin, -1
  br i1 %43, label %.lr.ph37.preheader, label %._crit_edge38

.lr.ph37.preheader:                               ; preds = %._crit_edge33
  %44 = sext i32 %.026.lcssa48 to i64
  %45 = add nuw i32 %invariant.smin, 1
  %wide.trip.count45 = zext i32 %45 to i64
  %xtraiter49 = and i64 %wide.trip.count45, 1
  %46 = icmp eq i32 %invariant.smin, 0
  br i1 %46, label %._crit_edge38.loopexit.unr-lcssa, label %.lr.ph37.preheader.new

.lr.ph37.preheader.new:                           ; preds = %.lr.ph37.preheader
  %unroll_iter53 = and i64 %wide.trip.count45, 4294967294
  br label %.lr.ph37

.lr.ph32:                                         ; preds = %.lr.ph32, %.lr.ph32.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %indvars.iv.next.3, %.lr.ph32 ]
  %niter = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %niter.next.3, %.lr.ph32 ]
  %47 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %indvars.iv
  %48 = load i32, ptr %47, align 16, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
  store i32 %51, ptr %52, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %53 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %indvars.iv.next
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next
  store i32 %57, ptr %58, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %59 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %indvars.iv.next.1
  %60 = load i32, ptr %59, align 8, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next.1
  store i32 %63, ptr %64, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %65 = getelementptr inbounds [8001 x i32], ptr %4, i64 0, i64 %indvars.iv.next.2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [8001 x i32], ptr %6, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next.2
  store i32 %69, ptr %70, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32, !llvm.loop !13

._crit_edge38.loopexit.unr-lcssa:                 ; preds = %.lr.ph37, %.lr.ph37.preheader
  %.1.lcssa.ph = phi i64 [ poison, %.lr.ph37.preheader ], [ %.1.1, %.lr.ph37 ]
  %indvars.iv42.unr = phi i64 [ 0, %.lr.ph37.preheader ], [ %indvars.iv.next43.1, %.lr.ph37 ]
  %.02434.unr = phi i64 [ 0, %.lr.ph37.preheader ], [ %.1.1, %.lr.ph37 ]
  %lcmp.mod51.not = icmp eq i64 %xtraiter49, 0
  br i1 %lcmp.mod51.not, label %._crit_edge38, label %.lr.ph37.epil

.lr.ph37.epil:                                    ; preds = %._crit_edge38.loopexit.unr-lcssa
  %71 = and i64 %indvars.iv42.unr, 1
  %.not.epil = icmp eq i64 %71, 0
  %72 = sub nsw i64 %44, %indvars.iv42.unr
  %73 = getelementptr inbounds [8001 x i64], ptr %7, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !14
  %75 = sub i64 0, %74
  %.1.in.p.epil = select i1 %.not.epil, i64 %74, i64 %75
  %.1.in.epil = add i64 %.02434.unr, %.1.in.p.epil
  %.1.epil = srem i64 %.1.in.epil, 1000000007
  br label %._crit_edge38

._crit_edge38:                                    ; preds = %.lr.ph37.epil, %._crit_edge38.loopexit.unr-lcssa, %._crit_edge33
  %.024.lcssa = phi i64 [ 0, %._crit_edge33 ], [ %.1.lcssa.ph, %._crit_edge38.loopexit.unr-lcssa ], [ %.1.epil, %.lr.ph37.epil ]
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.024.lcssa)
  call void @llvm.lifetime.end.p0(i64 64008, ptr nonnull %7) #6
  call void @llvm.stackrestore.p0(ptr %41)
  call void @llvm.lifetime.end.p0(i64 32004, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32004, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret i32 0

.lr.ph37:                                         ; preds = %.lr.ph37, %.lr.ph37.preheader.new
  %indvars.iv42 = phi i64 [ 0, %.lr.ph37.preheader.new ], [ %indvars.iv.next43.1, %.lr.ph37 ]
  %.02434 = phi i64 [ 0, %.lr.ph37.preheader.new ], [ %.1.1, %.lr.ph37 ]
  %niter54 = phi i64 [ 0, %.lr.ph37.preheader.new ], [ %niter54.next.1, %.lr.ph37 ]
  %77 = sub nsw i64 %44, %indvars.iv42
  %78 = getelementptr inbounds [8001 x i64], ptr %7, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !14
  %.1.in = add i64 %.02434, %79
  %.1 = srem i64 %.1.in, 1000000007
  %indvars.iv.next43.neg = xor i64 %indvars.iv42, -1
  %80 = add i64 %indvars.iv.next43.neg, %44
  %81 = getelementptr inbounds [8001 x i64], ptr %7, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %.1.in.1 = sub i64 %.1, %82
  %.1.1 = srem i64 %.1.in.1, 1000000007
  %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 2
  %niter54.next.1 = add i64 %niter54, 2
  %niter54.ncmp.1 = icmp eq i64 %niter54.next.1, %unroll_iter53
  br i1 %niter54.ncmp.1, label %._crit_edge38.loopexit.unr-lcssa, label %.lr.ph37, !llvm.loop !16
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

attributes #0 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !10}


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