#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 timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
void print_timeofday() {
  char buffer[30];
  struct timeval tv;
  time_t curtime;
  curtime = tv.tv_sec;
  strftime(buffer, 30, "%m-%d-%Y  %T.", localtime(&curtime));
  fprintf(stderr, "%s%ld\n", buffer, tv.tv_usec);
}


x86 assembly (clang, -O0):
<print_timeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x2c(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%ecx
mov    $0x1e,%esi
lea    0xe9f(%rip),%rdx
call   1050 <strftime@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timeofday>:
push   %rbx
sub    $0x30,%rsp
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeba(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"%m-%d-%Y %T.\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"%s%ld\0A\00"
define void @print_timeofday() {
%1 = alloca [30 x i8]
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = call i32 @localtime(i32* %3)
%8 = call i32 @strftime(i8* %6, i32 30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stderr
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%m-%d-%Y %T.\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"%s%ld\0A\00"
define void @print_timeofday() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* %3, i32 30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 undef)
ret void
}