program abc2
 implicit none
 character(len=3),allocatable::t(:)
 integer::N,ishotb=0,ishota=0,p=0,q=0,r=0,s=0
 read(*,*)N
 allocate(t(N))
 do ishotb=1,N
  read(*,*)t(ishotb)
 end do
 do ishota=1,N
  if(t(ishota)=="AC ")then
   p=p+1
  end if
  if(t(ishota)=="WA ")then
   q=q+1
  end if
  if(t(ishota)=="TLE")then
   r=r+1
  end if
  if(t(ishota)=="RE ")then
   s=s+1
  end if
 end do
 print'(a,i0)',"AC x ",p
 print'(a,i0)',"WA x ",q
 print'(a,i0)',"TLE x ",r
 print'(a,i0)',"RE x ",s
end program abc2
; 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"

@_QFEishota = internal unnamed_addr global i32 0
@_QFEishotb = internal unnamed_addr global i32 0
@_QFEp = internal unnamed_addr global i32 0
@_QFEq = internal unnamed_addr global i32 0
@_QFEr = internal unnamed_addr global i32 0
@_QFEs = internal unnamed_addr global i32 0
@_QFEt.0 = internal unnamed_addr global ptr null
@_QQcl.37f92fd366f983363179ae3ee18bf744 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_987/source.f\00"
@_QQcl.414320 = linkonce constant [3 x i8] c"AC "
@_QQcl.574120 = linkonce constant [3 x i8] c"WA "
@_QQcl.544C45 = linkonce constant [3 x i8] c"TLE"
@_QQcl.524520 = linkonce constant [3 x i8] c"RE "
@_QQcl.28612C693029 = linkonce constant [6 x i8] c"(a,i0)"
@_QQcl.4143207820 = linkonce constant [5 x i8] c"AC x "
@_QQcl.5741207820 = linkonce constant [5 x i8] c"WA x "
@_QQcl.544C45207820 = linkonce constant [6 x i8] c"TLE x "
@_QQcl.5245207820 = linkonce constant [5 x i8] c"RE x "
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 5)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = mul nuw nsw i64 %7, 3
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEt.0, align 8, !tbaa !7
  %10 = icmp sgt i32 %5, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %0
  %11 = sext i32 %5 to i64
  br label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  store i32 1, ptr @_QFEishotb, align 4, !tbaa !3
  br label %._crit_edge180

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %12 = phi i64 [ %23, %.lr.ph ], [ %11, %.lr.ph.preheader ]
  %13 = phi i32 [ %22, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  store i32 %13, ptr @_QFEishotb, align 4, !tbaa !3
  %14 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 8)
  %.unpack165 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %15 = load i32, ptr @_QFEishotb, align 4, !tbaa !3
  %16 = sext i32 %15 to i64
  %17 = add nsw i64 %16, -1
  %18 = getelementptr [3 x i8], ptr %.unpack165, i64 %17
  %19 = call i1 @_FortranAioInputAscii(ptr %14, ptr %18, i64 3)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %21 = load i32, ptr @_QFEishotb, align 4, !tbaa !3
  %22 = add i32 %21, 1
  %23 = add nsw i64 %12, -1
  %24 = icmp sgt i64 %12, 1
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !3
  store i32 %22, ptr @_QFEishotb, align 4, !tbaa !3
  %25 = icmp sgt i32 %.pre, 0
  br i1 %25, label %.lr.ph179.preheader, label %._crit_edge180

.lr.ph179.preheader:                              ; preds = %._crit_edge
  %.pre184 = sext i32 %.pre to i64
  br label %.lr.ph179

.lr.ph179:                                        ; preds = %.lr.ph179.preheader, %66
  %26 = phi i64 [ %69, %66 ], [ %.pre184, %.lr.ph179.preheader ]
  %27 = phi i32 [ %68, %66 ], [ 1, %.lr.ph179.preheader ]
  store i32 %27, ptr @_QFEishota, align 4, !tbaa !3
  %.unpack = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %28 = sext i32 %27 to i64
  %29 = add nsw i64 %28, -1
  %30 = getelementptr [3 x i8], ptr %.unpack, i64 %29
  %31 = call i32 @_FortranACharacterCompareScalar1(ptr %30, ptr nonnull @_QQcl.414320, i64 3, i64 3)
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %.lr.ph179
  %34 = load i32, ptr @_QFEp, align 4, !tbaa !3
  %35 = add i32 %34, 1
  store i32 %35, ptr @_QFEp, align 4, !tbaa !3
  br label %36

36:                                               ; preds = %33, %.lr.ph179
  %.unpack129 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %37 = load i32, ptr @_QFEishota, align 4, !tbaa !3
  %38 = sext i32 %37 to i64
  %39 = add nsw i64 %38, -1
  %40 = getelementptr [3 x i8], ptr %.unpack129, i64 %39
  %41 = call i32 @_FortranACharacterCompareScalar1(ptr %40, ptr nonnull @_QQcl.574120, i64 3, i64 3)
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %36
  %44 = load i32, ptr @_QFEq, align 4, !tbaa !3
  %45 = add i32 %44, 1
  store i32 %45, ptr @_QFEq, align 4, !tbaa !3
  br label %46

46:                                               ; preds = %43, %36
  %.unpack141 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %47 = load i32, ptr @_QFEishota, align 4, !tbaa !3
  %48 = sext i32 %47 to i64
  %49 = add nsw i64 %48, -1
  %50 = getelementptr [3 x i8], ptr %.unpack141, i64 %49
  %51 = call i32 @_FortranACharacterCompareScalar1(ptr %50, ptr nonnull @_QQcl.544C45, i64 3, i64 3)
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %56

53:                                               ; preds = %46
  %54 = load i32, ptr @_QFEr, align 4, !tbaa !3
  %55 = add i32 %54, 1
  store i32 %55, ptr @_QFEr, align 4, !tbaa !3
  br label %56

56:                                               ; preds = %53, %46
  %.unpack153 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %57 = load i32, ptr @_QFEishota, align 4, !tbaa !3
  %58 = sext i32 %57 to i64
  %59 = add nsw i64 %58, -1
  %60 = getelementptr [3 x i8], ptr %.unpack153, i64 %59
  %61 = call i32 @_FortranACharacterCompareScalar1(ptr %60, ptr nonnull @_QQcl.524520, i64 3, i64 3)
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %56
  %64 = load i32, ptr @_QFEs, align 4, !tbaa !3
  %65 = add i32 %64, 1
  store i32 %65, ptr @_QFEs, align 4, !tbaa !3
  br label %66

66:                                               ; preds = %63, %56
  %67 = load i32, ptr @_QFEishota, align 4, !tbaa !3
  %68 = add i32 %67, 1
  %69 = add nsw i64 %26, -1
  %70 = icmp sgt i64 %26, 1
  br i1 %70, label %.lr.ph179, label %._crit_edge180

._crit_edge180:                                   ; preds = %66, %._crit_edge.thread, %._crit_edge
  %.lcssa = phi i32 [ 1, %._crit_edge ], [ 1, %._crit_edge.thread ], [ %68, %66 ]
  store i32 %.lcssa, ptr @_QFEishota, align 4, !tbaa !3
  %71 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28612C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 24)
  %72 = call i1 @_FortranAioOutputAscii(ptr %71, ptr nonnull @_QQcl.4143207820, i64 5)
  %73 = load i32, ptr @_QFEp, align 4, !tbaa !3
  %74 = call i1 @_FortranAioOutputInteger32(ptr %71, i32 %73)
  %75 = call i32 @_FortranAioEndIoStatement(ptr %71)
  %76 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28612C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 25)
  %77 = call i1 @_FortranAioOutputAscii(ptr %76, ptr nonnull @_QQcl.5741207820, i64 5)
  %78 = load i32, ptr @_QFEq, align 4, !tbaa !3
  %79 = call i1 @_FortranAioOutputInteger32(ptr %76, i32 %78)
  %80 = call i32 @_FortranAioEndIoStatement(ptr %76)
  %81 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28612C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 26)
  %82 = call i1 @_FortranAioOutputAscii(ptr %81, ptr nonnull @_QQcl.544C45207820, i64 6)
  %83 = load i32, ptr @_QFEr, align 4, !tbaa !3
  %84 = call i1 @_FortranAioOutputInteger32(ptr %81, i32 %83)
  %85 = call i32 @_FortranAioEndIoStatement(ptr %81)
  %86 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28612C693029, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.37f92fd366f983363179ae3ee18bf744, i32 27)
  %87 = call i1 @_FortranAioOutputAscii(ptr %86, ptr nonnull @_QQcl.5245207820, i64 5)
  %88 = load i32, ptr @_QFEs, align 4, !tbaa !3
  %89 = call i1 @_FortranAioOutputInteger32(ptr %86, i32 %88)
  %90 = call i32 @_FortranAioEndIoStatement(ptr %86)
  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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
