INTEGER N
integer,allocatable,dimension(:)::x
READ*,N
allocate(x(n))
read*,x
PRINT"(A)",MERGE("Yes"," No",Maxval(x)*2<Sum(x))
end
; 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"

@_QFEx.0 = internal unnamed_addr global ptr null
@_QFEx.8 = internal unnamed_addr global i64 0
@_QQcl.27ab1d510ed5e40f06542788f2dc6271 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4999/source.f\00"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.204E6F = linkonce constant [3 x i8] c" No"
@_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.27ab1d510ed5e40f06542788f2dc6271, i32 3)
  %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 @_QFEx.0, align 8, !tbaa !7
  store i64 %8, ptr @_QFEx.8, align 8, !tbaa !7
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.27ab1d510ed5e40f06542788f2dc6271, i32 5)
  %.unpack = load ptr, ptr @_QFEx.0, align 8, !tbaa !7
  %.unpack153.unpack.unpack155 = load i64, ptr @_QFEx.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 %.unpack153.unpack.unpack155, 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 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.27ab1d510ed5e40f06542788f2dc6271, i32 6)
  %.unpack158 = load ptr, ptr @_QFEx.0, align 8, !tbaa !7
  %.unpack165.unpack.unpack167 = load i64, ptr @_QFEx.8, align 8, !tbaa !7
  %15 = icmp sgt i64 %.unpack165.unpack.unpack167, 0
  br i1 %15, label %.lr.ph.i.preheader, label %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %0
  %min.iters.check = icmp ult i64 %.unpack165.unpack.unpack167, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader222, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack165.unpack.unpack167, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %19, %vector.body ]
  %vec.phi200 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %20, %vector.body ]
  %16 = shl i64 %index, 2
  %17 = getelementptr i8, ptr %.unpack158, i64 %16
  %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !3
  %18 = getelementptr i32, ptr %17, i64 4
  %wide.load201 = load <4 x i32>, ptr %18, align 4, !tbaa !3
  %19 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %20 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load201, <4 x i32> %vec.phi200)
  %index.next = add nuw i64 %index, 8
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %rdx.minmax.select = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %19, <4 x i32> %20)
  %22 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax.select)
  %cmp.n = icmp eq i64 %.unpack165.unpack.unpack167, %n.vec
  br i1 %cmp.n, label %.lr.ph.i182.preheader, label %.lr.ph.i.preheader222

.lr.ph.i.preheader222:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph223 = phi i32 [ -2147483648, %.lr.ph.i.preheader ], [ %22, %middle.block ]
  %.ph224 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader222, %.lr.ph.i
  %23 = phi i32 [ %28, %.lr.ph.i ], [ %.ph223, %.lr.ph.i.preheader222 ]
  %24 = phi i64 [ %29, %.lr.ph.i ], [ %.ph224, %.lr.ph.i.preheader222 ]
  %25 = shl i64 %24, 2
  %26 = getelementptr i8, ptr %.unpack158, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !3
  %28 = call i32 @llvm.smax.i32(i32 %27, i32 %23)
  %29 = add nuw nsw i64 %24, 1
  %exitcond.not.i = icmp eq i64 %29, %.unpack165.unpack.unpack167
  br i1 %exitcond.not.i, label %.lr.ph.i182.preheader, label %.lr.ph.i, !llvm.loop !12

.lr.ph.i182.preheader:                            ; preds = %.lr.ph.i, %middle.block
  %.lcssa199 = phi i32 [ %22, %middle.block ], [ %28, %.lr.ph.i ]
  %30 = shl i32 %.lcssa199, 1
  %min.iters.check204 = icmp ult i64 %.unpack165.unpack.unpack167, 8
  br i1 %min.iters.check204, label %.lr.ph.i182.preheader218, label %vector.ph205

vector.ph205:                                     ; preds = %.lr.ph.i182.preheader
  %n.vec207 = and i64 %.unpack165.unpack.unpack167, -8
  br label %vector.body210

vector.body210:                                   ; preds = %vector.body210, %vector.ph205
  %index211 = phi i64 [ 0, %vector.ph205 ], [ %index.next216, %vector.body210 ]
  %vec.phi212 = phi <4 x i32> [ zeroinitializer, %vector.ph205 ], [ %34, %vector.body210 ]
  %vec.phi213 = phi <4 x i32> [ zeroinitializer, %vector.ph205 ], [ %35, %vector.body210 ]
  %31 = shl i64 %index211, 2
  %32 = getelementptr i8, ptr %.unpack158, i64 %31
  %wide.load214 = load <4 x i32>, ptr %32, align 4, !tbaa !3
  %33 = getelementptr i32, ptr %32, i64 4
  %wide.load215 = load <4 x i32>, ptr %33, align 4, !tbaa !3
  %34 = add <4 x i32> %wide.load214, %vec.phi212
  %35 = add <4 x i32> %wide.load215, %vec.phi213
  %index.next216 = add nuw i64 %index211, 8
  %36 = icmp eq i64 %index.next216, %n.vec207
  br i1 %36, label %middle.block202, label %vector.body210, !llvm.loop !13

middle.block202:                                  ; preds = %vector.body210
  %bin.rdx = add <4 x i32> %35, %34
  %37 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n209 = icmp eq i64 %.unpack165.unpack.unpack167, %n.vec207
  br i1 %cmp.n209, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i182.preheader218

.lr.ph.i182.preheader218:                         ; preds = %.lr.ph.i182.preheader, %middle.block202
  %.ph = phi i32 [ 0, %.lr.ph.i182.preheader ], [ %37, %middle.block202 ]
  %.ph219 = phi i64 [ 0, %.lr.ph.i182.preheader ], [ %n.vec207, %middle.block202 ]
  br label %.lr.ph.i182

.lr.ph.i182:                                      ; preds = %.lr.ph.i182.preheader218, %.lr.ph.i182
  %38 = phi i32 [ %43, %.lr.ph.i182 ], [ %.ph, %.lr.ph.i182.preheader218 ]
  %39 = phi i64 [ %44, %.lr.ph.i182 ], [ %.ph219, %.lr.ph.i182.preheader218 ]
  %40 = shl i64 %39, 2
  %41 = getelementptr i8, ptr %.unpack158, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !3
  %43 = add i32 %42, %38
  %44 = add nuw nsw i64 %39, 1
  %exitcond.not.i183 = icmp eq i64 %44, %.unpack165.unpack.unpack167
  br i1 %exitcond.not.i183, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i182, !llvm.loop !14

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i182, %middle.block202, %0
  %45 = phi i32 [ 0, %0 ], [ %30, %middle.block202 ], [ %30, %.lr.ph.i182 ]
  %.lcssa.i184 = phi i32 [ 0, %0 ], [ %37, %middle.block202 ], [ %43, %.lr.ph.i182 ]
  %46 = icmp slt i32 %45, %.lcssa.i184
  %47 = select i1 %46, ptr @_QQcl.596573, ptr @_QQcl.204E6F
  %48 = call i1 @_FortranAioOutputAscii(ptr %14, ptr nonnull %47, i64 3)
  %49 = call i32 @_FortranAioEndIoStatement(ptr %14)
  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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind 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}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
