Program ABC121A

integer n,m,c,i,j,x,w
integer,allocatable::a(:,:),b(:)

read(*,*) n,m,c
allocate(a(n,m))
allocate(b(m))
read(*,*) b
read(*,*) ((a(i,j),j=1,m),i=1,n)
x=0

do i=1,n
 w=c
 do j=1,m
  w=w+a(i,j)*b(j)
 end do
 if (w>0) then
  x=x+1
 end if
end do

write(*,*) x


stop
end
; 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.8 = internal unnamed_addr global i64 0
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEb.8 = internal unnamed_addr global i64 0
@_QQcl.d6d0d835958344fc60ff90e9ee0e5883 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4735/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

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %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
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6d0d835958344fc60ff90e9ee0e5883, 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 i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 4)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %10 = load i32, ptr %4, align 4, !tbaa !3
  %11 = load i32, ptr %3, align 4, !tbaa !3
  %12 = call i32 @llvm.smax.i32(i32 %10, i32 0)
  %13 = zext i32 %12 to i64
  %14 = call i32 @llvm.smax.i32(i32 %11, i32 0)
  %15 = zext i32 %14 to i64
  %16 = shl nuw nsw i64 %13, 2
  %17 = mul nuw i64 %16, %15
  %18 = call ptr @malloc(i64 %17)
  store ptr %18, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %13, ptr @_QFEa.8, align 8, !tbaa !7
  %19 = shl nuw nsw i64 %15, 2
  %20 = call ptr @malloc(i64 %19)
  store ptr %20, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %15, ptr @_QFEb.8, align 8, !tbaa !7
  %21 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6d0d835958344fc60ff90e9ee0e5883, i32 9)
  %.unpack = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack224.unpack.unpack226 = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  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 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 9, 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 %.unpack224.unpack.unpack226, 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
  %22 = call i1 @_FortranAioInputDescriptor(ptr %21, ptr nonnull %1)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %21)
  %24 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d6d0d835958344fc60ff90e9ee0e5883, i32 10)
  %25 = load i32, ptr %4, align 4, !tbaa !3
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph275.preheader, label %._crit_edge276

.lr.ph275.preheader:                              ; preds = %0
  %27 = zext i32 %25 to i64
  br label %.lr.ph275

.lr.ph275:                                        ; preds = %.lr.ph275.preheader, %._crit_edge
  %28 = phi i64 [ %43, %._crit_edge ], [ 1, %.lr.ph275.preheader ]
  %29 = load i32, ptr %3, align 4, !tbaa !3
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph275
  %31 = zext i32 %29 to i64
  %sext = shl i64 %28, 32
  %32 = ashr exact i64 %sext, 32
  %33 = add nsw i64 %32, -1
  br label %34

34:                                               ; preds = %.lr.ph, %34
  %35 = phi i64 [ 1, %.lr.ph ], [ %42, %34 ]
  %.unpack257 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack264.unpack.unpack267 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %sext273 = shl i64 %35, 32
  %36 = ashr exact i64 %sext273, 32
  %37 = add nsw i64 %36, -1
  %38 = mul i64 %37, %.unpack264.unpack.unpack267
  %39 = add i64 %33, %38
  %40 = getelementptr i32, ptr %.unpack257, i64 %39
  %41 = call i1 @_FortranAioInputInteger(ptr %24, ptr %40, i32 4)
  %42 = add nuw nsw i64 %35, 1
  %exitcond.not = icmp eq i64 %35, %31
  br i1 %exitcond.not, label %._crit_edge, label %34

._crit_edge:                                      ; preds = %34, %.lr.ph275
  %43 = add nuw nsw i64 %28, 1
  %exitcond287.not = icmp eq i64 %28, %27
  br i1 %exitcond287.not, label %._crit_edge276, label %.lr.ph275

._crit_edge276:                                   ; preds = %._crit_edge, %0
  %44 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %45 = load i32, ptr %4, align 4, !tbaa !3
  %46 = sext i32 %45 to i64
  %47 = icmp sgt i32 %45, 0
  br i1 %47, label %.lr.ph283, label %._crit_edge284

.lr.ph283:                                        ; preds = %._crit_edge276
  %48 = load i32, ptr %2, align 4, !tbaa !3
  %49 = load i32, ptr %3, align 4, !tbaa !3
  %50 = icmp sgt i32 %49, 0
  %.unpack229 = load ptr, ptr @_QFEa.0, align 8
  %.unpack236.unpack.unpack239 = load i64, ptr @_QFEa.8, align 8
  %.unpack245 = load ptr, ptr @_QFEb.0, align 8
  br i1 %50, label %.lr.ph279.us.preheader, label %.lr.ph283.split

.lr.ph279.us.preheader:                           ; preds = %.lr.ph283
  %51 = zext i32 %49 to i64
  %min.iters.check = icmp ugt i32 %49, 7
  %ident.check.not = icmp eq i64 %.unpack236.unpack.unpack239, 1
  %or.cond = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  %n.vec = and i64 %51, 4294967288
  %ind.end = or i64 %n.vec, 1
  %52 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %48, i64 0
  %cmp.n = icmp eq i64 %n.vec, %51
  %xtraiter = and i64 %51, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph279.us

.lr.ph279.us:                                     ; preds = %.lr.ph279.us.preheader, %._crit_edge280.us
  %indvars.iv290 = phi i64 [ 1, %.lr.ph279.us.preheader ], [ %indvars.iv.next291, %._crit_edge280.us ]
  %.0281.us = phi i32 [ 0, %.lr.ph279.us.preheader ], [ %spec.select.us, %._crit_edge280.us ]
  %53 = add nsw i64 %indvars.iv290, -1
  br i1 %or.cond, label %vector.body, label %scalar.ph.preheader

vector.body:                                      ; preds = %.lr.ph279.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph279.us ]
  %vec.phi = phi <4 x i32> [ %62, %vector.body ], [ %52, %.lr.ph279.us ]
  %vec.phi294 = phi <4 x i32> [ %63, %vector.body ], [ zeroinitializer, %.lr.ph279.us ]
  %54 = mul i64 %index, %.unpack236.unpack.unpack239
  %55 = add i64 %53, %54
  %56 = getelementptr i32, ptr %.unpack229, i64 %55
  %wide.load = load <4 x i32>, ptr %56, align 4, !tbaa !3
  %57 = getelementptr i32, ptr %56, i64 4
  %wide.load295 = load <4 x i32>, ptr %57, align 4, !tbaa !3
  %58 = getelementptr i32, ptr %.unpack245, i64 %index
  %wide.load296 = load <4 x i32>, ptr %58, align 4, !tbaa !3
  %59 = getelementptr i32, ptr %58, i64 4
  %wide.load297 = load <4 x i32>, ptr %59, align 4, !tbaa !3
  %60 = mul <4 x i32> %wide.load296, %wide.load
  %61 = mul <4 x i32> %wide.load297, %wide.load295
  %62 = add <4 x i32> %60, %vec.phi
  %63 = add <4 x i32> %61, %vec.phi294
  %index.next = add nuw i64 %index, 8
  %64 = icmp eq i64 %index.next, %n.vec
  br i1 %64, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %63, %62
  %65 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge280.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph279.us, %middle.block
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph279.us ], [ %ind.end, %middle.block ]
  %.0192277.us.ph = phi i32 [ %48, %.lr.ph279.us ], [ %65, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %66 = add nsw i64 %indvars.iv.ph, -1
  %67 = mul i64 %66, %.unpack236.unpack.unpack239
  %68 = add i64 %53, %67
  %69 = getelementptr i32, ptr %.unpack229, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !3
  %71 = add nsw i64 %indvars.iv.ph, -1
  %72 = getelementptr i32, ptr %.unpack245, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !3
  %74 = mul i32 %73, %70
  %75 = add i32 %74, %.0192277.us.ph
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.lcssa300.unr = phi i32 [ undef, %scalar.ph.preheader ], [ %75, %scalar.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %.0192277.us.unr = phi i32 [ %.0192277.us.ph, %scalar.ph.preheader ], [ %75, %scalar.ph.prol ]
  %76 = icmp eq i64 %indvars.iv.ph, %51
  br i1 %76, label %._crit_edge280.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %.0192277.us = phi i32 [ %94, %scalar.ph ], [ %.0192277.us.unr, %scalar.ph.prol.loopexit ]
  %77 = add i64 %indvars.iv, -1
  %78 = mul i64 %77, %.unpack236.unpack.unpack239
  %79 = add i64 %53, %78
  %80 = getelementptr i32, ptr %.unpack229, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !3
  %82 = add i64 %indvars.iv, -1
  %83 = getelementptr i32, ptr %.unpack245, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !3
  %85 = mul i32 %84, %81
  %86 = add i32 %85, %.0192277.us
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %87 = mul i64 %indvars.iv, %.unpack236.unpack.unpack239
  %88 = add i64 %53, %87
  %89 = getelementptr i32, ptr %.unpack229, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !3
  %91 = getelementptr i32, ptr %.unpack245, i64 %indvars.iv
  %92 = load i32, ptr %91, align 4, !tbaa !3
  %93 = mul i32 %92, %90
  %94 = add i32 %93, %86
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond289.not.1 = icmp eq i64 %indvars.iv.next, %51
  br i1 %exitcond289.not.1, label %._crit_edge280.us, label %scalar.ph, !llvm.loop !12

._crit_edge280.us:                                ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %65, %middle.block ], [ %.lcssa300.unr, %scalar.ph.prol.loopexit ], [ %94, %scalar.ph ]
  %95 = icmp sgt i32 %.lcssa, 0
  %96 = zext i1 %95 to i32
  %spec.select.us = add i32 %.0281.us, %96
  %indvars.iv.next291 = add nuw nsw i64 %indvars.iv290, 1
  %exitcond293.not = icmp eq i64 %indvars.iv290, %46
  br i1 %exitcond293.not, label %._crit_edge284, label %.lr.ph279.us

.lr.ph283.split:                                  ; preds = %.lr.ph283
  %97 = icmp sgt i32 %48, 0
  %98 = select i1 %97, i32 %45, i32 0
  br label %._crit_edge284

._crit_edge284:                                   ; preds = %._crit_edge280.us, %.lr.ph283.split, %._crit_edge276
  %.0.lcssa = phi i32 [ 0, %._crit_edge276 ], [ %98, %.lr.ph283.split ], [ %spec.select.us, %._crit_edge280.us ]
  %99 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.d6d0d835958344fc60ff90e9ee0e5883, i32 23)
  %100 = call i1 @_FortranAioOutputInteger32(ptr %99, i32 %.0.lcssa)
  %101 = call i32 @_FortranAioEndIoStatement(ptr %99)
  %102 = 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 i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 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, !10}
