; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-12 (C)

; 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
@lim = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@prime = external dso_local global [10000001 x i32], align 16
@fact = external dso_local global [10000001 x i32], align 16
@cnt = external dso_local global [10000001 x i64], align 16
@L = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@vis = external dso_local global [10000001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() #0

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

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

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

10:                                               ; preds = %32, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = load i64, ptr @R, align 8, !tbaa !9
  %20 = add nsw i64 %19, %18
  store i64 %20, ptr @R, align 8, !tbaa !9
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %22
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = add nsw i64 %24, 1
  store i64 %25, ptr %23, align 8, !tbaa !9
  %26 = load i32, ptr @lim, align 4, !tbaa !5
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %31

29:                                               ; preds = %15
  %30 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %30, ptr @lim, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %29, %15
  br label %32

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

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

36:                                               ; preds = %73, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @lim, align 4, !tbaa !5
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10000001 x i8], ptr @vis, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !13, !range !15, !noundef !16
  %46 = trunc i8 %45 to i1
  br i1 %46, label %72, label %47

47:                                               ; preds = %41
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr @tot, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @tot, align 4, !tbaa !5
  %51 = sext i32 %49 to i64
  %52 = getelementptr inbounds [10000001 x i32], ptr @prime, i64 0, i64 %51
  store i32 %48, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %53 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %53, ptr %6, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %67, %47
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr @lim, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %54
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10000001 x i8], ptr @vis, i64 0, i64 %61
  store i8 1, ptr %62, align 1, !tbaa !13
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %65
  store i32 %63, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %59
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, %68
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %54, !llvm.loop !17

71:                                               ; preds = %58
  br label %72

72:                                               ; preds = %71, %41
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !18

76:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %77 = load i32, ptr @lim, align 4, !tbaa !5
  store i32 %77, ptr %7, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %93, %76
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = icmp sge i32 %79, 2
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %96

82:                                               ; preds = %78
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = add nsw i64 %91, %87
  store i64 %92, ptr %90, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %82
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %7, align 4, !tbaa !5
  br label %78, !llvm.loop !19

96:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %97 = load i32, ptr @lim, align 4, !tbaa !5
  store i32 %97, ptr %8, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %137, %96
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = icmp sge i32 %99, 2
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %140

102:                                              ; preds = %98
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = icmp ne i32 %106, %107
  br i1 %108, label %109, label %136

109:                                              ; preds = %102
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !9
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = add nsw i64 %120, %113
  store i64 %121, ptr %119, align 8, !tbaa !9
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sdiv i32 %126, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = add nsw i64 %134, %125
  store i64 %135, ptr %133, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %109, %102
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %8, align 4, !tbaa !5
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %8, align 4, !tbaa !5
  br label %98, !llvm.loop !20

140:                                              ; preds = %101
  store i64 1, ptr @L, align 8, !tbaa !9
  br label %141

141:                                              ; preds = %156, %140
  %142 = load i64, ptr @L, align 8, !tbaa !9
  %143 = load i64, ptr @R, align 8, !tbaa !9
  %144 = icmp slt i64 %142, %143
  br i1 %144, label %145, label %157

145:                                              ; preds = %141
  %146 = load i64, ptr @L, align 8, !tbaa !9
  %147 = load i64, ptr @R, align 8, !tbaa !9
  %148 = add nsw i64 %146, %147
  %149 = ashr i64 %148, 1
  store i64 %149, ptr @M, align 8, !tbaa !9
  %150 = call noundef zeroext i1 @_Z5checkv()
  br i1 %150, label %151, label %153

151:                                              ; preds = %145
  %152 = load i64, ptr @M, align 8, !tbaa !9
  store i64 %152, ptr @R, align 8, !tbaa !9
  br label %156

153:                                              ; preds = %145
  %154 = load i64, ptr @M, align 8, !tbaa !9
  %155 = add nsw i64 %154, 1
  store i64 %155, ptr @L, align 8, !tbaa !9
  br label %156

156:                                              ; preds = %153, %151
  br label %141, !llvm.loop !21

157:                                              ; preds = %141
  %158 = load i64, ptr @L, align 8, !tbaa !9
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %158)
  ret i32 0
}

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

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

attributes #0 = { mustprogress 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 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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"

@n = external dso_local global i32, align 4
@lim = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@fact = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [10000001 x i64], align 16
@L = external dso_local local_unnamed_addr global i64, align 8
@R = external dso_local local_unnamed_addr global i64, align 8
@M = external dso_local local_unnamed_addr global i64, align 8
@vis = external dso_local local_unnamed_addr global [10000001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() 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: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = load i32, ptr @lim, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %18, %.._crit_edge_crit_edge
  %5 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %.not44 = icmp slt i32 %5, 2
  br i1 %.not44, label %._crit_edge53, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %._crit_edge
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %6 = add nuw i32 %5, 1
  %wide.trip.count = zext i32 %6 to i64
  br label %.lr.ph48

.lr.ph:                                           ; preds = %0, %18
  %.02939 = phi i32 [ %20, %18 ], [ 0, %0 ]
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = load i64, ptr @R, align 8, !tbaa !9
  %11 = add nsw i64 %10, %9
  store i64 %11, ptr @R, align 8, !tbaa !9
  %12 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %9
  %13 = load i64, ptr %12, align 8, !tbaa !9
  %14 = add nsw i64 %13, 1
  store i64 %14, ptr %12, align 8, !tbaa !9
  %15 = load i32, ptr @lim, align 4, !tbaa !5
  %16 = icmp slt i32 %15, %8
  br i1 %16, label %17, label %18

17:                                               ; preds = %.lr.ph
  store i32 %8, ptr @lim, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %.lr.ph, %17
  %19 = phi i32 [ %15, %.lr.ph ], [ %8, %17 ]
  %20 = add nuw nsw i32 %.02939, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph50.preheader:                               ; preds = %.loopexit
  %23 = zext nneg i32 %5 to i64
  %24 = shl nuw nsw i64 %23, 3
  %25 = getelementptr i8, ptr @cnt, i64 %24
  %scevgep = getelementptr i8, ptr %25, i64 8
  %load_initial = load i64, ptr %scevgep, align 8
  br label %.lr.ph50

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %.loopexit
  %indvars.iv = phi i64 [ 2, %.lr.ph48.preheader ], [ %indvars.iv.next, %.loopexit ]
  %26 = phi i32 [ %tot.promoted, %.lr.ph48.preheader ], [ %37, %.loopexit ]
  %27 = getelementptr inbounds [10000001 x i8], ptr @vis, i64 0, i64 %indvars.iv
  %28 = load i8, ptr %27, align 1, !tbaa !13, !range !15, !noundef !16
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %.loopexit, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %.lr.ph48
  %30 = add nsw i32 %26, 1
  store i32 %30, ptr @tot, align 4, !tbaa !5
  %31 = sext i32 %26 to i64
  %32 = getelementptr inbounds [10000001 x i32], ptr @prime, i64 0, i64 %31
  %33 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %33, ptr %32, align 4, !tbaa !5
  br label %.lr.ph43

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %.lr.ph43
  %indvars.iv59 = phi i64 [ %indvars.iv, %.lr.ph43.preheader ], [ %indvars.iv.next60, %.lr.ph43 ]
  %34 = getelementptr inbounds [10000001 x i8], ptr @vis, i64 0, i64 %indvars.iv59
  store i8 1, ptr %34, align 1, !tbaa !13
  %35 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %indvars.iv59
  store i32 %33, ptr %35, align 4, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, %indvars.iv
  %36 = trunc nuw i64 %indvars.iv.next60 to i32
  %.not36 = icmp slt i32 %5, %36
  br i1 %.not36, label %.loopexit, label %.lr.ph43, !llvm.loop !17

.loopexit:                                        ; preds = %.lr.ph43, %.lr.ph48
  %37 = phi i32 [ %26, %.lr.ph48 ], [ %30, %.lr.ph43 ]
  %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 %.lr.ph50.preheader, label %.lr.ph48, !llvm.loop !18

.lr.ph52.preheader:                               ; preds = %.lr.ph50
  %38 = zext nneg i32 %5 to i64
  br label %.lr.ph52

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %.lr.ph50
  %store_forwarded = phi i64 [ %load_initial, %.lr.ph50.preheader ], [ %41, %.lr.ph50 ]
  %indvars.iv63 = phi i64 [ %23, %.lr.ph50.preheader ], [ %indvars.iv.next64, %.lr.ph50 ]
  %39 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %indvars.iv63
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = add nsw i64 %40, %store_forwarded
  store i64 %41, ptr %39, align 8, !tbaa !9
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, -1
  %42 = icmp ugt i64 %indvars.iv63, 2
  br i1 %42, label %.lr.ph50, label %.lr.ph52.preheader, !llvm.loop !19

._crit_edge53:                                    ; preds = %62, %._crit_edge
  store i64 1, ptr @L, align 8, !tbaa !9
  %43 = load i64, ptr @R, align 8, !tbaa !9
  %44 = icmp sgt i64 %43, 1
  br i1 %44, label %.lr.ph55, label %._crit_edge56

.lr.ph52:                                         ; preds = %.lr.ph52.preheader, %62
  %indvars.iv66 = phi i64 [ %38, %.lr.ph52.preheader ], [ %indvars.iv.next67, %62 ]
  %45 = getelementptr inbounds [10000001 x i32], ptr @fact, i64 0, i64 %indvars.iv66
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %.not35 = icmp eq i64 %indvars.iv66, %47
  br i1 %.not35, label %62, label %48

48:                                               ; preds = %.lr.ph52
  %49 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %indvars.iv66
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = sext i32 %46 to i64
  %52 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = add nsw i64 %53, %50
  store i64 %54, ptr %52, align 8, !tbaa !9
  %55 = load i64, ptr %49, align 8, !tbaa !9
  %56 = trunc nuw nsw i64 %indvars.iv66 to i32
  %57 = sdiv i32 %56, %46
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10000001 x i64], ptr @cnt, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = add nsw i64 %60, %55
  store i64 %61, ptr %59, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %.lr.ph52, %48
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  %63 = icmp sgt i64 %indvars.iv66, 2
  br i1 %63, label %.lr.ph52, label %._crit_edge53, !llvm.loop !20

.lr.ph55:                                         ; preds = %._crit_edge53, %73
  %64 = phi i64 [ %74, %73 ], [ %43, %._crit_edge53 ]
  %65 = phi i64 [ %75, %73 ], [ 1, %._crit_edge53 ]
  %66 = add nsw i64 %64, %65
  %67 = ashr i64 %66, 1
  store i64 %67, ptr @M, align 8, !tbaa !9
  %68 = call noundef zeroext i1 @_Z5checkv()
  %69 = load i64, ptr @M, align 8, !tbaa !9
  br i1 %68, label %70, label %71

70:                                               ; preds = %.lr.ph55
  store i64 %69, ptr @R, align 8, !tbaa !9
  %.pre69 = load i64, ptr @L, align 8, !tbaa !9
  br label %73

71:                                               ; preds = %.lr.ph55
  %72 = add nsw i64 %69, 1
  store i64 %72, ptr @L, align 8, !tbaa !9
  %.pre70 = load i64, ptr @R, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %71, %70
  %74 = phi i64 [ %.pre70, %71 ], [ %69, %70 ]
  %75 = phi i64 [ %72, %71 ], [ %.pre69, %70 ]
  %76 = icmp slt i64 %75, %74
  br i1 %76, label %.lr.ph55, label %._crit_edge56, !llvm.loop !21

._crit_edge56:                                    ; preds = %73, %._crit_edge53
  %.lcssa = phi i64 [ 1, %._crit_edge53 ], [ %75, %73 ]
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.lcssa)
  ret i32 0
}

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

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

attributes #0 = { mustprogress 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 = { mustprogress 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 #3 = { 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 #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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