program five_transportations
    implicit none
    integer(8):: n,a,b,c,d,e

    read*, n
    read*, a
    read*, b
    read*, c
    read*, d
    read*, e

    print*, ceiling(dble(n)/dble(minval([a,b,c,d,e])),kind=8) + 4
end program five_transportations
; 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"

@_QQcl.6d175a1cc00f5042fd10931f9d653114 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4581/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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 5)
  %9 = call i1 @_FortranAioInputInteger(ptr %8, ptr nonnull %7, i32 8)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 6)
  %12 = call i1 @_FortranAioInputInteger(ptr %11, ptr nonnull %2, i32 8)
  %13 = call i32 @_FortranAioEndIoStatement(ptr %11)
  %14 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 7)
  %15 = call i1 @_FortranAioInputInteger(ptr %14, ptr nonnull %3, i32 8)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %17 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 8)
  %18 = call i1 @_FortranAioInputInteger(ptr %17, ptr nonnull %4, i32 8)
  %19 = call i32 @_FortranAioEndIoStatement(ptr %17)
  %20 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 9)
  %21 = call i1 @_FortranAioInputInteger(ptr %20, ptr nonnull %5, i32 8)
  %22 = call i32 @_FortranAioEndIoStatement(ptr %20)
  %23 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 10)
  %24 = call i1 @_FortranAioInputInteger(ptr %23, ptr nonnull %6, i32 8)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %23)
  %26 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 12)
  %27 = load i64, ptr %7, align 8, !tbaa !3
  %28 = call dereferenceable_or_null(40) ptr @malloc(i64 40)
  %29 = load i64, ptr %2, align 8, !tbaa !3
  store i64 %29, ptr %28, align 8, !tbaa !3
  %30 = load i64, ptr %3, align 8, !tbaa !3
  %31 = getelementptr [5 x i64], ptr %28, i64 0, i64 1
  store i64 %30, ptr %31, align 8, !tbaa !3
  %32 = load i64, ptr %4, align 8, !tbaa !3
  %33 = getelementptr [5 x i64], ptr %28, i64 0, i64 2
  store i64 %32, ptr %33, align 8, !tbaa !3
  %34 = load i64, ptr %5, align 8, !tbaa !3
  %35 = getelementptr [5 x i64], ptr %28, i64 0, i64 3
  store i64 %34, ptr %35, align 8, !tbaa !3
  %36 = load i64, ptr %6, align 8, !tbaa !3
  %37 = call dereferenceable_or_null(80) ptr @realloc(ptr nonnull %28, i64 80)
  %38 = getelementptr [5 x i64], ptr %37, i64 0, i64 4
  store i64 %36, ptr %38, align 8, !tbaa !3
  %39 = call dereferenceable_or_null(40) ptr @malloc(i64 40)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %39, ptr noundef nonnull align 8 dereferenceable(40) %37, i64 40, i1 false), !tbaa !3
  %40 = sitofp i64 %27 to double
  store ptr %39, 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 8, 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 10, 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 5, 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 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %41 = call i64 @_FortranAMinvalInteger8(ptr nonnull %1, ptr nonnull @_QQcl.6d175a1cc00f5042fd10931f9d653114, i32 12, i32 0, ptr null)
  %42 = sitofp i64 %41 to double
  %43 = fdiv contract double %40, %42
  %44 = call contract double @llvm.ceil.f64(double %43)
  %45 = fptosi double %44 to i64
  %46 = add i64 %45, 4
  %47 = call i1 @_FortranAioOutputInteger64(ptr %26, i64 %46)
  call void @free(ptr %39)
  call void @free(ptr nonnull %37)
  %48 = call i32 @_FortranAioEndIoStatement(ptr %26)
  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 ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #2 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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}
