program abc29
 implicit none
 integer(8)::N,D,i,ia,c=0
 integer(8),allocatable::a(:),b(:)
 read(*,*)N,D
 allocate(a(N),b(N))
 do i=1,N
  read(*,*)a(i),b(i)
 end do
 do ia=1,N
  if(a(ia)**2+b(ia)**2<=D**2)then
   c=c+1
  end if
 end do
 print'(i0)',c
 deallocate(a,b)
end program abc29
; 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
@_QFEc = internal unnamed_addr global i64 0
@_QQcl.086b49238e8996989bc4c384135083b6 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_854/source.f\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 i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.086b49238e8996989bc4c384135083b6, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 8)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 8)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i64, ptr %2, align 8, !tbaa !3
  %8 = call i64 @llvm.smax.i64(i64 %7, i64 0)
  %9 = shl i64 %8, 3
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEa.0, align 8, !tbaa !7
  %11 = call ptr @malloc(i64 %9)
  store ptr %11, ptr @_QFEb.0, align 8, !tbaa !7
  %12 = icmp sgt i64 %7, 0
  br i1 %12, label %.lr.ph, label %._crit_edge328

.lr.ph:                                           ; preds = %0, %.lr.ph
  %13 = phi i64 [ %22, %.lr.ph ], [ 1, %0 ]
  %14 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.086b49238e8996989bc4c384135083b6, i32 8)
  %.unpack302 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %15 = add i64 %13, -1
  %16 = getelementptr i64, ptr %.unpack302, i64 %15
  %17 = call i1 @_FortranAioInputInteger(ptr %14, ptr %16, i32 8)
  %.unpack314 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %18 = add i64 %13, -1
  %19 = getelementptr i64, ptr %.unpack314, i64 %18
  %20 = call i1 @_FortranAioInputInteger(ptr %14, ptr %19, i32 8)
  %21 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %22 = add nuw i64 %13, 1
  %exitcond.not = icmp eq i64 %13, %7
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i64, ptr %2, align 8, !tbaa !3
  %23 = icmp sgt i64 %.pre, 0
  br i1 %23, label %.lr.ph327, label %._crit_edge328

.lr.ph327:                                        ; preds = %._crit_edge
  %_QFEc.promoted = load i64, ptr @_QFEc, align 8, !tbaa !3
  %.unpack278 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack290 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %24 = load i64, ptr %1, align 8, !tbaa !3
  %25 = mul i64 %24, %24
  %xtraiter = and i64 %.pre, 1
  %26 = icmp eq i64 %.pre, 1
  br i1 %26, label %._crit_edge328.loopexit.unr-lcssa, label %.lr.ph327.new

.lr.ph327.new:                                    ; preds = %.lr.ph327
  %unroll_iter = and i64 %.pre, -2
  br label %27

27:                                               ; preds = %52, %.lr.ph327.new
  %28 = phi i64 [ 1, %.lr.ph327.new ], [ %54, %52 ]
  %29 = phi i64 [ %_QFEc.promoted, %.lr.ph327.new ], [ %53, %52 ]
  %niter = phi i64 [ 0, %.lr.ph327.new ], [ %niter.next.1, %52 ]
  %30 = add nsw i64 %28, -1
  %31 = getelementptr i64, ptr %.unpack278, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !3
  %33 = mul i64 %32, %32
  %34 = add nsw i64 %28, -1
  %35 = getelementptr i64, ptr %.unpack290, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !3
  %37 = mul i64 %36, %36
  %38 = add i64 %37, %33
  %.not = icmp sgt i64 %38, %25
  br i1 %.not, label %41, label %39

39:                                               ; preds = %27
  %40 = add i64 %29, 1
  store i64 %40, ptr @_QFEc, align 8, !tbaa !3
  br label %41

41:                                               ; preds = %39, %27
  %42 = phi i64 [ %40, %39 ], [ %29, %27 ]
  %43 = getelementptr i64, ptr %.unpack278, i64 %28
  %44 = load i64, ptr %43, align 8, !tbaa !3
  %45 = mul i64 %44, %44
  %46 = getelementptr i64, ptr %.unpack290, i64 %28
  %47 = load i64, ptr %46, align 8, !tbaa !3
  %48 = mul i64 %47, %47
  %49 = add i64 %48, %45
  %.not.1 = icmp sgt i64 %49, %25
  br i1 %.not.1, label %52, label %50

50:                                               ; preds = %41
  %51 = add i64 %42, 1
  store i64 %51, ptr @_QFEc, align 8, !tbaa !3
  br label %52

52:                                               ; preds = %50, %41
  %53 = phi i64 [ %51, %50 ], [ %42, %41 ]
  %54 = add nuw i64 %28, 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_edge328.loopexit.unr-lcssa.loopexit, label %27

._crit_edge328.loopexit.unr-lcssa.loopexit:       ; preds = %52
  %55 = add i64 %28, 1
  br label %._crit_edge328.loopexit.unr-lcssa

._crit_edge328.loopexit.unr-lcssa:                ; preds = %._crit_edge328.loopexit.unr-lcssa.loopexit, %.lr.ph327
  %.unr = phi i64 [ 0, %.lr.ph327 ], [ %55, %._crit_edge328.loopexit.unr-lcssa.loopexit ]
  %.unr330 = phi i64 [ %_QFEc.promoted, %.lr.ph327 ], [ %53, %._crit_edge328.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge328, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge328.loopexit.unr-lcssa
  %56 = getelementptr i64, ptr %.unpack278, i64 %.unr
  %57 = load i64, ptr %56, align 8, !tbaa !3
  %58 = mul i64 %57, %57
  %59 = getelementptr i64, ptr %.unpack290, i64 %.unr
  %60 = load i64, ptr %59, align 8, !tbaa !3
  %61 = mul i64 %60, %60
  %62 = add i64 %61, %58
  %.not.epil = icmp sgt i64 %62, %25
  br i1 %.not.epil, label %._crit_edge328, label %63

63:                                               ; preds = %.epil.preheader
  %64 = add i64 %.unr330, 1
  store i64 %64, ptr @_QFEc, align 8, !tbaa !3
  br label %._crit_edge328

._crit_edge328:                                   ; preds = %._crit_edge328.loopexit.unr-lcssa, %63, %.epil.preheader, %0, %._crit_edge
  %65 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.086b49238e8996989bc4c384135083b6, i32 15)
  %66 = load i64, ptr @_QFEc, align 8, !tbaa !3
  %67 = call i1 @_FortranAioOutputInteger64(ptr %65, i64 %66)
  %68 = call i32 @_FortranAioEndIoStatement(ptr %65)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  call void @free(ptr %.unpack)
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack266 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  call void @free(ptr %.unpack266)
  store ptr null, ptr @_QFEb.0, 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 ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

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) }

!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}
