#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 /*<<< orphan*/ Generate_list(int *, int);
int /*<<< orphan*/ Get_args(int, char **, int *);
int /*<<< orphan*/ Odd_even_sort(int *, int);
int /*<<< orphan*/ Print_list(int *, int, char *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  int n;
  Get_args(argc, argv, &n);
  int *a = (int *)malloc(n * sizeof(int));
  Generate_list(a, n);
  Print_list(a, n, "Before sort");
  Odd_even_sort(a, n);
  Print_list(a, n, "After sort");
  free(a);
  return 0;
}


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),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <Get_args@plt>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <Generate_list@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xe4d(%rip),%rdx
call   1080 <Print_list@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <Odd_even_sort@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xe3a(%rip),%rdx
call   1080 <Print_list@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
call   1050 <Get_args@plt>
mov    0xc(%rsp),%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%esi
mov    %rax,%rdi
call   1040 <Generate_list@plt>
mov    0xc(%rsp),%esi
lea    0xe6b(%rip),%rdx
mov    %rbx,%rdi
call   1080 <Print_list@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1070 <Odd_even_sort@plt>
mov    0xc(%rsp),%esi
lea    0xe58(%rip),%rdx
mov    %rbx,%rdi
call   1080 <Print_list@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Before sort\00"
@.str.1 = [11 x i8] c"After sort\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @Get_args(i32 %8, i8** %9, i32* %6)
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %7
%17 = load i32*, i32** %7
%18 = load i32, i32* %6
%19 = call i32 @Generate_list(i32* %17, i32 %18)
%20 = load i32*, i32** %7
%21 = load i32, i32* %6
%22 = call i32 @Print_list(i32* %20, i32 %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%23 = load i32*, i32** %7
%24 = load i32, i32* %6
%25 = call i32 @Odd_even_sort(i32* %23, i32 %24)
%26 = load i32*, i32** %7
%27 = load i32, i32* %6
%28 = call i32 @Print_list(i32* %26, i32 %27, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32*, i32** %7
%30 = call i32 @free(i32* %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Before sort\00"
@.str.1 = [11 x i8] c"After sort\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @Get_args(i32 %0, i8** %1, i32* %3)
%6 = load i32, i32* %3
%7 = shl i32 %6, 2
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
%10 = load i32, i32* %3
%11 = call i32 @Generate_list(i32* %9, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @Print_list(i32* %9, i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = call i32 @Odd_even_sort(i32* %9, i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @Print_list(i32* %9, i32 %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @free(i32* %9)
ret i32 0
}