program test02
 implicit none
 integer N
 integer,allocatable :: A(:)
 integer i
 integer :: dame=0

 read *, N
 allocate(A(N))
 read *, A

 do i=1,N
  if ( mod(A(i),2)==0 ) then
   if ( mod(A(i),3)/=0 .and. mod(A(i),5)/=0 ) then
    dame=1
   end if
  end if
 end do

 if ( dame==0 ) print '(A)', 'APPROVED'
 if ( dame==1 ) print '(A)', 'DENIED'

endprogram test02

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

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.8 = internal unnamed_addr global i64 0
@_QFEdame = internal unnamed_addr global i1 false
@_QQcl.5ec5a2900ced20fc27bcdc5ff52e3eb4 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2389/source.f\00"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQcl.415050524F564544 = linkonce constant [8 x i8] c"APPROVED"
@_QQcl.44454E494544 = linkonce constant [6 x i8] c"DENIED"
@_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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5ec5a2900ced20fc27bcdc5ff52e3eb4, i32 8)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %2, align 4, !tbaa !3
  %7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %8 = zext i32 %7 to i64
  %9 = shl nuw nsw i64 %8, 2
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %8, ptr @_QFEa.8, align 8, !tbaa !7
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5ec5a2900ced20fc27bcdc5ff52e3eb4, i32 10)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack116.unpack.unpack118 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack116.unpack.unpack118, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %12 = call i1 @_FortranAioInputDescriptor(ptr %11, ptr nonnull %1)
  %13 = call i32 @_FortranAioEndIoStatement(ptr %11)
  %14 = load i32, ptr %2, align 4, !tbaa !3
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %16 = zext i32 %14 to i64
  %.unpack121 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %min.iters.check = icmp ult i32 %14, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %16, 4294967292
  %ind.end = or i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %34, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %34 ]
  %17 = getelementptr i32, ptr %.unpack121, i64 %index
  %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !3
  %18 = and <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %19 = icmp eq <4 x i32> %18, zeroinitializer
  %20 = srem <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3>
  %21 = icmp ne <4 x i32> %20, zeroinitializer
  %22 = srem <4 x i32> %wide.load, <i32 5, i32 5, i32 5, i32 5>
  %23 = icmp ne <4 x i32> %22, zeroinitializer
  %24 = and <4 x i1> %21, %23
  %25 = select <4 x i1> %19, <4 x i1> %24, <4 x i1> zeroinitializer
  %26 = extractelement <4 x i1> %25, i64 0
  %27 = extractelement <4 x i1> %25, i64 1
  %28 = or i1 %26, %27
  %29 = extractelement <4 x i1> %25, i64 2
  %30 = or i1 %28, %29
  %31 = extractelement <4 x i1> %25, i64 3
  %32 = or i1 %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %vector.body
  store i1 true, ptr @_QFEdame, align 1
  br label %34

34:                                               ; preds = %vector.body, %33
  %index.next = add nuw i64 %index, 4
  %35 = icmp eq i64 %index.next, %n.vec
  br i1 %35, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %34
  %cmp.n = icmp eq i64 %n.vec, %16
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph, %middle.block
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %36 = add i64 %indvars.iv, -1
  %37 = getelementptr i32, ptr %.unpack121, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !3
  %39 = and i32 %38, 1
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %48

41:                                               ; preds = %scalar.ph
  %42 = srem i32 %38, 3
  %43 = icmp ne i32 %42, 0
  %44 = srem i32 %38, 5
  %45 = icmp ne i32 %44, 0
  %46 = and i1 %43, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %41
  store i1 true, ptr @_QFEdame, align 1
  br label %48

48:                                               ; preds = %47, %41, %scalar.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %16
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %48, %middle.block, %0
  %.b100 = load i1, ptr @_QFEdame, align 1
  br i1 %.b100, label %.thread, label %49

49:                                               ; preds = %._crit_edge
  %50 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.5ec5a2900ced20fc27bcdc5ff52e3eb4, i32 20)
  %51 = call i1 @_FortranAioOutputAscii(ptr %50, ptr nonnull @_QQcl.415050524F564544, i64 8)
  %52 = call i32 @_FortranAioEndIoStatement(ptr %50)
  %.b.pr = load i1, ptr @_QFEdame, align 1
  br i1 %.b.pr, label %.thread, label %56

.thread:                                          ; preds = %._crit_edge, %49
  %53 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.5ec5a2900ced20fc27bcdc5ff52e3eb4, i32 21)
  %54 = call i1 @_FortranAioOutputAscii(ptr %53, ptr nonnull @_QQcl.44454E494544, i64 6)
  %55 = call i32 @_FortranAioEndIoStatement(ptr %53)
  br label %56

56:                                               ; preds = %.thread, %49
  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 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) 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}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
