   program abc166c
      implicit none
      integer(8)::n,m
      integer(8),allocatable::h(:),a(:),b(:),flag(:)
      integer(8)::i,j,ans

         read *, n,m
         allocate(h(n),a(m),b(m),flag(n))
         read *, h(1:n)

         do i=1,m
            read *, a(i),b(i)
         end do

         flag=1
         do i=1,m
            if ( h(a(i)) < h(b(i)) ) then
               flag(a(i))=0
            else if ( h(a(i)) > h(b(i)) ) then
               flag(b(i))=0
            else
               flag(a(i))=0;flag(b(i))=0
            end if
         end do

         ans=0
         do i=1,n
            if (flag(i)==1) ans=ans+1
         end do

         print *, ans

   end program abc166c
; 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
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEflag.0 = internal unnamed_addr global ptr null
@_QFEflag.7 = internal unnamed_addr global i64 1
@_QFEflag.8 = internal unnamed_addr global i64 0
@_QFEh.0 = internal unnamed_addr global ptr null
@_QQcl.8d2ff31de67e298258d82e9338dbd70c = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1515/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"
@_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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8d2ff31de67e298258d82e9338dbd70c, i32 7)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %8 = load i64, ptr %3, align 8, !tbaa !3
  %9 = call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = shl i64 %9, 3
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEh.0, align 8, !tbaa !7
  %12 = load i64, ptr %2, align 8, !tbaa !3
  %13 = call i64 @llvm.smax.i64(i64 %12, i64 0)
  %14 = shl i64 %13, 3
  %15 = call ptr @malloc(i64 %14)
  store ptr %15, ptr @_QFEa.0, align 8, !tbaa !7
  %16 = call ptr @malloc(i64 %14)
  store ptr %16, ptr @_QFEb.0, align 8, !tbaa !7
  %17 = call ptr @malloc(i64 %10)
  store ptr %17, ptr @_QFEflag.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEflag.7, align 8, !tbaa !7
  store i64 %9, ptr @_QFEflag.8, align 8, !tbaa !7
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8d2ff31de67e298258d82e9338dbd70c, i32 9)
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %19 = load i64, ptr %3, align 8, !tbaa !3
  %20 = call i64 @llvm.smax.i64(i64 %19, i64 0)
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %20, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %21 = call i1 @_FortranAioInputDescriptor(ptr %18, ptr nonnull %1)
  %22 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %23 = load i64, ptr %2, align 8, !tbaa !3
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %25 = phi i64 [ %34, %.lr.ph ], [ 1, %0 ]
  %26 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8d2ff31de67e298258d82e9338dbd70c, i32 12)
  %.unpack985 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %27 = add i64 %25, -1
  %28 = getelementptr i64, ptr %.unpack985, i64 %27
  %29 = call i1 @_FortranAioInputInteger(ptr %26, ptr %28, i32 8)
  %.unpack997 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %30 = add i64 %25, -1
  %31 = getelementptr i64, ptr %.unpack997, i64 %30
  %32 = call i1 @_FortranAioInputInteger(ptr %26, ptr %31, i32 8)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %26)
  %34 = add nuw i64 %25, 1
  %exitcond.not = icmp eq i64 %25, %23
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.unpack844 = load ptr, ptr @_QFEflag.0, align 8, !tbaa !7
  %.unpack851.unpack.unpack853 = load i64, ptr @_QFEflag.8, align 8, !tbaa !7
  %.not = icmp eq ptr %.unpack844, null
  br i1 %.not, label %42, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %35 = icmp sgt i64 %.unpack851.unpack.unpack853, 0
  br i1 %35, label %.lr.ph1009.preheader, label %.loopexit

.lr.ph1009.preheader:                             ; preds = %.preheader
  %min.iters.check = icmp ult i64 %.unpack851.unpack.unpack853, 4
  br i1 %min.iters.check, label %.lr.ph1009.preheader1036, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph1009.preheader
  %n.vec = and i64 %.unpack851.unpack.unpack853, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = getelementptr i64, ptr %.unpack844, i64 %index
  store <2 x i64> <i64 1, i64 1>, ptr %36, align 8, !tbaa !3
  %37 = getelementptr i64, ptr %36, i64 2
  store <2 x i64> <i64 1, i64 1>, ptr %37, align 8, !tbaa !3
  %index.next = add nuw i64 %index, 4
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.unpack851.unpack.unpack853, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph1009.preheader1036

.lr.ph1009.preheader1036:                         ; preds = %.lr.ph1009.preheader, %middle.block
  %.ph1037 = phi i64 [ 0, %.lr.ph1009.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph1009

.lr.ph1009:                                       ; preds = %.lr.ph1009.preheader1036, %.lr.ph1009
  %39 = phi i64 [ %40, %.lr.ph1009 ], [ %.ph1037, %.lr.ph1009.preheader1036 ]
  %40 = add nuw nsw i64 %39, 1
  %41 = getelementptr i64, ptr %.unpack844, i64 %39
  store i64 1, ptr %41, align 8, !tbaa !3
  %exitcond1017.not = icmp eq i64 %40, %.unpack851.unpack.unpack853
  br i1 %exitcond1017.not, label %.loopexit, label %.lr.ph1009, !llvm.loop !12

42:                                               ; preds = %._crit_edge
  %43 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.8d2ff31de67e298258d82e9338dbd70c, i32 15)
  %.unpack971.unpack.unpack = load i64, ptr @_QFEflag.7, align 8, !tbaa !7
  %44 = icmp eq i64 %.unpack851.unpack.unpack853, 0
  %45 = select i1 %44, i64 1, i64 %.unpack971.unpack.unpack
  store ptr null, ptr @_QFEflag.0, align 8, !tbaa !7
  store i64 %45, ptr @_QFEflag.7, align 8, !tbaa !7
  store i64 %.unpack851.unpack.unpack853, ptr @_QFEflag.8, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph1009, %middle.block, %.preheader, %42
  %46 = load i64, ptr %2, align 8, !tbaa !3
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %.lr.ph1011, label %._crit_edge1012

.lr.ph1011:                                       ; preds = %.loopexit
  %.unpack868 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack880 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack892 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack911.unpack.unpack = load i64, ptr @_QFEflag.7, align 8
  br label %48

48:                                               ; preds = %.lr.ph1011, %69
  %49 = phi i64 [ 1, %.lr.ph1011 ], [ %72, %69 ]
  %50 = add i64 %49, -1
  %51 = getelementptr i64, ptr %.unpack880, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !3
  %53 = add i64 %52, -1
  %54 = getelementptr i64, ptr %.unpack868, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !3
  %56 = add i64 %49, -1
  %57 = getelementptr i64, ptr %.unpack892, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !3
  %59 = add i64 %58, -1
  %60 = getelementptr i64, ptr %.unpack868, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !3
  %62 = icmp slt i64 %55, %61
  br i1 %62, label %69, label %63

63:                                               ; preds = %48
  %64 = icmp sgt i64 %55, %61
  br i1 %64, label %69, label %65

65:                                               ; preds = %63
  %66 = sub i64 %52, %.unpack911.unpack.unpack
  %67 = getelementptr i64, ptr %.unpack844, i64 %66
  store i64 0, ptr %67, align 8, !tbaa !3
  %68 = load i64, ptr %57, align 8, !tbaa !3
  br label %69

69:                                               ; preds = %63, %48, %65
  %.sink = phi i64 [ %68, %65 ], [ %52, %48 ], [ %58, %63 ]
  %70 = sub i64 %.sink, %.unpack911.unpack.unpack
  %71 = getelementptr i64, ptr %.unpack844, i64 %70
  store i64 0, ptr %71, align 8, !tbaa !3
  %72 = add nuw i64 %49, 1
  %exitcond1018.not = icmp eq i64 %49, %46
  br i1 %exitcond1018.not, label %._crit_edge1012, label %48

._crit_edge1012:                                  ; preds = %69, %.loopexit
  %73 = load i64, ptr %3, align 8, !tbaa !3
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %.lr.ph1015, label %._crit_edge1016

.lr.ph1015:                                       ; preds = %._crit_edge1012
  %.unpack863.unpack.unpack = load i64, ptr @_QFEflag.7, align 8, !tbaa !7
  %min.iters.check1024 = icmp ult i64 %73, 4
  br i1 %min.iters.check1024, label %scalar.ph1023.preheader, label %vector.ph1025

vector.ph1025:                                    ; preds = %.lr.ph1015
  %n.vec1027 = and i64 %73, -4
  %ind.end = or i64 %n.vec1027, 1
  br label %vector.body1030

vector.body1030:                                  ; preds = %vector.body1030, %vector.ph1025
  %index1031 = phi i64 [ 0, %vector.ph1025 ], [ %index.next1034, %vector.body1030 ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph1025 ], [ %82, %vector.body1030 ]
  %vec.phi1032 = phi <2 x i64> [ zeroinitializer, %vector.ph1025 ], [ %83, %vector.body1030 ]
  %offset.idx = or i64 %index1031, 1
  %75 = sub i64 %offset.idx, %.unpack863.unpack.unpack
  %76 = getelementptr i64, ptr %.unpack844, i64 %75
  %wide.load = load <2 x i64>, ptr %76, align 8, !tbaa !3
  %77 = getelementptr i64, ptr %76, i64 2
  %wide.load1033 = load <2 x i64>, ptr %77, align 8, !tbaa !3
  %78 = icmp eq <2 x i64> %wide.load, <i64 1, i64 1>
  %79 = icmp eq <2 x i64> %wide.load1033, <i64 1, i64 1>
  %80 = zext <2 x i1> %78 to <2 x i64>
  %81 = zext <2 x i1> %79 to <2 x i64>
  %82 = add <2 x i64> %vec.phi, %80
  %83 = add <2 x i64> %vec.phi1032, %81
  %index.next1034 = add nuw i64 %index1031, 4
  %84 = icmp eq i64 %index.next1034, %n.vec1027
  br i1 %84, label %middle.block1022, label %vector.body1030, !llvm.loop !13

middle.block1022:                                 ; preds = %vector.body1030
  %bin.rdx = add <2 x i64> %83, %82
  %85 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n1029 = icmp eq i64 %73, %n.vec1027
  br i1 %cmp.n1029, label %._crit_edge1016, label %scalar.ph1023.preheader

scalar.ph1023.preheader:                          ; preds = %.lr.ph1015, %middle.block1022
  %.ph = phi i64 [ 1, %.lr.ph1015 ], [ %ind.end, %middle.block1022 ]
  %.01013.ph = phi i64 [ 0, %.lr.ph1015 ], [ %85, %middle.block1022 ]
  br label %scalar.ph1023

scalar.ph1023:                                    ; preds = %scalar.ph1023.preheader, %scalar.ph1023
  %86 = phi i64 [ %92, %scalar.ph1023 ], [ %.ph, %scalar.ph1023.preheader ]
  %.01013 = phi i64 [ %spec.select, %scalar.ph1023 ], [ %.01013.ph, %scalar.ph1023.preheader ]
  %87 = sub i64 %86, %.unpack863.unpack.unpack
  %88 = getelementptr i64, ptr %.unpack844, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !3
  %90 = icmp eq i64 %89, 1
  %91 = zext i1 %90 to i64
  %spec.select = add i64 %.01013, %91
  %92 = add nuw i64 %86, 1
  %exitcond1019.not = icmp eq i64 %86, %73
  br i1 %exitcond1019.not, label %._crit_edge1016, label %scalar.ph1023, !llvm.loop !14

._crit_edge1016:                                  ; preds = %scalar.ph1023, %middle.block1022, %._crit_edge1012
  %.0.lcssa = phi i64 [ 0, %._crit_edge1012 ], [ %85, %middle.block1022 ], [ %spec.select, %scalar.ph1023 ]
  %93 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8d2ff31de67e298258d82e9338dbd70c, i32 31)
  %94 = call i1 @_FortranAioOutputInteger64(ptr %93, i64 %.0.lcssa)
  %95 = call i32 @_FortranAioEndIoStatement(ptr %93)
  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 i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
