; LLVM IR from tangjz/acm-icpc :: self_training/2015-09-21 (E)

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

@t = external dso_local global i32, align 4
@id = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@fact = external dso_local global [18 x i64], align 16
@c = external dso_local global [18 x [18 x i64]], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 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
  store i32 0, ptr %1, align 4
  store i64 1, ptr @c, align 16, !tbaa !5
  store i64 1, ptr @fact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %6

6:                                                ; preds = %66, %0
  %7 = load i32, ptr %2, align 4, !tbaa !9
  %8 = icmp slt i32 %7, 18
  br i1 %8, label %10, label %9

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

10:                                               ; preds = %6
  %11 = load i32, ptr %2, align 4, !tbaa !9
  %12 = sub nsw i32 %11, 1
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = mul nsw i64 %15, %17
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %20
  store i64 %18, ptr %21, align 8, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %23
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [18 x i64], ptr %24, i64 0, i64 %26
  store i64 1, ptr %27, align 8, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %29
  %31 = getelementptr inbounds [18 x i64], ptr %30, i64 0, i64 0
  store i64 1, ptr %31, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %62, %10
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %2, align 4, !tbaa !9
  %39 = sub nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %40
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [18 x i64], ptr %41, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !9
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %49
  %51 = load i32, ptr %4, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [18 x i64], ptr %50, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = add nsw i64 %46, %54
  %56 = load i32, ptr %2, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %57
  %59 = load i32, ptr %4, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [18 x i64], ptr %58, i64 0, i64 %60
  store i64 %55, ptr %61, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %37
  %63 = load i32, ptr %4, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !9
  br label %32, !llvm.loop !11

65:                                               ; preds = %36
  br label %66

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

69:                                               ; preds = %9
  %70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %71

71:                                               ; preds = %109, %69
  %72 = load i32, ptr @t, align 4, !tbaa !9
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr @t, align 4, !tbaa !9
  %74 = icmp ne i32 %72, 0
  br i1 %74, label %75, label %113

75:                                               ; preds = %71
  store i64 0, ptr @ans, align 8, !tbaa !5
  %76 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @id, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %106, %75
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = load i32, ptr @m, align 4, !tbaa !9
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %109

82:                                               ; preds = %77
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = and i32 %83, 1
  %85 = icmp ne i32 %84, 0
  %86 = zext i1 %85 to i64
  %87 = select i1 %85, i32 -1, i32 1
  %88 = sext i32 %87 to i64
  %89 = load i32, ptr @m, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %90
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [18 x i64], ptr %91, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = mul nsw i64 %88, %95
  %97 = load i32, ptr @n, align 4, !tbaa !9
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = sub nsw i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %103 = mul nsw i64 %96, %102
  %104 = load i64, ptr @ans, align 8, !tbaa !5
  %105 = add nsw i64 %104, %103
  store i64 %105, ptr @ans, align 8, !tbaa !5
  br label %106

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

109:                                              ; preds = %81
  %110 = load i32, ptr @id, align 4, !tbaa !9
  %111 = load i64, ptr @ans, align 8, !tbaa !5
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %110, i64 noundef %111)
  br label %71, !llvm.loop !15

113:                                              ; preds = %71
  ret i32 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

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

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 }

!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++ 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}
!15 = distinct !{!15, !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"

@t = external dso_local global i32, align 4
@id = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@fact = external dso_local local_unnamed_addr global [18 x i64], align 16
@c = external dso_local local_unnamed_addr global [18 x [18 x i64]], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  store i64 1, ptr @c, align 16, !tbaa !5
  store i64 1, ptr @fact, align 16, !tbaa !5
  br label %5

1:                                                ; preds = %._crit_edge
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !9
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @t, align 4, !tbaa !9
  %.not34 = icmp eq i32 %3, 0
  br i1 %.not34, label %._crit_edge37, label %.lr.ph36

5:                                                ; preds = %0, %._crit_edge
  %indvar = phi i64 [ 0, %0 ], [ %indvar.next, %._crit_edge ]
  %6 = phi i64 [ 1, %0 ], [ %8, %._crit_edge ]
  %indvars.iv39 = phi i64 [ 1, %0 ], [ %indvars.iv.next40, %._crit_edge ]
  %7 = add nsw i64 %indvars.iv39, -1
  %8 = mul nuw nsw i64 %6, %indvars.iv39
  %9 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %indvars.iv39
  store i64 %8, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %indvars.iv39
  %11 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %indvars.iv39, i64 %indvars.iv39
  store i64 1, ptr %11, align 8, !tbaa !5
  store i64 1, ptr %10, align 16, !tbaa !5
  %12 = icmp ugt i64 %indvars.iv39, 1
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %5
  %.phi.trans.insert = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %7, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 16, !tbaa !5
  %min.iters.check = icmp ult i64 %indvar, 4
  br i1 %min.iters.check, label %.lr.ph.preheader70, label %vector.ph

.lr.ph.preheader70:                               ; preds = %middle.block, %.lr.ph.preheader
  %.ph71 = phi i64 [ %.pre, %.lr.ph.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %indvar, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load48, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %13 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %7, i64 %offset.idx
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %wide.load = load <2 x i64>, ptr %13, align 8, !tbaa !5
  %wide.load48 = load <2 x i64>, ptr %14, align 8, !tbaa !5
  %15 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
  %16 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load48, <2 x i32> <i32 1, i32 2>
  %17 = add nsw <2 x i64> %wide.load, %15
  %18 = add nsw <2 x i64> %wide.load48, %16
  %19 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %indvars.iv39, i64 %offset.idx
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <2 x i64> %17, ptr %19, align 8, !tbaa !5
  store <2 x i64> %18, ptr %20, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <2 x i64> %wide.load48, i64 1
  %cmp.n = icmp eq i64 %indvar, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader70

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %5
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond42.not = icmp eq i64 %indvars.iv.next40, 18
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond42.not, label %1, label %5, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader70, %.lr.ph
  %22 = phi i64 [ %24, %.lr.ph ], [ %.ph71, %.lr.ph.preheader70 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader70 ]
  %23 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %7, i64 %indvars.iv
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = add nsw i64 %24, %22
  %26 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %indvars.iv39, i64 %indvars.iv
  store i64 %25, ptr %26, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv39
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

.lr.ph36:                                         ; preds = %1, %.lr.ph36._crit_edge
  store i64 0, ptr @ans, align 8, !tbaa !5
  %27 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @id, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %28 = load i32, ptr @m, align 4, !tbaa !9
  %.not2529 = icmp slt i32 %28, 0
  %.pre47 = load i64, ptr @ans, align 8, !tbaa !5
  br i1 %.not2529, label %.lr.ph36._crit_edge, label %.lr.ph32

.lr.ph32:                                         ; preds = %.lr.ph36
  %29 = zext nneg i32 %28 to i64
  %30 = load i32, ptr @n, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = add nuw i32 %28, 1
  %wide.trip.count = zext i32 %32 to i64
  %min.iters.check51 = icmp ult i32 %28, 3
  br i1 %min.iters.check51, label %scalar.ph50.preheader, label %vector.ph52

scalar.ph50.preheader:                            ; preds = %middle.block49, %.lr.ph32
  %indvars.iv43.ph = phi i64 [ 0, %.lr.ph32 ], [ %n.vec54, %middle.block49 ]
  %.ph = phi i64 [ %.pre47, %.lr.ph32 ], [ %53, %middle.block49 ]
  br label %scalar.ph50

vector.ph52:                                      ; preds = %.lr.ph32
  %n.vec54 = and i64 %wide.trip.count, 4294967292
  %33 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.pre47, i64 0
  br label %vector.body56

vector.body56:                                    ; preds = %vector.body56, %vector.ph52
  %index57 = phi i64 [ 0, %vector.ph52 ], [ %index.next65, %vector.body56 ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph52 ], [ %vec.ind.next, %vector.body56 ]
  %vec.phi = phi <2 x i64> [ %33, %vector.ph52 ], [ %50, %vector.body56 ]
  %vec.phi59 = phi <2 x i64> [ zeroinitializer, %vector.ph52 ], [ %51, %vector.body56 ]
  %34 = and <2 x i64> %vec.ind, <i64 1, i64 1>
  %35 = and <2 x i64> %vec.ind, <i64 1, i64 1>
  %36 = icmp eq <2 x i64> %34, zeroinitializer
  %37 = icmp eq <2 x i64> %35, zeroinitializer
  %38 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %29, i64 %index57
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %wide.load60 = load <2 x i64>, ptr %38, align 16, !tbaa !5
  %wide.load61 = load <2 x i64>, ptr %39, align 16, !tbaa !5
  %40 = sub nsw <2 x i64> zeroinitializer, %wide.load60
  %41 = sub nsw <2 x i64> zeroinitializer, %wide.load61
  %42 = select <2 x i1> %36, <2 x i64> %wide.load60, <2 x i64> %40
  %43 = select <2 x i1> %37, <2 x i64> %wide.load61, <2 x i64> %41
  %44 = sub nsw i64 %31, %index57
  %45 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %44
  %46 = getelementptr inbounds i8, ptr %45, i64 -8
  %47 = getelementptr inbounds i8, ptr %45, i64 -24
  %wide.load62 = load <2 x i64>, ptr %46, align 8, !tbaa !5
  %reverse = shufflevector <2 x i64> %wide.load62, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  %wide.load63 = load <2 x i64>, ptr %47, align 8, !tbaa !5
  %reverse64 = shufflevector <2 x i64> %wide.load63, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  %48 = mul nsw <2 x i64> %reverse, %42
  %49 = mul nsw <2 x i64> %reverse64, %43
  %50 = add <2 x i64> %vec.phi, %48
  %51 = add <2 x i64> %vec.phi59, %49
  %index.next65 = add nuw i64 %index57, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %52 = icmp eq i64 %index.next65, %n.vec54
  br i1 %52, label %middle.block49, label %vector.body56, !llvm.loop !17

middle.block49:                                   ; preds = %vector.body56
  %bin.rdx = add <2 x i64> %51, %50
  %53 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n66 = icmp eq i64 %n.vec54, %wide.trip.count
  br i1 %cmp.n66, label %._crit_edge33, label %scalar.ph50.preheader

._crit_edge33:                                    ; preds = %scalar.ph50, %middle.block49
  %.lcssa = phi i64 [ %53, %middle.block49 ], [ %69, %scalar.ph50 ]
  store i64 %.lcssa, ptr @ans, align 8, !tbaa !5
  br label %.lr.ph36._crit_edge

.lr.ph36._crit_edge:                              ; preds = %.lr.ph36, %._crit_edge33
  %54 = phi i64 [ %.lcssa, %._crit_edge33 ], [ %.pre47, %.lr.ph36 ]
  %55 = load i32, ptr @id, align 4, !tbaa !9
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %55, i64 noundef %54)
  %57 = load i32, ptr @t, align 4, !tbaa !9
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr @t, align 4, !tbaa !9
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !18

scalar.ph50:                                      ; preds = %scalar.ph50.preheader, %scalar.ph50
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %scalar.ph50 ], [ %indvars.iv43.ph, %scalar.ph50.preheader ]
  %59 = phi i64 [ %69, %scalar.ph50 ], [ %.ph, %scalar.ph50.preheader ]
  %60 = and i64 %indvars.iv43, 1
  %.not26 = icmp eq i64 %60, 0
  %61 = getelementptr inbounds [18 x [18 x i64]], ptr @c, i64 0, i64 %29, i64 %indvars.iv43
  %62 = load i64, ptr %61, align 8, !tbaa !5
  %63 = sub nsw i64 0, %62
  %64 = select i1 %.not26, i64 %62, i64 %63
  %65 = sub nsw i64 %31, %indvars.iv43
  %66 = getelementptr inbounds [18 x i64], ptr @fact, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = mul nsw i64 %67, %64
  %69 = add nsw i64 %59, %68
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond46.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count
  br i1 %exitcond46.not, label %._crit_edge33, label %scalar.ph50, !llvm.loop !19

._crit_edge37:                                    ; preds = %.lr.ph36._crit_edge, %1
  ret i32 0
}

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

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

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

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12, !13, !14}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !14, !13}


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