program main
  implicit none
  integer :: n, i, j, k, d, a(100)
  integer :: pena(100)
  pena(:) = 0
  read *, n, k
  pena(1:n) = 1
  do i = 1, k
    read *, d
    read *, a(1:d)
    do j = 1, d
      pena(a(j)) = 0
    end do
  end do
  print "(i0)", sum(pena)
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 = internal global [100 x i32] undef
@_QFEpena = internal unnamed_addr global [100 x i32] undef
@_QQcl.c55ddd8e3721e01bd181f19a3c7a73e5 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1485/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @_QFEpena, i8 0, i64 400, i1 false), !tbaa !3
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c55ddd8e3721e01bd181f19a3c7a73e5, i32 6)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %9 = load i32, ptr %4, align 4, !tbaa !3
  %.not = icmp slt i32 %9, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %10 = zext i32 %9 to i64
  %min.iters.check = icmp ult i32 %9, 8
  br i1 %min.iters.check, label %.lr.ph.preheader31, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %10, 4294967288
  %ind.end = and i64 %10, 7
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %11 = getelementptr i32, ptr @_QFEpena, i64 %index
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %11, align 16, !tbaa !3
  %12 = getelementptr i32, ptr %11, i64 4
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %12, align 16, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !7

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %10
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader31

.lr.ph.preheader31:                               ; preds = %.lr.ph.preheader, %middle.block
  %.ph = phi i64 [ %10, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.ph32 = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader31, %.lr.ph
  %14 = phi i64 [ %18, %.lr.ph ], [ %.ph, %.lr.ph.preheader31 ]
  %15 = phi i64 [ %16, %.lr.ph ], [ %.ph32, %.lr.ph.preheader31 ]
  %16 = add nuw nsw i64 %15, 1
  %17 = getelementptr i32, ptr @_QFEpena, i64 %15
  store i32 1, ptr %17, align 4, !tbaa !3
  %18 = add nsw i64 %14, -1
  %19 = icmp ugt i64 %14, 1
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %0
  %20 = load i32, ptr %3, align 4, !tbaa !3
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph20, label %.lr.ph.i

.lr.ph20:                                         ; preds = %._crit_edge
  %22 = zext i32 %20 to i64
  %.fca.1.gep4 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep5 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep6 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep7 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep8 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep9 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep10 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep11 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep12 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  br label %23

23:                                               ; preds = %.lr.ph20, %._crit_edge18
  %24 = phi i64 [ %22, %.lr.ph20 ], [ %55, %._crit_edge18 ]
  %25 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c55ddd8e3721e01bd181f19a3c7a73e5, i32 9)
  %26 = call i1 @_FortranAioInputInteger(ptr %25, ptr nonnull %2, i32 4)
  %27 = call i32 @_FortranAioEndIoStatement(ptr %25)
  %28 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c55ddd8e3721e01bd181f19a3c7a73e5, i32 10)
  %29 = load i32, ptr %2, align 4, !tbaa !3
  %30 = call i32 @llvm.smax.i32(i32 %29, i32 0)
  %31 = zext i32 %30 to i64
  store ptr @_QFEa, ptr %1, align 8, !tbaa !11
  store i64 4, ptr %.fca.1.gep4, align 8, !tbaa !11
  store i32 20180515, ptr %.fca.2.gep5, align 8, !tbaa !11
  store i8 1, ptr %.fca.3.gep6, align 4, !tbaa !11
  store i8 9, ptr %.fca.4.gep7, align 1, !tbaa !11
  store i8 0, ptr %.fca.5.gep8, align 2, !tbaa !11
  store i8 0, ptr %.fca.6.gep9, align 1, !tbaa !11
  store i64 1, ptr %.fca.7.0.0.gep10, align 8, !tbaa !11
  store i64 %31, ptr %.fca.7.0.1.gep11, align 8, !tbaa !11
  store i64 4, ptr %.fca.7.0.2.gep12, align 8, !tbaa !11
  %32 = call i1 @_FortranAioInputDescriptor(ptr %28, ptr nonnull %1)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %28)
  %34 = load i32, ptr %2, align 4, !tbaa !3
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph17.preheader, label %._crit_edge18

.lr.ph17.preheader:                               ; preds = %23
  %36 = zext i32 %34 to i64
  %xtraiter = and i64 %36, 1
  %37 = icmp eq i32 %34, 1
  br i1 %37, label %._crit_edge18.loopexit.unr-lcssa, label %.lr.ph17.preheader.new

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

.lr.ph17:                                         ; preds = %.lr.ph17, %.lr.ph17.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph17.preheader.new ], [ %indvars.iv.next.1, %.lr.ph17 ]
  %niter = phi i64 [ 0, %.lr.ph17.preheader.new ], [ %niter.next.1, %.lr.ph17 ]
  %38 = add nsw i64 %indvars.iv, -1
  %39 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !3
  %41 = sext i32 %40 to i64
  %42 = add nsw i64 %41, -1
  %43 = getelementptr [100 x i32], ptr @_QFEpena, i64 0, i64 %42
  store i32 0, ptr %43, align 4, !tbaa !3
  %44 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %indvars.iv
  %45 = load i32, ptr %44, align 4, !tbaa !3
  %46 = sext i32 %45 to i64
  %47 = add nsw i64 %46, -1
  %48 = getelementptr [100 x i32], ptr @_QFEpena, i64 0, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !3
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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_edge18.loopexit.unr-lcssa, label %.lr.ph17

._crit_edge18.loopexit.unr-lcssa:                 ; preds = %.lr.ph17, %.lr.ph17.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph17.preheader ], [ %indvars.iv.next.1, %.lr.ph17 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge18, label %.lr.ph17.epil

.lr.ph17.epil:                                    ; preds = %._crit_edge18.loopexit.unr-lcssa
  %49 = add nsw i64 %indvars.iv.unr, -1
  %50 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !3
  %52 = sext i32 %51 to i64
  %53 = add nsw i64 %52, -1
  %54 = getelementptr [100 x i32], ptr @_QFEpena, i64 0, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !3
  br label %._crit_edge18

._crit_edge18:                                    ; preds = %.lr.ph17.epil, %._crit_edge18.loopexit.unr-lcssa, %23
  %55 = add nsw i64 %24, -1
  %56 = icmp sgt i64 %24, 1
  br i1 %56, label %23, label %.lr.ph.i

.lr.ph.i:                                         ; preds = %._crit_edge18, %._crit_edge
  %57 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.c55ddd8e3721e01bd181f19a3c7a73e5, i32 15)
  %wide.load = load <4 x i32>, ptr @_QFEpena, align 16, !tbaa !3
  %wide.load.1 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 4), align 16, !tbaa !3
  %58 = add <4 x i32> %wide.load.1, %wide.load
  %wide.load.2 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 8), align 16, !tbaa !3
  %59 = add <4 x i32> %wide.load.2, %58
  %wide.load.3 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 12), align 16, !tbaa !3
  %60 = add <4 x i32> %wide.load.3, %59
  %wide.load.4 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 16), align 16, !tbaa !3
  %61 = add <4 x i32> %wide.load.4, %60
  %wide.load.5 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 20), align 16, !tbaa !3
  %62 = add <4 x i32> %wide.load.5, %61
  %wide.load.6 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 24), align 16, !tbaa !3
  %63 = add <4 x i32> %wide.load.6, %62
  %wide.load.7 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 28), align 16, !tbaa !3
  %64 = add <4 x i32> %wide.load.7, %63
  %wide.load.8 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 32), align 16, !tbaa !3
  %65 = add <4 x i32> %wide.load.8, %64
  %wide.load.9 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 36), align 16, !tbaa !3
  %66 = add <4 x i32> %wide.load.9, %65
  %wide.load.10 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 40), align 16, !tbaa !3
  %67 = add <4 x i32> %wide.load.10, %66
  %wide.load.11 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 44), align 16, !tbaa !3
  %68 = add <4 x i32> %wide.load.11, %67
  %wide.load.12 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 48), align 16, !tbaa !3
  %69 = add <4 x i32> %wide.load.12, %68
  %wide.load.13 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 52), align 16, !tbaa !3
  %70 = add <4 x i32> %wide.load.13, %69
  %wide.load.14 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 56), align 16, !tbaa !3
  %71 = add <4 x i32> %wide.load.14, %70
  %wide.load.15 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 60), align 16, !tbaa !3
  %72 = add <4 x i32> %wide.load.15, %71
  %wide.load.16 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 64), align 16, !tbaa !3
  %73 = add <4 x i32> %wide.load.16, %72
  %wide.load.17 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 68), align 16, !tbaa !3
  %74 = add <4 x i32> %wide.load.17, %73
  %wide.load.18 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 72), align 16, !tbaa !3
  %75 = add <4 x i32> %wide.load.18, %74
  %wide.load.19 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 76), align 16, !tbaa !3
  %76 = add <4 x i32> %wide.load.19, %75
  %wide.load.20 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 80), align 16, !tbaa !3
  %77 = add <4 x i32> %wide.load.20, %76
  %wide.load.21 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 84), align 16, !tbaa !3
  %78 = add <4 x i32> %wide.load.21, %77
  %wide.load.22 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 88), align 16, !tbaa !3
  %79 = add <4 x i32> %wide.load.22, %78
  %wide.load.23 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 92), align 16, !tbaa !3
  %80 = add <4 x i32> %wide.load.23, %79
  %wide.load.24 = load <4 x i32>, ptr getelementptr inbounds ([100 x i32], ptr @_QFEpena, i64 0, i64 96), align 16, !tbaa !3
  %81 = add <4 x i32> %wide.load.24, %80
  %82 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %81)
  %83 = call i1 @_FortranAioOutputInteger32(ptr %57, i32 %82)
  %84 = call i32 @_FortranAioEndIoStatement(ptr %57)
  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 ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, 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) #0

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

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!7, !8, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !9, !8}
!11 = !{!12, !12, i64 0}
!12 = !{!"descriptor member", !5, i64 0}
