#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sort(int *, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  int i, size;
  size = atoi(argv[1]);
  int A[size];
  for (i = 0; i < size; i++) {
    scanf("%d", &A[i]);
  }
  sort(A, 0, size - 1);
  for (i = 0; i < size; i++) {
    printf("%d ", A[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c9 <main+0x89>
mov    -0x30(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4a(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x54>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <sort@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1214 <main+0xd4>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e1 <main+0xa1>
lea    0xdec(%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
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%r14d
mov    %rsp,%r12
lea    0xf(,%r14,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
test   %eax,%eax
jle    11f9 <main+0xa9>
lea    0x0(,%r14,4),%r13
xor    %ebx,%ebx
lea    0xe6c(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r12,%rbx,1),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
add    $0x4,%rbx
cmp    %rbx,%r13
jne    11a0 <main+0x50>
lea    -0x1(%r14),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1050 <sort@plt>
test   %r14d,%r14d
jle    120a <main+0xba>
lea    0xe34(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11e0 <main+0x90>
jmp    120a <main+0xba>
add    $0xffffffff,%r14d
mov    %r12,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1050 <sort@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %8
%17 = alloca i32, i64 %15
store i64 %15, i64* %9
store i32 0, i32* %6
br label %18
18: ; preds = %27, %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %17, i64 %24
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
br label %27
27: ; preds = %22
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %18
30: ; preds = %18
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = call i32 @sort(i32* %17, i32 0, i32 %32)
store i32 0, i32* %6
br label %34
34: ; preds = %44, %30
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %47
38: ; preds = %34
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %17, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %38
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %34
47: ; preds = %34
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
%49 = load i8*, i8** %8
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = zext i32 %5 to i64
%7 = alloca i32, i64 %6
%8 = icmp sgt i32 %5, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = add nsw i32 %5, -1
%11 = call i32 @sort(i32* %7, i32 0, i32 %10)
br label %28
12: ; preds = %2, %12
%13 = phi i64 [ %16, %12 ], [ 0, %2 ]
%14 = getelementptr inbounds i32, i32* %7, i64 %13
%15 = call i32 @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 = icmp eq i64 %16, %6
br i1 %17, label %18, label %12
18: ; preds = %12
%19 = add nsw i32 %5, -1
%20 = call i32 @sort(i32* %7, i32 0, i32 %19)
br i1 %8, label %21, label %28
21: ; preds = %18, %21
%22 = phi i64 [ %26, %21 ], [ 0, %18 ]
%23 = getelementptr inbounds i32, i32* %7, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i64 %22, 1
%27 = icmp eq i64 %26, %6
br i1 %27, label %28, label %21
28: ; preds = %21, %9, %18
%29 = call i32 @putchar(i32 10)
ret i32 0
}