program sample
    implicit none
  
    integer(8) :: i,j,m,n
    real(8)::a,b
    integer(8),allocatable :: x(:),y(:)
    character(len=100)::c !文字列

    read(*,*) c
    j=0
    n=len_trim(c)  !len_trimは空白を無視する、大きめに取って
    if (n==7)then
        if (c=='keyence')then
            write(*,*)'YES'
        else
            write(*,*)'NO'
        end if

        stop
    end if

    if (c(1:7)=='keyence')then
        write(*,*)'YES'
        stop
    end if
    if (c(n-6:n)=='keyence')then
        write(*,*)'YES'
        stop
    end if
    

    do i=1,6
    
        if (c(1:i)//c(n+i-6:n)=='keyence')then
            write(*,*)'YES'
            stop
        
        end if

    end do
    write(*,*)'NO'
  
    stop
end program sample
  


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

@_QFEc = internal global [100 x i8] undef
@_QQcl.54a2753adbe7b0256fad6e631492b8dc = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5115/source.f\00"
@_QQcl.6B6579656E6365 = linkonce constant [7 x i8] c"keyence"
@_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: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 9)
  %2 = tail call i1 @_FortranAioInputAscii(ptr %1, ptr nonnull @_QFEc, i64 100)
  %3 = tail call i32 @_FortranAioEndIoStatement(ptr %1)
  br label %4

4:                                                ; preds = %0, %4
  %5 = phi i64 [ 99, %0 ], [ %9, %4 ]
  %6 = getelementptr [100 x [1 x i8]], ptr @_QFEc, i64 0, i64 %5
  %7 = load i8, ptr %6, align 1, !tbaa !3
  %8 = icmp eq i8 %7, 32
  %9 = add nsw i64 %5, -1
  %10 = icmp ne i64 %5, 0
  %11 = and i1 %8, %10
  br i1 %11, label %4, label %12

12:                                               ; preds = %4
  %13 = shl i64 %5, 32
  %sext = add i64 %13, 4294967296
  %14 = ashr exact i64 %sext, 32
  %15 = select i1 %8, i64 0, i64 %14
  %16 = icmp eq i64 %15, 7
  br i1 %16, label %17, label %24

17:                                               ; preds = %12
  %18 = tail call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEc, ptr nonnull @_QQcl.6B6579656E6365, i64 100, i64 7)
  %19 = icmp eq i32 %18, 0
  %. = select i1 %19, i32 14, i32 16
  %.20 = select i1 %19, i64 3, i64 2
  %_QQcl.594553._QQcl.4E4F = select i1 %19, ptr @_QQcl.594553, ptr @_QQcl.4E4F
  %20 = tail call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 %.)
  %21 = tail call i1 @_FortranAioOutputAscii(ptr %20, ptr nonnull %_QQcl.594553._QQcl.4E4F, i64 %.20)
  %22 = tail call i32 @_FortranAioEndIoStatement(ptr %20)
  %23 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

24:                                               ; preds = %12
  %25 = tail call i32 @_FortranACharacterCompareScalar1(ptr nonnull @_QFEc, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %24
  %28 = tail call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 23)
  %29 = tail call i1 @_FortranAioOutputAscii(ptr %28, ptr nonnull @_QQcl.594553, i64 3)
  %30 = tail call i32 @_FortranAioEndIoStatement(ptr %28)
  %31 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

32:                                               ; preds = %24
  %33 = add nsw i64 %15, -7
  %34 = getelementptr [100 x [1 x i8]], ptr @_QFEc, i64 0, i64 %33
  %35 = tail call i32 @_FortranACharacterCompareScalar1(ptr %34, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %._crit_edge

37:                                               ; preds = %32
  %38 = tail call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 27)
  %39 = tail call i1 @_FortranAioOutputAscii(ptr %38, ptr nonnull @_QQcl.594553, i64 3)
  %40 = tail call i32 @_FortranAioEndIoStatement(ptr %38)
  %41 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

._crit_edge:                                      ; preds = %32
  %42 = alloca [7 x i8], align 1
  %43 = load i8, ptr @_QFEc, align 16
  store i8 %43, ptr %42, align 1
  %44 = add nsw i64 %15, -6
  %uglygep16 = getelementptr i8, ptr @_QFEc, i64 %44
  %uglygep = getelementptr inbounds i8, ptr %42, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %uglygep, ptr noundef nonnull align 1 dereferenceable(6) %uglygep16, i64 6, i1 false), !tbaa !3
  %45 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %42, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %._crit_edge.1

47:                                               ; preds = %._crit_edge.5, %._crit_edge.4, %._crit_edge.3, %._crit_edge.2, %._crit_edge.1, %._crit_edge
  %48 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 35)
  %49 = call i1 @_FortranAioOutputAscii(ptr %48, ptr nonnull @_QQcl.594553, i64 3)
  %50 = call i32 @_FortranAioEndIoStatement(ptr %48)
  %51 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

._crit_edge.1:                                    ; preds = %._crit_edge
  %52 = alloca [7 x i8], align 2
  %53 = load i16, ptr @_QFEc, align 16
  store i16 %53, ptr %52, align 2
  %54 = add nsw i64 %15, -5
  %uglygep16.1 = getelementptr i8, ptr @_QFEc, i64 %54
  %uglygep.1 = getelementptr inbounds i8, ptr %52, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) %uglygep.1, ptr noundef nonnull align 1 dereferenceable(5) %uglygep16.1, i64 5, i1 false), !tbaa !3
  %55 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %52, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %47, label %._crit_edge.2

._crit_edge.2:                                    ; preds = %._crit_edge.1
  %57 = alloca [7 x i8], align 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %57, ptr noundef nonnull align 16 dereferenceable(3) @_QFEc, i64 3, i1 false)
  %58 = add nsw i64 %15, -4
  %uglygep16.2 = getelementptr i8, ptr @_QFEc, i64 %58
  %uglygep.2 = getelementptr inbounds i8, ptr %57, i64 3
  %59 = load i32, ptr %uglygep16.2, align 1, !tbaa !3
  store i32 %59, ptr %uglygep.2, align 1, !tbaa !3
  %60 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %57, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %47, label %._crit_edge.3

._crit_edge.3:                                    ; preds = %._crit_edge.2
  %62 = alloca [7 x i8], align 4
  %63 = load i32, ptr @_QFEc, align 16
  store i32 %63, ptr %62, align 4
  %64 = add nsw i64 %15, -3
  %uglygep16.3 = getelementptr i8, ptr @_QFEc, i64 %64
  %uglygep.3 = getelementptr inbounds i8, ptr %62, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(3) %uglygep.3, ptr noundef nonnull align 1 dereferenceable(3) %uglygep16.3, i64 3, i1 false), !tbaa !3
  %65 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %62, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %47, label %._crit_edge.4

._crit_edge.4:                                    ; preds = %._crit_edge.3
  %67 = alloca [7 x i8], align 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %67, ptr noundef nonnull align 16 dereferenceable(5) @_QFEc, i64 5, i1 false)
  %68 = add nsw i64 %15, -2
  %uglygep16.4 = getelementptr i8, ptr @_QFEc, i64 %68
  %uglygep.4 = getelementptr inbounds i8, ptr %67, i64 5
  %69 = load i16, ptr %uglygep16.4, align 1, !tbaa !3
  store i16 %69, ptr %uglygep.4, align 1, !tbaa !3
  %70 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %67, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %47, label %._crit_edge.5

._crit_edge.5:                                    ; preds = %._crit_edge.4
  %72 = alloca [7 x i8], align 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %72, ptr noundef nonnull align 16 dereferenceable(6) @_QFEc, i64 6, i1 false)
  %73 = add nsw i64 %15, -1
  %uglygep16.5 = getelementptr i8, ptr @_QFEc, i64 %73
  %uglygep.5 = getelementptr inbounds i8, ptr %72, i64 6
  %74 = load i8, ptr %uglygep16.5, align 1, !tbaa !3
  store i8 %74, ptr %uglygep.5, align 1, !tbaa !3
  %75 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %72, ptr nonnull @_QQcl.6B6579656E6365, i64 7, i64 7)
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %47, label %77

77:                                               ; preds = %._crit_edge.5
  %78 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.54a2753adbe7b0256fad6e631492b8dc, i32 41)
  %79 = call i1 @_FortranAioOutputAscii(ptr %78, ptr nonnull @_QQcl.4E4F, i64 2)
  %80 = call i32 @_FortranAioEndIoStatement(ptr %78)
  %81 = 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 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

attributes #0 = { noreturn }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

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