#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 tm {
  scalar_t__ tm_sec;
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
};
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
struct tm *localtime(int /*<<< orphan*/ *);
double _now_time(void) {
  struct tm *now;
  struct timezone tz;
  struct timeval t;
  gettimeofday(&t, &tz);
  now = localtime(&t.tv_sec);
  return (double)(now->tm_hour) * 3600.0e+6 + (double)(now->tm_min) * 60.0e+6 +
         (double)(now->tm_sec) * 1.0e+6 + (double)(t.tv_usec);
}


x86 assembly (clang, -O0):
<_now_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <gettimeofday@plt>
lea    -0x20(%rbp),%rdi
add    $0x8,%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
movsd  0xeae(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe9a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
movsd  0xe79(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_now_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <gettimeofday@plt>
lea    0x10(%rsp),%rdi
call   1030 <localtime@plt>
cvtsi2sdq 0x10(%rax),%xmm0
cvtsi2sdq 0x8(%rax),%xmm1
mulsd  0xeb1(%rip),%xmm1
mulsd  0xeb1(%rip),%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
mulsd  0xea5(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i64, i64, i64 }
%struct.timezone = type { i32 }
%struct.timeval = type { i64, i32 }
define double @_now_time() {
%1 = alloca %struct.tm*
%2 = alloca %struct.timezone
%3 = alloca %struct.timeval
%4 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %6, %struct.tm** %1
%7 = load %struct.tm*, %struct.tm** %1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 2
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = load %struct.tm*, %struct.tm** %1
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = fmul double %14, 6.000000e+07
%16 = call double @llvm.fmuladd.f64(double %10, double 3.600000e+09, double %15)
%17 = load %struct.tm*, %struct.tm** %1
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sitofp i64 %19 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 1.000000e+06, double %16)
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%23 = load i64, i64* %22
%24 = sitofp i64 %23 to double
%25 = fadd double %21, %24
ret double %25
}

LLVM IR (-O2):
%struct.timezone = type { i32 }
%struct.timeval = type { i64, i32 }
%struct.tm = type { i64, i64, i64 }
define double @_now_time() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = bitcast %struct.timezone* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%7 = call %struct.tm* @localtime(i32* %6)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 2
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fmul double %13, 6.000000e+07
%15 = call double @llvm.fmuladd.f64(double %10, double 3.600000e+09, double %14)
%16 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
%17 = load i64, i64* %16
%18 = sitofp i64 %17 to double
%19 = call double @llvm.fmuladd.f64(double %18, double 1.000000e+06, double %15)
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%21 = load i64, i64* %20
%22 = sitofp i64 %21 to double
%23 = fadd double %19, %22
ret double %23
}