#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 RtfFontNumber(char *);
int /*<<< orphan*/ diagnostics(int, char *, char *);
scalar_t__ strcmp(char *, char *);
scalar_t__ strstr(char *, char *);
void setPackageFont(char *font) {
  int fnumber = -1;
  if (strcmp(font, "palatino") == 0)
    fnumber = RtfFontNumber("Palatino");
  else if (strstr(font, "times"))
    fnumber = RtfFontNumber("Times");
  else if (strstr(font, "chancery"))
    fnumber = RtfFontNumber("Zapf Chancery");
  else if (strstr(font, "courier"))
    fnumber = RtfFontNumber("Courier");
  else if (strstr(font, "avant"))
    fnumber = RtfFontNumber("Avant Garde");
  else if (strstr(font, "helvet"))
    fnumber = RtfFontNumber("Helvetica");
  else if (strstr(font, "newcen"))
    fnumber = RtfFontNumber("New Century Schoolbook");
  else if (strstr(font, "book"))
    fnumber = RtfFontNumber("Bookman");
  if (fnumber == -1)
    diagnostics(1, "Font Package <%s> not supported.", font);
}


x86 assembly (clang, -O0):
<setPackageFont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1181 <setPackageFont+0x41>
lea    0xe95(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12e1 <setPackageFont+0x1a1>
mov    -0x8(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11af <setPackageFont+0x6f>
lea    0xe76(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12dc <setPackageFont+0x19c>
mov    -0x8(%rbp),%rdi
lea    0xe64(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11dd <setPackageFont+0x9d>
lea    0xe57(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12d7 <setPackageFont+0x197>
mov    -0x8(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     120b <setPackageFont+0xcb>
lea    0xe3f(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12d2 <setPackageFont+0x192>
mov    -0x8(%rbp),%rdi
lea    0xe2f(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1239 <setPackageFont+0xf9>
lea    0xe1f(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12cd <setPackageFont+0x18d>
mov    -0x8(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1267 <setPackageFont+0x127>
lea    0xe04(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12c8 <setPackageFont+0x188>
mov    -0x8(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1295 <setPackageFont+0x155>
lea    0xde7(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12c3 <setPackageFont+0x183>
mov    -0x8(%rbp),%rdi
lea    0xde1(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     12be <setPackageFont+0x17e>
lea    0xdd0(%rip),%rdi
call   1050 <RtfFontNumber@plt>
mov    %eax,-0xc(%rbp)
jmp    12c3 <setPackageFont+0x183>
jmp    12c8 <setPackageFont+0x188>
jmp    12cd <setPackageFont+0x18d>
jmp    12d2 <setPackageFont+0x192>
jmp    12d7 <setPackageFont+0x197>
jmp    12dc <setPackageFont+0x19c>
jmp    12e1 <setPackageFont+0x1a1>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1300 <setPackageFont+0x1c0>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xd93(%rip),%rsi
call   1030 <diagnostics@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPackageFont>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1175 <setPackageFont+0x35>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1181 <setPackageFont+0x41>
lea    0xea8(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe8d(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11a1 <setPackageFont+0x61>
lea    0xe8b(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11be <setPackageFont+0x7e>
lea    0xe81(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11db <setPackageFont+0x9b>
lea    0xe72(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11f8 <setPackageFont+0xb8>
lea    0xe68(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe69(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1215 <setPackageFont+0xd5>
lea    0xe5c(%rip),%rdi
jmp    1230 <setPackageFont+0xf0>
lea    0xe65(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     123c <setPackageFont+0xfc>
lea    0xe56(%rip),%rdi
call   1050 <RtfFontNumber@plt>
cmp    $0xffffffff,%eax
je     123c <setPackageFont+0xfc>
pop    %rbx
ret
lea    0xe4b(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <diagnostics@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"palatino\00"
@.str.1 = [9 x i8] c"Palatino\00"
@.str.2 = [6 x i8] c"times\00"
@.str.3 = [6 x i8] c"Times\00"
@.str.4 = [9 x i8] c"chancery\00"
@.str.5 = [14 x i8] c"Zapf Chancery\00"
@.str.6 = [8 x i8] c"courier\00"
@.str.7 = [8 x i8] c"Courier\00"
@.str.8 = [6 x i8] c"avant\00"
@.str.9 = [12 x i8] c"Avant Garde\00"
@.str.10 = [7 x i8] c"helvet\00"
@.str.11 = [10 x i8] c"Helvetica\00"
@.str.12 = [7 x i8] c"newcen\00"
@.str.13 = [23 x i8] c"New Century Schoolbook\00"
@.str.14 = [5 x i8] c"book\00"
@.str.15 = [8 x i8] c"Bookman\00"
@.str.16 = [33 x i8] c"Font Package <%s> not supported.\00"
define void @setPackageFont(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 %8, i32* %3
br label %58
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @strstr(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 %14, i32* %3
br label %57
15: ; preds = %9
%16 = load i8*, i8** %2
%17 = call i64 @strstr(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
store i32 %20, i32* %3
br label %56
21: ; preds = %15
%22 = load i8*, i8** %2
%23 = call i64 @strstr(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
store i32 %26, i32* %3
br label %55
27: ; preds = %21
%28 = load i8*, i8** %2
%29 = call i64 @strstr(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
store i32 %32, i32* %3
br label %54
33: ; preds = %27
%34 = load i8*, i8** %2
%35 = call i64 @strstr(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
store i32 %38, i32* %3
br label %53
39: ; preds = %33
%40 = load i8*, i8** %2
%41 = call i64 @strstr(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
store i32 %44, i32* %3
br label %52
45: ; preds = %39
%46 = load i8*, i8** %2
%47 = call i64 @strstr(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 @RtfFontNumber(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
store i32 %50, i32* %3
br label %51
51: ; preds = %49, %45
br label %52
52: ; preds = %51, %43
br label %53
53: ; preds = %52, %37
br label %54
54: ; preds = %53, %31
br label %55
55: ; preds = %54, %25
br label %56
56: ; preds = %55, %19
br label %57
57: ; preds = %56, %13
br label %58
58: ; preds = %57, %7
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i8*, i8** %2
%63 = call i32 @diagnostics(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i64 0, i64 0), i8* %62)
br label %64
64: ; preds = %61, %58
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"palatino\00"
@.str.1 = [9 x i8] c"Palatino\00"
@.str.2 = [6 x i8] c"times\00"
@.str.3 = [6 x i8] c"Times\00"
@.str.4 = [9 x i8] c"chancery\00"
@.str.5 = [14 x i8] c"Zapf Chancery\00"
@.str.6 = [8 x i8] c"courier\00"
@.str.7 = [8 x i8] c"Courier\00"
@.str.8 = [6 x i8] c"avant\00"
@.str.9 = [12 x i8] c"Avant Garde\00"
@.str.10 = [7 x i8] c"helvet\00"
@.str.11 = [10 x i8] c"Helvetica\00"
@.str.12 = [7 x i8] c"newcen\00"
@.str.13 = [23 x i8] c"New Century Schoolbook\00"
@.str.14 = [5 x i8] c"book\00"
@.str.15 = [8 x i8] c"Bookman\00"
@.str.16 = [33 x i8] c"Font Package <%s> not supported.\00"
define void @setPackageFont(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %25, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22, %19, %16, %13, %10, %7, %4, %1
%26 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), %13 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), %16 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), %19 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), %22 ]
%27 = tail call i32 @RtfFontNumber(i8* %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %22, %25
%30 = tail call i32 @diagnostics(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i64 0, i64 0), i8* %0)
br label %31
31: ; preds = %29, %25
ret void
}