program sample
    implicit none
    integer(8) ::a, b,c,i,j,m,n,k,a1,b1,c1
    
    character(len=10)::s
    character(len=1)::t
    read(*,*) s
    a=len_trim(s)
    b=0
    c=0
    do i=1,a
        t=s(i:i)
        if (t=='A' .or. t=='C' .or. t=='G' .or. t=='T') then
            b=b+1
        else
            if (b>c)then
                c=b
            end if
            b=0
        end if

    end do
    if (b>c)then
        c=b
    end if
    write(*,*)c
    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"

@_QQcl.a77300340eee8d86eac8f18c38859ae2 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4655/source.f\00"
@_QQcl.41 = linkonce constant [1 x i8] c"A"
@_QQcl.43 = linkonce constant [1 x i8] c"C"
@_QQcl.47 = linkonce constant [1 x i8] c"G"
@_QQcl.54 = linkonce constant [1 x i8] c"T"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca [10 x i8], align 1
  %2 = alloca [1 x i8], align 1
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a77300340eee8d86eac8f18c38859ae2, i32 7)
  %4 = call i1 @_FortranAioInputAscii(ptr %3, ptr nonnull %1, i64 10)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  br label %6

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

14:                                               ; preds = %6
  %15 = shl i64 %7, 32
  %sext = add i64 %15, 4294967296
  %16 = ashr exact i64 %sext, 32
  %spec.select17 = select i1 %10, i64 0, i64 %16
  %17 = icmp sgt i64 %spec.select17, 0
  br i1 %17, label %select.unfold, label %select.unfold._crit_edge

select.unfold:                                    ; preds = %14, %select.unfold
  %18 = phi i64 [ %34, %select.unfold ], [ 1, %14 ]
  %.020 = phi i64 [ %.2, %select.unfold ], [ 0, %14 ]
  %.01119 = phi i64 [ %.112, %select.unfold ], [ 0, %14 ]
  %19 = add nsw i64 %18, -1
  %20 = getelementptr [10 x [1 x i8]], ptr %1, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1
  store i8 %21, ptr %2, align 1
  %22 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.41, i64 1, i64 1)
  %23 = icmp eq i32 %22, 0
  %24 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.43, i64 1, i64 1)
  %25 = icmp eq i32 %24, 0
  %26 = or i1 %23, %25
  %27 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.47, i64 1, i64 1)
  %28 = icmp eq i32 %27, 0
  %29 = or i1 %26, %28
  %30 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.54, i64 1, i64 1)
  %31 = icmp eq i32 %30, 0
  %32 = or i1 %29, %31
  %33 = add i64 %.01119, 1
  %spec.select = call i64 @llvm.smax.i64(i64 %.01119, i64 %.020)
  %.112 = select i1 %32, i64 %33, i64 0
  %.2 = select i1 %32, i64 %.020, i64 %spec.select
  %34 = add nuw nsw i64 %18, 1
  %exitcond.not = icmp eq i64 %18, %spec.select17
  br i1 %exitcond.not, label %select.unfold._crit_edge, label %select.unfold

select.unfold._crit_edge:                         ; preds = %select.unfold, %14
  %.011.lcssa = phi i64 [ 0, %14 ], [ %.112, %select.unfold ]
  %.0.lcssa = phi i64 [ 0, %14 ], [ %.2, %select.unfold ]
  %spec.select16 = call i64 @llvm.smax.i64(i64 %.011.lcssa, i64 %.0.lcssa)
  %35 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a77300340eee8d86eac8f18c38859ae2, i32 26)
  %36 = call i1 @_FortranAioOutputInteger64(ptr %35, i64 %spec.select16)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %35)
  %38 = 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 @_FortranAioOutputInteger64(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.smax.i64(i64, i64) #1

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