#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ mysort(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argc != 2) {
    return EXIT_FAILURE;
  }
  int number = strtol(argv[1], NULL, 10);
  int *arr;
  arr = malloc(sizeof(int) * number);
  if (arr == NULL) {
    return EXIT_FAILURE;
  }
  int ind;
  for (ind = 0; ind < number; ind++) {
    scanf("%d", &arr[ind]);
  }
  mysort(arr, number);
  for (ind = 0; ind < number; ind++) {
    printf("%d\n", arr[ind]);
  }
  free(arr);
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1191 <main+0x31>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    126e <main+0x10e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11d9 <main+0x79>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    126e <main+0x10e>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1215 <main+0xb5>
mov    -0x20(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdfe(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e0 <main+0x80>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <mysort@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1259 <main+0xf9>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdbd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1228 <main+0xc8>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e6e(%rip),%r15
cmp    $0x2,%edi
jne    1222 <main+0xc2>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,%r14d
lea    0x0(,%r14,4),%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1222 <main+0xc2>
mov    %rax,%r13
test   %r14d,%r14d
jle    1208 <main+0xa8>
mov    %r14d,%r12d
lea    0x0(,%r12,4),%rbx
xor    %ebp,%ebp
lea    0xe40(%rip),%r15
mov    %r13,%rsi
add    %rbp,%rsi
mov    %r15,%rdi
call   1080 <scanf@plt>
add    $0x4,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x60>
mov    %r13,%rdi
mov    %r14d,%esi
call   1070 <mysort@plt>
test   %r14d,%r14d
jle    1213 <main+0xb3>
xor    %ebx,%ebx
lea    0xe13(%rip),%r14
mov    0x0(%r13,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11f0 <main+0x90>
jmp    1213 <main+0xb3>
mov    %r13,%rdi
mov    %r14d,%esi
call   1070 <mysort@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x2db6(%rip),%r15
mov    (%r15),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %36
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 10)
%8 = shl i32 %7, 2
%9 = tail call i32* @malloc(i32 %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %36, label %11
11: ; preds = %4
%12 = icmp sgt i32 %7, 0
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call i32 @mysort(i32* %9, i32 %7)
br label %34
15: ; preds = %11
%16 = zext i32 %7 to i64
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 0, %15 ], [ %21, %17 ]
%19 = getelementptr inbounds i32, i32* %9, i64 %18
%20 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = add nuw nsw i64 %18, 1
%22 = icmp eq i64 %21, %16
br i1 %22, label %23, label %17
23: ; preds = %17
%24 = tail call i32 @mysort(i32* %9, i32 %7)
br i1 %12, label %25, label %34
25: ; preds = %23
%26 = zext i32 %7 to i64
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ 0, %25 ], [ %32, %27 ]
%29 = getelementptr inbounds i32, i32* %9, i64 %28
%30 = load i32, i32* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = add nuw nsw i64 %28, 1
%33 = icmp eq i64 %32, %26
br i1 %33, label %34, label %27
34: ; preds = %27, %13, %23
%35 = tail call i32 @free(i32* %9)
br label %36
36: ; preds = %34, %4, %2
%37 = phi i32* [ @EXIT_FAILURE, %2 ], [ @EXIT_SUCCESS, %34 ], [ @EXIT_FAILURE, %4 ]
%38 = load i32, i32* %37
ret i32 %38
}