#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 *, int);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ sort(int *, int);
int main() {
  static int array[100];
  int n, i;
  while (EOF != scanf("%d", &n) && n != 0) {
    i = 0;
    while (i < n) {
      scanf("%d", &array[i]);
      i++;
    }
    sort(array, n);
    for (i = 0; i < n - 1; i++)
      printf("%d ", array[i]);
    printf("%d\n", array[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0xd(%rbp)
je     117c <main+0x4c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    118c <main+0x5c>
jmp    1239 <main+0x109>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cb <main+0x9b>
movslq -0xc(%rbp),%rax
lea    0x2ea6(%rip),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe48(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1193 <main+0x63>
mov    -0x8(%rbp),%esi
lea    0x2e7b(%rip),%rdi
call   1040 <sort@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    121a <main+0xea>
movslq -0xc(%rbp),%rcx
lea    0x2e53(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e1 <main+0xb1>
movslq -0xc(%rbp),%rcx
lea    0x2e2b(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%rbx
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    %rax,%rbx
je     123c <main+0x10c>
mov    0x4(%rsp),%esi
test   %esi,%esi
je     123c <main+0x10c>
lea    0x2ede(%rip),%r12
lea    0xe87(%rip),%r13
lea    0xe83(%rip),%r15
test   %esi,%esi
jle    11ad <main+0x7d>
mov    %r12,%rbp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rsi
add    $0x4,%rbp
cmp    %rsi,%rbx
jl     1190 <main+0x60>
mov    %r12,%rdi
call   1040 <sort@plt>
cmpl   $0x2,0x4(%rsp)
jl     1200 <main+0xd0>
mov    %r12,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
add    $0xffffffffffffffff,%rax
add    $0x4,%r14
cmp    %rax,%rbp
jl     11d0 <main+0xa0>
jmp    1202 <main+0xd2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebp,%ebp
mov    %ebp,%eax
mov    (%r12,%rax,4),%esi
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%rbx
mov    %r13,%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    %rax,%rbx
je     123c <main+0x10c>
mov    0x4(%rsp),%esi
test   %esi,%esi
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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