program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d,y(5)
    integer(8),allocatable::x(:)
  
    read(*,*) n
    do i=1,5
        read(*,*)y(i)
    end do
    a=minval(y)
    if(mod(n,a)==0)then
        b=n/a
    else
        b=n/a+1
    endif
    write(*,*)b+4
    stop
end program sample
  


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

@_QFEy = internal global [5 x i64] undef
@_QQcl.5459d93f1d7d42bbab604f2f22001c8f = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4587/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 8)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 8)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 10)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull @_QFEy, i32 8)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 10)
  %10 = call i1 @_FortranAioInputInteger(ptr %9, ptr nonnull getelementptr inbounds ([5 x i64], ptr @_QFEy, i64 0, i64 1), i32 8)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 10)
  %13 = call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull getelementptr inbounds ([5 x i64], ptr @_QFEy, i64 0, i64 2), i32 8)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 10)
  %16 = call i1 @_FortranAioInputInteger(ptr %15, ptr nonnull getelementptr inbounds ([5 x i64], ptr @_QFEy, i64 0, i64 3), i32 8)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 10)
  %19 = call i1 @_FortranAioInputInteger(ptr %18, ptr nonnull getelementptr inbounds ([5 x i64], ptr @_QFEy, i64 0, i64 4), i32 8)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %18)
  store ptr @_QFEy, ptr %1, align 8, !tbaa !3
  %.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 8, ptr %.fca.1.gep, align 8, !tbaa !3
  %.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 !3
  %.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 !3
  %.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 10, ptr %.fca.4.gep, align 1, !tbaa !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 5, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.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 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %21 = call i64 @_FortranAMinvalInteger8(ptr nonnull %1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 12, i32 0, ptr null)
  %22 = load i64, ptr %2, align 8, !tbaa !7
  %23 = srem i64 %22, %21
  %24 = icmp ne i64 %23, 0
  %25 = sdiv i64 %22, %21
  %26 = zext i1 %24 to i64
  %.0 = add i64 %25, %26
  %27 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.5459d93f1d7d42bbab604f2f22001c8f, i32 18)
  %28 = add i64 %.0, 4
  %29 = call i1 @_FortranAioOutputInteger64(ptr %27, i64 %28)
  %30 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %31 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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 i64 @_FortranAMinvalInteger8(ptr, ptr, i32, i32, ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
