program prob4
    implicit none
    integer::n, i
    integer(16)::t, ans, a, b, c
    read(*,*) n
    read(*,*) t
    ans = t
    do i = 2, n
        read(*,*) t
        a = ans
        b = t
        c = mod(a,b)
        do while(c > 0)
            a = b
            b = c
            c = mod(a,b)
        end do
        ans = ans/b*t
    end do
    write(*,*) ans
    stop
end program
; 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.643cef9323ca360d5b911412b959c3e3 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7037/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i128, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.643cef9323ca360d5b911412b959c3e3, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.643cef9323ca360d5b911412b959c3e3, i32 6)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %2, i32 16)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = load i128, ptr %2, align 8, !tbaa !3
  %10 = load i32, ptr %1, align 4, !tbaa !3
  %.01720 = add i32 %10, -1
  %11 = icmp sgt i32 %.01720, 0
  br i1 %11, label %.lr.ph24, label %._crit_edge25

.lr.ph24:                                         ; preds = %0, %._crit_edge
  %.01722 = phi i32 [ %.017, %._crit_edge ], [ %.01720, %0 ]
  %.01621 = phi i128 [ %21, %._crit_edge ], [ %9, %0 ]
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.643cef9323ca360d5b911412b959c3e3, i32 9)
  %13 = call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull %2, i32 16)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = load i128, ptr %2, align 8, !tbaa !3
  %16 = srem i128 %.01621, %15
  %17 = icmp sgt i128 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph24, %.lr.ph
  %.01419 = phi i128 [ %18, %.lr.ph ], [ %16, %.lr.ph24 ]
  %.01518 = phi i128 [ %.01419, %.lr.ph ], [ %15, %.lr.ph24 ]
  %18 = srem i128 %.01518, %.01419
  %19 = icmp sgt i128 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph24
  %.015.lcssa = phi i128 [ %15, %.lr.ph24 ], [ %.01419, %.lr.ph ]
  %20 = sdiv i128 %.01621, %.015.lcssa
  %21 = mul i128 %20, %15
  %.017 = add i32 %.01722, -1
  %22 = icmp sgt i32 %.017, 0
  br i1 %22, label %.lr.ph24, label %._crit_edge25

._crit_edge25:                                    ; preds = %._crit_edge, %0
  %.016.lcssa = phi i128 [ %9, %0 ], [ %21, %._crit_edge ]
  %23 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.643cef9323ca360d5b911412b959c3e3, i32 20)
  %24 = call i1 @_FortranAioOutputInteger128(ptr %23, i128 %.016.lcssa)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %23)
  %26 = 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 ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger128(ptr, i128) 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 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
