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

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int itoa(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void _start(void) {
  struct timeval tv;
  char buffer[18];
  if (0 == gettimeofday(&tv, NULL)) {
    int n = itoa(tv.tv_sec, buffer, 10);
    buffer[n++] = ':';
    n += itoa(tv.tv_usec, buffer + n, 6);
    buffer[n++] = '\n';
    write(1, buffer, n);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ca <_start+0x8a>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1060 <itoa@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x3a,-0x20(%rbp,%rax,1)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
mov    $0x6,%edx
call   1060 <itoa@plt>
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0xa,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %rax,%rax
jne    11ab <_start+0x6b>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
mov    $0xa,%edx
call   1060 <itoa@plt>
movslq %eax,%rbx
movb   $0x3a,0x10(%rsp,%rbx,1)
mov    0x8(%rsp),%edi
lea    (%rsp,%rbx,1),%rsi
add    $0x11,%rsi
mov    $0x6,%edx
call   1060 <itoa@plt>
lea    (%rbx,%rax,1),%ecx
add    $0x1,%ecx
lea    0x2(%rbx,%rax,1),%edx
movslq %ecx,%rax
movb   $0xa,0x10(%rsp,%rax,1)
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @_start() {
%1 = alloca %struct.timeval
%2 = alloca [18 x i8]
%3 = alloca i32
%4 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %31
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%10 = call i32 @itoa(i32 %8, i8* %9, i32 10)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 %13
store i8 58, i8* %14
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = call i32 @itoa(i32 %16, i8* %20, i32 6)
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 %26
store i8 10, i8* %27
%28 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%29 = load i32, i32* %3
%30 = call i32 @write(i32 1, i8* %28, i32 %29)
br label %31
31: ; preds = %6, %0
%32 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @_start() {
%1 = alloca %struct.timeval
%2 = alloca [18 x i8]
%3 = bitcast %struct.timeval* %1 to i8*
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%5 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %24
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @itoa(i32 %9, i8* %4, i32 10)
%11 = add nsw i32 %10, 1
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 %12
store i8 58, i8* %13
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%15 = load i32, i32* %14
%16 = sext i32 %11 to i64
%17 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 %16
%18 = call i32 @itoa(i32 %15, i8* %17, i32 6)
%19 = add nsw i32 %18, %11
%20 = add nsw i32 %19, 1
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 %21
store i8 10, i8* %22
%23 = call i32 @write(i32 1, i8* %4, i32 %20)
br label %24
24: ; preds = %7, %0
%25 = call i32 @exit(i32 0)
unreachable
}