program two
  implicit none
  integer :: i
  integer :: n, h, w
  integer, allocatable :: a(:), b(:)
  integer :: count

  count=0

  read(*,*)n,h,w
  
  allocate(a(n))
  allocate(b(n))
  
  do i=1,n
     read(*,*)a(i),b(i)
  end do

  do i=1,n
     if (h<=a(i) .and. w<=b(i)) then
        count=count+1
     end if
  end do

  write(*,*)count

end program two
; 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
@_QQcl.f15eebf9dbd054743c1e1ea7c94efa11 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5241/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

define void @_QQmain() local_unnamed_addr {
  %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.f15eebf9dbd054743c1e1ea7c94efa11, i32 10)
  %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 %2, 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 = call ptr @malloc(i64 %12)
  store ptr %14, ptr @_QFEb.0, align 8, !tbaa !7
  %15 = icmp sgt i32 %9, 0
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge204

.lr.ph.preheader:                                 ; preds = %0
  %16 = 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 ]
  %17 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f15eebf9dbd054743c1e1ea7c94efa11, i32 16)
  %.unpack177 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %18 = add nsw i64 %indvars.iv, -1
  %19 = getelementptr i32, ptr %.unpack177, i64 %18
  %20 = call i1 @_FortranAioInputInteger(ptr %17, ptr %19, i32 4)
  %.unpack189 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %21 = add nsw i64 %indvars.iv, -1
  %22 = getelementptr i32, ptr %.unpack189, i64 %21
  %23 = call i1 @_FortranAioInputInteger(ptr %17, ptr %22, i32 4)
  %24 = call i32 @_FortranAioEndIoStatement(ptr %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %16
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  %25 = icmp sgt i32 %.pre, 0
  br i1 %25, label %.lr.ph203, label %._crit_edge204

.lr.ph203:                                        ; preds = %._crit_edge
  %26 = zext i32 %.pre to i64
  %27 = load i32, ptr %1, align 4, !tbaa !3
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %28 = load i32, ptr %3, align 4, !tbaa !3
  %.unpack165 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %min.iters.check = icmp ult i32 %.pre, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph203
  %n.vec = and i64 %26, 4294967288
  %ind.end = or i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %27, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert212 = insertelement <4 x i32> poison, i32 %27, i64 0
  %broadcast.splat213 = shufflevector <4 x i32> %broadcast.splatinsert212, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert216 = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat217 = shufflevector <4 x i32> %broadcast.splatinsert216, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert218 = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat219 = shufflevector <4 x i32> %broadcast.splatinsert218, <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 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ]
  %vec.phi210 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ]
  %29 = getelementptr i32, ptr %.unpack, i64 %index
  %wide.load = load <4 x i32>, ptr %29, align 4, !tbaa !3
  %30 = getelementptr i32, ptr %29, i64 4
  %wide.load211 = load <4 x i32>, ptr %30, align 4, !tbaa !3
  %31 = icmp sle <4 x i32> %broadcast.splat, %wide.load
  %32 = icmp sle <4 x i32> %broadcast.splat213, %wide.load211
  %33 = getelementptr i32, ptr %.unpack165, i64 %index
  %wide.load214 = load <4 x i32>, ptr %33, align 4, !tbaa !3
  %34 = getelementptr i32, ptr %33, i64 4
  %wide.load215 = load <4 x i32>, ptr %34, align 4, !tbaa !3
  %35 = icmp sle <4 x i32> %broadcast.splat217, %wide.load214
  %36 = icmp sle <4 x i32> %broadcast.splat219, %wide.load215
  %37 = and <4 x i1> %31, %35
  %38 = and <4 x i1> %32, %36
  %39 = zext <4 x i1> %37 to <4 x i32>
  %40 = zext <4 x i1> %38 to <4 x i32>
  %41 = add <4 x i32> %vec.phi, %39
  %42 = add <4 x i32> %vec.phi210, %40
  %index.next = add nuw i64 %index, 8
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %42, %41
  %44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %26
  br i1 %cmp.n, label %._crit_edge204, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph203, %middle.block
  %indvars.iv206.ph = phi i64 [ 1, %.lr.ph203 ], [ %ind.end, %middle.block ]
  %.0201.ph = phi i32 [ 0, %.lr.ph203 ], [ %44, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv206 = phi i64 [ %indvars.iv.next207, %scalar.ph ], [ %indvars.iv206.ph, %scalar.ph.preheader ]
  %.0201 = phi i32 [ %spec.select, %scalar.ph ], [ %.0201.ph, %scalar.ph.preheader ]
  %45 = add i64 %indvars.iv206, -1
  %46 = getelementptr i32, ptr %.unpack, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !3
  %48 = icmp sle i32 %27, %47
  %49 = add i64 %indvars.iv206, -1
  %50 = getelementptr i32, ptr %.unpack165, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !3
  %52 = icmp sle i32 %28, %51
  %53 = and i1 %48, %52
  %54 = zext i1 %53 to i32
  %spec.select = add i32 %.0201, %54
  %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
  %exitcond209.not = icmp eq i64 %indvars.iv206, %26
  br i1 %exitcond209.not, label %._crit_edge204, label %scalar.ph, !llvm.loop !12

._crit_edge204:                                   ; preds = %scalar.ph, %middle.block, %0, %._crit_edge
  %.0.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %44, %middle.block ], [ %spec.select, %scalar.ph ]
  %55 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f15eebf9dbd054743c1e1ea7c94efa11, i32 25)
  %56 = call i1 @_FortranAioOutputInteger32(ptr %55, i32 %.0.lcssa)
  %57 = call i32 @_FortranAioEndIoStatement(ptr %55)
  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 ptr @_FortranAioBeginExternalListOutput(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) #1

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