#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*/ FILE;

/* Variables and functions */
char *format_time_str(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void pulse_data_print_pulse_header(FILE *file) {
  char time_str[32];
  fprintf(file, ";pulse data\n");
  fprintf(file, ";version 1\n");
  fprintf(file, ";timescale 1us\n");
  fprintf(file, ";created %s\n", format_time_str(time_str, NULL, 0));
}


x86 assembly (clang, -O0):
<pulse_data_print_pulse_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <format_time_str@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rdx
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulse_data_print_pulse_header>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeb5(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xea8(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rsp,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <format_time_str@plt>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c";pulse data\0A\00"
@.str.1 = [12 x i8] c";version 1\0A\00"
@.str.2 = [16 x i8] c";timescale 1us\0A\00"
@.str.3 = [13 x i8] c";created %s\0A\00"
define void @pulse_data_print_pulse_header(i32* %0) {
%2 = alloca i32*
%3 = alloca [32 x i8]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%12 = call i8* @format_time_str(i8* %11, i32* null, i32 0)
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c";pulse data\0A\00"
@.str.1 = [12 x i8] c";version 1\0A\00"
@.str.2 = [16 x i8] c";timescale 1us\0A\00"
@.str.3 = [13 x i8] c";created %s\0A\00"
define void @pulse_data_print_pulse_header(i32* nocapture %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 12, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 15, i64 1, i32* %0)
%7 = call i8* @format_time_str(i8* %3, i32* null, i32 0)
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}