#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;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
scalar_t__ snprintf(char *, int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                    char const *, char const *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
void tx_code(const char *raw, const char *cooked) {
  char buf[512];
  struct timeval tv;
  gettimeofday(&tv, 0);
  write(1, buf,
        snprintf(buf, sizeof(buf), "=%ld.%06ld\x01%s\x01%s", tv.tv_sec,
                 tv.tv_usec, raw, cooked) +
            1);
}


x86 assembly (clang, -O0):
<tx_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x218(%rbp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
lea    -0x210(%rbp),%rax
mov    %rax,-0x220(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x214(%rbp),%ecx
mov    -0x218(%rbp),%r8d
mov    -0x8(%rbp),%r9
mov    -0x10(%rbp),%rax
mov    $0x200,%esi
lea    0xe79(%rip),%rdx
mov    %rax,(%rsp)
call   1040 <snprintf@plt>
mov    -0x220(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_code>:
push   %r14
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%ecx
mov    %rbx,(%rsp)
lea    0xea0(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r14,%r9
call   1040 <snprintf@plt>
lea    0x1(%rax),%rdx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <write@plt>
add    $0x218,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [17 x i8] c"=%ld.%06ld\01%s\01%s\00"
define void @tx_code(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
%6 = alloca %struct.timeval
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 @gettimeofday(%struct.timeval* %6, i32 0)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i64 @snprintf(i8* %9, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13, i8* %14, i8* %15)
%17 = add nsw i64 %16, 1
%18 = call i32 @write(i32 1, i8* %8, i64 %17)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [17 x i8] c"=%ld.%06ld\01%s\01%s\00"
define void @tx_code(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = alloca %struct.timeval
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = bitcast %struct.timeval* %4 to i8*
%7 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @snprintf(i8* %5, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i8* %0, i8* %1)
%13 = add nsw i64 %12, 1
%14 = call i32 @write(i32 1, i8* %5, i64 %13)
ret void
}