#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 tms {
  scalar_t__ tms_stime;
  scalar_t__ tms_utime;
};

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
scalar_t__ sysconf(int /*<<< orphan*/);
float timing(struct tms from, struct tms to) {
  return ((float)(to.tms_utime + to.tms_stime) -
          (float)(from.tms_utime + from.tms_stime)) /
         (float)sysconf(_SC_CLK_TCK);
}


x86 assembly (clang, -O0):
<timing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
movss  -0x24(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timing>:
push   %rax
add    %rcx,%rdx
cvtsi2ss %rdx,%xmm1
add    %rsi,%rdi
cvtsi2ss %rdi,%xmm0
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
@_SC_CLK_TCK = global i32 0
define float @timing(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.tms
%6 = alloca %struct.tms
%7 = bitcast %struct.tms* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.tms* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.tms, %struct.tms* %6, i32 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.tms, %struct.tms* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = add nsw i64 %14, %16
%18 = sitofp i64 %17 to float
%19 = getelementptr inbounds %struct.tms, %struct.tms* %5, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.tms, %struct.tms* %5, i32 0, i32 0
%22 = load i64, i64* %21
%23 = add nsw i64 %20, %22
%24 = sitofp i64 %23 to float
%25 = fsub float %18, %24
%26 = load i32, i32* @_SC_CLK_TCK
%27 = call i64 @sysconf(i32 %26)
%28 = sitofp i64 %27 to float
%29 = fdiv float %25, %28
ret float %29
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define float @timing(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add nsw i64 %3, %2
%6 = sitofp i64 %5 to float
%7 = add nsw i64 %1, %0
%8 = sitofp i64 %7 to float
%9 = fsub float %6, %8
%10 = load i32, i32* @_SC_CLK_TCK
%11 = tail call i64 @sysconf(i32 %10)
%12 = sitofp i64 %11 to float
%13 = fdiv float %9, %12
ret float %13
}