#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 *, char *);
int /*<<< orphan*/ Odd_even(int *, int);
int /*<<< orphan*/ Read_list(int *, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  int n;
  char g_i;
  int *a;
  double start, finish;
  Get_args(argc, argv, &n, &g_i);
  a = malloc(n * sizeof(int));
  if (g_i == 'g') {
    Generate_list(a, n);
  } else {
    Read_list(a, n);
  }
  start = omp_get_wtime();
  Odd_even(a, n);
  finish = omp_get_wtime();
  printf("Elapsed time = %e seconds\n", finish - start);
  free(a);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x15(%rbp),%rcx
call   1080 <Get_args@plt>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x67,%eax
jne    11db <main+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <Generate_list@plt>
jmp    11e7 <main+0x67>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10a0 <Read_list@plt>
mov    $0x0,%al
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <Odd_even@plt>
mov    $0x0,%al
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
lea    0xde4(%rip),%rdi
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xc(%rsp),%rdx
lea    0xb(%rsp),%rcx
call   1080 <Get_args@plt>
mov    0xc(%rsp),%ebx
lea    0x0(,%rbx,4),%edi
call   1090 <malloc@plt>
mov    %rax,%r14
cmpb   $0x67,0xb(%rsp)
jne    11bc <main+0x3c>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <Generate_list@plt>
jmp    11c6 <main+0x46>
mov    %r14,%rdi
mov    %ebx,%esi
call   10a0 <Read_list@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1050 <Odd_even@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
lea    0xe0d(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Elapsed time = %e seconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32*
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @Get_args(i32 %11, i8** %12, i32* %6, i8* %7)
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 4
%17 = trunc i64 %16 to i32
%18 = call i32* @malloc(i32 %17)
store i32* %18, i32** %8
%19 = load i8, i8* %7
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 103
br i1 %21, label %22, label %26
22: ; preds = %2
%23 = load i32*, i32** %8
%24 = load i32, i32* %6
%25 = call i32 @Generate_list(i32* %23, i32 %24)
br label %30
26: ; preds = %2
%27 = load i32*, i32** %8
%28 = load i32, i32* %6
%29 = call i32 @Read_list(i32* %27, i32 %28)
br label %30
30: ; preds = %26, %22
%31 = call double (...) @omp_get_wtime()
store double %31, double* %9
%32 = load i32*, i32** %8
%33 = load i32, i32* %6
%34 = call i32 @Odd_even(i32* %32, i32 %33)
%35 = call double (...) @omp_get_wtime()
store double %35, double* %10
%36 = load double, double* %10
%37 = load double, double* %9
%38 = fsub double %36, %37
%39 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %38)
%40 = load i32*, i32** %8
%41 = call i32 @free(i32* %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Elapsed time = %e seconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %3 to i8*
%6 = call i32 @Get_args(i32 %0, i8** %1, i32* %3, i8* %4)
%7 = load i32, i32* %3
%8 = shl i32 %7, 2
%9 = call i32* @malloc(i32 %8)
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 103
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @Generate_list(i32* %9, i32 %7)
br label %16
14: ; preds = %2
%15 = call i32 @Read_list(i32* %9, i32 %7)
br label %16
16: ; preds = %14, %12
%17 = call double (...) @omp_get_wtime()
%18 = load i32, i32* %3
%19 = call i32 @Odd_even(i32* %9, i32 %18)
%20 = call double (...) @omp_get_wtime()
%21 = fsub double %20, %17
%22 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %21)
%23 = call i32 @free(i32* %9)
ret i32 0
}