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

/* Variables and functions */
int DefaultFontFamily();
int /*<<< orphan*/ WriteColorTable();
int /*<<< orphan*/ WriteFontHeader();
int /*<<< orphan*/ WriteHeadFoot();
int /*<<< orphan*/ WriteInfo();
int /*<<< orphan*/ WritePageSize();
int /*<<< orphan*/ WriteStyleHeader();
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ fprintRTF(char *, int);
void WriteRtfHeader(void) {
  int family = DefaultFontFamily();
  diagnostics(4, "Writing header for RTF file");
  fprintRTF("{\\rtf1\\ansi\\uc1\\deff%d\\deflang1024\n", family);
  WriteFontHeader();
  WriteColorTable();
  WriteStyleHeader();
  WriteInfo();
  WriteHeadFoot();
  WritePageSize();
}


x86 assembly (clang, -O0):
<WriteRtfHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <DefaultFontFamily@plt>
mov    %eax,-0x4(%rbp)
mov    $0x4,%edi
lea    0xe52(%rip),%rsi
call   1060 <diagnostics@plt>
mov    -0x4(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1090 <fprintRTF@plt>
mov    $0x0,%al
call   1030 <WriteFontHeader@plt>
mov    $0x0,%al
call   1070 <WriteColorTable@plt>
mov    $0x0,%al
call   1080 <WriteStyleHeader@plt>
mov    $0x0,%al
call   10a0 <WriteInfo@plt>
mov    $0x0,%al
call   10b0 <WriteHeadFoot@plt>
mov    $0x0,%al
call   1040 <WritePageSize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteRtfHeader>:
push   %rbx
xor    %eax,%eax
call   1050 <DefaultFontFamily@plt>
mov    %eax,%ebx
lea    0xe5f(%rip),%rsi
mov    $0x4,%edi
call   1060 <diagnostics@plt>
lea    0xe6a(%rip),%rdi
mov    %ebx,%esi
call   1090 <fprintRTF@plt>
xor    %eax,%eax
call   1030 <WriteFontHeader@plt>
xor    %eax,%eax
call   1070 <WriteColorTable@plt>
xor    %eax,%eax
call   1080 <WriteStyleHeader@plt>
xor    %eax,%eax
call   10a0 <WriteInfo@plt>
xor    %eax,%eax
call   10b0 <WriteHeadFoot@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <WritePageSize@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Writing header for RTF file\00"
@.str.1 = [36 x i8] c"{\\rtf1\\ansi\\uc1\\deff%d\\deflang1024\0A\00"
define void @WriteRtfHeader() {
%1 = alloca i32
%2 = call i32 (...) @DefaultFontFamily()
store i32 %2, i32* %1
%3 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @fprintRTF(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @WriteFontHeader()
%7 = call i32 (...) @WriteColorTable()
%8 = call i32 (...) @WriteStyleHeader()
%9 = call i32 (...) @WriteInfo()
%10 = call i32 (...) @WriteHeadFoot()
%11 = call i32 (...) @WritePageSize()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Writing header for RTF file\00"
@.str.1 = [36 x i8] c"{\\rtf1\\ansi\\uc1\\deff%d\\deflang1024\0A\00"
define void @WriteRtfHeader() {
%1 = tail call i32 (...) @DefaultFontFamily()
%2 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%4 = tail call i32 (...) @WriteFontHeader()
%5 = tail call i32 (...) @WriteColorTable()
%6 = tail call i32 (...) @WriteStyleHeader()
%7 = tail call i32 (...) @WriteInfo()
%8 = tail call i32 (...) @WriteHeadFoot()
%9 = tail call i32 (...) @WritePageSize()
ret void
}