#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 EXIT_SUCCESS;
int /*<<< orphan*/ SP1(int *, int);
int /*<<< orphan*/ afficherTAB(int *, int);
int *malloc(int);
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ remplirTABrand(int *, int);
int main(int argc, char *argv[]) {
  int n;
  n = 1024;
  int *T = malloc(n * sizeof(int));
  remplirTABrand(T, n);
  afficherTAB(T, n);
  double fin;
  double debut = omp_get_wtime();
  SP1(T, n);
  fin = omp_get_wtime();
  afficherTAB(T, n);
  printf("durée = %lf\n", fin - debut);
  return EXIT_SUCCESS;
}


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)
movl   $0x400,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <remplirTABrand@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <afficherTAB@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <SP1@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <afficherTAB@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
lea    0xe17(%rip),%rdi
call   1040 <printf@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1000,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x400,%esi
call   1060 <remplirTABrand@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1080 <afficherTAB@plt>
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <SP1@plt>
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0x400,%esi
call   1080 <afficherTAB@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"dur\C3\A9e = %lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1024, i32* %6
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
store i32* %14, i32** %7
%15 = load i32*, i32** %7
%16 = load i32, i32* %6
%17 = call i32 @remplirTABrand(i32* %15, i32 %16)
%18 = load i32*, i32** %7
%19 = load i32, i32* %6
%20 = call i32 @afficherTAB(i32* %18, i32 %19)
%21 = call double (...) @omp_get_wtime()
store double %21, double* %9
%22 = load i32*, i32** %7
%23 = load i32, i32* %6
%24 = call i32 @SP1(i32* %22, i32 %23)
%25 = call double (...) @omp_get_wtime()
store double %25, double* %8
%26 = load i32*, i32** %7
%27 = load i32, i32* %6
%28 = call i32 @afficherTAB(i32* %26, i32 %27)
%29 = load double, double* %8
%30 = load double, double* %9
%31 = fsub double %29, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %31)
%33 = load i32, i32* @EXIT_SUCCESS
ret i32 %33
}

LLVM IR (-O2):
@.str = [14 x i8] c"dur\C3\A9e = %lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4096)
%4 = tail call i32 @remplirTABrand(i32* %3, i32 1024)
%5 = tail call i32 @afficherTAB(i32* %3, i32 1024)
%6 = tail call double (...) @omp_get_wtime()
%7 = tail call i32 @SP1(i32* %3, i32 1024)
%8 = tail call double (...) @omp_get_wtime()
%9 = tail call i32 @afficherTAB(i32* %3, i32 1024)
%10 = fsub double %8, %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}