program main
	implicit none
    integer n,i
    double precision,allocatable::a(:)
    double precision::s=0
    read *, n
    allocate(a(n))
    read *, (a(i), i=1,n)
    do i=1,n
    	s=s+1/(1.0*a(i))
    end do
    print '(f0.12)',1/s
end program main
; 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
@_QFEs = internal unnamed_addr global double 0.000000e+00
@_QQcl.8455fc1f5fb1cccf16b548f50d2a0f89 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3451/source.f\00"
@_QQcl.2866302E313229 = linkonce constant [7 x i8] c"(f0.12)"
@_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 i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8455fc1f5fb1cccf16b548f50d2a0f89, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = shl nuw nsw i64 %7, 3
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEa.0, align 8, !tbaa !7
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8455fc1f5fb1cccf16b548f50d2a0f89, i32 8)
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %13 = zext i32 %11 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %14 = phi i64 [ %19, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %.unpack71 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %sext = shl i64 %14, 32
  %15 = ashr exact i64 %sext, 32
  %16 = add nsw i64 %15, -1
  %17 = getelementptr double, ptr %.unpack71, i64 %16
  %18 = call i1 @_FortranAioInputReal64(ptr %10, ptr %17)
  %19 = add nuw nsw i64 %14, 1
  %exitcond.not = icmp eq i64 %14, %13
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %20 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %21 = load i32, ptr %1, align 4, !tbaa !3
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph84, label %50

.lr.ph84:                                         ; preds = %._crit_edge
  %23 = zext i32 %21 to i64
  %_QFEs.promoted = load double, ptr @_QFEs, align 8, !tbaa !3
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %xtraiter = and i64 %23, 3
  %24 = icmp ult i32 %21, 4
  br i1 %24, label %._crit_edge85.unr-lcssa, label %.lr.ph84.new

.lr.ph84.new:                                     ; preds = %.lr.ph84
  %unroll_iter = and i64 %23, 4294967292
  br label %25

25:                                               ; preds = %25, %.lr.ph84.new
  %indvars.iv = phi i64 [ 1, %.lr.ph84.new ], [ %indvars.iv.next.3, %25 ]
  %26 = phi double [ %_QFEs.promoted, %.lr.ph84.new ], [ %43, %25 ]
  %niter = phi i64 [ 0, %.lr.ph84.new ], [ %niter.next.3, %25 ]
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr double, ptr %.unpack, i64 %27
  %29 = load double, ptr %28, align 8, !tbaa !3
  %30 = fdiv contract double 1.000000e+00, %29
  %31 = fadd contract double %26, %30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = getelementptr double, ptr %.unpack, i64 %indvars.iv
  %33 = load double, ptr %32, align 8, !tbaa !3
  %34 = fdiv contract double 1.000000e+00, %33
  %35 = fadd contract double %31, %34
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %36 = getelementptr double, ptr %.unpack, i64 %indvars.iv.next
  %37 = load double, ptr %36, align 8, !tbaa !3
  %38 = fdiv contract double 1.000000e+00, %37
  %39 = fadd contract double %35, %38
  %40 = getelementptr double, ptr %.unpack, i64 %indvars.iv.next.1
  %41 = load double, ptr %40, align 8, !tbaa !3
  %42 = fdiv contract double 1.000000e+00, %41
  %43 = fadd contract double %39, %42
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge85.unr-lcssa, label %25

._crit_edge85.unr-lcssa:                          ; preds = %25, %.lr.ph84
  %.lcssa.ph = phi double [ undef, %.lr.ph84 ], [ %43, %25 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph84 ], [ %indvars.iv.next.3, %25 ]
  %.unr = phi double [ %_QFEs.promoted, %.lr.ph84 ], [ %43, %25 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge85, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge85.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge85.unr-lcssa ]
  %44 = phi double [ %49, %.epil.preheader ], [ %.unr, %._crit_edge85.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge85.unr-lcssa ]
  %45 = add nsw i64 %indvars.iv.epil, -1
  %46 = getelementptr double, ptr %.unpack, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !3
  %48 = fdiv contract double 1.000000e+00, %47
  %49 = fadd contract double %44, %48
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge85, label %.epil.preheader, !llvm.loop !9

._crit_edge85:                                    ; preds = %.epil.preheader, %._crit_edge85.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge85.unr-lcssa ], [ %49, %.epil.preheader ]
  store double %.lcssa, ptr @_QFEs, align 8, !tbaa !3
  br label %50

50:                                               ; preds = %._crit_edge85, %._crit_edge
  %51 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2866302E313229, i64 7, ptr null, i32 -1, ptr nonnull @_QQcl.8455fc1f5fb1cccf16b548f50d2a0f89, i32 12)
  %52 = load double, ptr @_QFEs, align 8, !tbaa !3
  %53 = fdiv contract double 1.000000e+00, %52
  %54 = call i1 @_FortranAioOutputReal64(ptr %51, double %53)
  %55 = call i32 @_FortranAioEndIoStatement(ptr %51)
  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 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputReal64(ptr, double) 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}
!10 = !{!"llvm.loop.unroll.disable"}
