program main
    implicit none
    integer n,i,ans
    real(8) x,y,d
    read(*,*)n,d
    ans=0
    do i=1,n
        read(*,*)x,y
        if(sqrt(x**2+y**2)<=d)then
            ans=ans+1
        endif
    enddo
    write(*,*)ans
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"

@_QQcl.498eb9786fc370c68b7fc858cf69a202 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_852/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca double, align 8
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.498eb9786fc370c68b7fc858cf69a202, i32 5)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 4)
  %7 = call i1 @_FortranAioInputReal64(ptr %5, ptr nonnull %1)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %9 = load i32, ptr %2, align 4, !tbaa !3
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %11 = zext i32 %9 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %12 = phi i64 [ %26, %.lr.ph ], [ %11, %.lr.ph.preheader ]
  %.04 = phi i32 [ %.1, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.498eb9786fc370c68b7fc858cf69a202, i32 8)
  %14 = call i1 @_FortranAioInputReal64(ptr %13, ptr nonnull %3)
  %15 = call i1 @_FortranAioInputReal64(ptr %13, ptr nonnull %4)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %13)
  %17 = load double, ptr %3, align 8, !tbaa !3
  %18 = fmul double %17, %17
  %19 = load double, ptr %4, align 8, !tbaa !3
  %20 = fmul double %19, %19
  %21 = fadd contract double %18, %20
  %22 = call contract double @llvm.sqrt.f64(double %21)
  %23 = load double, ptr %1, align 8, !tbaa !3
  %24 = fcmp ole double %22, %23
  %25 = zext i1 %24 to i32
  %.1 = add i32 %.04, %25
  %26 = add nsw i64 %12, -1
  %27 = icmp ugt i64 %12, 1
  br i1 %27, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.0.lcssa = phi i32 [ 0, %0 ], [ %.1, %.lr.ph ]
  %28 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.498eb9786fc370c68b7fc858cf69a202, i32 13)
  %29 = call i1 @_FortranAioOutputInteger32(ptr %28, i32 %.0.lcssa)
  %30 = call i32 @_FortranAioEndIoStatement(ptr %28)
  ret void
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputReal64(ptr, ptr) 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #0

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable 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"}
