#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 */
scalar_t__ strchr(char *, char);
scalar_t__ strcmp(char const *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int matchList(const char *list, const char *word) {
  const char *wp;
  const char *ep;
  char ec;
  char listbuf[1024];
  strcpy(listbuf, list);
  wp = listbuf;
  for (ep = wp; ec = *ep; ep++) {
    if (strchr(", )#\t\r\n", ec)) {
      *(char *)ep = 0;
      if (strcmp(word, wp) == 0)
        return 1;
      wp = ep + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<matchList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x430(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
cmp    $0x0,%al
je     11dd <matchList+0xad>
lea    0xe82(%rip),%rdi
movsbl -0x29(%rbp),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11c7 <matchList+0x97>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bb <matchList+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    11e4 <matchList+0xb4>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11cc <matchList+0x9c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1166 <matchList+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchList>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r12
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    (%rsp),%al
xor    %r14d,%r14d
test   %al,%al
je     11a9 <matchList+0x79>
lea    0x1(%rsp),%rbp
lea    0xe9a(%rip),%r15
jmp    117c <matchList+0x4c>
nopl   0x0(%rax,%rax,1)
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
je     11a9 <matchList+0x79>
movsbl %al,%esi
mov    %r15,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
je     1170 <matchList+0x40>
movb   $0x0,-0x1(%rbp)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
mov    %rbp,%rbx
test   %rax,%rax
jne    1170 <matchList+0x40>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c", )#\09\0D\0A\00"
define i32 @matchList(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8* %13, i8** %6
%14 = load i8*, i8** %6
store i8* %14, i8** %7
br label %15
15: ; preds = %34, %2
%16 = load i8*, i8** %7
%17 = load i8, i8* %16
store i8 %17, i8* %8
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i8, i8* %8
%21 = call i64 @strchr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load i8*, i8** %7
store i8 0, i8* %24
%25 = load i8*, i8** %5
%26 = load i8*, i8** %6
%27 = call i64 @strcmp(i8* %25, i8* %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 1, i32* %3
br label %38
30: ; preds = %23
%31 = load i8*, i8** %7
%32 = getelementptr inbounds i8, i8* %31, i64 1
store i8* %32, i8** %6
br label %33
33: ; preds = %30, %19
br label %34
34: ; preds = %33
%35 = load i8*, i8** %7
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %7
br label %15
37: ; preds = %15
store i32 0, i32* %3
br label %38
38: ; preds = %37, %29
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [8 x i8] c", )#\09\0D\0A\00"
define i32 @matchList(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %24, label %8
8: ; preds = %2, %19
%9 = phi i8 [ %22, %19 ], [ %6, %2 ]
%10 = phi i8* [ %21, %19 ], [ %4, %2 ]
%11 = phi i8* [ %20, %19 ], [ %4, %2 ]
%12 = call i64 @strchr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%13 = icmp eq i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %8
store i8 0, i8* %10
%15 = call i64 @strcmp(i8* %1, i8* %11)
%16 = icmp eq i64 %15, 0
br i1 %16, label %24, label %17
17: ; preds = %14
%18 = getelementptr inbounds i8, i8* %10, i64 1
br label %19
19: ; preds = %8, %17
%20 = phi i8* [ %18, %17 ], [ %11, %8 ]
%21 = getelementptr inbounds i8, i8* %10, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %8
24: ; preds = %14, %19, %2
%25 = phi i32 [ 0, %2 ], [ 0, %19 ], [ 1, %14 ]
ret i32 %25
}