#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 /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n, now, i, max, min, flag;
  while (scanf("%d", &n) != EOF) {
    flag = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &now);
      if (flag == 0) {
        max = min = now;
        flag = 1;
        continue;
      }
      if (now > max)
        max = now;
      if (now < min)
        min = now;
    }
    if (n == 0)
      printf("Empty list\n");
    else
      printf("%d %d\n", max, min);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     120c <main+0xec>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d6 <main+0xb6>
lea    0xe89(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x28(%rbp)
jne    119f <main+0x7f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
jmp    11c8 <main+0xa8>
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11b1 <main+0x91>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11c3 <main+0xa3>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11c8 <main+0xa8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1164 <main+0x44>
cmpl   $0x0,-0x14(%rbp)
jne    11f3 <main+0xd3>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1207 <main+0xe7>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1136 <main+0x16>
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    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    0x2e97(%rip),%r13
cmp    0x0(%r13),%rax
jne    1168 <main+0x38>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe91(%rip),%rbx
lea    0x4(%rsp),%r14
jmp    11af <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
mov    %r15d,%ebp
test   %eax,%eax
je     1210 <main+0xe0>
lea    0xe71(%rip),%rdi
mov    %ebp,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
je     1157 <main+0x27>
mov    (%rsp),%eax
test   %eax,%eax
jle    1183 <main+0x53>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%r15d
mov    (%rsp),%eax
cmp    $0x2,%eax
jl     1180 <main+0x50>
mov    $0x1,%r12d
mov    %r15d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
cmp    %r15d,%eax
cmovl  %eax,%r15d
add    $0x1,%r12d
mov    (%rsp),%eax
cmp    %eax,%r12d
jl     11e0 <main+0xb0>
jmp    1183 <main+0x53>
nopl   0x0(%rax)
lea    0xdf3(%rip),%rdi
call   1030 <puts@plt>
jmp    119e <main+0x6e>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [12 x i8] c"Empty list\0A\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %12
12: ; preds = %52, %2
%13 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %53
16: ; preds = %12
store i32 0, i32* %11
store i32 0, i32* %8
br label %17
17: ; preds = %40, %16
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %43
21: ; preds = %17
%22 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%23 = load i32, i32* %11
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %7
store i32 %26, i32* %10
store i32 %26, i32* %9
store i32 1, i32* %11
br label %40
27: ; preds = %21
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32, i32* %7
store i32 %32, i32* %9
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* %7
%35 = load i32, i32* %10
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load i32, i32* %7
store i32 %38, i32* %10
br label %39
39: ; preds = %37, %33
br label %40
40: ; preds = %39, %25
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %17
43: ; preds = %17
%44 = load i32, i32* %6
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %52
48: ; preds = %43
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %49, i32 %50)
br label %52
52: ; preds = %48, %46
br label %12
53: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.2 = [7 x i8] c"%d %d\0A\00"
@str = [11 x i8] c"Empty list\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %46, label %10
10: ; preds = %2, %42
%11 = phi i32 [ %35, %42 ], [ undef, %2 ]
%12 = phi i32 [ %34, %42 ], [ undef, %2 ]
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %10
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %33
20: ; preds = %15, %20
%21 = phi i32 [ %29, %20 ], [ %17, %15 ]
%22 = phi i32 [ %27, %20 ], [ %17, %15 ]
%23 = phi i32 [ %30, %20 ], [ 1, %15 ]
%24 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, %22
%27 = select i1 %26, i32 %25, i32 %22
%28 = icmp slt i32 %25, %21
%29 = select i1 %28, i32 %25, i32 %21
%30 = add nuw nsw i32 %23, 1
%31 = load i32, i32* %3
%32 = icmp slt i32 %30, %31
br i1 %32, label %20, label %33
33: ; preds = %20, %15, %10
%34 = phi i32 [ %12, %10 ], [ %17, %15 ], [ %27, %20 ]
%35 = phi i32 [ %11, %10 ], [ %17, %15 ], [ %29, %20 ]
%36 = phi i32 [ %13, %10 ], [ %18, %15 ], [ %31, %20 ]
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %42
40: ; preds = %33
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %35)
br label %42
42: ; preds = %40, %38
%43 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%44 = load i64, i64* @EOF
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %10
46: ; preds = %42, %2
ret i32 0
}