; LLVM IR from abeaumont/competitive-programming :: kattis (election)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@binom = external dso_local global [51 x [51 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  store i64 1, ptr @binom, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !11
  br label %21

21:                                               ; preds = %70, %0
  %22 = load i32, ptr %2, align 4, !tbaa !11
  %23 = icmp sle i32 %22, 50
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %73

25:                                               ; preds = %21
  %26 = load i32, ptr %2, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %27
  %29 = getelementptr inbounds [51 x i64], ptr %28, i64 0, i64 0
  store i64 1, ptr %29, align 8, !tbaa !8
  %30 = load i32, ptr %2, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %31
  %33 = load i32, ptr %2, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [51 x i64], ptr %32, i64 0, i64 %34
  store i64 1, ptr %35, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !11
  br label %36

36:                                               ; preds = %66, %25
  %37 = load i32, ptr %4, align 4, !tbaa !11
  %38 = load i32, ptr %2, align 4, !tbaa !11
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !11
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %44
  %46 = load i32, ptr %4, align 4, !tbaa !11
  %47 = sub nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [51 x i64], ptr %45, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = load i32, ptr %2, align 4, !tbaa !11
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %53
  %55 = load i32, ptr %4, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [51 x i64], ptr %54, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = add nsw i64 %50, %58
  %60 = load i32, ptr %2, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %61
  %63 = load i32, ptr %4, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [51 x i64], ptr %62, i64 0, i64 %64
  store i64 %59, ptr %65, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %41
  %67 = load i32, ptr %4, align 4, !tbaa !11
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %4, align 4, !tbaa !11
  br label %36, !llvm.loop !13

69:                                               ; preds = %40
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %2, align 4, !tbaa !11
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %2, align 4, !tbaa !11
  br label %21, !llvm.loop !15

73:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %75

75:                                               ; preds = %144, %73
  %76 = load i32, ptr %5, align 4, !tbaa !11
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %5, align 4, !tbaa !11
  %78 = icmp ne i32 %76, 0
  br i1 %78, label %79, label %145

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %80, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %81, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %82, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %84 = load i32, ptr %8, align 4, !tbaa !11
  %85 = mul nsw i32 %84, 2
  %86 = load i32, ptr %6, align 4, !tbaa !11
  %87 = icmp sge i32 %85, %86
  br i1 %87, label %88, label %90

88:                                               ; preds = %79
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %144

90:                                               ; preds = %79
  %91 = load i32, ptr %7, align 4, !tbaa !11
  %92 = mul nsw i32 %91, 2
  %93 = load i32, ptr %6, align 4, !tbaa !11
  %94 = icmp sgt i32 %92, %93
  br i1 %94, label %95, label %97

95:                                               ; preds = %90
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %143

97:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %98 = load i32, ptr %6, align 4, !tbaa !11
  %99 = sdiv i32 %98, 2
  %100 = add nsw i32 %99, 1
  %101 = load i32, ptr %7, align 4, !tbaa !11
  %102 = sub nsw i32 %100, %101
  store i32 %102, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %103 = load i32, ptr %6, align 4, !tbaa !11
  %104 = load i32, ptr %7, align 4, !tbaa !11
  %105 = sub nsw i32 %103, %104
  %106 = load i32, ptr %8, align 4, !tbaa !11
  %107 = sub nsw i32 %105, %106
  store i32 %107, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %108 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %108, ptr %13, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %124, %97
  %110 = load i32, ptr %13, align 4, !tbaa !11
  %111 = load i32, ptr %11, align 4, !tbaa !11
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %114, label %113

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

114:                                              ; preds = %109
  %115 = load i32, ptr %11, align 4, !tbaa !11
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %116
  %118 = load i32, ptr %13, align 4, !tbaa !11
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [51 x i64], ptr %117, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = load i64, ptr %12, align 8, !tbaa !8
  %123 = add nsw i64 %122, %121
  store i64 %123, ptr %12, align 8, !tbaa !8
  br label %124

124:                                              ; preds = %114
  %125 = load i32, ptr %13, align 4, !tbaa !11
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %13, align 4, !tbaa !11
  br label %109, !llvm.loop !16

127:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %128 = load i32, ptr %11, align 4, !tbaa !11
  %129 = zext i32 %128 to i64
  %130 = shl i64 1, %129
  store i64 %130, ptr %14, align 8, !tbaa !8
  %131 = load i64, ptr %12, align 8, !tbaa !8
  %132 = mul nsw i64 %131, 100
  %133 = load i32, ptr %9, align 4, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = load i64, ptr %14, align 8, !tbaa !8
  %136 = mul nsw i64 %134, %135
  %137 = icmp sgt i64 %132, %136
  br i1 %137, label %138, label %140

138:                                              ; preds = %127
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %142

140:                                              ; preds = %127
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %142

142:                                              ; preds = %140, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %143

143:                                              ; preds = %142, %95
  br label %144

144:                                              ; preds = %143, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %75, !llvm.loop !17

145:                                              ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %146 = load i32, ptr %1, align 4
  ret i32 %146
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@binom = external dso_local local_unnamed_addr global [51 x [51 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  store i64 1, ptr @binom, align 16, !tbaa !8
  br label %16

12:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %14 = load i32, ptr %1, align 4, !tbaa !11
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %1, align 4, !tbaa !11
  %.not42 = icmp eq i32 %14, 0
  br i1 %.not42, label %._crit_edge45, label %.lr.ph44

16:                                               ; preds = %0, %._crit_edge
  %indvar = phi i64 [ 0, %0 ], [ %indvar.next, %._crit_edge ]
  %indvars.iv47 = phi i64 [ 1, %0 ], [ %indvars.iv.next48, %._crit_edge ]
  %17 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %indvars.iv47
  store i64 1, ptr %17, align 8, !tbaa !8
  %18 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %indvars.iv47, i64 %indvars.iv47
  store i64 1, ptr %18, align 8, !tbaa !8
  %19 = icmp ugt i64 %indvars.iv47, 1
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %20 = add nsw i64 %indvars.iv47, -1
  %.phi.trans.insert = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %20, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  %min.iters.check = icmp ult i64 %indvar, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph
  %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.load55, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %21 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %20, i64 %offset.idx
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load = load <2 x i64>, ptr %21, align 8, !tbaa !8
  %wide.load55 = load <2 x i64>, ptr %22, align 8, !tbaa !8
  %23 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
  %24 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load55, <2 x i32> <i32 1, i32 2>
  %25 = add nsw <2 x i64> %wide.load, %23
  %26 = add nsw <2 x i64> %wide.load55, %24
  %27 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %indvars.iv47, i64 %offset.idx
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  store <2 x i64> %25, ptr %27, align 8, !tbaa !8
  store <2 x i64> %26, ptr %28, align 8, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %29 = icmp eq i64 %index.next, %n.vec
  br i1 %29, label %middle.block, label %vector.body, !llvm.loop !13

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

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %16
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next48, 51
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond50.not, label %12, label %16, !llvm.loop !17

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %30 = phi i64 [ %32, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %31 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %20, i64 %indvars.iv
  %32 = load i64, ptr %31, align 8, !tbaa !8
  %33 = add nsw i64 %32, %30
  %34 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %indvars.iv47, i64 %indvars.iv
  store i64 %33, ptr %34, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv47
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !18

.lr.ph44:                                         ; preds = %12, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %39 = load i32, ptr %4, align 4, !tbaa !11
  %40 = shl nsw i32 %39, 1
  %41 = load i32, ptr %2, align 4, !tbaa !11
  %.not30 = icmp slt i32 %40, %41
  br i1 %.not30, label %42, label %76

42:                                               ; preds = %.lr.ph44
  %43 = load i32, ptr %3, align 4, !tbaa !11
  %44 = shl nsw i32 %43, 1
  %45 = icmp sgt i32 %44, %41
  br i1 %45, label %76, label %46

46:                                               ; preds = %42
  %47 = sdiv i32 %41, 2
  %48 = add nsw i32 %47, 1
  %49 = sub i32 %48, %43
  %50 = add i32 %39, %43
  %51 = sub i32 %41, %50
  %.not3136 = icmp sgt i32 %49, %51
  br i1 %.not3136, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %46
  %52 = sext i32 %51 to i64
  %53 = sext i32 %49 to i64
  %54 = add i32 %41, 1
  %55 = sub i32 %54, %50
  %56 = xor i32 %39, -1
  %57 = add i32 %41, %56
  %58 = sub i32 %57, %47
  %59 = zext i32 %58 to i64
  %60 = add nuw nsw i64 %59, 1
  %min.iters.check58 = icmp ult i32 %58, 3
  br i1 %min.iters.check58, label %scalar.ph57.preheader, label %vector.ph59

scalar.ph57.preheader:                            ; preds = %middle.block56, %.lr.ph40
  %indvars.iv51.ph = phi i64 [ %53, %.lr.ph40 ], [ %ind.end62, %middle.block56 ]
  %.02637.ph = phi i64 [ 0, %.lr.ph40 ], [ %66, %middle.block56 ]
  br label %scalar.ph57

vector.ph59:                                      ; preds = %.lr.ph40
  %n.vec61 = and i64 %60, 8589934588
  %ind.end62 = add nsw i64 %n.vec61, %53
  br label %vector.body64

vector.body64:                                    ; preds = %vector.body64, %vector.ph59
  %index65 = phi i64 [ 0, %vector.ph59 ], [ %index.next70, %vector.body64 ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph59 ], [ %63, %vector.body64 ]
  %vec.phi66 = phi <2 x i64> [ zeroinitializer, %vector.ph59 ], [ %64, %vector.body64 ]
  %offset.idx67 = add i64 %index65, %53
  %61 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %52, i64 %offset.idx67
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load68 = load <2 x i64>, ptr %61, align 8, !tbaa !8
  %wide.load69 = load <2 x i64>, ptr %62, align 8, !tbaa !8
  %63 = add <2 x i64> %wide.load68, %vec.phi
  %64 = add <2 x i64> %wide.load69, %vec.phi66
  %index.next70 = add nuw i64 %index65, 4
  %65 = icmp eq i64 %index.next70, %n.vec61
  br i1 %65, label %middle.block56, label %vector.body64, !llvm.loop !19

middle.block56:                                   ; preds = %vector.body64
  %bin.rdx = add <2 x i64> %64, %63
  %66 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n71 = icmp eq i64 %60, %n.vec61
  br i1 %cmp.n71, label %._crit_edge41, label %scalar.ph57.preheader

._crit_edge41:                                    ; preds = %scalar.ph57, %middle.block56, %46
  %.026.lcssa = phi i64 [ 0, %46 ], [ %66, %middle.block56 ], [ %75, %scalar.ph57 ]
  %67 = zext nneg i32 %51 to i64
  %68 = mul nsw i64 %.026.lcssa, 100
  %69 = load i32, ptr %5, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = shl i64 %70, %67
  %72 = icmp sgt i64 %68, %71
  %.str.1..str.2 = select i1 %72, ptr @.str.1, ptr @.str.2
  br label %76

scalar.ph57:                                      ; preds = %scalar.ph57.preheader, %scalar.ph57
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %scalar.ph57 ], [ %indvars.iv51.ph, %scalar.ph57.preheader ]
  %.02637 = phi i64 [ %75, %scalar.ph57 ], [ %.02637.ph, %scalar.ph57.preheader ]
  %73 = getelementptr inbounds [51 x [51 x i64]], ptr @binom, i64 0, i64 %52, i64 %indvars.iv51
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = add nsw i64 %74, %.02637
  %indvars.iv.next52 = add nsw i64 %indvars.iv51, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next52 to i32
  %exitcond54.not = icmp eq i32 %55, %lftr.wideiv
  br i1 %exitcond54.not, label %._crit_edge41, label %scalar.ph57, !llvm.loop !20

76:                                               ; preds = %._crit_edge41, %42, %.lr.ph44
  %.str.1.sink = phi ptr [ @.str, %.lr.ph44 ], [ @.str.1, %42 ], [ %.str.1..str.2, %._crit_edge41 ]
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, 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
  %78 = load i32, ptr %1, align 4, !tbaa !11
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %1, align 4, !tbaa !11
  %.not = icmp eq i32 %78, 0
  br i1 %.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !21

._crit_edge45:                                    ; preds = %76, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !16, !15}
!19 = distinct !{!19, !14, !15, !16}
!20 = distinct !{!20, !14, !16, !15}
!21 = distinct !{!21, !14}


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