#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 s, i, j, t;
  scanf("%d", &s);
  int x[s];
  scanf("%d", &x[0]);
  for (i = 1; i < s; ++i) {
    scanf("%d", &t);
    for (j = i; (j > 0) && (x[j - 1] > t); --j)
      x[j] = x[j - 1];
    x[j] = t;
    t = x[i + 1];
  }
  for (i = 0; i < s; ++i)
    printf("%d ", x[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x30(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1223 <main+0x103>
lea    0xe74(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x31(%rbp)
jle    11c3 <main+0xa3>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
setg   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11d3 <main+0xb3>
jmp    11f8 <main+0xd8>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    119b <main+0x7b>
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%edx
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    125d <main+0x13d>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122a <main+0x10a>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebb(%rip),%r14
lea    -0x2c(%rbp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    -0x2c(%rbp),%eax
cmp    $0x2,%eax
jl     11f1 <main+0xc1>
mov    $0x1,%r13d
lea    0xe74(%rip),%r14
lea    -0x30(%rbp),%r15
jmp    11bb <main+0x8b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %ecx,%rcx
mov    %eax,(%rbx,%rcx,4)
mov    0x4(%rbx,%r13,4),%eax
add    $0x1,%r13
mov    %eax,-0x30(%rbp)
movslq -0x2c(%rbp),%rax
cmp    %rax,%r13
jge    11f1 <main+0xc1>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    -0x30(%rbp),%eax
mov    %r13,%rcx
nopl   0x0(%rax)
lea    -0x1(%rcx),%rdx
mov    %edx,%esi
mov    (%rbx,%rsi,4),%esi
cmp    %eax,%esi
jle    11a0 <main+0x70>
mov    %esi,(%rbx,%rcx,4)
lea    0x1(%rdx),%rsi
mov    %rdx,%rcx
cmp    $0x1,%rsi
jg     11d0 <main+0xa0>
xor    %ecx,%ecx
jmp    11a0 <main+0x70>
test   %eax,%eax
jle    121b <main+0xeb>
lea    0xe07(%rip),%r14
xor    %r15d,%r15d
nop
mov    (%rbx,%r15,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jl     1200 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 i32
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i32, i64 %10
store i64 %10, i64* %7
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
store i32 1, i32* %3
br label %15
15: ; preds = %57, %0
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %60
19: ; preds = %15
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%21 = load i32, i32* %3
store i32 %21, i32* %4
br label %22
22: ; preds = %44, %19
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %22
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %12, i64 %28
%30 = load i32, i32* %29
%31 = load i32, i32* %5
%32 = icmp sgt i32 %30, %31
br label %33
33: ; preds = %25, %22
%34 = phi i1 [ false, %22 ], [ %32, %25 ]
br i1 %34, label %35, label %47
35: ; preds = %33
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %12, i64 %38
%40 = load i32, i32* %39
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %12, i64 %42
store i32 %40, i32* %43
br label %44
44: ; preds = %35
%45 = load i32, i32* %4
%46 = add nsw i32 %45, -1
store i32 %46, i32* %4
br label %22
47: ; preds = %33
%48 = load i32, i32* %5
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %12, i64 %50
store i32 %48, i32* %51
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %12, i64 %54
%56 = load i32, i32* %55
store i32 %56, i32* %5
br label %57
57: ; preds = %47
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %15
60: ; preds = %15
store i32 0, i32* %3
br label %61
61: ; preds = %71, %60
%62 = load i32, i32* %3
%63 = load i32, i32* %2
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %74
65: ; preds = %61
%66 = load i32, i32* %3
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %12, i64 %67
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %65
%72 = load i32, i32* %3
%73 = add nsw i32 %72, 1
store i32 %73, i32* %3
br label %61
74: ; preds = %61
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
%76 = load i8*, i8** %6
%77 = load i32, i32* %1
ret i32 %77
}

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*
%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* %1)
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 1
br i1 %12, label %16, label %13
13: ; preds = %30, %0
%14 = phi i32 [ %11, %0 ], [ %38, %30 ]
%15 = icmp sgt i32 %14, 0
br i1 %15, label %41, label %50
16: ; preds = %0, %30
%17 = phi i64 [ %35, %30 ], [ 1, %0 ]
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%19 = load i32, i32* %2
br label %20
20: ; preds = %16, %27
%21 = phi i64 [ %17, %16 ], [ %22, %27 ]
%22 = add nsw i64 %21, -1
%23 = and i64 %22, 4294967295
%24 = getelementptr inbounds i32, i32* %9, i64 %23
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, %19
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = getelementptr inbounds i32, i32* %9, i64 %21
store i32 %25, i32* %28
%29 = icmp sgt i64 %21, 1
br i1 %29, label %20, label %30
30: ; preds = %27, %20
%31 = phi i64 [ 0, %27 ], [ %21, %20 ]
%32 = shl i64 %31, 32
%33 = ashr exact i64 %32, 32
%34 = getelementptr inbounds i32, i32* %9, i64 %33
store i32 %19, i32* %34
%35 = add nuw nsw i64 %17, 1
%36 = getelementptr inbounds i32, i32* %9, i64 %35
%37 = load i32, i32* %36
store i32 %37, i32* %2
%38 = load i32, i32* %1
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %35, %39
br i1 %40, label %16, label %13
41: ; preds = %13, %41
%42 = phi i64 [ %46, %41 ], [ 0, %13 ]
%43 = getelementptr inbounds i32, i32* %9, i64 %42
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%46 = add nuw nsw i64 %42, 1
%47 = load i32, i32* %1
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %46, %48
br i1 %49, label %41, label %50
50: ; preds = %41, %13
%51 = call i32 @putchar(i32 10)
ret i32 0
}