#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__ memcmp(unsigned char const *, char *, int);
int strlen(char *);
int is_special_file(const unsigned char *name) {
  int splen = strlen("<special>");
  return name[0] == '\0' && memcmp(name + 1, "<special>", splen) == 0 &&
         name[splen + 1] == '\0';
}


x86 assembly (clang, -O0):
<is_special_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1193 <is_special_file+0x73>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
jne    1193 <is_special_file+0x73>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_special_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmpb   $0x0,(%rbx)
jne    1162 <is_special_file+0x42>
mov    %eax,%r14d
lea    0x1(%rbx),%rdi
lea    0xeb8(%rip),%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    1162 <is_special_file+0x42>
movslq %r14d,%rax
xor    %ebp,%ebp
cmpb   $0x0,0x1(%rax,%rbx,1)
sete   %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"<special>\00"
define i32 @is_special_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i32, i32* %3
%14 = call i64 @memcmp(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %10
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br label %25
25: ; preds = %16, %10, %1
%26 = phi i1 [ false, %10 ], [ false, %1 ], [ %24, %16 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
@.str = [10 x i8] c"<special>\00"
define i32 @is_special_file(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i64 @memcmp(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = add nsw i32 %2, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %5, %1
%17 = phi i32 [ 0, %5 ], [ 0, %1 ], [ %15, %9 ]
ret i32 %17
}