; LLVM IR from ravireddy07/cpp-book :: src/Code-Chef (BESTBATS)

; 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 [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z8NChooseKii(i32 noundef, i32 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: 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 [11 x i32], align 16
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 11, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 44, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  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
  br label %13

13:                                               ; preds = %88, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %97

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

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

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

22:                                               ; preds = %18
  %23 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 0
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i32, ptr %23, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %26)
  br label %28

28:                                               ; preds = %22
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %9, align 4, !tbaa !5
  br label %18, !llvm.loop !9

31:                                               ; preds = %21
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %33 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 0
  %34 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 0
  %35 = getelementptr inbounds i32, ptr %34, i64 11
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %33, ptr noundef %35)
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sub nsw i32 11, %36
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %61, %31
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sub nsw i32 11, %43
  %45 = icmp sle i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %64

47:                                               ; preds = %41
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sub nsw i32 11, %48
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = sub nsw i32 %49, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %47
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %7, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %57, %47
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %10, align 4, !tbaa !5
  br label %41, !llvm.loop !11

64:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %85, %64
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = icmp sle i32 %66, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %88

71:                                               ; preds = %65
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sub nsw i32 11, %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = add nsw i32 %73, %74
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [11 x i32], ptr %4, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = icmp eq i32 %78, %79
  br i1 %80, label %81, label %84

81:                                               ; preds = %71
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %81, %71
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !5
  br label %65, !llvm.loop !12

88:                                               ; preds = %70
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = add nsw i32 %89, %90
  %92 = add nsw i32 %91, 1
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  %95 = call noundef i64 @_Z8NChooseKii(i32 noundef %92, i32 noundef %94)
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %95)
  br label %13, !llvm.loop !13

97:                                               ; preds = %13
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 44, 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
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #4

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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; 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 [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z8NChooseKii(i32 noundef, i32 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca [11 x i32], align 16
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not35 = icmp eq i32 %5, 0
  br i1 %.not35, label %._crit_edge36, label %.preheader25.lr.ph

.preheader25.lr.ph:                               ; preds = %0
  %7 = getelementptr inbounds i8, ptr %2, i64 44
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  %10 = getelementptr inbounds i8, ptr %2, i64 12
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  %12 = getelementptr inbounds i8, ptr %2, i64 20
  %13 = getelementptr inbounds i8, ptr %2, i64 24
  %14 = getelementptr inbounds i8, ptr %2, i64 28
  %15 = getelementptr inbounds i8, ptr %2, i64 32
  %16 = getelementptr inbounds i8, ptr %2, i64 36
  %17 = getelementptr inbounds i8, ptr %2, i64 40
  br label %.preheader25

.preheader25:                                     ; preds = %.preheader25.lr.ph, %._crit_edge
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11)
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %12)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %13)
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14)
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %17)
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %7)
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sub nsw i32 11, %30
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %.not2227 = icmp sgt i32 %30, 10
  br i1 %.not2227, label %.lr.ph33, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader25
  %smax = call i32 @llvm.smax.i32(i32 %31, i32 1)
  %35 = add nuw i32 %smax, 1
  %wide.trip.count = zext i32 %35 to i64
  %36 = zext nneg i32 %smax to i64
  %min.iters.check54 = icmp sgt i32 %30, 3
  br i1 %min.iters.check54, label %.lr.ph.preheader74, label %vector.ph55

.lr.ph.preheader74:                               ; preds = %middle.block52, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end58, %middle.block52 ]
  %.01928.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %48, %middle.block52 ]
  br label %.lr.ph

vector.ph55:                                      ; preds = %.lr.ph.preheader
  %n.vec57 = and i64 %36, 2147483640
  %ind.end58 = or disjoint i64 %n.vec57, 1
  %broadcast.splatinsert68 = insertelement <4 x i32> poison, i32 %34, i64 0
  %broadcast.splat69 = shufflevector <4 x i32> %broadcast.splatinsert68, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body60

vector.body60:                                    ; preds = %vector.body60, %vector.ph55
  %index61 = phi i64 [ 0, %vector.ph55 ], [ %index.next70, %vector.body60 ]
  %vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph55 ], [ %45, %vector.body60 ]
  %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph55 ], [ %46, %vector.body60 ]
  %offset.idx64.neg = xor i64 %index61, -1
  %37 = add i64 %offset.idx64.neg, %32
  %38 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 -12
  %40 = getelementptr inbounds i8, ptr %38, i64 -28
  %wide.load65 = load <4 x i32>, ptr %39, align 4, !tbaa !5
  %reverse = shufflevector <4 x i32> %wide.load65, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load66 = load <4 x i32>, ptr %40, align 4, !tbaa !5
  %reverse67 = shufflevector <4 x i32> %wide.load66, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %41 = icmp eq <4 x i32> %reverse, %broadcast.splat69
  %42 = icmp eq <4 x i32> %reverse67, %broadcast.splat69
  %43 = zext <4 x i1> %41 to <4 x i32>
  %44 = zext <4 x i1> %42 to <4 x i32>
  %45 = add <4 x i32> %vec.phi62, %43
  %46 = add <4 x i32> %vec.phi63, %44
  %index.next70 = add nuw i64 %index61, 8
  %47 = icmp eq i64 %index.next70, %n.vec57
  br i1 %47, label %middle.block52, label %vector.body60, !llvm.loop !9

middle.block52:                                   ; preds = %vector.body60
  %bin.rdx71 = add <4 x i32> %46, %45
  %48 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx71)
  %cmp.n72 = icmp eq i64 %n.vec57, %36
  br i1 %cmp.n72, label %.preheader, label %.lr.ph.preheader74

.preheader:                                       ; preds = %.lr.ph, %middle.block52
  %spec.select.lcssa = phi i32 [ %48, %middle.block52 ], [ %spec.select, %.lr.ph ]
  %.not23.not30 = icmp sgt i32 %30, 1
  br i1 %.not23.not30, label %.lr.ph33, label %._crit_edge

.lr.ph33:                                         ; preds = %.preheader25, %.preheader
  %.019.lcssa49 = phi i32 [ %spec.select.lcssa, %.preheader ], [ 0, %.preheader25 ]
  %wide.trip.count44 = zext nneg i32 %30 to i64
  %49 = add nsw i64 %wide.trip.count44, -1
  %min.iters.check = icmp ult i64 %49, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.scevcheck, %.lr.ph33
  %indvars.iv40.ph = phi i64 [ 1, %vector.scevcheck ], [ 1, %.lr.ph33 ], [ %ind.end, %middle.block ]
  %.01831.ph = phi i32 [ 0, %vector.scevcheck ], [ 0, %.lr.ph33 ], [ %82, %middle.block ]
  %50 = and i64 %wide.trip.count44, 1
  %lcmp.mod.not.not = icmp eq i64 %50, 0
  br i1 %lcmp.mod.not.not, label %scalar.ph.prol, label %scalar.ph.prol.loopexit

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %51 = trunc nsw i64 %indvars.iv40.ph to i32
  %52 = sub i32 %51, %30
  %53 = add i32 %52, 11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, %34
  %58 = zext i1 %57 to i32
  %spec.select24.prol = add nuw nsw i32 %.01831.ph, %58
  %indvars.iv.next41.prol = add nuw nsw i64 %indvars.iv40.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %spec.select24.lcssa.unr = phi i32 [ poison, %scalar.ph.preheader ], [ %spec.select24.prol, %scalar.ph.prol ]
  %indvars.iv40.unr = phi i64 [ %indvars.iv40.ph, %scalar.ph.preheader ], [ %indvars.iv.next41.prol, %scalar.ph.prol ]
  %.01831.unr = phi i32 [ %.01831.ph, %scalar.ph.preheader ], [ %spec.select24.prol, %scalar.ph.prol ]
  %59 = add nsw i64 %wide.trip.count44, -1
  %60 = icmp eq i64 %indvars.iv40.ph, %59
  br i1 %60, label %._crit_edge, label %scalar.ph

vector.scevcheck:                                 ; preds = %.lr.ph33
  %61 = add nsw i64 %wide.trip.count44, -2
  %62 = sub i32 12, %30
  %63 = trunc i64 %61 to i32
  %64 = add i32 %62, %63
  %65 = icmp slt i32 %64, %62
  %66 = icmp ugt i64 %61, 4294967295
  %67 = or i1 %65, %66
  br i1 %67, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.scevcheck
  %n.vec = and i64 %49, -8
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %34, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %79, %vector.body ]
  %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %80, %vector.body ]
  %68 = trunc i64 %index to i32
  %69 = or disjoint i32 %68, 1
  %70 = sub i32 %69, %30
  %71 = add i32 %70, 11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %72
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %wide.load = load <4 x i32>, ptr %73, align 4, !tbaa !5
  %wide.load51 = load <4 x i32>, ptr %74, align 4, !tbaa !5
  %75 = icmp eq <4 x i32> %wide.load, %broadcast.splat
  %76 = icmp eq <4 x i32> %wide.load51, %broadcast.splat
  %77 = zext <4 x i1> %75 to <4 x i32>
  %78 = zext <4 x i1> %76 to <4 x i32>
  %79 = add <4 x i32> %vec.phi, %77
  %80 = add <4 x i32> %vec.phi50, %78
  %index.next = add nuw i64 %index, 8
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %80, %79
  %82 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %49, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader74, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader74 ]
  %.01928 = phi i32 [ %spec.select, %.lr.ph ], [ %.01928.ph, %.lr.ph.preheader74 ]
  %83 = sub nsw i64 %32, %indvars.iv
  %84 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp eq i32 %85, %34
  %87 = zext i1 %86 to i32
  %spec.select = add nuw nsw i32 %.01928, %87
  %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 %.preheader, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.preheader
  %.019.lcssa48 = phi i32 [ %spec.select.lcssa, %.preheader ], [ %.019.lcssa49, %middle.block ], [ %.019.lcssa49, %scalar.ph ], [ %.019.lcssa49, %scalar.ph.prol.loopexit ]
  %.018.lcssa = phi i32 [ 0, %.preheader ], [ %82, %middle.block ], [ %spec.select24.lcssa.unr, %scalar.ph.prol.loopexit ], [ %spec.select24.1, %scalar.ph ]
  %88 = add nsw i32 %.019.lcssa48, 1
  %89 = add nsw i32 %88, %.018.lcssa
  %90 = add nsw i32 %.018.lcssa, 1
  %91 = call noundef i64 @_Z8NChooseKii(i32 noundef %89, i32 noundef %90)
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %91)
  %93 = load i32, ptr %1, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %93, 0
  br i1 %.not, label %._crit_edge36, label %.preheader25, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv40 = phi i64 [ %indvars.iv.next41.1, %scalar.ph ], [ %indvars.iv40.unr, %scalar.ph.prol.loopexit ]
  %.01831 = phi i32 [ %spec.select24.1, %scalar.ph ], [ %.01831.unr, %scalar.ph.prol.loopexit ]
  %95 = trunc i64 %indvars.iv40 to i32
  %96 = sub i32 %95, %30
  %97 = add i32 %96, 11
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp eq i32 %100, %34
  %102 = zext i1 %101 to i32
  %spec.select24 = add nuw nsw i32 %.01831, %102
  %103 = trunc i64 %indvars.iv40 to i32
  %104 = add i32 %103, 1
  %105 = sub i32 %104, %30
  %106 = add i32 %105, 11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [11 x i32], ptr %2, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp eq i32 %109, %34
  %111 = zext i1 %110 to i32
  %spec.select24.1 = add nuw nsw i32 %spec.select24, %111
  %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 2
  %exitcond45.not.1 = icmp eq i64 %indvars.iv.next41.1, %wide.trip.count44
  br i1 %exitcond45.not.1, label %._crit_edge, label %scalar.ph, !llvm.loop !16

._crit_edge36:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

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 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !11}


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