#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*/ fprintf(int /*<<< orphan*/, char *, size_t, double);
int /*<<< orphan*/ stdout;
double timeval_to_secs(struct timeval *);
void report(struct timeval starttime, struct timeval endtime, size_t bytes) {
  double elapsed_time = timeval_to_secs(&endtime) - timeval_to_secs(&starttime);
  fprintf(stdout, "report: exchanged %zd Bytes in %2.3f seconds.\n", bytes,
          elapsed_time);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <timeval_to_secs@plt>
movsd  %xmm0,-0x28(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <timeval_to_secs@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %edi,0x10(%rsp)
mov    %esi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <timeval_to_secs@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <timeval_to_secs@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdx
movapd %xmm1,%xmm0
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@stdout = global i32 0
@.str = [47 x i8] c"report: exchanged %zd Bytes in %2.3f seconds.\0A\00"
define void @report(i32 %0, i32 %1, i64 %2) {
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca i64
%7 = alloca double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %1, i32* %9
store i64 %2, i64* %6
%10 = call double @timeval_to_secs(%struct.timeval* %5)
%11 = call double @timeval_to_secs(%struct.timeval* %4)
%12 = fsub double %10, %11
store double %12, double* %7
%13 = load i32, i32* @stdout
%14 = load i64, i64* %6
%15 = load double, double* %7
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %14, double %15)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@stdout = global i32 0
@.str = [47 x i8] c"report: exchanged %zd Bytes in %2.3f seconds.\0A\00"
define void @report(i32 %0, i32 %1, i64 %2) {
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i32 %1, i32* %7
%8 = call double @timeval_to_secs(%struct.timeval* %5)
%9 = call double @timeval_to_secs(%struct.timeval* %4)
%10 = fsub double %8, %9
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %2, double %10)
ret void
}