#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  scalar_t__ tm_sec;
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
  scalar_t__ tm_mday;
  scalar_t__ tm_mon;
  scalar_t__ tm_year;
};
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ Platform_YMDHMStoClock(long long, long long, long long,
                                          long long, long long, long long,
                                          long long *, long long *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
struct tm *localtime(int /*<<< orphan*/ *);
void Platform_GetClock(long long *t, long long *d) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  struct tm *time = localtime((time_t *)&tv.tv_sec);
  Platform_YMDHMStoClock((long long)time->tm_year, (long long)time->tm_mon,
                         (long long)time->tm_mday, (long long)time->tm_hour,
                         (long long)time->tm_min, (long long)time->tm_sec, &*t,
                         &*d);
}


x86 assembly (clang, -O0):
<Platform_GetClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rdi
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r8
mov    -0x20(%rbp),%rax
mov    (%rax),%r9
mov    -0x8(%rbp),%r10
mov    -0x10(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <Platform_YMDHMStoClock@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_GetClock>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    0x28(%rax),%rdi
mov    0x20(%rax),%rsi
mov    0x18(%rax),%rdx
mov    0x10(%rax),%rcx
mov    (%rax),%r9
mov    0x8(%rax),%r8
push   %r15
push   %r14
call   1050 <Platform_YMDHMStoClock@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.tm = type { i64, i64, i64, i64, i64, i64 }
define void @Platform_GetClock(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
%6 = alloca %struct.tm*
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = call i32 @gettimeofday(%struct.timeval* %5, i32 0)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%9 = call %struct.tm* @localtime(i32* %8)
store %struct.tm* %9, %struct.tm** %6
%10 = load %struct.tm*, %struct.tm** %6
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 5
%12 = load i64, i64* %11
%13 = load %struct.tm*, %struct.tm** %6
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 4
%15 = load i64, i64* %14
%16 = load %struct.tm*, %struct.tm** %6
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 3
%18 = load i64, i64* %17
%19 = load %struct.tm*, %struct.tm** %6
%20 = getelementptr inbounds %struct.tm, %struct.tm* %19, i32 0, i32 2
%21 = load i64, i64* %20
%22 = load %struct.tm*, %struct.tm** %6
%23 = getelementptr inbounds %struct.tm, %struct.tm* %22, i32 0, i32 1
%24 = load i64, i64* %23
%25 = load %struct.tm*, %struct.tm** %6
%26 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 0
%27 = load i64, i64* %26
%28 = load i64*, i64** %3
%29 = load i64*, i64** %4
%30 = call i32 @Platform_YMDHMStoClock(i64 %12, i64 %15, i64 %18, i64 %21, i64 %24, i64 %27, i64* %28, i64* %29)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.tm = type { i64, i64, i64, i64, i64, i64 }
define void @Platform_GetClock(i64* %0, i64* %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = call %struct.tm* @localtime(i32* %6)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 5
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 4
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 3
%13 = load i64, i64* %12
%14 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 2
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%17 = load i64, i64* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
%19 = load i64, i64* %18
%20 = call i32 @Platform_YMDHMStoClock(i64 %9, i64 %11, i64 %13, i64 %15, i64 %17, i64 %19, i64* %0, i64* %1)
ret void
}