#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*/ deleteStr(char *);
char *lexLookaheadWord();
int /*<<< orphan*/ strcasecmp(char *, char *);
int match_begin_name(int end) {
  char *n = lexLookaheadWord();
  int token = 274;
  if (n) {
    if (!strcasecmp(n, "vcard"))
      token = end ? 267 : 266;
    else if (!strcasecmp(n, "vcalendar"))
      token = end ? 269 : 268;
    else if (!strcasecmp(n, "vevent"))
      token = end ? 271 : 270;
    else if (!strcasecmp(n, "vtodo"))
      token = end ? 273 : 272;
    deleteStr(n);
    return token;
  }
  return 0;
}


x86 assembly (clang, -O0):
<match_begin_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lexLookaheadWord@plt>
mov    %rax,-0x10(%rbp)
movl   $0x112,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1246 <match_begin_name+0x116>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%eax
jne    118c <match_begin_name+0x5c>
mov    -0x8(%rbp),%edx
mov    $0x10a,%eax
mov    $0x10b,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1232 <match_begin_name+0x102>
mov    -0x10(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11c0 <match_begin_name+0x90>
mov    -0x8(%rbp),%edx
mov    $0x10c,%eax
mov    $0x10d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    122d <match_begin_name+0xfd>
mov    -0x10(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11f4 <match_begin_name+0xc4>
mov    -0x8(%rbp),%edx
mov    $0x10e,%eax
mov    $0x10f,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1228 <match_begin_name+0xf8>
mov    -0x10(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1223 <match_begin_name+0xf3>
mov    -0x8(%rbp),%edx
mov    $0x110,%eax
mov    $0x111,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1228 <match_begin_name+0xf8>
jmp    122d <match_begin_name+0xfd>
jmp    1232 <match_begin_name+0x102>
mov    -0x10(%rbp),%rdi
call   1050 <deleteStr@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    124d <match_begin_name+0x11d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_begin_name>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <lexLookaheadWord@plt>
test   %rax,%rax
je     11d2 <match_begin_name+0xa2>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcasecmp@plt>
test   %eax,%eax
je     11a8 <match_begin_name+0x78>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %eax,%eax
je     11b3 <match_begin_name+0x83>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %eax,%eax
je     11be <match_begin_name+0x8e>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
mov    $0x112,%ebp
test   %eax,%eax
jne    11ca <match_begin_name+0x9a>
cmp    $0x1,%r14d
mov    $0x111,%ebp
jmp    11c7 <match_begin_name+0x97>
cmp    $0x1,%r14d
mov    $0x10b,%ebp
jmp    11c7 <match_begin_name+0x97>
cmp    $0x1,%r14d
mov    $0x10d,%ebp
jmp    11c7 <match_begin_name+0x97>
cmp    $0x1,%r14d
mov    $0x10f,%ebp
sbb    $0x0,%ebp
mov    %rbx,%rdi
call   1050 <deleteStr@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"vcard\00"
@.str.1 = [10 x i8] c"vcalendar\00"
@.str.2 = [7 x i8] c"vevent\00"
@.str.3 = [6 x i8] c"vtodo\00"
define i32 @match_begin_name(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
%6 = call i8* (...) @lexLookaheadWord()
store i8* %6, i8** %4
store i32 274, i32* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %52
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = call i32 @strcasecmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 267, i32 266
store i32 %17, i32* %5
br label %48
18: ; preds = %9
%19 = load i8*, i8** %4
%20 = call i32 @strcasecmp(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %18
%23 = load i32, i32* %3
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 269, i32 268
store i32 %26, i32* %5
br label %47
27: ; preds = %18
%28 = load i8*, i8** %4
%29 = call i32 @strcasecmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 271, i32 270
store i32 %35, i32* %5
br label %46
36: ; preds = %27
%37 = load i8*, i8** %4
%38 = call i32 @strcasecmp(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %45, label %40
40: ; preds = %36
%41 = load i32, i32* %3
%42 = icmp ne i32 %41, 0
%43 = zext i1 %42 to i64
%44 = select i1 %42, i32 273, i32 272
store i32 %44, i32* %5
br label %45
45: ; preds = %40, %36
br label %46
46: ; preds = %45, %31
br label %47
47: ; preds = %46, %22
br label %48
48: ; preds = %47, %13
%49 = load i8*, i8** %4
%50 = call i32 @deleteStr(i8* %49)
%51 = load i32, i32* %5
store i32 %51, i32* %2
br label %53
52: ; preds = %1
store i32 0, i32* %2
br label %53
53: ; preds = %52, %48
%54 = load i32, i32* %2
ret i32 %54
}

LLVM IR (-O2):
@.str = [6 x i8] c"vcard\00"
@.str.1 = [10 x i8] c"vcalendar\00"
@.str.2 = [7 x i8] c"vevent\00"
@.str.3 = [6 x i8] c"vtodo\00"
define i32 @match_begin_name(i32 %0) {
%2 = tail call i8* (...) @lexLookaheadWord()
%3 = icmp eq i8* %2, null
br i1 %3, label %31, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 266, i32 267
br label %28
10: ; preds = %4
%11 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = icmp eq i32 %0, 0
%15 = select i1 %14, i32 268, i32 269
br label %28
16: ; preds = %10
%17 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = icmp eq i32 %0, 0
%21 = select i1 %20, i32 270, i32 271
br label %28
22: ; preds = %16
%23 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = icmp eq i32 %0, 0
%27 = select i1 %26, i32 272, i32 273
br label %28
28: ; preds = %13, %22, %25, %19, %7
%29 = phi i32 [ 274, %22 ], [ %27, %25 ], [ %21, %19 ], [ %15, %13 ], [ %9, %7 ]
%30 = tail call i32 @deleteStr(i8* %2)
br label %31
31: ; preds = %1, %28
%32 = phi i32 [ %29, %28 ], [ 0, %1 ]
ret i32 %32
}