#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 */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int mian() {
  int n, a, b, c;
  c = 1;
  b = 1;
  while (scanf("%d", &n) != 0)
    if (c <= n) {
      scanf("%d", &a);
      b = b >= a ? b : a;
      c++;
    }
  printf("%d", b);
  return 0;
}


x86 assembly (clang, -O0):
<mian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     119d <mian+0x7d>
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1198 <mian+0x78>
lea    0xe9d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1183 <mian+0x63>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1189 <mian+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <mian+0x16>
mov    -0xc(%rbp),%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mian>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     118f <mian+0x6f>
mov    $0x1,%ebp
lea    0xeb2(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%r12
mov    $0x1,%ebx
jmp    1170 <mian+0x50>
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1194 <mian+0x74>
cmp    0x8(%rsp),%ebp
jg     1160 <mian+0x40>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
cmovl  %eax,%ebx
add    $0x1,%ebp
jmp    1160 <mian+0x40>
mov    $0x1,%ebx
lea    0xe65(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @mian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %25, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %1
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %3
br label %21
19: ; preds = %12
%20 = load i32, i32* %2
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ %18, %17 ], [ %20, %19 ]
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %25
25: ; preds = %21, %8
br label %5
26: ; preds = %5
%27 = load i32, i32* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @mian() {
%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 = icmp eq i64 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %0, %18
%8 = phi i32 [ %20, %18 ], [ 1, %0 ]
%9 = phi i32 [ %19, %18 ], [ 1, %0 ]
%10 = load i32, i32* %1
%11 = icmp sgt i32 %8, %10
br i1 %11, label %18, label %12
12: ; preds = %7
%13 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = icmp slt i32 %9, %14
%16 = select i1 %15, i32 %14, i32 %9
%17 = add nsw i32 %8, 1
br label %18
18: ; preds = %12, %7
%19 = phi i32 [ %16, %12 ], [ %9, %7 ]
%20 = phi i32 [ %17, %12 ], [ %8, %7 ]
%21 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %7
23: ; preds = %18, %0
%24 = phi i32 [ 1, %0 ], [ %19, %18 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}