#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*/ fputc(int, int /*<<< orphan*/ *);
void writeHeader(FILE *out_file) {
  int i;
  for (i = 0; i < 57; ++i) {
    fputc(0x10, out_file);
    fputc(0x02, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
    fputc(0x01, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
    fputc(0x00, out_file);
  }
  fputc(0x11, out_file);
  fputc(0x02, out_file);
  fputc(0x00, out_file);
  fputc(0x00, out_file);
}


x86 assembly (clang, -O0):
<writeHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x39,-0xc(%rbp)
jge    119c <writeHeader+0x8c>
mov    -0x8(%rbp),%rsi
mov    $0x10,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <writeHeader+0x13>
mov    -0x8(%rbp),%rsi
mov    $0x11,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeHeader>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x39,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x10,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <writeHeader+0x10>
mov    $0x11,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @writeHeader(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 57
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = call i32 @fputc(i32 16, i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @fputc(i32 2, i32* %10)
%12 = load i32*, i32** %2
%13 = call i32 @fputc(i32 0, i32* %12)
%14 = load i32*, i32** %2
%15 = call i32 @fputc(i32 0, i32* %14)
%16 = load i32*, i32** %2
%17 = call i32 @fputc(i32 1, i32* %16)
%18 = load i32*, i32** %2
%19 = call i32 @fputc(i32 0, i32* %18)
%20 = load i32*, i32** %2
%21 = call i32 @fputc(i32 0, i32* %20)
%22 = load i32*, i32** %2
%23 = call i32 @fputc(i32 0, i32* %22)
br label %24
24: ; preds = %7
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %4
27: ; preds = %4
%28 = load i32*, i32** %2
%29 = call i32 @fputc(i32 17, i32* %28)
%30 = load i32*, i32** %2
%31 = call i32 @fputc(i32 2, i32* %30)
%32 = load i32*, i32** %2
%33 = call i32 @fputc(i32 0, i32* %32)
%34 = load i32*, i32** %2
%35 = call i32 @fputc(i32 0, i32* %34)
ret void
}

LLVM IR (-O2):
define void @writeHeader(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %12, %2 ]
%4 = tail call i32 @fputc(i32 16, i32* %0)
%5 = tail call i32 @fputc(i32 2, i32* %0)
%6 = tail call i32 @fputc(i32 0, i32* %0)
%7 = tail call i32 @fputc(i32 0, i32* %0)
%8 = tail call i32 @fputc(i32 1, i32* %0)
%9 = tail call i32 @fputc(i32 0, i32* %0)
%10 = tail call i32 @fputc(i32 0, i32* %0)
%11 = tail call i32 @fputc(i32 0, i32* %0)
%12 = add nuw nsw i32 %3, 1
%13 = icmp eq i32 %12, 57
br i1 %13, label %14, label %2
14: ; preds = %2
%15 = tail call i32 @fputc(i32 17, i32* %0)
%16 = tail call i32 @fputc(i32 2, i32* %0)
%17 = tail call i32 @fputc(i32 0, i32* %0)
%18 = tail call i32 @fputc(i32 0, i32* %0)
ret void
}