#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 LCMNums(int *, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  int i;
  int *A;
  int gcd;
  while (scanf("%d", &n) != EOF) {
    A = malloc(sizeof(int) * n);
    for (i = 0; i < n; ++i) {
      scanf("%d", &A[i]);
    }
    gcd = LCMNums(A, n);
    printf("%d\n", gcd);
    free(A);
    A = NULL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
je     1202 <main+0xb2>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ce <main+0x7e>
mov    -0x18(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe45(%rip),%rdi
call   1070 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1199 <main+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <LCMNums@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
jmp    115f <main+0xf>
xor    %eax,%eax
add    $0x20,%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
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
jne    1189 <main+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe70(%rip),%r13
lea    0x4(%rsp),%r15
jmp    11d7 <main+0x87>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
call   1050 <LCMNums@plt>
lea    0xe52(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    0x2e16(%rip),%rcx
cmp    (%rcx),%rax
je     1178 <main+0x28>
mov    0x4(%rsp),%ebx
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r12
test   %ebx,%ebx
jle    11a0 <main+0x50>
mov    %r12,%rbp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
add    $0x1,%r14
movslq 0x4(%rsp),%rbx
add    $0x4,%rbp
cmp    %rbx,%r14
jl     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
store i32 0, i32* %1
br label %6
6: ; preds = %29, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = mul i64 4, %12
%14 = trunc i64 %13 to i32
%15 = call i32* @malloc(i32 %14)
store i32* %15, i32** %4
store i32 0, i32* %3
br label %16
16: ; preds = %26, %10
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32*, i32** %4
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %16
29: ; preds = %16
%30 = load i32*, i32** %4
%31 = load i32, i32* %2
%32 = call i32 @LCMNums(i32* %30, i32 %31)
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32*, i32** %4
%36 = call i32 @free(i32* %35)
store i32* null, i32** %4
br label %6
37: ; preds = %6
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 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %27, label %6
6: ; preds = %0, %19
%7 = load i32, i32* %1
%8 = shl i32 %7, 2
%9 = call i32* @malloc(i32 %8)
%10 = icmp sgt i32 %7, 0
br i1 %10, label %11, label %19
11: ; preds = %6, %11
%12 = phi i64 [ %15, %11 ], [ 0, %6 ]
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = add nuw nsw i64 %12, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %6
%20 = phi i32 [ %7, %6 ], [ %16, %11 ]
%21 = call i32 @LCMNums(i32* %9, i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 @free(i32* %9)
%24 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%25 = load i64, i64* @EOF
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %6
27: ; preds = %19, %0
ret i32 0
}