#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int GetLcm(int *, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n, nc;
  int *psz = NULL;
  int re;
  int t;
  int i = 0;
  while (scanf("%d", &n) != EOF) {
    nc = n;
    psz = (int *)malloc(n * sizeof(int));
    i = 0;
    while (nc-- > 0) {
      scanf("%d", &t);
      psz[i++] = t;
    }
    printf("%d\n", GetLcm(psz, n));
    free(psz);
    psz = NULL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe8b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    0x2e63(%rip),%rcx
cmp    (%rcx),%rax
je     121f <main+0xcf>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    11ef <main+0x9f>
lea    0xe37(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    11ae <main+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <GetLcm@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
jmp    116e <main+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
jne    1187 <main+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe72(%rip),%r13
lea    0x4(%rsp),%r14
mov    %rsp,%r12
jmp    11d8 <main+0x88>
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%esi
mov    %rbx,%rdi
call   1060 <GetLcm@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    0x2e15(%rip),%rcx
cmp    (%rcx),%rax
je     1176 <main+0x26>
mov    (%rsp),%ebp
lea    0x0(,%rbp,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    11a0 <main+0x50>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rbx,%r15,4)
add    $0x1,%r15
cmp    %r15,%rbp
jne    1200 <main+0xb0>
jmp    11a0 <main+0x50>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32* null, i32** %4
store i32 0, i32* %7
br label %8
8: ; preds = %32, %0
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %39
12: ; preds = %8
%13 = load i32, i32* %2
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 4
%17 = trunc i64 %16 to i32
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to i32*
store i32* %19, i32** %4
store i32 0, i32* %7
br label %20
20: ; preds = %24, %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
%23 = icmp sgt i32 %21, 0
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%26 = load i32, i32* %6
%27 = load i32*, i32** %4
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
store i32 %26, i32* %31
br label %20
32: ; preds = %20
%33 = load i32*, i32** %4
%34 = load i32, i32* %2
%35 = call i32 @GetLcm(i32* %33, i32 %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = load i32*, i32** %4
%38 = call i32 @free(i32* %37)
store i32* null, i32** %4
br label %8
39: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %31, label %8
8: ; preds = %0, %23
%9 = load i32, i32* %1
%10 = shl i32 %9, 2
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
%13 = icmp sgt i32 %9, 0
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = zext i32 %9 to i64
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 0, %14 ], [ %20, %16 ]
%18 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%19 = load i32, i32* %2
%20 = add nuw nsw i64 %17, 1
%21 = getelementptr inbounds i32, i32* %12, i64 %17
store i32 %19, i32* %21
%22 = icmp eq i64 %20, %15
br i1 %22, label %23, label %16
23: ; preds = %16, %8
%24 = load i32, i32* %1
%25 = call i32 @GetLcm(i32* %12, i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = call i32 @free(i32* %12)
%28 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%29 = load i64, i64* @EOF
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %8
31: ; preds = %23, %0
ret i32 0
}