program main
  implicit none
  
  integer :: n,i
  character*1 :: s(100)
  
  read(*,*)n
  read(*,*)(s(i),i=1, n)
  do i = 1, n
    if (s(i) == 'Y') then
      write(*,*)'Four'
      stop
    end if
  end do
  
  write(*,*)'Three'
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"

@_QFEs = internal global [100 x [1 x i8]] undef
@_QQcl.43c8a737573bdaa4ac4c5cc8eca76b90 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6206/source.f\00"
@_QQcl.59 = linkonce constant [1 x i8] c"Y"
@_QQcl.466F7572 = linkonce constant [4 x i8] c"Four"
@_QQcl.5468726565 = linkonce constant [5 x i8] c"Three"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

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

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %9 = phi i64 [ %14, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %sext = shl i64 %9, 32
  %10 = ashr exact i64 %sext, 32
  %11 = add nsw i64 %10, -1
  %12 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %11
  %13 = call i1 @_FortranAioInputAscii(ptr %5, ptr %12, i64 1)
  %14 = add nuw nsw i64 %9, 1
  %exitcond.not = icmp eq i64 %9, %8
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %15 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %16 = load i32, ptr %1, align 4, !tbaa !3
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph10.preheader, label %._crit_edge11

.lr.ph10.preheader:                               ; preds = %._crit_edge
  %18 = add nuw i32 %16, 1
  %wide.trip.count = zext i32 %18 to i64
  br label %.lr.ph10

.lr.ph10:                                         ; preds = %.lr.ph10.preheader, %28
  %indvars.iv = phi i64 [ 1, %.lr.ph10.preheader ], [ %indvars.iv.next, %28 ]
  %19 = add nsw i64 %indvars.iv, -1
  %20 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %19
  %21 = call i32 @_FortranACharacterCompareScalar1(ptr %20, ptr nonnull @_QQcl.59, i64 1, i64 1)
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %28

23:                                               ; preds = %.lr.ph10
  %24 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.43c8a737573bdaa4ac4c5cc8eca76b90, i32 11)
  %25 = call i1 @_FortranAioOutputAscii(ptr %24, ptr nonnull @_QQcl.466F7572, i64 4)
  %26 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %27 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

28:                                               ; preds = %.lr.ph10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond13.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond13.not, label %._crit_edge11, label %.lr.ph10

._crit_edge11:                                    ; preds = %28, %._crit_edge
  %29 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.43c8a737573bdaa4ac4c5cc8eca76b90, i32 16)
  %30 = call i1 @_FortranAioOutputAscii(ptr %29, ptr nonnull @_QQcl.5468726565, i64 5)
  %31 = call i32 @_FortranAioEndIoStatement(ptr %29)
  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 i1 @_FortranAioInputAscii(ptr, ptr, i64) 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

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