#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 *SP2(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 = 102400;
  int *S;
  int *T = malloc(n * sizeof(int));
  remplirTABrand(T, n);
  afficherTAB(T, n);
  double fin;
  double debut = omp_get_wtime();
  S = SP2(T, n);
  fin = omp_get_wtime();
  afficherTAB(S, n);
  printf("durée = %lf\n", fin - debut);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x19000,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <remplirTABrand@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <afficherTAB@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <SP2@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <afficherTAB@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
lea    0xe13(%rip),%rdi
call   1040 <printf@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x64000,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x19000,%esi
call   1050 <remplirTABrand@plt>
mov    %rbx,%rdi
mov    $0x19000,%esi
call   1080 <afficherTAB@plt>
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x19000,%esi
call   1070 <SP2@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0x19000,%esi
call   1080 <afficherTAB@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e00(%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 i32*
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 102400, 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 i32* @malloc(i32 %14)
store i32* %15, i32** %8
%16 = load i32*, i32** %8
%17 = load i32, i32* %6
%18 = call i32 @remplirTABrand(i32* %16, i32 %17)
%19 = load i32*, i32** %8
%20 = load i32, i32* %6
%21 = call i32 @afficherTAB(i32* %19, i32 %20)
%22 = call double (...) @omp_get_wtime()
store double %22, double* %10
%23 = load i32*, i32** %8
%24 = load i32, i32* %6
%25 = call i32* @SP2(i32* %23, i32 %24)
store i32* %25, i32** %7
%26 = call double (...) @omp_get_wtime()
store double %26, double* %9
%27 = load i32*, i32** %7
%28 = load i32, i32* %6
%29 = call i32 @afficherTAB(i32* %27, i32 %28)
%30 = load double, double* %9
%31 = load double, double* %10
%32 = fsub double %30, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

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 409600)
%4 = tail call i32 @remplirTABrand(i32* %3, i32 102400)
%5 = tail call i32 @afficherTAB(i32* %3, i32 102400)
%6 = tail call double (...) @omp_get_wtime()
%7 = tail call i32* @SP2(i32* %3, i32 102400)
%8 = tail call double (...) @omp_get_wtime()
%9 = tail call i32 @afficherTAB(i32* %7, i32 102400)
%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
}