program abc80
 implicit none
 integer(8)::N,K,ia,ib,d,ic
 integer(8),allocatable::a(:),b(:)
 read(*,*)N,K
 allocate(a(N))
 a=0
 do ia=1,K
  read(*,*)d
  allocate(b(d))
  read(*,*)(b(ic),ic=1,d)
  do ib=1,d
   a(b(ib))=a(b(ib))+1
  end do
  deallocate(b)
 end do
 print'(i0)',count(a==0)
 deallocate(a)
end program abc80
; 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
@_QFEa.7 = internal unnamed_addr global i64 1
@_QFEa.8 = internal unnamed_addr global i64 0
@_QFEb.0 = internal unnamed_addr global ptr null
@_QQcl.ea8c6a281dc600ab4bada374badf79ba = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1488/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.28693029 = linkonce constant [4 x i8] c"(i0)"
@_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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

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 = alloca i64, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 5)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 8)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %9 = load i64, ptr %4, align 8, !tbaa !3
  %10 = call i64 @llvm.smax.i64(i64 %9, i64 0)
  %11 = shl i64 %10, 3
  %12 = call ptr @malloc(i64 %11)
  store ptr %12, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEa.7, align 8, !tbaa !7
  store i64 %10, ptr @_QFEa.8, align 8, !tbaa !7
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %.preheader

.preheader:                                       ; preds = %0
  %.not545 = icmp slt i64 %9, 1
  br i1 %.not545, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %12, i8 0, i64 %11, i1 false), !tbaa !3
  br label %.loopexit

13:                                               ; preds = %0
  %14 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 7)
  %.unpack521.unpack.unpack = load i64, ptr @_QFEa.7, align 8, !tbaa !7
  %15 = icmp slt i64 %9, 1
  %16 = select i1 %15, i64 1, i64 %.unpack521.unpack.unpack
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %16, ptr @_QFEa.7, align 8, !tbaa !7
  store i64 %10, ptr @_QFEa.8, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.preheader, %.preheader, %13
  %17 = load i64, ptr %3, align 8, !tbaa !3
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph540, label %._crit_edge541

.lr.ph540:                                        ; preds = %.loopexit, %._crit_edge538
  %19 = phi i64 [ %62, %._crit_edge538 ], [ %17, %.loopexit ]
  %20 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 9)
  %21 = call i1 @_FortranAioInputInteger(ptr %20, ptr nonnull %2, i32 8)
  %22 = call i32 @_FortranAioEndIoStatement(ptr %20)
  %23 = load i64, ptr %2, align 8, !tbaa !3
  %24 = call i64 @llvm.smax.i64(i64 %23, i64 0)
  %25 = shl i64 %24, 3
  %26 = call ptr @malloc(i64 %25)
  store ptr %26, ptr @_QFEb.0, align 8, !tbaa !7
  %27 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 11)
  %28 = load i64, ptr %2, align 8, !tbaa !3
  %29 = icmp sgt i64 %28, 0
  br i1 %29, label %.lr.ph535, label %._crit_edge

.lr.ph535:                                        ; preds = %.lr.ph540, %.lr.ph535
  %30 = phi i64 [ %34, %.lr.ph535 ], [ 1, %.lr.ph540 ]
  %.unpack502 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %31 = add i64 %30, -1
  %32 = getelementptr i64, ptr %.unpack502, i64 %31
  %33 = call i1 @_FortranAioInputInteger(ptr %27, ptr %32, i32 8)
  %34 = add nuw i64 %30, 1
  %exitcond.not = icmp eq i64 %30, %28
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph535

._crit_edge:                                      ; preds = %.lr.ph535, %.lr.ph540
  %35 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %36 = load i64, ptr %2, align 8, !tbaa !3
  %37 = icmp sgt i64 %36, 0
  br i1 %37, label %.lr.ph537, label %._crit_edge.._crit_edge538_crit_edge

._crit_edge.._crit_edge538_crit_edge:             ; preds = %._crit_edge
  %.unpack466.pre = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  br label %._crit_edge538

.lr.ph537:                                        ; preds = %._crit_edge
  %.unpack478 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack485.unpack.unpack = load i64, ptr @_QFEa.7, align 8, !tbaa !7
  %.unpack490 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %xtraiter = and i64 %36, 1
  %38 = icmp eq i64 %36, 1
  br i1 %38, label %._crit_edge538.loopexit.unr-lcssa, label %.lr.ph537.new

.lr.ph537.new:                                    ; preds = %.lr.ph537
  %unroll_iter = and i64 %36, -2
  br label %39

39:                                               ; preds = %39, %.lr.ph537.new
  %40 = phi i64 [ 1, %.lr.ph537.new ], [ %54, %39 ]
  %niter = phi i64 [ 0, %.lr.ph537.new ], [ %niter.next.1, %39 ]
  %41 = add nsw i64 %40, -1
  %42 = getelementptr i64, ptr %.unpack490, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !3
  %44 = sub i64 %43, %.unpack485.unpack.unpack
  %45 = getelementptr i64, ptr %.unpack478, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !3
  %47 = add i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !3
  %48 = getelementptr i64, ptr %.unpack490, i64 %40
  %49 = load i64, ptr %48, align 8, !tbaa !3
  %50 = sub i64 %49, %.unpack485.unpack.unpack
  %51 = getelementptr i64, ptr %.unpack478, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !3
  %53 = add i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !3
  %54 = add nuw i64 %40, 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_edge538.loopexit.unr-lcssa, label %39

._crit_edge538.loopexit.unr-lcssa:                ; preds = %39, %.lr.ph537
  %.unr = phi i64 [ 1, %.lr.ph537 ], [ %54, %39 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge538, label %._crit_edge538.loopexit.epilog-lcssa

._crit_edge538.loopexit.epilog-lcssa:             ; preds = %._crit_edge538.loopexit.unr-lcssa
  %55 = add i64 %.unr, -1
  %56 = getelementptr i64, ptr %.unpack490, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !3
  %58 = sub i64 %57, %.unpack485.unpack.unpack
  %59 = getelementptr i64, ptr %.unpack478, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !3
  %61 = add i64 %60, 1
  store i64 %61, ptr %59, align 8, !tbaa !3
  br label %._crit_edge538

._crit_edge538:                                   ; preds = %._crit_edge538.loopexit.epilog-lcssa, %._crit_edge538.loopexit.unr-lcssa, %._crit_edge.._crit_edge538_crit_edge
  %.unpack466 = phi ptr [ %.unpack466.pre, %._crit_edge.._crit_edge538_crit_edge ], [ %.unpack490, %._crit_edge538.loopexit.unr-lcssa ], [ %.unpack490, %._crit_edge538.loopexit.epilog-lcssa ]
  call void @free(ptr %.unpack466)
  store ptr null, ptr @_QFEb.0, align 8, !tbaa !7
  %62 = add nsw i64 %19, -1
  %63 = icmp sgt i64 %19, 1
  br i1 %63, label %.lr.ph540, label %._crit_edge541

._crit_edge541:                                   ; preds = %._crit_edge538, %.loopexit
  %64 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 17)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack440.unpack.unpack442 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %65 = shl i64 %.unpack440.unpack.unpack442, 2
  %66 = call ptr @malloc(i64 %65)
  %67 = icmp sgt i64 %.unpack440.unpack.unpack442, 0
  br i1 %67, label %.lr.ph543.preheader, label %._crit_edge544

.lr.ph543.preheader:                              ; preds = %._crit_edge541
  %min.iters.check = icmp ult i64 %.unpack440.unpack.unpack442, 10
  br i1 %min.iters.check, label %.lr.ph543.preheader551, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph543.preheader
  %68 = shl i64 %.unpack440.unpack.unpack442, 2
  %uglygep = getelementptr i8, ptr %66, i64 %68
  %69 = shl i64 %.unpack440.unpack.unpack442, 3
  %uglygep549 = getelementptr i8, ptr %.unpack, i64 %69
  %bound0 = icmp ult ptr %66, %uglygep549
  %bound1 = icmp ult ptr %.unpack, %uglygep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph543.preheader551, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %.unpack440.unpack.unpack442, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %70 = getelementptr i64, ptr %.unpack, i64 %index
  %wide.load = load <2 x i64>, ptr %70, align 8, !tbaa !3, !alias.scope !9
  %71 = getelementptr i64, ptr %70, i64 2
  %wide.load550 = load <2 x i64>, ptr %71, align 8, !tbaa !3, !alias.scope !9
  %72 = icmp eq <2 x i64> %wide.load, zeroinitializer
  %73 = icmp eq <2 x i64> %wide.load550, zeroinitializer
  %74 = zext <2 x i1> %72 to <2 x i32>
  %75 = zext <2 x i1> %73 to <2 x i32>
  %76 = getelementptr i32, ptr %66, i64 %index
  store <2 x i32> %74, ptr %76, align 4, !tbaa !3, !alias.scope !12, !noalias !9
  %77 = getelementptr i32, ptr %76, i64 2
  store <2 x i32> %75, ptr %77, align 4, !tbaa !3, !alias.scope !12, !noalias !9
  %index.next = add nuw i64 %index, 4
  %78 = icmp eq i64 %index.next, %n.vec
  br i1 %78, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.unpack440.unpack.unpack442, %n.vec
  br i1 %cmp.n, label %._crit_edge544, label %.lr.ph543.preheader551

.lr.ph543.preheader551:                           ; preds = %vector.memcheck, %.lr.ph543.preheader, %middle.block
  %.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph543.preheader ], [ %n.vec, %middle.block ]
  %79 = xor i64 %.ph, -1
  %80 = add i64 %.unpack440.unpack.unpack442, %79
  %xtraiter552 = and i64 %.unpack440.unpack.unpack442, 3
  %lcmp.mod553.not = icmp eq i64 %xtraiter552, 0
  br i1 %lcmp.mod553.not, label %.lr.ph543.prol.loopexit, label %.lr.ph543.prol

.lr.ph543.prol:                                   ; preds = %.lr.ph543.preheader551, %.lr.ph543.prol
  %81 = phi i64 [ %86, %.lr.ph543.prol ], [ %.ph, %.lr.ph543.preheader551 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph543.prol ], [ 0, %.lr.ph543.preheader551 ]
  %82 = getelementptr i64, ptr %.unpack, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !3
  %84 = icmp eq i64 %83, 0
  %85 = zext i1 %84 to i32
  %86 = add nuw nsw i64 %81, 1
  %87 = getelementptr i32, ptr %66, i64 %81
  store i32 %85, ptr %87, align 4, !tbaa !3
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter552
  br i1 %prol.iter.cmp.not, label %.lr.ph543.prol.loopexit, label %.lr.ph543.prol, !llvm.loop !17

.lr.ph543.prol.loopexit:                          ; preds = %.lr.ph543.prol, %.lr.ph543.preheader551
  %.unr554 = phi i64 [ %.ph, %.lr.ph543.preheader551 ], [ %86, %.lr.ph543.prol ]
  %88 = icmp ult i64 %80, 3
  br i1 %88, label %._crit_edge544, label %.lr.ph543

.lr.ph543:                                        ; preds = %.lr.ph543.prol.loopexit, %.lr.ph543
  %89 = phi i64 [ %112, %.lr.ph543 ], [ %.unr554, %.lr.ph543.prol.loopexit ]
  %90 = getelementptr i64, ptr %.unpack, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !3
  %92 = icmp eq i64 %91, 0
  %93 = zext i1 %92 to i32
  %94 = add nuw nsw i64 %89, 1
  %95 = getelementptr i32, ptr %66, i64 %89
  store i32 %93, ptr %95, align 4, !tbaa !3
  %96 = getelementptr i64, ptr %.unpack, i64 %94
  %97 = load i64, ptr %96, align 8, !tbaa !3
  %98 = icmp eq i64 %97, 0
  %99 = zext i1 %98 to i32
  %100 = add nuw nsw i64 %89, 2
  %101 = getelementptr i32, ptr %66, i64 %94
  store i32 %99, ptr %101, align 4, !tbaa !3
  %102 = getelementptr i64, ptr %.unpack, i64 %100
  %103 = load i64, ptr %102, align 8, !tbaa !3
  %104 = icmp eq i64 %103, 0
  %105 = zext i1 %104 to i32
  %106 = add nuw nsw i64 %89, 3
  %107 = getelementptr i32, ptr %66, i64 %100
  store i32 %105, ptr %107, align 4, !tbaa !3
  %108 = getelementptr i64, ptr %.unpack, i64 %106
  %109 = load i64, ptr %108, align 8, !tbaa !3
  %110 = icmp eq i64 %109, 0
  %111 = zext i1 %110 to i32
  %112 = add nuw nsw i64 %89, 4
  %113 = getelementptr i32, ptr %66, i64 %106
  store i32 %111, ptr %113, align 4, !tbaa !3
  %exitcond547.not.3 = icmp eq i64 %112, %.unpack440.unpack.unpack442
  br i1 %exitcond547.not.3, label %._crit_edge544, label %.lr.ph543, !llvm.loop !19

._crit_edge544:                                   ; preds = %.lr.ph543.prol.loopexit, %.lr.ph543, %middle.block, %._crit_edge541
  store ptr %66, 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 4, 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 14, 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 %.unpack440.unpack.unpack442, 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 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %114 = call i64 @_FortranACount(ptr nonnull %1, ptr nonnull @_QQcl.ea8c6a281dc600ab4bada374badf79ba, i32 17, i32 0)
  %115 = trunc i64 %114 to i32
  %116 = call i1 @_FortranAioOutputInteger32(ptr %64, i32 %115)
  call void @free(ptr %66)
  %117 = call i32 @_FortranAioEndIoStatement(ptr %64)
  %.unpack445 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  call void @free(ptr %.unpack445)
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEa.7, align 8, !tbaa !7
  store i64 0, ptr @_QFEa.8, align 8, !tbaa !7
  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 {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare i64 @_FortranACount(ptr, ptr, i32, i32) 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 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
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 = !{!10}
!10 = distinct !{!10, !11}
!11 = distinct !{!11, !"LVerDomain"}
!12 = !{!13}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !15}
