#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 */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void write_header(FILE *f_out, const char *rng_name, unsigned int seed,
                  int count) {
  fprintf(
      f_out, "%s\n",
      "#==================================================================");
  fprintf(f_out, "# generator %s  seed %u\n", rng_name, seed);
  fprintf(
      f_out, "%s\n",
      "#==================================================================");
  fprintf(f_out, "type: %s\n", "d");
  fprintf(f_out, "count: %d\n", count);
  fprintf(f_out, "numbit: %d\n", 32);
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf32(%rip),%rsi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xef3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf00(%rip),%rsi
lea    0xe96(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee1(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xf35(%rip),%r12
lea    0xecb(%rip),%r13
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xefb(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeed(%rip),%rsi
lea    0xef0(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [68 x i8] c"#==================================================================\00"
@.str.2 = [25 x i8] c"# generator %s seed %u\0A\00"
@.str.3 = [10 x i8] c"type: %s\0A\00"
@.str.4 = [2 x i8] c"d\00"
@.str.5 = [11 x i8] c"count: %d\0A\00"
@.str.6 = [12 x i8] c"numbit: %d\0A\00"
define void @write_header(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i32*, i32** %5
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32*, i32** %5
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32*, i32** %5
%20 = load i32, i32* %8
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = load i32*, i32** %5
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 32)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [68 x i8] c"#==================================================================\00"
@.str.2 = [25 x i8] c"# generator %s seed %u\0A\00"
@.str.3 = [10 x i8] c"type: %s\0A\00"
@.str.4 = [2 x i8] c"d\00"
@.str.5 = [11 x i8] c"count: %d\0A\00"
@.str.6 = [12 x i8] c"numbit: %d\0A\00"
define void @write_header(i32* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %1, i32 %2)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %3)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 32)
ret void
}