program keyence
  implicit none
  character(len=100)::s
  character(len=7)::ke='keyence'
  integer :: i, k
  read(*,*) s
  s=trim(s)
  k=len_trim(s)

  do i = 1, 6
     if ( s(1:i)==ke(1:i) .and. s(k+i-6:k)==ke(i+1:7)) then
        write(*,*) 'YES'
        stop
     end if
  end do

  if ( s(1:7) == ke .or. s(k-6:k) == ke ) then
     write(*,*) 'YES'
     stop
  end if

  write(*,*) 'NO'
  
  stop
end program keyence
     

; 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"

@_QFEke = internal global [7 x i8] c"keyence"
@_QFEs = internal global [100 x i8] undef
@_QQcl.897272c37f83d9c71771a0a6b0693c93 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5107/source.f\00"
@_QQcl.594553 = linkonce constant [3 x i8] c"YES"
@_QQcl.4E4F = linkonce constant [2 x i8] c"NO"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.897272c37f83d9c71771a0a6b0693c93, i32 6)
  %4 = tail call i1 @_FortranAioInputAscii(ptr %3, ptr nonnull @_QFEs, i64 100)
  %5 = tail call i32 @_FortranAioEndIoStatement(ptr %3)
  store ptr @_QFEs, ptr %1, align 8, !tbaa !3
  %.fca.1.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 100, ptr %.fca.1.gep15, align 8, !tbaa !3
  %.fca.2.gep16 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep16, align 8, !tbaa !3
  %.fca.3.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep17, align 4, !tbaa !3
  %.fca.4.gep18 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep18, align 1, !tbaa !3
  %.fca.5.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep19, align 2, !tbaa !3
  %.fca.6.gep20 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep20, align 1, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %6 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.897272c37f83d9c71771a0a6b0693c93, i32 7)
  %.fca.0.load = load ptr, ptr %2, align 8, !tbaa !3
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !3
  %7 = call i64 @llvm.smin.i64(i64 %.fca.1.load, i64 100)
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 16 @_QFEs, ptr align 1 %.fca.0.load, i64 %7, i1 false)
  %8 = sub i64 100, %7
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %uglygep = getelementptr i8, ptr @_QFEs, i64 %7
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep, i8 32, i64 %8, i1 false), !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %0
  call void @free(ptr %.fca.0.load)
  br label %10

10:                                               ; preds = %._crit_edge, %10
  %11 = phi i64 [ 99, %._crit_edge ], [ %15, %10 ]
  %12 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !7
  %14 = icmp eq i8 %13, 32
  %15 = add nsw i64 %11, -1
  %16 = icmp ne i64 %11, 0
  %17 = and i1 %14, %16
  br i1 %17, label %10, label %18

18:                                               ; preds = %10
  %19 = trunc i64 %11 to i32
  %20 = add i32 %19, 1
  %21 = select i1 %14, i32 0, i32 %20
  %22 = add i32 %21, -6
  %23 = sext i32 %21 to i64
  %24 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 1, i64 1)
  %25 = add i32 %21, -5
  %26 = sext i32 %25 to i64
  %27 = add nsw i64 %26, -1
  %28 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %27
  %29 = sub nsw i64 %23, %26
  %30 = call i64 @llvm.smax.i64(i64 %29, i64 -1)
  %31 = add nsw i64 %30, 1
  %32 = call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 1), i64 %31, i64 6)
  %33 = or i32 %32, %24
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %102, label %35

35:                                               ; preds = %18
  %36 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 2, i64 2)
  %37 = add i32 %21, -4
  %38 = sext i32 %37 to i64
  %39 = add nsw i64 %38, -1
  %40 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %39
  %41 = sub nsw i64 %23, %38
  %42 = call i64 @llvm.smax.i64(i64 %41, i64 -1)
  %43 = add nsw i64 %42, 1
  %44 = call i32 @_FortranACharacterCompareScalar1(ptr %40, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 2), i64 %43, i64 5)
  %45 = or i32 %44, %36
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %102, label %47

47:                                               ; preds = %35
  %48 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 3, i64 3)
  %49 = add i32 %21, -3
  %50 = sext i32 %49 to i64
  %51 = add nsw i64 %50, -1
  %52 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %51
  %53 = sub nsw i64 %23, %50
  %54 = call i64 @llvm.smax.i64(i64 %53, i64 -1)
  %55 = add nsw i64 %54, 1
  %56 = call i32 @_FortranACharacterCompareScalar1(ptr %52, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 3), i64 %55, i64 4)
  %57 = or i32 %56, %48
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %102, label %59

59:                                               ; preds = %47
  %60 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 4, i64 4)
  %61 = add i32 %21, -2
  %62 = sext i32 %61 to i64
  %63 = add nsw i64 %62, -1
  %64 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %63
  %65 = sub nsw i64 %23, %62
  %66 = call i64 @llvm.smax.i64(i64 %65, i64 -1)
  %67 = add nsw i64 %66, 1
  %68 = call i32 @_FortranACharacterCompareScalar1(ptr %64, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 4), i64 %67, i64 3)
  %69 = or i32 %68, %60
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %102, label %71

71:                                               ; preds = %59
  %72 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 5, i64 5)
  %73 = add i32 %21, -1
  %74 = sext i32 %73 to i64
  %75 = add nsw i64 %74, -1
  %76 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %75
  %77 = sub nsw i64 %23, %74
  %78 = call i64 @llvm.smax.i64(i64 %77, i64 -1)
  %79 = add nsw i64 %78, 1
  %80 = call i32 @_FortranACharacterCompareScalar1(ptr %76, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 5), i64 %79, i64 2)
  %81 = or i32 %80, %72
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %102, label %83

83:                                               ; preds = %71
  %84 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 6, i64 6)
  %85 = add nsw i64 %23, -1
  %86 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %85
  %87 = call i32 @_FortranACharacterCompareScalar1(ptr %86, ptr nonnull getelementptr inbounds ([7 x i8], ptr @_QFEke, i64 0, i64 6), i64 1, i64 1)
  %88 = or i32 %87, %84
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %102, label %90

90:                                               ; preds = %83
  %91 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEs, ptr nonnull @_QFEke, i64 7, i64 7)
  %92 = icmp eq i32 %91, 0
  %93 = sext i32 %22 to i64
  %94 = add nsw i64 %93, -1
  %95 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %94
  %96 = sub nsw i64 %23, %93
  %97 = call i64 @llvm.smax.i64(i64 %96, i64 -1)
  %98 = add nsw i64 %97, 1
  %99 = call i32 @_FortranACharacterCompareScalar1(ptr %95, ptr nonnull @_QFEke, i64 %98, i64 7)
  %100 = icmp eq i32 %99, 0
  %101 = or i1 %92, %100
  br i1 %101, label %107, label %112

102:                                              ; preds = %83, %71, %59, %47, %35, %18
  %103 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.897272c37f83d9c71771a0a6b0693c93, i32 12)
  %104 = call i1 @_FortranAioOutputAscii(ptr %103, ptr nonnull @_QQcl.594553, i64 3)
  %105 = call i32 @_FortranAioEndIoStatement(ptr %103)
  %106 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

107:                                              ; preds = %90
  %108 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.897272c37f83d9c71771a0a6b0693c93, i32 18)
  %109 = call i1 @_FortranAioOutputAscii(ptr %108, ptr nonnull @_QQcl.594553, i64 3)
  %110 = call i32 @_FortranAioEndIoStatement(ptr %108)
  %111 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

112:                                              ; preds = %90
  %113 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.897272c37f83d9c71771a0a6b0693c93, i32 22)
  %114 = call i1 @_FortranAioOutputAscii(ptr %113, ptr nonnull @_QQcl.4E4F, i64 2)
  %115 = call i32 @_FortranAioEndIoStatement(ptr %113)
  %116 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #2

declare i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

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

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { noreturn }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
