#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__ malloc(int);
int /*<<< orphan*/ oddSort(int *, int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int *a = (int *)malloc((argc - 1) * sizeof(int));
  for (int i = 1; i < argc; i++)
    a[i - 1] = (int)strtol(argv[i], NULL, 10);
  oddSort(a, argc - 1);
  for (int i = 0; i < argc - 1; i++)
    printf("%d ", a[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ba <main+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1174 <main+0x34>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <oddSort@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1206 <main+0xc6>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11d0 <main+0x90>
mov    -0x4(%rbp),%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    %rsi,%r12
mov    %edi,%r15d
lea    -0x1(%r15),%r14d
lea    -0x4(,%r15,4),%edi
ff
call   1060 <malloc@plt>
mov    %rax,%r13
cmp    $0x1,%r15d
jle    11d8 <main+0x98>
mov    %r15d,%ebp
add    $0xffffffffffffffff,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%r12,%rbx,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,0x0(%r13,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1180 <main+0x40>
mov    %r13,%rdi
mov    %r14d,%esi
call   1030 <oddSort@plt>
cmp    $0x2,%r15d
jl     11e3 <main+0xa3>
mov    %r14d,%ebx
xor    %ebp,%ebp
lea    0xe44(%rip),%r14
nopl   0x0(%rax)
mov    0x0(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x80>
jmp    11e3 <main+0xa3>
mov    %r13,%rdi
mov    %r14d,%esi
call   1030 <oddSort@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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