#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 check_equality(char *, char *);
int is_match(char *speech, char *buf) {
  char *ptr;
  char *speechPtr;
  ptr = buf;
  if (*ptr == '\n' || *ptr == '\0' || *ptr == '\r')
    return 0;
  if (*ptr == '#')
    return 0;
  speechPtr = speech;
  return check_equality(speechPtr, ptr);
}


x86 assembly (clang, -O0):
<is_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1158 <is_match+0x48>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <is_match+0x48>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1164 <is_match+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1198 <is_match+0x88>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1180 <is_match+0x70>
movl   $0x0,-0x4(%rbp)
jmp    1198 <is_match+0x88>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <check_equality@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_match>:
movzbl (%rsi),%eax
cmp    $0x23,%rax
ja     112c <is_match+0x1c>
movabs $0x800002401,%rcx
bt     %rax,%rcx
jae    112c <is_match+0x1c>
xor    %eax,%eax
ret
jmp    1030 <check_equality@plt>

LLVM IR (-O0):
define i32 @is_match(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %23, label %13
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 13
br i1 %22, label %23, label %24
23: ; preds = %18, %13, %2
store i32 0, i32* %3
br label %35
24: ; preds = %18
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 35
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 0, i32* %3
br label %35
30: ; preds = %24
%31 = load i8*, i8** %4
store i8* %31, i8** %7
%32 = load i8*, i8** %7
%33 = load i8*, i8** %6
%34 = call i32 @check_equality(i8* %32, i8* %33)
store i32 %34, i32* %3
br label %35
35: ; preds = %30, %29, %23
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @is_match(i8* %0, i8* %1) {
%3 = load i8, i8* %1
switch i8 %3, label %4 [
i8 10, label %6
i8 0, label %6
i8 13, label %6
i8 35, label %6
]
4: ; preds = %2
%5 = tail call i32 @check_equality(i8* %0, i8* %1)
br label %6
6: ; preds = %2, %2, %2, %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ], [ 0, %2 ], [ 0, %2 ], [ 0, %2 ]
ret i32 %7
}