program main
  implicit none
  integer i,N,K,ans
  integer,allocatable :: H(:)
  read(*, *)N,K
  allocate(H(N))
  read(*, *) (H(i), i = 1,N)
  ans = 0
  do i = 1,N
    if (H(i) >= K) then
      ans = ans + 1
    end if
  end do
  write(*, *) ans
end program main

; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEh.0 = internal unnamed_addr global ptr null
@_QQcl.893a5577d8921f363f9d6b135ed6ce1f = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3172/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.893a5577d8921f363f9d6b135ed6ce1f, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %2, align 4, !tbaa !3
  %8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %9 = zext i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEh.0, align 8, !tbaa !7
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.893a5577d8921f363f9d6b135ed6ce1f, i32 7)
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %15 = zext i32 %13 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %16 = phi i64 [ %21, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %.unpack74 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %sext = shl i64 %16, 32
  %17 = ashr exact i64 %sext, 32
  %18 = add nsw i64 %17, -1
  %19 = getelementptr i32, ptr %.unpack74, i64 %18
  %20 = call i1 @_FortranAioInputInteger(ptr %12, ptr %19, i32 4)
  %21 = add nuw nsw i64 %16, 1
  %exitcond.not = icmp eq i64 %16, %15
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %22 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %23 = load i32, ptr %2, align 4, !tbaa !3
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph88, label %._crit_edge89

.lr.ph88:                                         ; preds = %._crit_edge
  %25 = zext i32 %23 to i64
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %26 = load i32, ptr %1, align 4, !tbaa !3
  %min.iters.check = icmp ult i32 %23, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph88
  %n.vec = and i64 %25, 4294967288
  %ind.end = or i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %26, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert94 = insertelement <4 x i32> poison, i32 %26, i64 0
  %broadcast.splat95 = shufflevector <4 x i32> %broadcast.splatinsert94, <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 ], [ %33, %vector.body ]
  %vec.phi92 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ]
  %27 = getelementptr i32, ptr %.unpack, i64 %index
  %wide.load = load <4 x i32>, ptr %27, align 4, !tbaa !3
  %28 = getelementptr i32, ptr %27, i64 4
  %wide.load93 = load <4 x i32>, ptr %28, align 4, !tbaa !3
  %29 = icmp sge <4 x i32> %wide.load, %broadcast.splat
  %30 = icmp sge <4 x i32> %wide.load93, %broadcast.splat95
  %31 = zext <4 x i1> %29 to <4 x i32>
  %32 = zext <4 x i1> %30 to <4 x i32>
  %33 = add <4 x i32> %vec.phi, %31
  %34 = add <4 x i32> %vec.phi92, %32
  %index.next = add nuw i64 %index, 8
  %35 = icmp eq i64 %index.next, %n.vec
  br i1 %35, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %34, %33
  %36 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %25
  br i1 %cmp.n, label %._crit_edge89, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph88, %middle.block
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph88 ], [ %ind.end, %middle.block ]
  %.086.ph = phi i32 [ 0, %.lr.ph88 ], [ %36, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.086 = phi i32 [ %spec.select, %scalar.ph ], [ %.086.ph, %scalar.ph.preheader ]
  %37 = add i64 %indvars.iv, -1
  %38 = getelementptr i32, ptr %.unpack, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %.not = icmp sge i32 %39, %26
  %40 = zext i1 %.not to i32
  %spec.select = add i32 %.086, %40
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond91.not = icmp eq i64 %indvars.iv, %25
  br i1 %exitcond91.not, label %._crit_edge89, label %scalar.ph, !llvm.loop !12

._crit_edge89:                                    ; preds = %scalar.ph, %middle.block, %._crit_edge
  %.0.lcssa = phi i32 [ 0, %._crit_edge ], [ %36, %middle.block ], [ %spec.select, %scalar.ph ]
  %41 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.893a5577d8921f363f9d6b135ed6ce1f, i32 14)
  %42 = call i1 @_FortranAioOutputInteger32(ptr %41, i32 %.0.lcssa)
  %43 = call i32 @_FortranAioEndIoStatement(ptr %41)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
