#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*/);
int /*<<< orphan*/ times(struct tms *);
void getSecsDetail(double *user_time, double *system_time) {
  struct tms time;
  times(&time);
  *user_time = (double)time.tms_utime / (double)sysconf(_SC_CLK_TCK);
  *system_time = (double)time.tms_stime / (double)sysconf(_SC_CLK_TCK);
}


x86 assembly (clang, -O0):
<getSecsDetail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <times@plt>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdq -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSecsDetail>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
call   1030 <times@plt>
cvtsi2sdq 0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x2e93(%rip),%r15
mov    (%r15),%edi
call   1040 <sysconf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    (%r15),%edi
call   1040 <sysconf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
@_SC_CLK_TCK = global i32 0
define void @getSecsDetail(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca %struct.tms
store double* %0, double** %3
store double* %1, double** %4
%6 = call i32 @times(%struct.tms* %5)
%7 = getelementptr inbounds %struct.tms, %struct.tms* %5, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = load i32, i32* @_SC_CLK_TCK
%11 = call i64 @sysconf(i32 %10)
%12 = sitofp i64 %11 to double
%13 = fdiv double %9, %12
%14 = load double*, double** %3
store double %13, double* %14
%15 = getelementptr inbounds %struct.tms, %struct.tms* %5, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sitofp i64 %16 to double
%18 = load i32, i32* @_SC_CLK_TCK
%19 = call i64 @sysconf(i32 %18)
%20 = sitofp i64 %19 to double
%21 = fdiv double %17, %20
%22 = load double*, double** %4
store double %21, double* %22
ret void
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
@_SC_CLK_TCK = global i32 0
define void @getSecsDetail(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = alloca %struct.tms
%4 = bitcast %struct.tms* %3 to i8*
%5 = call i32 @times(%struct.tms* %3)
%6 = getelementptr inbounds %struct.tms, %struct.tms* %3, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = load i32, i32* @_SC_CLK_TCK
%10 = tail call i64 @sysconf(i32 %9)
%11 = sitofp i64 %10 to double
%12 = fdiv double %8, %11
store double %12, double* %0
%13 = getelementptr inbounds %struct.tms, %struct.tms* %3, i64 0, i32 0
%14 = load i64, i64* %13
%15 = sitofp i64 %14 to double
%16 = load i32, i32* @_SC_CLK_TCK
%17 = tail call i64 @sysconf(i32 %16)
%18 = sitofp i64 %17 to double
%19 = fdiv double %15, %18
store double %19, double* %1
ret void
}