#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 timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_settime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ ctime_r(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void timet_h(struct timespec *ptp1) {
  clockid_t clk_id;
  struct timespec *ptp;
  clock_settime(CLOCK_REALTIME, ptp);
  clock_settime(clk_id, ptp);
  clock_settime(clk_id, ptp1);
  struct timespec tp;
  clock_settime(CLOCK_REALTIME, &tp);
  clock_settime(clk_id, &tp);
  time_t clock = time(0);
  char buf[26];
  ctime_r(&clock, buf);
}


x86 assembly (clang, -O0):
<timet_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1050 <clock_settime@plt>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <clock_settime@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <clock_settime@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1050 <clock_settime@plt>
mov    -0xc(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <clock_settime@plt>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0x24(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x24(%rbp),%rdi
call   1040 <ctime_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timet_h>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
mov    0x2e9f(%rip),%r14
mov    (%r14),%edi
call   1050 <clock_settime@plt>
call   1050 <clock_settime@plt>
mov    %rbx,%rsi
call   1050 <clock_settime@plt>
mov    (%r14),%edi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <clock_settime@plt>
mov    %rbx,%rsi
call   1050 <clock_settime@plt>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <ctime_r@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define void @timet_h(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca %struct.timespec
%6 = alloca i32
%7 = alloca [26 x i8]
store %struct.timespec* %0, %struct.timespec** %2
%8 = load i32, i32* @CLOCK_REALTIME
%9 = load %struct.timespec*, %struct.timespec** %4
%10 = call i32 @clock_settime(i32 %8, %struct.timespec* %9)
%11 = load i32, i32* %3
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = call i32 @clock_settime(i32 %11, %struct.timespec* %12)
%14 = load i32, i32* %3
%15 = load %struct.timespec*, %struct.timespec** %2
%16 = call i32 @clock_settime(i32 %14, %struct.timespec* %15)
%17 = load i32, i32* @CLOCK_REALTIME
%18 = call i32 @clock_settime(i32 %17, %struct.timespec* %5)
%19 = load i32, i32* %3
%20 = call i32 @clock_settime(i32 %19, %struct.timespec* %5)
%21 = call i32 @time(i32 0)
store i32 %21, i32* %6
%22 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 0
%23 = call i32 @ctime_r(i32* %6, i8* %22)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define void @timet_h(%struct.timespec* %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
%4 = alloca [26 x i8]
%5 = load i32, i32* @CLOCK_REALTIME
%6 = tail call i32 @clock_settime(i32 %5, %struct.timespec* undef)
%7 = tail call i32 @clock_settime(i32 undef, %struct.timespec* undef)
%8 = tail call i32 @clock_settime(i32 undef, %struct.timespec* %0)
%9 = bitcast %struct.timespec* %2 to i8*
%10 = load i32, i32* @CLOCK_REALTIME
%11 = call i32 @clock_settime(i32 %10, %struct.timespec* %2)
%12 = call i32 @clock_settime(i32 undef, %struct.timespec* %2)
%13 = bitcast i32* %3 to i8*
%14 = call i32 @time(i32 0)
store i32 %14, i32* %3
%15 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 0
%16 = call i32 @ctime_r(i32* %3, i8* %15)
ret void
}