program abc_b
  integer :: count=0, current_count=0
  character(10) input
  read *, input
  do i=1, 10
    select case (input(i:i))
      case ('A', 'T', 'C', 'G')
        current_count = current_count +1
      case default
        call count_up()
    end select
  end do
  call count_up()
  print '(I0)', count

  contains
    subroutine count_up()
      if (current_count > count) then
        count = current_count
        current_count = 0
      end if
    end subroutine count_up
end program

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

@_QFEcount = internal unnamed_addr global i32 0
@_QFEcurrent_count = internal unnamed_addr global i32 0
@_QQcl.d264ccd7d8abae6574558dde9720ef90 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4656/source.f\00"
@_QQcl.41 = linkonce constant [1 x i8] c"A"
@_QQcl.54 = linkonce constant [1 x i8] c"T"
@_QQcl.43 = linkonce constant [1 x i8] c"C"
@_QQcl.47 = linkonce constant [1 x i8] c"G"
@_QQcl.28493029 = linkonce constant [4 x i8] c"(I0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca [10 x i8], align 1
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d264ccd7d8abae6574558dde9720ef90, i32 4)
  %3 = call i1 @_FortranAioInputAscii(ptr %2, ptr nonnull %1, i64 10)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  br label %5

5:                                                ; preds = %0, %_QFPcount_up.exit
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %_QFPcount_up.exit ]
  %6 = add nsw i64 %indvars.iv, -1
  %7 = getelementptr [10 x [1 x i8]], ptr %1, i64 0, i64 %6
  %8 = call i32 @_FortranACharacterCompareScalar1(ptr %7, ptr nonnull @_QQcl.41, i64 1, i64 1)
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %24, label %10

10:                                               ; preds = %5
  %11 = call i32 @_FortranACharacterCompareScalar1(ptr %7, ptr nonnull @_QQcl.54, i64 1, i64 1)
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %24, label %13

13:                                               ; preds = %10
  %14 = call i32 @_FortranACharacterCompareScalar1(ptr %7, ptr nonnull @_QQcl.43, i64 1, i64 1)
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %24, label %16

16:                                               ; preds = %13
  %17 = call i32 @_FortranACharacterCompareScalar1(ptr %7, ptr nonnull @_QQcl.47, i64 1, i64 1)
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %24, label %19

19:                                               ; preds = %16
  %20 = load i32, ptr @_QFEcurrent_count, align 4, !tbaa !3
  %21 = load i32, ptr @_QFEcount, align 4, !tbaa !3
  %22 = icmp sgt i32 %20, %21
  br i1 %22, label %23, label %_QFPcount_up.exit

23:                                               ; preds = %19
  store i32 %20, ptr @_QFEcount, align 4, !tbaa !3
  br label %_QFPcount_up.exit.sink.split

24:                                               ; preds = %16, %13, %10, %5
  %25 = load i32, ptr @_QFEcurrent_count, align 4, !tbaa !3
  %26 = add i32 %25, 1
  br label %_QFPcount_up.exit.sink.split

_QFPcount_up.exit.sink.split:                     ; preds = %24, %23
  %.sink = phi i32 [ 0, %23 ], [ %26, %24 ]
  store i32 %.sink, ptr @_QFEcurrent_count, align 4, !tbaa !3
  br label %_QFPcount_up.exit

_QFPcount_up.exit:                                ; preds = %_QFPcount_up.exit.sink.split, %19
  %27 = phi i32 [ %20, %19 ], [ %.sink, %_QFPcount_up.exit.sink.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 11
  br i1 %exitcond.not, label %28, label %5

28:                                               ; preds = %_QFPcount_up.exit
  %29 = load i32, ptr @_QFEcount, align 4, !tbaa !3
  %30 = icmp sgt i32 %27, %29
  br i1 %30, label %31, label %_QFPcount_up.exit5

31:                                               ; preds = %28
  store i32 %27, ptr @_QFEcount, align 4, !tbaa !3
  store i32 0, ptr @_QFEcurrent_count, align 4, !tbaa !3
  br label %_QFPcount_up.exit5

_QFPcount_up.exit5:                               ; preds = %28, %31
  %32 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28493029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d264ccd7d8abae6574558dde9720ef90, i32 14)
  %33 = load i32, ptr @_QFEcount, align 4, !tbaa !3
  %34 = call i1 @_FortranAioOutputInteger32(ptr %32, i32 %33)
  %35 = call i32 @_FortranAioEndIoStatement(ptr %32)
  ret void
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none)
define void @_QFPcount_up() local_unnamed_addr #0 {
  %1 = load i32, ptr @_QFEcurrent_count, align 4, !tbaa !3
  %2 = load i32, ptr @_QFEcount, align 4, !tbaa !3
  %3 = icmp sgt i32 %1, %2
  br i1 %3, label %4, label %5

4:                                                ; preds = %0
  store i32 %1, ptr @_QFEcount, align 4, !tbaa !3
  store i32 0, ptr @_QFEcurrent_count, align 4, !tbaa !3
  br label %5

5:                                                ; preds = %4, %0
  ret void
}

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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: 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"}
