program main
 implicit none
 
 character*80 s
 integer*8 B,A,db,da
 db = 0
 da = 0
 read(*,*) s
 read(s(1:2),*) B
 read(s(3:4),*) A
 
 if(B == 0 .or. B > 12) then
  db = 1
 end if
 if(A == 0 .or. A > 12) then
  da = 1
 end if
 
 if(db == 0 .and. da == 0) then
  write(*,*) 'AMBIGUOUS'
 else if(db == 0 .and. da == 1) then
  write(*,*) 'MMYY'
 else if(db == 1 .and. da == 0) then
  write(*,*) 'YYMM'
 else
  write(*,*) 'NA'
 end if
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 [80 x i8] undef
@_QQcl.a64e75afc4bf099a8d6d902ea07751ab = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4269/source.f\00"
@_QQcl.414D424947554F5553 = linkonce constant [9 x i8] c"AMBIGUOUS"
@_QQcl.4D4D5959 = linkonce constant [4 x i8] c"MMYY"
@_QQcl.59594D4D = linkonce constant [4 x i8] c"YYMM"
@_QQcl.4E41 = linkonce constant [2 x i8] c"NA"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 8)
  %4 = tail call i1 @_FortranAioInputAscii(ptr %3, ptr nonnull @_QFEs, i64 80)
  %5 = tail call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = tail call ptr @_FortranAioBeginInternalListInput(ptr nonnull @_QFEs, i64 2, ptr null, i64 0, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 9)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %2, i32 8)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = call ptr @_FortranAioBeginInternalListInput(ptr nonnull getelementptr inbounds ([80 x i8], ptr @_QFEs, i64 0, i64 2), i64 2, ptr null, i64 0, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 10)
  %10 = call i1 @_FortranAioInputInteger(ptr %9, ptr nonnull %1, i32 8)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %12 = load i64, ptr %2, align 8, !tbaa !3
  %13 = icmp ne i64 %12, 0
  %14 = icmp slt i64 %12, 13
  %.not8 = and i1 %13, %14
  %15 = xor i1 %.not8, true
  %16 = load i64, ptr %1, align 8, !tbaa !3
  %17 = icmp ne i64 %16, 0
  %18 = icmp slt i64 %16, 13
  %.not10 = and i1 %17, %18
  %19 = and i1 %.not8, %.not10
  br i1 %19, label %20, label %23

20:                                               ; preds = %0
  %21 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 20)
  %22 = call i1 @_FortranAioOutputAscii(ptr %21, ptr nonnull @_QQcl.414D424947554F5553, i64 9)
  br label %37

23:                                               ; preds = %0
  %24 = xor i1 %.not10, true
  %25 = and i1 %.not8, %24
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 22)
  %28 = call i1 @_FortranAioOutputAscii(ptr %27, ptr nonnull @_QQcl.4D4D5959, i64 4)
  br label %37

29:                                               ; preds = %23
  %30 = and i1 %.not10, %15
  br i1 %30, label %31, label %34

31:                                               ; preds = %29
  %32 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 24)
  %33 = call i1 @_FortranAioOutputAscii(ptr %32, ptr nonnull @_QQcl.59594D4D, i64 4)
  br label %37

34:                                               ; preds = %29
  %35 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a64e75afc4bf099a8d6d902ea07751ab, i32 26)
  %36 = call i1 @_FortranAioOutputAscii(ptr %35, ptr nonnull @_QQcl.4E41, i64 2)
  br label %37

37:                                               ; preds = %20, %26, %31, %34
  %.sink = phi ptr [ %21, %20 ], [ %27, %26 ], [ %32, %31 ], [ %35, %34 ]
  %38 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 ptr @_FortranAioBeginInternalListInput(ptr, i64, ptr, i64, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) 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"}
