#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int length = 10000 + 1;
  int n = 0;
  int i = 0;
  int table[length];
  for (i = 0; i < length; i++) {
    table[i] = 0;
  }
  scanf("%d", &n);
  while (n-- > 0) {
    int data = 0;
    scanf("%d", &data);
    table[data] = 1;
  }
  int first = 0;
  for (i = 0; i < length; i++) {
    if (table[i] == 1) {
      if (first == 0) {
        first = 1;
        printf("%d", i);
      } else {
        printf(" %d", i);
      }
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2711,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119b <main+0x7b>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <main+0x52>
lea    0xe5f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    11ea <main+0xca>
movl   $0x0,-0x24(%rbp)
lea    0xe34(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    11ab <main+0x8b>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1266 <main+0x146>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1253 <main+0x133>
cmpl   $0x0,-0x28(%rbp)
jne    123d <main+0x11d>
movl   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%esi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124e <main+0x12e>
mov    -0x10(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1253 <main+0x133>
jmp    1258 <main+0x138>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f8 <main+0xd8>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x9c58,%rsp
mov    %rsp,%r12
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x9c44,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe90(%rip),%r14
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
test   %eax,%eax
jle    11cf <main+0x8f>
lea    0xe6d(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
movl   $0x0,0xc(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
movl   $0x1,0x10(%rsp,%rax,4)
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
test   %eax,%eax
jg     11a0 <main+0x60>
lea    0xe2a(%rip),%r15
xor    %ebx,%ebx
xor    %eax,%eax
jmp    11ed <main+0xad>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x2711,%rbx
je     120d <main+0xcd>
cmpl   $0x1,0x10(%rsp,%rbx,4)
jne    11e0 <main+0xa0>
test   %eax,%eax
mov    %r15,%rdi
cmove  %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rsp
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = tail call i8* @llvm.stacksave()
%5 = alloca [10001 x i32]
%6 = bitcast [10001 x i32]* %5 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %21
11: ; preds = %0
%12 = bitcast i32* %2 to i8*
br label %13
13: ; preds = %11, %13
store i32 0, i32* %2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10001 x i32], [10001 x i32]* %5, i64 0, i64 %16
store i32 1, i32* %17
%18 = load i32, i32* %1
%19 = add nsw i32 %18, -1
store i32 %19, i32* %1
%20 = icmp sgt i32 %18, 0
br i1 %20, label %13, label %21
21: ; preds = %13, %0
br label %22
22: ; preds = %21, %33
%23 = phi i64 [ %35, %33 ], [ 0, %21 ]
%24 = phi i32 [ %34, %33 ], [ 0, %21 ]
%25 = getelementptr inbounds [10001 x i32], [10001 x i32]* %5, i64 0, i64 %23
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %33
28: ; preds = %22
%29 = icmp eq i32 %24, 0
%30 = trunc i64 %23 to i32
%31 = select i1 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %31, i32 %30)
br label %33
33: ; preds = %28, %22
%34 = phi i32 [ %24, %22 ], [ 1, %28 ]
%35 = add nuw nsw i64 %23, 1
%36 = icmp eq i64 %35, 10001
br i1 %36, label %37, label %22
37: ; preds = %33
%38 = call i32 @putchar(i32 10)
ret i32 0
}