#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*/ strcasecmp(char const *, char *);
int css_get_font_family(const char *str) {
  int v;
  if (!strcasecmp(str, "serif") || !strcasecmp(str, "times"))
    v = 0x0200;
  else if (!strcasecmp(str, "sans") || !strcasecmp(str, "arial") ||
           !strcasecmp(str, "helvetica"))
    v = 0x0300;
  else if (!strcasecmp(str, "fixed") || !strcasecmp(str, "monospace") ||
           !strcasecmp(str, "courier"))
    v = 0x0100;
  else
    v = 0;
  return v;
}


x86 assembly (clang, -O0):
<css_get_font_family>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     114e <css_get_font_family+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    115a <css_get_font_family+0x4a>
movl   $0x200,-0xc(%rbp)
jmp    1219 <css_get_font_family+0x109>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11a5 <css_get_font_family+0x95>
mov    -0x8(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11a5 <css_get_font_family+0x95>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11b1 <css_get_font_family+0xa1>
movl   $0x300,-0xc(%rbp)
jmp    1214 <css_get_font_family+0x104>
mov    -0x8(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11fc <css_get_font_family+0xec>
mov    -0x8(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11fc <css_get_font_family+0xec>
mov    -0x8(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1208 <css_get_font_family+0xf8>
movl   $0x100,-0xc(%rbp)
jmp    120f <css_get_font_family+0xff>
movl   $0x0,-0xc(%rbp)
jmp    1214 <css_get_font_family+0x104>
jmp    1219 <css_get_font_family+0x109>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<css_get_font_family>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    $0x200,%ebp
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x300,%ebp
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x100,%ebp
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c9 <css_get_font_family+0xb9>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
shl    $0x8,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"serif\00"
@.str.1 = [6 x i8] c"times\00"
@.str.2 = [5 x i8] c"sans\00"
@.str.3 = [6 x i8] c"arial\00"
@.str.4 = [10 x i8] c"helvetica\00"
@.str.5 = [6 x i8] c"fixed\00"
@.str.6 = [10 x i8] c"monospace\00"
@.str.7 = [8 x i8] c"courier\00"
define i32 @css_get_font_family(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @strcasecmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %1
store i32 512, i32* %3
br label %41
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = call i32 @strcasecmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i8*, i8** %2
%18 = call i32 @strcasecmp(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8*, i8** %2
%22 = call i32 @strcasecmp(i8* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20, %16, %12
store i32 768, i32* %3
br label %40
25: ; preds = %20
%26 = load i8*, i8** %2
%27 = call i32 @strcasecmp(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i8*, i8** %2
%31 = call i32 @strcasecmp(i8* %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i8*, i8** %2
%35 = call i32 @strcasecmp(i8* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %33, %29, %25
store i32 256, i32* %3
br label %39
38: ; preds = %33
store i32 0, i32* %3
br label %39
39: ; preds = %38, %37
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40, %11
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [6 x i8] c"serif\00"
@.str.1 = [6 x i8] c"times\00"
@.str.2 = [5 x i8] c"sans\00"
@.str.3 = [6 x i8] c"arial\00"
@.str.4 = [10 x i8] c"helvetica\00"
@.str.5 = [6 x i8] c"fixed\00"
@.str.6 = [10 x i8] c"monospace\00"
@.str.7 = [8 x i8] c"courier\00"
define i32 @css_get_font_family(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %26, label %7
7: ; preds = %4
%8 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %26, label %10
10: ; preds = %7
%11 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %26, label %13
13: ; preds = %10
%14 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %13
%17 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 256, i32 0
br label %26
26: ; preds = %22, %16, %19, %7, %10, %13, %1, %4
%27 = phi i32 [ 512, %4 ], [ 512, %1 ], [ 768, %13 ], [ 768, %10 ], [ 768, %7 ], [ 256, %19 ], [ 256, %16 ], [ %25, %22 ]
ret i32 %27
}