#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*/ printf(char const *, ...);
int /*<<< orphan*/ sort(int *, int);
int main(int argc, char **argv) {
  int lsize;
  int *list;
  void *tmp;
  int i;
  int i___0;
  {
    megaInit();
    lsize = argc - 1;
    if (lsize > 0) {
      tmp = malloc((unsigned long)lsize * sizeof(int));
      list = (int *)tmp;
      i = 0;
      while (i < lsize) {
        *(list + i) = atoi((char const *)*(argv + (1 + 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    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1231 <main+0xe1>
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1060 <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    11dd <main+0x8d>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <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    11a0 <main+0x50>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <sort@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1223 <main+0xd3>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f0 <main+0xa0>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%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    %rsi,%r15
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <megaInit@plt>
cmp    $0x2,%r14d
jl     11f2 <main+0x92>
add    $0xffffffff,%r14d
mov    %r14d,%r12d
lea    0x0(,%r12,4),%rdi
call   1070 <malloc@plt>
mov    %rax,%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbp),%rbx
mov    0x8(%r15,%rbp,8),%rdi
call   1080 <atoi@plt>
mov    %eax,0x0(%r13,%rbp,4)
mov    %rbx,%rbp
cmp    %rbx,%r12
jne    11a0 <main+0x40>
mov    %r13,%rdi
mov    %r14d,%esi
call   1060 <sort@plt>
lea    0xe33(%rip),%r14
xor    %ebp,%ebp
nop
mov    0x0(%r13,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11d0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%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 = [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 i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (...) @megaInit()
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %60
16: ; preds = %2
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 4
%20 = call i8* @malloc(i64 %19)
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = bitcast i8* %21 to i32*
store i32* %22, i32** %7
store i32 0, i32* %9
br label %23
23: ; preds = %27, %16
%24 = load i32, i32* %9
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = load i32, i32* %9
%30 = add nsw i32 1, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %28, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
%35 = load i32*, i32** %7
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
store i32 %34, i32* %38
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %23
41: ; preds = %23
%42 = load i32*, i32** %7
%43 = load i32, i32* %6
%44 = call i32 @sort(i32* %42, i32 %43)
store i32 0, i32* %10
br label %45
45: ; preds = %49, %41
%46 = load i32, i32* %10
%47 = load i32, i32* %6
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %58
49: ; preds = %45
%50 = load i32*, i32** %7
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %50, i64 %52
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
store i32 %57, i32* %10
br label %45
58: ; preds = %45
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %60
60: ; preds = %58, %2
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 = add i32 %0, -1
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %30
6: ; preds = %2
%7 = zext i32 %4 to i64
%8 = shl nuw nsw i64 %7, 2
%9 = tail call i8* @malloc(i64 %8)
%10 = bitcast i8* %9 to i32*
br label %11
11: ; preds = %6, %11
%12 = phi i64 [ 0, %6 ], [ %13, %11 ]
%13 = add nuw nsw i64 %12, 1
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %16, i32* %17
%18 = icmp eq i64 %13, %7
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = tail call i32 @sort(i32* %10, i32 %4)
br label %21
21: ; preds = %19, %21
%22 = phi i64 [ 0, %19 ], [ %26, %21 ]
%23 = getelementptr inbounds i32, i32* %10, i64 %22
%24 = load i32, i32* %23
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i64 %22, 1
%27 = icmp eq i64 %26, %7
br i1 %27, label %28, label %21
28: ; preds = %21
%29 = tail call i32 @putchar(i32 10)
br label %30
30: ; preds = %28, %2
ret i32 0
}