#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 *);
main() {
  int a[11] = {0};
  int i = 0;
  int j = 0;
  for (i = 0; i < 5; i++) {
    int b;
    scanf("%d", &b);
    a[b]++;
  }
  for (i = 0; i < 11; i++) {
    for (j = 0; j < a[i]; j++) {
      printf("%d  ", i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1040 <memset@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    119b <main+0x6b>
lea    0xe8b(%rip),%rdi
lea    -0x3c(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1164 <main+0x34>
movl   $0x0,-0x34(%rbp)
cmpl   $0xb,-0x34(%rbp)
jge    11f4 <main+0xc4>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jge    11e1 <main+0xb1>
mov    -0x34(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11b3 <main+0x83>
jmp    11e6 <main+0xb6>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a2 <main+0x72>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xebf(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    0x10(%rsp),%ebp
test   %ebp,%ebp
jle    11cf <main+0xaf>
lea    0xe45(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0xa0>
mov    0x14(%rsp),%ebp
test   %ebp,%ebp
jle    11f2 <main+0xd2>
lea    0xe25(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    11e0 <main+0xc0>
mov    0x18(%rsp),%ebp
test   %ebp,%ebp
jle    1222 <main+0x102>
lea    0xe02(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xf0>
mov    0x1c(%rsp),%ebp
test   %ebp,%ebp
jle    1252 <main+0x132>
lea    0xdd2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1240 <main+0x120>
mov    0x20(%rsp),%ebp
test   %ebp,%ebp
jle    1282 <main+0x162>
lea    0xda2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1270 <main+0x150>
mov    0x24(%rsp),%ebp
test   %ebp,%ebp
jle    12b2 <main+0x192>
lea    0xd72(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    12a0 <main+0x180>
mov    0x28(%rsp),%ebp
test   %ebp,%ebp
jle    12e2 <main+0x1c2>
lea    0xd42(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    12d0 <main+0x1b0>
mov    0x2c(%rsp),%ebp
test   %ebp,%ebp
jle    1312 <main+0x1f2>
lea    0xd12(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1300 <main+0x1e0>
mov    0x30(%rsp),%ebp
test   %ebp,%ebp
jle    1342 <main+0x222>
lea    0xce2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1330 <main+0x210>
mov    0x34(%rsp),%ebp
test   %ebp,%ebp
jle    1372 <main+0x252>
lea    0xcb2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1360 <main+0x240>
mov    0x38(%rsp),%ebp
test   %ebp,%ebp
jle    13a2 <main+0x282>
lea    0xc82(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1390 <main+0x270>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = bitcast [11 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
store i32 %28, i32* %26
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
%35 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%36 = load i32, i32* %35
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %0, %38
%39 = phi i32 [ %41, %38 ], [ 0, %0 ]
%40 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
%41 = add nuw nsw i32 %39, 1
%42 = icmp eq i32 %41, %36
br i1 %42, label %43, label %38
43: ; preds = %38, %0
%44 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 1
%45 = load i32, i32* %44
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %43, %47
%48 = phi i32 [ %50, %47 ], [ 0, %43 ]
%49 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%50 = add nuw nsw i32 %48, 1
%51 = icmp eq i32 %50, %45
br i1 %51, label %52, label %47
52: ; preds = %47, %43
%53 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 2
%54 = load i32, i32* %53
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %52, %56
%57 = phi i32 [ %59, %56 ], [ 0, %52 ]
%58 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 2)
%59 = add nuw nsw i32 %57, 1
%60 = icmp eq i32 %59, %54
br i1 %60, label %61, label %56
61: ; preds = %56, %52
%62 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 3
%63 = load i32, i32* %62
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %61, %65
%66 = phi i32 [ %68, %65 ], [ 0, %61 ]
%67 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3)
%68 = add nuw nsw i32 %66, 1
%69 = icmp eq i32 %68, %63
br i1 %69, label %70, label %65
70: ; preds = %65, %61
%71 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 4
%72 = load i32, i32* %71
%73 = icmp sgt i32 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %70, %74
%75 = phi i32 [ %77, %74 ], [ 0, %70 ]
%76 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%77 = add nuw nsw i32 %75, 1
%78 = icmp eq i32 %77, %72
br i1 %78, label %79, label %74
79: ; preds = %74, %70
%80 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 5
%81 = load i32, i32* %80
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %79, %83
%84 = phi i32 [ %86, %83 ], [ 0, %79 ]
%85 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
%86 = add nuw nsw i32 %84, 1
%87 = icmp eq i32 %86, %81
br i1 %87, label %88, label %83
88: ; preds = %83, %79
%89 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 6
%90 = load i32, i32* %89
%91 = icmp sgt i32 %90, 0
br i1 %91, label %92, label %97
92: ; preds = %88, %92
%93 = phi i32 [ %95, %92 ], [ 0, %88 ]
%94 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 6)
%95 = add nuw nsw i32 %93, 1
%96 = icmp eq i32 %95, %90
br i1 %96, label %97, label %92
97: ; preds = %92, %88
%98 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 7
%99 = load i32, i32* %98
%100 = icmp sgt i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %97, %101
%102 = phi i32 [ %104, %101 ], [ 0, %97 ]
%103 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 7)
%104 = add nuw nsw i32 %102, 1
%105 = icmp eq i32 %104, %99
br i1 %105, label %106, label %101
106: ; preds = %101, %97
%107 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 8
%108 = load i32, i32* %107
%109 = icmp sgt i32 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %106, %110
%111 = phi i32 [ %113, %110 ], [ 0, %106 ]
%112 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 8)
%113 = add nuw nsw i32 %111, 1
%114 = icmp eq i32 %113, %108
br i1 %114, label %115, label %110
115: ; preds = %110, %106
%116 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 9
%117 = load i32, i32* %116
%118 = icmp sgt i32 %117, 0
br i1 %118, label %119, label %124
119: ; preds = %115, %119
%120 = phi i32 [ %122, %119 ], [ 0, %115 ]
%121 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 9)
%122 = add nuw nsw i32 %120, 1
%123 = icmp eq i32 %122, %117
br i1 %123, label %124, label %119
124: ; preds = %119, %115
%125 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 10
%126 = load i32, i32* %125
%127 = icmp sgt i32 %126, 0
br i1 %127, label %128, label %133
128: ; preds = %124, %128
%129 = phi i32 [ %131, %128 ], [ 0, %124 ]
%130 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 10)
%131 = add nuw nsw i32 %129, 1
%132 = icmp eq i32 %131, %126
br i1 %132, label %133, label %128
133: ; preds = %128, %124
ret i32 0
}