program golf

 implicit none
 integer :: k,a,b,i,j

 read*,k,a,b

 j=0
 do i=1,1000
   if(k*i>=a .and. k*i<=b) j=j+1
 end do

 if(j>=1) print*,'OK'
 if(j==0) print*,'NG'

end program golf

 
; 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.22ee964bfc79a2c2270877fa93b2e069 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1542/source.f\00"
@_QQcl.4F4B = linkonce constant [2 x i8] c"OK"
@_QQcl.4E47 = linkonce constant [2 x i8] c"NG"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
vector.ph:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.22ee964bfc79a2c2270877fa93b2e069, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %0, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %8 = load i32, ptr %1, align 4, !tbaa !3
  %9 = load i32, ptr %0, align 4, !tbaa !3
  %10 = load i32, ptr %2, align 4, !tbaa !3
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %10, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert10 = insertelement <4 x i32> poison, i32 %10, i64 0
  %broadcast.splat11 = shufflevector <4 x i32> %broadcast.splatinsert10, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert12 = insertelement <4 x i32> poison, i32 %9, i64 0
  %broadcast.splat13 = shufflevector <4 x i32> %broadcast.splatinsert12, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert14 = insertelement <4 x i32> poison, i32 %9, i64 0
  %broadcast.splat15 = shufflevector <4 x i32> %broadcast.splatinsert14, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert16 = insertelement <4 x i32> poison, i32 %8, i64 0
  %broadcast.splat17 = shufflevector <4 x i32> %broadcast.splatinsert16, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert18 = insertelement <4 x i32> poison, i32 %8, i64 0
  %broadcast.splat19 = shufflevector <4 x i32> %broadcast.splatinsert18, <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.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
  %vec.phi9 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %11 = mul <4 x i32> %broadcast.splat, %vec.ind
  %12 = mul <4 x i32> %broadcast.splat11, %step.add
  %13 = icmp sge <4 x i32> %11, %broadcast.splat13
  %14 = icmp sge <4 x i32> %12, %broadcast.splat15
  %15 = icmp sle <4 x i32> %11, %broadcast.splat17
  %16 = icmp sle <4 x i32> %12, %broadcast.splat19
  %17 = and <4 x i1> %13, %15
  %18 = and <4 x i1> %14, %16
  %19 = zext <4 x i1> %17 to <4 x i32>
  %20 = zext <4 x i1> %18 to <4 x i32>
  %21 = add <4 x i32> %vec.phi, %19
  %22 = add <4 x i32> %vec.phi9, %20
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %23 = icmp eq i64 %index.next, 1000
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !7

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %22, %21
  %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.thread, label %28

.thread:                                          ; preds = %middle.block
  %26 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.22ee964bfc79a2c2270877fa93b2e069, i32 13)
  %27 = call i1 @_FortranAioOutputAscii(ptr %26, ptr nonnull @_QQcl.4F4B, i64 2)
  br label %.sink.split

28:                                               ; preds = %middle.block
  %29 = icmp eq i32 %24, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %28
  %31 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.22ee964bfc79a2c2270877fa93b2e069, i32 14)
  %32 = call i1 @_FortranAioOutputAscii(ptr %31, ptr nonnull @_QQcl.4E47, i64 2)
  br label %.sink.split

.sink.split:                                      ; preds = %30, %.thread
  %.sink = phi ptr [ %26, %.thread ], [ %31, %30 ]
  %33 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  br label %34

34:                                               ; preds = %.sink.split, %28
  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 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

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

attributes #0 = { 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"}
