#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 const *);
void *malloc(unsigned long);
int /*<<< orphan*/ megaInit();
int /*<<< orphan*/ mmmeIInit();
int /*<<< orphan*/ printf(char const *, ...);
int /*<<< orphan*/ sort(int *, int);
int main(int argc, char **argv) {
  int lsize;
  int tmp;
  int *list;
  void *tmp___0;
  int i;
  int i___0;
  {
    megaInit();
    mmmeIInit();
    tmp = atoi((char const *)*(argv + 1));
    lsize = tmp;
    tmp___0 = malloc((unsigned long)lsize * sizeof(int));
    list = (int *)tmp___0;
    i = 0;
    while (i < lsize) {
      *(list + i) = atoi((char const *)*(argv + (2 + i)));
      i++;
    }
    sort(list, lsize);
    i___0 = 0;
    while (i___0 < lsize) {
      printf((char const *)"%d", *(list + i___0));
      i___0++;
    }
    printf((char const *)"\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    $0x0,%al
call   1030 <megaInit@plt>
mov    $0x0,%al
call   1040 <mmmeIInit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f7 <main+0x97>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ba <main+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <sort@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123d <main+0xdd>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    120a <main+0xaa>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
xor    %eax,%eax
call   1040 <megaInit@plt>
xor    %eax,%eax
call   1050 <mmmeIInit@plt>
mov    0x8(%r14),%rdi
call   1090 <atoi@plt>
mov    %eax,%r15d
movslq %eax,%rbx
lea    0x0(,%rbx,4),%rdi
call   1080 <malloc@plt>
mov    %rax,%r12
test   %ebx,%ebx
jle    1209 <main+0x99>
mov    %r15d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%r14,%rbx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <main+0x50>
mov    %r12,%rdi
mov    %r15d,%esi
call   1070 <sort@plt>
test   %r15d,%r15d
jle    1214 <main+0xa4>
lea    0xe12(%rip),%r14
xor    %ebx,%ebx
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11f0 <main+0x80>
jmp    1214 <main+0xa4>
mov    %r12,%rdi
mov    %r15d,%esi
call   1070 <sort@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [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 i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (...) @megaInit()
%13 = call i32 (...) @mmmeIInit()
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 4
%22 = call i8* @malloc(i64 %21)
store i8* %22, i8** %9
%23 = load i8*, i8** %9
%24 = bitcast i8* %23 to i32*
store i32* %24, i32** %8
store i32 0, i32* %10
br label %25
25: ; preds = %29, %2
%26 = load i32, i32* %10
%27 = load i32, i32* %6
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %43
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i32, i32* %10
%32 = add nsw i32 2, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %30, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
%37 = load i32*, i32** %8
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %37, i64 %39
store i32 %36, i32* %40
%41 = load i32, i32* %10
%42 = add nsw i32 %41, 1
store i32 %42, i32* %10
br label %25
43: ; preds = %25
%44 = load i32*, i32** %8
%45 = load i32, i32* %6
%46 = call i32 @sort(i32* %44, i32 %45)
store i32 0, i32* %11
br label %47
47: ; preds = %51, %43
%48 = load i32, i32* %11
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %60
51: ; preds = %47
%52 = load i32*, i32** %8
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
store i32 %59, i32* %11
br label %47
60: ; preds = %47
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

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