program ABC137B
    implicit none
    integer(8)::N,i
    real(8)::out=0
    real(8),allocatable,dimension(:)::A
    read(5,*)N
    allocate(A(N))
    read(5,*)(A(i),i=1,N)

    do i=1,N
        out=out+1/A(i)
    end do

    print'(f0.10)',1/out
    
end program ABC137B
; 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
@_QFEout = internal unnamed_addr global double 0.000000e+00
@_QQcl.35a7eb93507b386a5e48dba7f65512f0 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3454/source.f\00"
@_QQcl.2866302E313029 = linkonce constant [7 x i8] c"(f0.10)"
@_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 i64, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.35a7eb93507b386a5e48dba7f65512f0, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 8)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i64, ptr %1, align 8, !tbaa !3
  %6 = call i64 @llvm.smax.i64(i64 %5, i64 0)
  %7 = shl i64 %6, 3
  %8 = call ptr @malloc(i64 %7)
  store ptr %8, ptr @_QFEa.0, align 8, !tbaa !7
  %9 = call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.35a7eb93507b386a5e48dba7f65512f0, i32 8)
  %10 = load i64, ptr %1, align 8, !tbaa !3
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %12 = phi i64 [ %16, %.lr.ph ], [ 1, %0 ]
  %.unpack71 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %13 = add i64 %12, -1
  %14 = getelementptr double, ptr %.unpack71, i64 %13
  %15 = call i1 @_FortranAioInputReal64(ptr %9, ptr %14)
  %16 = add nuw i64 %12, 1
  %exitcond.not = icmp eq i64 %12, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %17 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %18 = load i64, ptr %1, align 8, !tbaa !3
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph84, label %52

.lr.ph84:                                         ; preds = %._crit_edge
  %_QFEout.promoted = load double, ptr @_QFEout, align 8, !tbaa !3
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %xtraiter = and i64 %18, 3
  %20 = icmp ult i64 %18, 4
  br i1 %20, label %._crit_edge85.unr-lcssa, label %.lr.ph84.new

.lr.ph84.new:                                     ; preds = %.lr.ph84
  %unroll_iter = and i64 %18, -4
  br label %21

21:                                               ; preds = %21, %.lr.ph84.new
  %22 = phi i64 [ 1, %.lr.ph84.new ], [ %43, %21 ]
  %23 = phi double [ %_QFEout.promoted, %.lr.ph84.new ], [ %42, %21 ]
  %niter = phi i64 [ 0, %.lr.ph84.new ], [ %niter.next.3, %21 ]
  %24 = add nsw i64 %22, -1
  %25 = getelementptr double, ptr %.unpack, i64 %24
  %26 = load double, ptr %25, align 8, !tbaa !3
  %27 = fdiv contract double 1.000000e+00, %26
  %28 = fadd contract double %23, %27
  %29 = add nuw nsw i64 %22, 1
  %30 = getelementptr double, ptr %.unpack, i64 %22
  %31 = load double, ptr %30, align 8, !tbaa !3
  %32 = fdiv contract double 1.000000e+00, %31
  %33 = fadd contract double %28, %32
  %34 = add nuw nsw i64 %22, 2
  %35 = getelementptr double, ptr %.unpack, i64 %29
  %36 = load double, ptr %35, align 8, !tbaa !3
  %37 = fdiv contract double 1.000000e+00, %36
  %38 = fadd contract double %33, %37
  %39 = getelementptr double, ptr %.unpack, i64 %34
  %40 = load double, ptr %39, align 8, !tbaa !3
  %41 = fdiv contract double 1.000000e+00, %40
  %42 = fadd contract double %38, %41
  %43 = add nuw i64 %22, 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 %21

._crit_edge85.unr-lcssa:                          ; preds = %21, %.lr.ph84
  %.lcssa.ph = phi double [ undef, %.lr.ph84 ], [ %42, %21 ]
  %.unr = phi i64 [ 1, %.lr.ph84 ], [ %43, %21 ]
  %.unr87 = phi double [ %_QFEout.promoted, %.lr.ph84 ], [ %42, %21 ]
  %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
  %44 = phi i64 [ %51, %.epil.preheader ], [ %.unr, %._crit_edge85.unr-lcssa ]
  %45 = phi double [ %50, %.epil.preheader ], [ %.unr87, %._crit_edge85.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge85.unr-lcssa ]
  %46 = add i64 %44, -1
  %47 = getelementptr double, ptr %.unpack, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !3
  %49 = fdiv contract double 1.000000e+00, %48
  %50 = fadd contract double %45, %49
  %51 = add nuw i64 %44, 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 ], [ %50, %.epil.preheader ]
  store double %.lcssa, ptr @_QFEout, align 8, !tbaa !3
  br label %52

52:                                               ; preds = %._crit_edge85, %._crit_edge
  %53 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2866302E313029, i64 7, ptr null, i32 -1, ptr nonnull @_QQcl.35a7eb93507b386a5e48dba7f65512f0, i32 14)
  %54 = load double, ptr @_QFEout, align 8, !tbaa !3
  %55 = fdiv contract double 1.000000e+00, %54
  %56 = call i1 @_FortranAioOutputReal64(ptr %53, double %55)
  %57 = call i32 @_FortranAioEndIoStatement(ptr %53)
  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 i64 @llvm.smax.i64(i64, i64) #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"}
