#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 /*<<< orphan*/ Convert();
int TexFontNumber(char *);
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ fprintRTF(char *, ...);
void RtfHeader(int where, char *what) {
  int fn = TexFontNumber("Roman");
  switch (where) {
  case 347:
    fprintRTF("\n{\\headerr \\pard\\plain\\f%d ", fn);
    break;
  case 349:
    fprintRTF("\n{\\headerl \\pard\\plain\\f%d ", fn);
    break;
  case 348:
    fprintRTF("\n{\\header \\pard\\plain\\f%d ", fn);
    break;
  default:
    diagnostics(0, "\n error -> called RtfHeader with illegal parameter\n ");
  }
  if (what == NULL) {
    diagnostics(4, "Entering Convert() from RtfHeader");
    Convert();
    diagnostics(4, "Exiting Convert() from RtfHeader");
    fprintRTF("}");
  } else
    fprintRTF("%s}", what);
}


x86 assembly (clang, -O0):
<RtfHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <TexFontNumber@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x15b,%eax
je     119a <RtfHeader+0x5a>
jmp    1174 <RtfHeader+0x34>
mov    -0x18(%rbp),%eax
sub    $0x15c,%eax
je     11c6 <RtfHeader+0x86>
jmp    1187 <RtfHeader+0x47>
mov    -0x18(%rbp),%eax
sub    $0x15d,%eax
je     11b0 <RtfHeader+0x70>
jmp    11dc <RtfHeader+0x9c>
mov    -0x14(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1060 <fprintRTF@plt>
jmp    11ea <RtfHeader+0xaa>
mov    -0x14(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1060 <fprintRTF@plt>
jmp    11ea <RtfHeader+0xaa>
mov    -0x14(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1060 <fprintRTF@plt>
jmp    11ea <RtfHeader+0xaa>
xor    %edi,%edi
lea    0xe74(%rip),%rsi
call   1050 <diagnostics@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1231 <RtfHeader+0xf1>
mov    $0x4,%edi
lea    0xe8d(%rip),%rsi
call   1050 <diagnostics@plt>
mov    $0x0,%al
call   1040 <Convert@plt>
mov    $0x4,%edi
lea    0xe97(%rip),%rsi
call   1050 <diagnostics@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1060 <fprintRTF@plt>
jmp    1243 <RtfHeader+0x103>
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1060 <fprintRTF@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RtfHeader>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1030 <TexFontNumber@plt>
cmp    $0x15d,%ebp
je     1175 <RtfHeader+0x35>
cmp    $0x15c,%ebp
je     117e <RtfHeader+0x3e>
cmp    $0x15b,%ebp
jne    11aa <RtfHeader+0x6a>
lea    0xe93(%rip),%rdi
jmp    1185 <RtfHeader+0x45>
lea    0xea6(%rip),%rdi
jmp    1185 <RtfHeader+0x45>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <fprintRTF@plt>
test   %rbx,%rbx
je     11bd <RtfHeader+0x7d>
lea    0xf37(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <fprintRTF@plt>
lea    0xea8(%rip),%rsi
xor    %edi,%edi
call   1050 <diagnostics@plt>
test   %rbx,%rbx
jne    1193 <RtfHeader+0x53>
lea    0xeca(%rip),%rsi
mov    $0x4,%edi
call   1050 <diagnostics@plt>
xor    %eax,%eax
call   1040 <Convert@plt>
lea    0xed4(%rip),%rsi
mov    $0x4,%edi
call   1050 <diagnostics@plt>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Roman\00"
@.str.1 = [28 x i8] c"\0A{\\headerr \\pard\\plain\\f%d \00"
@.str.2 = [28 x i8] c"\0A{\\headerl \\pard\\plain\\f%d \00"
@.str.3 = [27 x i8] c"\0A{\\header \\pard\\plain\\f%d \00"
@.str.4 = [53 x i8] c"\0A error -> called RtfHeader with illegal parameter\0A \00"
@.str.5 = [34 x i8] c"Entering Convert() from RtfHeader\00"
@.str.6 = [33 x i8] c"Exiting Convert() from RtfHeader\00"
@.str.7 = [2 x i8] c"}\00"
@.str.8 = [4 x i8] c"%s}\00"
define void @RtfHeader(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @TexFontNumber(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %5
%7 = load i32, i32* %3
switch i32 %7, label %17 [
i32 347, label %8
i32 349, label %11
i32 348, label %14
]
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %19
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %19
14: ; preds = %2
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 @diagnostics(i32 0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %14, %11, %8
%20 = load i8*, i8** %4
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 (...) @Convert()
%25 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%26 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %30
27: ; preds = %19
%28 = load i8*, i8** %4
%29 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %27, %22
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Roman\00"
@.str.1 = [28 x i8] c"\0A{\\headerr \\pard\\plain\\f%d \00"
@.str.2 = [28 x i8] c"\0A{\\headerl \\pard\\plain\\f%d \00"
@.str.3 = [27 x i8] c"\0A{\\header \\pard\\plain\\f%d \00"
@.str.4 = [53 x i8] c"\0A error -> called RtfHeader with illegal parameter\0A \00"
@.str.5 = [34 x i8] c"Entering Convert() from RtfHeader\00"
@.str.6 = [33 x i8] c"Exiting Convert() from RtfHeader\00"
@.str.7 = [2 x i8] c"}\00"
@.str.8 = [4 x i8] c"%s}\00"
define void @RtfHeader(i32 %0, i8* %1) {
%3 = tail call i32 @TexFontNumber(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %10 [
i32 347, label %4
i32 349, label %6
i32 348, label %8
]
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %12
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %3)
br label %12
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %3)
br label %12
10: ; preds = %2
%11 = tail call i32 @diagnostics(i32 0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
%13 = icmp eq i8* %1, null
br i1 %13, label %14, label %19
14: ; preds = %12
%15 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%16 = tail call i32 (...) @Convert()
%17 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %21
19: ; preds = %12
%20 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %1)
br label %21
21: ; preds = %19, %14
ret void
}