program garden
  implicit none

  integer :: n, min, max, i, cnt, j, k, t, s
  integer, allocatable :: h(:), h2(:)

  read(*,*) n
  allocate(h(n))
  allocate(h2(n))
  read(*,*) h

  min = minval(h)
  max = maxval(h)


     cnt = min

  
  do j = min, max
     do t = 1, n
        if(h(t) >= j) then
           h2(t) = h(t) - j 
        else
           h2(t) = 0
        end if

        
     end do
     
     do i = 1, n
        if (h2(i) >= 1) then
           if(product(h2(i:n)) == 0) then
              do k = i, n
                 if(h2(k) == 0) then
                    do s = i, k
                       h2(s) = 0
                    end do
                    
                    cnt = cnt + 1
                    exit
                 end if
              end do
              
           else
              cnt = cnt + 1
              exit
           end if
        end if
     end do
     
  end do

  write(*,*) cnt
end program garden

           

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

@_QFEh.0 = internal unnamed_addr global ptr null
@_QFEh.8 = internal unnamed_addr global i64 0
@_QFEh2.0 = internal unnamed_addr global ptr null
@_QQcl.315aa78deca7c6aac97337c8811c1dd0 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5089/source.f\00"
@_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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca i32, align 4
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.315aa78deca7c6aac97337c8811c1dd0, i32 7)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %8 = load i32, ptr %4, align 4, !tbaa !3
  %9 = call i32 @llvm.smax.i32(i32 %8, i32 0)
  %10 = zext i32 %9 to i64
  %11 = shl nuw nsw i64 %10, 2
  %12 = call ptr @malloc(i64 %11)
  store ptr %12, ptr @_QFEh.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEh.8, align 8, !tbaa !7
  %13 = call ptr @malloc(i64 %11)
  store ptr %13, ptr @_QFEh2.0, align 8, !tbaa !7
  %14 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.315aa78deca7c6aac97337c8811c1dd0, i32 10)
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack499.unpack.unpack501 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %3, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack499.unpack.unpack501, 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 %3, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %15 = call i1 @_FortranAioInputDescriptor(ptr %14, ptr nonnull %3)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %.unpack504 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack511.unpack.unpack513 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  store ptr %.unpack504, ptr %2, align 8, !tbaa !7
  %.fca.1.gep139 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep139, align 8, !tbaa !7
  %.fca.2.gep141 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep141, align 8, !tbaa !7
  %.fca.3.gep143 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep143, align 4, !tbaa !7
  %.fca.4.gep145 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep145, align 1, !tbaa !7
  %.fca.5.gep147 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep147, align 2, !tbaa !7
  %.fca.6.gep149 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep149, align 1, !tbaa !7
  %.fca.7.0.0.gep151 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep151, align 8, !tbaa !7
  %.fca.7.0.1.gep153 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack511.unpack.unpack513, ptr %.fca.7.0.1.gep153, align 8, !tbaa !7
  %.fca.7.0.2.gep155 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep155, align 8, !tbaa !7
  %17 = call i32 @_FortranAMinvalInteger4(ptr nonnull %2, ptr nonnull @_QQcl.315aa78deca7c6aac97337c8811c1dd0, i32 12, i32 0, ptr null)
  %.unpack516 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack523.unpack.unpack525 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  %18 = icmp sgt i64 %.unpack523.unpack.unpack525, 0
  br i1 %18, label %.lr.ph.i.preheader, label %_FortranAMaxvalInteger4x1_contract_simplified.exit

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

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack523.unpack.unpack525, -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 ], [ %22, %vector.body ]
  %vec.phi643 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %23, %vector.body ]
  %19 = shl i64 %index, 2
  %20 = getelementptr i8, ptr %.unpack516, i64 %19
  %wide.load = load <4 x i32>, ptr %20, align 4, !tbaa !3
  %21 = getelementptr i32, ptr %20, i64 4
  %wide.load644 = load <4 x i32>, ptr %21, align 4, !tbaa !3
  %22 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %23 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load644, <4 x i32> %vec.phi643)
  %index.next = add nuw i64 %index, 8
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, 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> %22, <4 x i32> %23)
  %25 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax.select)
  %cmp.n = icmp eq i64 %.unpack523.unpack.unpack525, %n.vec
  br i1 %cmp.n, label %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader682

.lr.ph.i.preheader682:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph683 = phi i32 [ -2147483648, %.lr.ph.i.preheader ], [ %25, %middle.block ]
  %.ph684 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader682, %.lr.ph.i
  %26 = phi i32 [ %31, %.lr.ph.i ], [ %.ph683, %.lr.ph.i.preheader682 ]
  %27 = phi i64 [ %32, %.lr.ph.i ], [ %.ph684, %.lr.ph.i.preheader682 ]
  %28 = shl i64 %27, 2
  %29 = getelementptr i8, ptr %.unpack516, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !3
  %31 = call i32 @llvm.smax.i32(i32 %30, i32 %26)
  %32 = add nuw nsw i64 %27, 1
  %exitcond.not.i = icmp eq i64 %32, %.unpack523.unpack.unpack525
  br i1 %exitcond.not.i, label %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranAMaxvalInteger4x1_contract_simplified.exit: ; preds = %.lr.ph.i, %middle.block, %0
  %.lcssa.i = phi i32 [ -2147483648, %0 ], [ %25, %middle.block ], [ %31, %.lr.ph.i ]
  %33 = sub i32 1, %17
  %34 = add i32 %33, %.lcssa.i
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph620, label %._crit_edge621

.lr.ph620:                                        ; preds = %_FortranAMaxvalInteger4x1_contract_simplified.exit
  %.fca.1.gep269 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep271 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep273 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep275 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep277 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep279 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep281 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep283 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep285 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  br label %36

36:                                               ; preds = %.lr.ph620, %.loopexit601
  %.0468619 = phi i32 [ %17, %.lr.ph620 ], [ %124, %.loopexit601 ]
  %.0470618 = phi i32 [ %17, %.lr.ph620 ], [ %.3, %.loopexit601 ]
  %.0471617 = phi i32 [ %34, %.lr.ph620 ], [ %123, %.loopexit601 ]
  %37 = load i32, ptr %4, align 4, !tbaa !3
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph, label %.loopexit601

.lr.ph:                                           ; preds = %36
  %39 = zext i32 %37 to i64
  %.unpack564 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack588 = load ptr, ptr @_QFEh2.0, align 8
  %min.iters.check663 = icmp ult i32 %37, 8
  %.unpack588659 = ptrtoint ptr %.unpack588 to i64
  %.unpack564660 = ptrtoint ptr %.unpack564 to i64
  %40 = sub i64 %.unpack588659, %.unpack564660
  %diff.check = icmp ult i64 %40, 32
  %or.cond = select i1 %min.iters.check663, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph662.preheader, label %vector.ph664

vector.ph664:                                     ; preds = %.lr.ph
  %n.vec666 = and i64 %39, 4294967288
  %ind.end667 = or i64 %n.vec666, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.0468619, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert675 = insertelement <4 x i32> poison, i32 %.0468619, i64 0
  %broadcast.splat676 = shufflevector <4 x i32> %broadcast.splatinsert675, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body670

vector.body670:                                   ; preds = %vector.body670, %vector.ph664
  %index671 = phi i64 [ 0, %vector.ph664 ], [ %index.next677, %vector.body670 ]
  %41 = getelementptr i32, ptr %.unpack564, i64 %index671
  %wide.load673 = load <4 x i32>, ptr %41, align 4, !tbaa !3
  %42 = getelementptr i32, ptr %41, i64 4
  %wide.load674 = load <4 x i32>, ptr %42, align 4, !tbaa !3
  %43 = icmp slt <4 x i32> %wide.load673, %broadcast.splat
  %44 = icmp slt <4 x i32> %wide.load674, %broadcast.splat676
  %45 = sub <4 x i32> %wide.load673, %broadcast.splat
  %46 = sub <4 x i32> %wide.load674, %broadcast.splat676
  %47 = select <4 x i1> %43, <4 x i32> zeroinitializer, <4 x i32> %45
  %48 = select <4 x i1> %44, <4 x i32> zeroinitializer, <4 x i32> %46
  %49 = getelementptr i32, ptr %.unpack588, i64 %index671
  store <4 x i32> %47, ptr %49, align 4, !tbaa !3
  %50 = getelementptr i32, ptr %49, i64 4
  store <4 x i32> %48, ptr %50, align 4, !tbaa !3
  %index.next677 = add nuw i64 %index671, 8
  %51 = icmp eq i64 %index.next677, %n.vec666
  br i1 %51, label %middle.block661, label %vector.body670, !llvm.loop !13

middle.block661:                                  ; preds = %vector.body670
  %cmp.n669 = icmp eq i64 %n.vec666, %39
  br i1 %cmp.n669, label %._crit_edge, label %scalar.ph662.preheader

scalar.ph662.preheader:                           ; preds = %.lr.ph, %middle.block661
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end667, %middle.block661 ]
  %xtraiter = and i64 %39, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph662.prol.loopexit, label %scalar.ph662.prol

scalar.ph662.prol:                                ; preds = %scalar.ph662.preheader
  %52 = add nsw i64 %indvars.iv.ph, -1
  %53 = getelementptr i32, ptr %.unpack564, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !3
  %.not.prol = icmp slt i32 %54, %.0468619
  %55 = sub i32 %54, %.0468619
  %.sink.prol = select i1 %.not.prol, i32 0, i32 %55
  %56 = add nsw i64 %indvars.iv.ph, -1
  %57 = getelementptr i32, ptr %.unpack588, i64 %56
  store i32 %.sink.prol, ptr %57, align 4, !tbaa !3
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1
  br label %scalar.ph662.prol.loopexit

scalar.ph662.prol.loopexit:                       ; preds = %scalar.ph662.prol, %scalar.ph662.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph662.preheader ], [ %indvars.iv.next.prol, %scalar.ph662.prol ]
  %58 = icmp eq i64 %indvars.iv.ph, %39
  br i1 %58, label %._crit_edge, label %scalar.ph662

scalar.ph662:                                     ; preds = %scalar.ph662.prol.loopexit, %scalar.ph662
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph662 ], [ %indvars.iv.unr, %scalar.ph662.prol.loopexit ]
  %59 = add i64 %indvars.iv, -1
  %60 = getelementptr i32, ptr %.unpack564, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !3
  %.not = icmp slt i32 %61, %.0468619
  %62 = sub i32 %61, %.0468619
  %.sink = select i1 %.not, i32 0, i32 %62
  %63 = add i64 %indvars.iv, -1
  %64 = getelementptr i32, ptr %.unpack588, i64 %63
  store i32 %.sink, ptr %64, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %65 = getelementptr i32, ptr %.unpack564, i64 %indvars.iv
  %66 = load i32, ptr %65, align 4, !tbaa !3
  %.not.1 = icmp slt i32 %66, %.0468619
  %67 = sub i32 %66, %.0468619
  %.sink.1 = select i1 %.not.1, i32 0, i32 %67
  %68 = getelementptr i32, ptr %.unpack588, i64 %indvars.iv
  store i32 %.sink.1, ptr %68, align 4, !tbaa !3
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next, %39
  br i1 %exitcond.not.1, label %._crit_edge, label %scalar.ph662, !llvm.loop !14

._crit_edge:                                      ; preds = %scalar.ph662.prol.loopexit, %scalar.ph662, %middle.block661
  %.pre = load i32, ptr %4, align 4, !tbaa !3
  %69 = icmp sgt i32 %.pre, 0
  br i1 %69, label %.lr.ph616.preheader, label %.loopexit601

.lr.ph616.preheader:                              ; preds = %._crit_edge
  %.unpack528.pre629 = load ptr, ptr @_QFEh2.0, align 8, !tbaa !7
  br label %.lr.ph616

.lr.ph616:                                        ; preds = %.lr.ph616.preheader, %.loopexit
  %indvar = phi i64 [ 0, %.lr.ph616.preheader ], [ %indvar.next, %.loopexit ]
  %.unpack528 = phi ptr [ %.unpack528.pre629, %.lr.ph616.preheader ], [ %.unpack528630, %.loopexit ]
  %.0469612 = phi i32 [ 1, %.lr.ph616.preheader ], [ %122, %.loopexit ]
  %.1611 = phi i32 [ %.0470618, %.lr.ph616.preheader ], [ %.2, %.loopexit ]
  %70 = xor i64 %indvar, -1
  %71 = sext i32 %.0469612 to i64
  %72 = add nsw i64 %71, -1
  %73 = getelementptr i32, ptr %.unpack528, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !3
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %76, label %.loopexit

76:                                               ; preds = %.lr.ph616
  %77 = load i32, ptr %4, align 4, !tbaa !3
  %78 = sext i32 %77 to i64
  %79 = sub nsw i64 %78, %71
  %80 = call i64 @llvm.smax.i64(i64 %79, i64 -1)
  %81 = add nsw i64 %80, 1
  store ptr %73, ptr %1, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep269, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep271, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep273, align 4, !tbaa !7
  store i8 9, ptr %.fca.4.gep275, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep277, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep279, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep281, align 8, !tbaa !7
  store i64 %81, ptr %.fca.7.0.1.gep283, align 8, !tbaa !7
  store i64 4, ptr %.fca.7.0.2.gep285, align 8, !tbaa !7
  %82 = call i32 @_FortranAProductInteger4(ptr nonnull %1, ptr nonnull @_QQcl.315aa78deca7c6aac97337c8811c1dd0, i32 30, i32 0, ptr null)
  %83 = icmp eq i32 %82, 0
  %.unpack528.pre = load ptr, ptr @_QFEh2.0, align 8, !tbaa !7
  br i1 %83, label %84, label %120

84:                                               ; preds = %76
  %85 = load i32, ptr %4, align 4, !tbaa !3
  %86 = sub i32 1, %.0469612
  %87 = add i32 %86, %85
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.lr.ph607, label %.loopexit

.lr.ph607:                                        ; preds = %84, %118
  %.0467604 = phi i32 [ %119, %118 ], [ %.0469612, %84 ]
  %89 = sext i32 %.0467604 to i64
  %90 = add nsw i64 %89, -1
  %91 = getelementptr i32, ptr %.unpack528.pre, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !3
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %118

94:                                               ; preds = %.lr.ph607
  %95 = sub nsw i64 1, %71
  %96 = add nsw i64 %95, %89
  %97 = icmp sgt i64 %96, 0
  br i1 %97, label %.lr.ph609.preheader, label %._crit_edge610

.lr.ph609.preheader:                              ; preds = %94
  %min.iters.check647 = icmp ult i64 %96, 12
  br i1 %min.iters.check647, label %.lr.ph609.preheader678, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph609.preheader
  %98 = add i64 %70, %89
  %99 = trunc i64 %98 to i32
  %100 = add i32 %.0469612, %99
  %101 = icmp slt i32 %100, %.0469612
  %102 = icmp ugt i64 %98, 4294967295
  %103 = or i1 %101, %102
  br i1 %103, label %.lr.ph609.preheader678, label %vector.ph648

vector.ph648:                                     ; preds = %vector.scevcheck
  %n.vec650 = and i64 %96, -8
  %ind.end = and i64 %96, 7
  %.cast = trunc i64 %n.vec650 to i32
  %ind.end652 = add i32 %.0469612, %.cast
  br label %vector.body655

vector.body655:                                   ; preds = %vector.body655, %vector.ph648
  %index656 = phi i64 [ 0, %vector.ph648 ], [ %index.next658, %vector.body655 ]
  %.cast657 = trunc i64 %index656 to i32
  %offset.idx = add i32 %.0469612, %.cast657
  %104 = sext i32 %offset.idx to i64
  %105 = add nsw i64 %104, -1
  %106 = getelementptr i32, ptr %.unpack528.pre, i64 %105
  store <4 x i32> zeroinitializer, ptr %106, align 4, !tbaa !3
  %107 = getelementptr i32, ptr %106, i64 4
  store <4 x i32> zeroinitializer, ptr %107, align 4, !tbaa !3
  %index.next658 = add nuw i64 %index656, 8
  %108 = icmp eq i64 %index.next658, %n.vec650
  br i1 %108, label %middle.block645, label %vector.body655, !llvm.loop !15

middle.block645:                                  ; preds = %vector.body655
  %cmp.n654 = icmp eq i64 %96, %n.vec650
  br i1 %cmp.n654, label %._crit_edge610, label %.lr.ph609.preheader678

.lr.ph609.preheader678:                           ; preds = %vector.scevcheck, %.lr.ph609.preheader, %middle.block645
  %.ph = phi i64 [ %96, %vector.scevcheck ], [ %96, %.lr.ph609.preheader ], [ %ind.end, %middle.block645 ]
  %.ph679 = phi i32 [ %.0469612, %vector.scevcheck ], [ %.0469612, %.lr.ph609.preheader ], [ %ind.end652, %middle.block645 ]
  br label %.lr.ph609

.lr.ph609:                                        ; preds = %.lr.ph609.preheader678, %.lr.ph609
  %109 = phi i64 [ %115, %.lr.ph609 ], [ %.ph, %.lr.ph609.preheader678 ]
  %110 = phi i32 [ %114, %.lr.ph609 ], [ %.ph679, %.lr.ph609.preheader678 ]
  %111 = sext i32 %110 to i64
  %112 = add nsw i64 %111, -1
  %113 = getelementptr i32, ptr %.unpack528.pre, i64 %112
  store i32 0, ptr %113, align 4, !tbaa !3
  %114 = add i32 %110, 1
  %115 = add nsw i64 %109, -1
  %116 = icmp ugt i64 %109, 1
  br i1 %116, label %.lr.ph609, label %._crit_edge610, !llvm.loop !16

._crit_edge610:                                   ; preds = %.lr.ph609, %middle.block645, %94
  %117 = add i32 %.1611, 1
  br label %.loopexit

118:                                              ; preds = %.lr.ph607
  %119 = add nuw i32 %.0467604, 1
  %exitcond627.not = icmp eq i32 %.0467604, %85
  br i1 %exitcond627.not, label %.loopexit, label %.lr.ph607

120:                                              ; preds = %76
  %121 = add i32 %.1611, 1
  br label %.loopexit601

.loopexit:                                        ; preds = %118, %84, %._crit_edge610, %.lr.ph616
  %.unpack528630 = phi ptr [ %.unpack528.pre, %._crit_edge610 ], [ %.unpack528, %.lr.ph616 ], [ %.unpack528.pre, %84 ], [ %.unpack528.pre, %118 ]
  %.2 = phi i32 [ %117, %._crit_edge610 ], [ %.1611, %.lr.ph616 ], [ %.1611, %84 ], [ %.1611, %118 ]
  %122 = add nuw i32 %.0469612, 1
  %exitcond628.not = icmp eq i32 %.0469612, %.pre
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond628.not, label %.loopexit601, label %.lr.ph616

.loopexit601:                                     ; preds = %.loopexit, %36, %._crit_edge, %120
  %.3 = phi i32 [ %121, %120 ], [ %.0470618, %._crit_edge ], [ %.0470618, %36 ], [ %.2, %.loopexit ]
  %123 = add i32 %.0471617, -1
  %124 = add i32 %.0468619, 1
  %125 = icmp sgt i32 %123, 0
  br i1 %125, label %36, label %._crit_edge621

._crit_edge621:                                   ; preds = %.loopexit601, %_FortranAMaxvalInteger4x1_contract_simplified.exit
  %.0470.lcssa = phi i32 [ %17, %_FortranAMaxvalInteger4x1_contract_simplified.exit ], [ %.3, %.loopexit601 ]
  %126 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.315aa78deca7c6aac97337c8811c1dd0, i32 53)
  %127 = call i1 @_FortranAioOutputInteger32(ptr %126, i32 %.0470.lcssa)
  %128 = call i32 @_FortranAioEndIoStatement(ptr %126)
  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 i32 @_FortranAMinvalInteger4(ptr, ptr, i32, i32, ptr) local_unnamed_addr

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

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) 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 i64 @llvm.smax.i64(i64, i64) #2

; 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

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, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}
