#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 */
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ tarea_dos();
int /*<<< orphan*/ tarea_uno();
int main() {
  double timeIni, timeFin;
  timeIni = omp_get_wtime();
  printf("Ejecutando tarea 1 \n");
  tarea_uno();
  printf("Ejecutando tarea 2\n\n");
  tarea_dos();
  timeFin = omp_get_wtime();
  printf("Tiempo tardado = %.4lf segundos\n\n", (timeFin - timeIni));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <tarea_uno@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1050 <tarea_dos@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <tarea_uno@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <tarea_dos@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  (%rsp),%xmm0
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Ejecutando tarea 1 \0A\00"
@.str.1 = [21 x i8] c"Ejecutando tarea 2\0A\0A\00"
@.str.2 = [34 x i8] c"Tiempo tardado = %.4lf segundos\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double (...) @omp_get_wtime()
store double %4, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @tarea_uno()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @tarea_dos()
%9 = call double (...) @omp_get_wtime()
store double %9, double* %3
%10 = load double, double* %3
%11 = load double, double* %2
%12 = fsub double %10, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [34 x i8] c"Tiempo tardado = %.4lf segundos\0A\0A\00"
@str = [20 x i8] c"Ejecutando tarea 1 \00"
@str.3 = [20 x i8] c"Ejecutando tarea 2\0A\00"
define i32 @main() {
%1 = tail call double (...) @omp_get_wtime()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @tarea_uno()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (...) @tarea_dos()
%6 = tail call double (...) @omp_get_wtime()
%7 = fsub double %6, %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}