#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 strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int matches(char *start, char *pos, char *end) {
  if (start == NULL)
    return matches("\t", pos, end) || matches("    ", pos, end);
  return (pos + strlen(start) < end && strncmp(pos, start, strlen(start)) == 0);
}


x86 assembly (clang, -O0):
<matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a0 <matches+0x70>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xea2(%rip),%rdi
call   1040 <matches@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    1190 <matches+0x60>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe80(%rip),%rdi
call   1040 <matches@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1206 <matches+0xd6>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x30(%rbp),%rcx
cltq
add    %rax,%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x22(%rbp)
jae    11fb <matches+0xcb>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
test   %rdi,%rdi
je     1135 <matches+0x15>
mov    %rdi,%rbx
jmp    1173 <matches+0x53>
lea    0xec4(%rip),%rdi
call   1040 <strlen@plt>
cltq
add    %r15,%rax
cmp    %r14,%rax
jae    116c <matches+0x4c>
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11ae <matches+0x8e>
lea    0xe8f(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
movslq %eax,%rcx
add    %r15,%rcx
xor    %eax,%eax
cmp    %r14,%rcx
jae    11a8 <matches+0x88>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%eax
jmp    11a8 <matches+0x88>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [5 x i8] c" \00"
define i32 @matches(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %23
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = call i32 @matches(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %10
%16 = load i8*, i8** %6
%17 = load i8*, i8** %7
%18 = call i32 @matches(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* %17)
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %15, %10
%21 = phi i1 [ true, %10 ], [ %19, %15 ]
%22 = zext i1 %21 to i32
store i32 %22, i32* %4
br label %41
23: ; preds = %3
%24 = load i8*, i8** %6
%25 = load i8*, i8** %5
%26 = call i32 @strlen(i8* %25)
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8*, i8** %7
%30 = icmp ult i8* %28, %29
br i1 %30, label %31, label %38
31: ; preds = %23
%32 = load i8*, i8** %6
%33 = load i8*, i8** %5
%34 = load i8*, i8** %5
%35 = call i32 @strlen(i8* %34)
%36 = call i64 @strncmp(i8* %32, i8* %33, i32 %35)
%37 = icmp eq i64 %36, 0
br label %38
38: ; preds = %31, %23
%39 = phi i1 [ false, %23 ], [ %37, %31 ]
%40 = zext i1 %39 to i32
store i32 %40, i32* %4
br label %41
41: ; preds = %38, %20
%42 = load i32, i32* %4
ret i32 %42
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@.str.1 = [5 x i8] c" \00"
define i32 @matches(i8* %0, i8* %1, i8* readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = icmp ult i8* %8, %2
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %30, label %14
14: ; preds = %5, %10
%15 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %1, i64 %16
%18 = icmp ult i8* %17, %2
br i1 %18, label %24, label %30
19: ; preds = %3
%20 = tail call i32 @strlen(i8* %0)
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %1, i64 %21
%23 = icmp ult i8* %22, %2
br i1 %23, label %24, label %30
24: ; preds = %19, %14
%25 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %14 ], [ %0, %19 ]
%26 = tail call i32 @strlen(i8* %25)
%27 = tail call i64 @strncmp(i8* %1, i8* %25, i32 %26)
%28 = icmp eq i64 %27, 0
%29 = zext i1 %28 to i32
br label %30
30: ; preds = %24, %14, %19, %10
%31 = phi i32 [ 1, %10 ], [ 0, %19 ], [ 0, %14 ], [ %29, %24 ]
ret i32 %31
}