program main
  implicit none
  integer :: N, K, Q
  integer, allocatable :: A(:)
  integer, allocatable :: people(:)
  integer :: i

  !
  read (*,*) N,K,Q
  allocate(A(Q))
  do i = 1,Q
     read(*,*) A(i)
  end do
  allocate(people(N))
  people = 0
  do i = 1,Q
     people(A(i))  = people(A(i)) + 1
  end do

  ! calc point
  people(:) = K+people(:)-Q
  do i = 1,N
     if (people(i) >0) then
        write(*,'(a)') 'Yes'
     else
        write(*,'(a)') 'No'
     end if
  end do
  stop
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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEpeople.0 = internal unnamed_addr global ptr null
@_QFEpeople.7 = internal unnamed_addr global i64 1
@_QQcl.47e354ce99c058aa8ec23f663e2716ba = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3257/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_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

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

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %16 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.47e354ce99c058aa8ec23f663e2716ba, i32 12)
  %.unpack323 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %17 = add nsw i64 %indvars.iv, -1
  %18 = getelementptr i32, ptr %.unpack323, i64 %17
  %19 = call i1 @_FortranAioInputInteger(ptr %16, ptr %18, i32 4)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %15
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %21 = load i32, ptr %2, align 4, !tbaa !3
  %22 = call i32 @llvm.smax.i32(i32 %21, i32 0)
  %23 = zext i32 %22 to i64
  %24 = shl nuw nsw i64 %23, 2
  %25 = call ptr @malloc(i64 %24)
  store ptr %25, ptr @_QFEpeople.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEpeople.7, align 8, !tbaa !7
  %.not = icmp eq ptr %25, null
  br i1 %.not, label %28, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %.not345 = icmp slt i32 %21, 1
  br i1 %.not345, label %.loopexit, label %.lr.ph335.preheader

.lr.ph335.preheader:                              ; preds = %.preheader
  %26 = call i64 @llvm.smax.i64(i64 %23, i64 1)
  %27 = shl nuw nsw i64 %26, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %25, i8 0, i64 %27, i1 false), !tbaa !3
  br label %.loopexit

28:                                               ; preds = %._crit_edge
  %29 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.47e354ce99c058aa8ec23f663e2716ba, i32 15)
  %.unpack309.unpack.unpack = load i64, ptr @_QFEpeople.7, align 8, !tbaa !7
  %30 = icmp slt i32 %21, 1
  %31 = select i1 %30, i64 1, i64 %.unpack309.unpack.unpack
  store ptr null, ptr @_QFEpeople.0, align 8, !tbaa !7
  store i64 %31, ptr @_QFEpeople.7, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph335.preheader, %.preheader, %28
  %.unpack285.unpack.unpack = phi i64 [ 1, %.lr.ph335.preheader ], [ 1, %.preheader ], [ %31, %28 ]
  %32 = load i32, ptr %3, align 4, !tbaa !3
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph337, label %._crit_edge338

.lr.ph337:                                        ; preds = %.loopexit
  %34 = zext i32 %32 to i64
  %.unpack290 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %xtraiter = and i64 %34, 1
  %35 = icmp eq i32 %32, 1
  br i1 %35, label %._crit_edge338.loopexit.unr-lcssa, label %.lr.ph337.new

.lr.ph337.new:                                    ; preds = %.lr.ph337
  %unroll_iter = and i64 %34, 4294967294
  br label %36

36:                                               ; preds = %36, %.lr.ph337.new
  %indvars.iv348 = phi i64 [ 1, %.lr.ph337.new ], [ %indvars.iv.next349.1, %36 ]
  %niter = phi i64 [ 0, %.lr.ph337.new ], [ %niter.next.1, %36 ]
  %37 = add nsw i64 %indvars.iv348, -1
  %38 = getelementptr i32, ptr %.unpack290, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %40 = sext i32 %39 to i64
  %41 = sub i64 %40, %.unpack285.unpack.unpack
  %42 = getelementptr i32, ptr %25, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !3
  %44 = add i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !3
  %45 = getelementptr i32, ptr %.unpack290, i64 %indvars.iv348
  %46 = load i32, ptr %45, align 4, !tbaa !3
  %47 = sext i32 %46 to i64
  %48 = sub i64 %47, %.unpack285.unpack.unpack
  %49 = getelementptr i32, ptr %25, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !3
  %51 = add i32 %50, 1
  store i32 %51, ptr %49, align 4, !tbaa !3
  %indvars.iv.next349.1 = add nuw nsw i64 %indvars.iv348, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge338.loopexit.unr-lcssa.loopexit, label %36

._crit_edge338.loopexit.unr-lcssa.loopexit:       ; preds = %36
  %52 = add nuw nsw i64 %indvars.iv348, 1
  br label %._crit_edge338.loopexit.unr-lcssa

._crit_edge338.loopexit.unr-lcssa:                ; preds = %._crit_edge338.loopexit.unr-lcssa.loopexit, %.lr.ph337
  %indvars.iv348.unr = phi i64 [ 0, %.lr.ph337 ], [ %52, %._crit_edge338.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge338, label %._crit_edge338.loopexit.epilog-lcssa

._crit_edge338.loopexit.epilog-lcssa:             ; preds = %._crit_edge338.loopexit.unr-lcssa
  %53 = getelementptr i32, ptr %.unpack290, i64 %indvars.iv348.unr
  %54 = load i32, ptr %53, align 4, !tbaa !3
  %55 = sext i32 %54 to i64
  %56 = sub i64 %55, %.unpack285.unpack.unpack
  %57 = getelementptr i32, ptr %25, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !3
  %59 = add i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !3
  br label %._crit_edge338

._crit_edge338:                                   ; preds = %._crit_edge338.loopexit.epilog-lcssa, %._crit_edge338.loopexit.unr-lcssa, %.loopexit
  %.not346 = icmp slt i32 %21, 1
  br i1 %.not346, label %._crit_edge341, label %.lr.ph340

.lr.ph340:                                        ; preds = %._crit_edge338
  %60 = load i32, ptr %1, align 4, !tbaa !3
  %61 = sub i32 %60, %32
  %min.iters.check = icmp ult i32 %22, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph340
  %n.vec = and i64 %23, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %61, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert360 = insertelement <4 x i32> poison, i32 %61, i64 0
  %broadcast.splat361 = shufflevector <4 x i32> %broadcast.splatinsert360, <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 ]
  %62 = getelementptr i32, ptr %25, i64 %index
  %wide.load = load <4 x i32>, ptr %62, align 4, !tbaa !3
  %63 = getelementptr i32, ptr %62, i64 4
  %wide.load359 = load <4 x i32>, ptr %63, align 4, !tbaa !3
  %64 = add <4 x i32> %broadcast.splat, %wide.load
  %65 = add <4 x i32> %broadcast.splat361, %wide.load359
  store <4 x i32> %64, ptr %62, align 4, !tbaa !3
  store <4 x i32> %65, ptr %63, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %66 = icmp eq i64 %index.next, %n.vec
  br i1 %66, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %23
  br i1 %cmp.n, label %._crit_edge341, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph340, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph340 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %67 = phi i64 [ %71, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %68 = getelementptr i32, ptr %25, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !3
  %70 = add i32 %61, %69
  store i32 %70, ptr %68, align 4, !tbaa !3
  %71 = add nuw nsw i64 %67, 1
  %exitcond352.not = icmp eq i64 %71, %23
  br i1 %exitcond352.not, label %._crit_edge341, label %scalar.ph, !llvm.loop !12

._crit_edge341:                                   ; preds = %scalar.ph, %middle.block, %._crit_edge338
  %72 = load i32, ptr %2, align 4, !tbaa !3
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph343.preheader, label %._crit_edge344

.lr.ph343.preheader:                              ; preds = %._crit_edge341
  %74 = zext i32 %72 to i64
  br label %.lr.ph343

.lr.ph343:                                        ; preds = %.lr.ph343.preheader, %85
  %indvars.iv353 = phi i64 [ 1, %.lr.ph343.preheader ], [ %indvars.iv.next354, %85 ]
  %.unpack266 = load ptr, ptr @_QFEpeople.0, align 8, !tbaa !7
  %.unpack273.unpack.unpack = load i64, ptr @_QFEpeople.7, align 8, !tbaa !7
  %75 = sub i64 %indvars.iv353, %.unpack273.unpack.unpack
  %76 = getelementptr i32, ptr %.unpack266, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !3
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %.lr.ph343
  %80 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.47e354ce99c058aa8ec23f663e2716ba, i32 24)
  %81 = call i1 @_FortranAioOutputAscii(ptr %80, ptr nonnull @_QQcl.596573, i64 3)
  br label %85

82:                                               ; preds = %.lr.ph343
  %83 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.47e354ce99c058aa8ec23f663e2716ba, i32 26)
  %84 = call i1 @_FortranAioOutputAscii(ptr %83, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %85

85:                                               ; preds = %79, %82
  %.sink = phi ptr [ %80, %79 ], [ %83, %82 ]
  %86 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  %indvars.iv.next354 = add nuw nsw i64 %indvars.iv353, 1
  %exitcond356.not = icmp eq i64 %indvars.iv353, %74
  br i1 %exitcond356.not, label %._crit_edge344, label %.lr.ph343

._crit_edge344:                                   ; preds = %85, %._crit_edge341
  %87 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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 {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

!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}
