int main() {
  int i, n, a[100];
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int gcd = GCD(a[0], a[1]);
  for (i = 2; i < n; ++i) {
    gcd = GCD(GCD, a[i]);
  }
  printf("GCD of the elements of the array is %d", GCD);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeeb(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1185 <main+0x65>
movslq -0x8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <main+0x2b>
mov    -0x1a0(%rbp),%edi
mov    -0x19c(%rbp),%esi
mov    $0x0,%al
call   1050 <GCD@plt>
mov    %eax,-0x1a4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11de <main+0xbe>
movslq -0x8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
mov    0x2e25(%rip),%rdi
mov    $0x0,%al
call   1050 <GCD@plt>
mov    %eax,-0x1a4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a5 <main+0x85>
lea    0xe1b(%rip),%rdi
mov    0x2dfc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
lea    0xef1(%rip),%r14
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1150 <main+0x30>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1050 <GCD@plt>
cmpl   $0x3,0xc(%rsp)
jl     11bc <main+0x9c>
mov    $0x2,%ebx
mov    0x2e57(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <GCD@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11a0 <main+0x80>
lea    0xe3d(%rip),%rdi
mov    0x2e1e(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [39 x i8] c"GCD of the elements of the array is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [100 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ %12, %8 ], [ 0, %0 ]
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %9
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%12 = add nuw nsw i64 %9, 1
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %8, label %16
16: ; preds = %8
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%18 = load i32, i32* %17
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 1
%20 = load i32, i32* %19
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @GCD to i32 (i32, i32, ...)*)(i32 %18, i32 %20)
%22 = load i32, i32* %1
%23 = icmp sgt i32 %22, 2
br i1 %23, label %24, label %33
24: ; preds = %16, %24
%25 = phi i64 [ %29, %24 ], [ 2, %16 ]
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @GCD to i32 (i32 (...)*, i32, ...)*)(i32 (...)* @GCD, i32 %27)
%29 = add nuw nsw i64 %25, 1
%30 = load i32, i32* %1
%31 = sext i32 %30 to i64
%32 = icmp slt i64 %29, %31
br i1 %32, label %24, label %33
33: ; preds = %24, %16
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 (...)* @GCD)
ret i32 0
}