#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, y, z, a[20];
  for (x = 0; x < 20; scanf("%d", a + x++))
    ;
  for (y = 0; y < 19; y++)
    for (x = y + 1; x < 20; x++)
      if (a[y] < a[x])
        z = a[y], a[y] = a[x], a[x] = z;
  for (x = 0; x < 5; printf("%d ", a[x++]))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    116e <main+0x4e>
jmp    1145 <main+0x25>
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <scanf@plt>
jmp    1136 <main+0x16>
movl   $0x0,-0xc(%rbp)
cmpl   $0x13,-0xc(%rbp)
jge    11f4 <main+0xd4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    11e1 <main+0xc1>
movslq -0xc(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
jge    11ce <main+0xae>
movslq -0xc(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x10(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
jmp    11d3 <main+0xb3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1188 <main+0x68>
jmp    11e6 <main+0xc6>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x55>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    122c <main+0x10c>
jmp    120a <main+0xea>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
mov    -0x60(%rbp,%rax,4),%esi
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
jmp    11fb <main+0xdb>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x44(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x48(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0x1,%eax
xor    %ecx,%ecx
jmp    124a <main+0x12a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    $0x13,%rcx
je     127c <main+0x15c>
mov    %rcx,%rdx
add    $0x1,%rcx
mov    %rax,%rsi
jmp    126a <main+0x14a>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rsi
cmp    $0x14,%rsi
je     1240 <main+0x120>
mov    (%rsp,%rdx,4),%edi
mov    (%rsp,%rsi,4),%ebx
cmp    %ebx,%edi
jge    1260 <main+0x140>
mov    %ebx,(%rsp,%rdx,4)
mov    %edi,(%rsp,%rsi,4)
jmp    1260 <main+0x140>
mov    (%rsp),%esi
lea    0xd7d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.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 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %17
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 0
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
br label %6
17: ; preds = %6
store i32 0, i32* %3
br label %18
18: ; preds = %58, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 19
br i1 %20, label %21, label %61
21: ; preds = %18
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %24
24: ; preds = %54, %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 20
br i1 %26, label %27, label %57
27: ; preds = %24
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp slt i32 %31, %35
br i1 %36, label %37, label %53
37: ; preds = %27
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %39
%41 = load i32, i32* %40
store i32 %41, i32* %4
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %47
store i32 %45, i32* %48
%49 = load i32, i32* %4
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %51
store i32 %49, i32* %52
br label %53
53: ; preds = %37, %27
br label %54
54: ; preds = %53
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %24
57: ; preds = %24
br label %58
58: ; preds = %57
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %18
61: ; preds = %18
store i32 0, i32* %2
br label %62
62: ; preds = %66, %61
%63 = load i32, i32* %2
%64 = icmp slt i32 %63, 5
br i1 %64, label %65, label %73
65: ; preds = %62
br label %66
66: ; preds = %65
%67 = load i32, i32* %2
%68 = add nsw i32 %67, 1
store i32 %68, i32* %2
%69 = sext i32 %67 to i64
%70 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
br label %62
73: ; preds = %62
%74 = load i32, i32* %1
ret i32 %74
}

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