#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 */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ GetElapsedTime(double *, struct timeval *, struct timeval *);
void ComputeTotalTime(double *timing, struct timeval *time_start1,
                      struct timeval *time_end1, struct timeval *time_start2,
                      struct timeval *time_end2) {
  double aux;
  GetElapsedTime(&aux, time_start1, time_end1);
  GetElapsedTime(timing, time_start2, time_end2);
  *timing += aux;
}


x86 assembly (clang, -O0):
<ComputeTotalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x30(%rbp),%rdi
call   1030 <GetElapsedTime@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <GetElapsedTime@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComputeTotalTime>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <GetElapsedTime@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <GetElapsedTime@plt>
movsd  0x8(%rsp),%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @ComputeTotalTime(double* %0, %struct.timeval* %1, %struct.timeval* %2, %struct.timeval* %3, %struct.timeval* %4) {
%6 = alloca double*
%7 = alloca %struct.timeval*
%8 = alloca %struct.timeval*
%9 = alloca %struct.timeval*
%10 = alloca %struct.timeval*
%11 = alloca double
store double* %0, double** %6
store %struct.timeval* %1, %struct.timeval** %7
store %struct.timeval* %2, %struct.timeval** %8
store %struct.timeval* %3, %struct.timeval** %9
store %struct.timeval* %4, %struct.timeval** %10
%12 = load %struct.timeval*, %struct.timeval** %7
%13 = load %struct.timeval*, %struct.timeval** %8
%14 = call i32 @GetElapsedTime(double* %11, %struct.timeval* %12, %struct.timeval* %13)
%15 = load double*, double** %6
%16 = load %struct.timeval*, %struct.timeval** %9
%17 = load %struct.timeval*, %struct.timeval** %10
%18 = call i32 @GetElapsedTime(double* %15, %struct.timeval* %16, %struct.timeval* %17)
%19 = load double, double* %11
%20 = load double*, double** %6
%21 = load double, double* %20
%22 = fadd double %21, %19
store double %22, double* %20
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @ComputeTotalTime(double* %0, %struct.timeval* %1, %struct.timeval* %2, %struct.timeval* %3, %struct.timeval* %4) {
%6 = alloca double
%7 = bitcast double* %6 to i8*
%8 = call i32 @GetElapsedTime(double* %6, %struct.timeval* %1, %struct.timeval* %2)
%9 = call i32 @GetElapsedTime(double* %0, %struct.timeval* %3, %struct.timeval* %4)
%10 = load double, double* %6
%11 = load double, double* %0
%12 = fadd double %10, %11
store double %12, double* %0
ret void
}