#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 parse_theme_colordef(int const, int const);
int parse_theme_element(int const, char *, int const);
int /*<<< orphan*/ strcasecmp(char *, char *);
char *strtok(char *, char *);
int parse_theme_line(const int line_num, char *line,
                     const int errors_are_fatal) {
  char *name;
  if (line[0] == '#' || !(name = strtok(line, " \t"))) {
    return 1;
  }
  if (!strcasecmp(name, "colordef"))
    return parse_theme_colordef(line_num, errors_are_fatal);
  return parse_theme_element(line_num, name, errors_are_fatal);
}


x86 assembly (clang, -O0):
<parse_theme_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1180 <parse_theme_line+0x40>
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    118c <parse_theme_line+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    11ca <parse_theme_line+0x8a>
mov    -0x20(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11b8 <parse_theme_line+0x78>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <parse_theme_colordef@plt>
mov    %eax,-0x4(%rbp)
jmp    11ca <parse_theme_line+0x8a>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <parse_theme_element@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_theme_line>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x23,(%rsi)
je     118c <parse_theme_line+0x4c>
mov    %edx,%r14d
mov    %edi,%ebp
lea    0xeab(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     118c <parse_theme_line+0x4c>
mov    %rax,%rbx
lea    0xe94(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcasecmp@plt>
mov    %ebp,%edi
test   %eax,%eax
je     1196 <parse_theme_line+0x56>
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <parse_theme_element@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <parse_theme_colordef@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
@.str.1 = [9 x i8] c"colordef\00"
define i32 @parse_theme_line(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 35
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i8* @strtok(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %16, i8** %8
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %14, %3
store i32 1, i32* %4
br label %32
19: ; preds = %14
%20 = load i8*, i8** %8
%21 = call i32 @strcasecmp(i8* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = call i32 @parse_theme_colordef(i32 %24, i32 %25)
store i32 %26, i32* %4
br label %32
27: ; preds = %19
%28 = load i32, i32* %5
%29 = load i8*, i8** %8
%30 = load i32, i32* %7
%31 = call i32 @parse_theme_element(i32 %28, i8* %29, i32 %30)
store i32 %31, i32* %4
br label %32
32: ; preds = %27, %23, %18
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [9 x i8] c"colordef\00"
define i32 @parse_theme_line(i32 %0, i8* %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 35
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = tail call i8* @strtok(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = tail call i32 @strcasecmp(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @parse_theme_colordef(i32 %0, i32 %2)
br label %16
14: ; preds = %9
%15 = tail call i32 @parse_theme_element(i32 %0, i8* %7, i32 %2)
br label %16
16: ; preds = %3, %6, %14, %12
%17 = phi i32 [ %15, %14 ], [ %13, %12 ], [ 1, %6 ], [ 1, %3 ]
ret i32 %17
}