#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__ strcmp(char *, char *);
bool hasExt(char *ext) {
  return ext && (strcmp(ext, ".b") == 0 || strcmp(ext, ".bf") == 0 ||
                 strcmp(ext, ".br") == 0 || strcmp(ext, ".wit") == 0 ||
                 strcmp(ext, ".brain") == 0);
}


x86 assembly (clang, -O0):
<hasExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11d4 <hasExt+0xc4>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     11ce <hasExt+0xbe>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     11ce <hasExt+0xbe>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     11ce <hasExt+0xbe>
mov    -0x8(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     11ce <hasExt+0xbe>
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasExt>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1187 <hasExt+0x77>
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     1189 <hasExt+0x79>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1189 <hasExt+0x79>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1189 <hasExt+0x79>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1189 <hasExt+0x79>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
jmp    1189 <hasExt+0x79>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c".b\00"
@.str.1 = [4 x i8] c".bf\00"
@.str.2 = [4 x i8] c".br\00"
@.str.3 = [5 x i8] c".wit\00"
@.str.4 = [7 x i8] c".brain\00"
define i32 @hasExt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %27
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %25, label %13
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %25, label %17
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8*, i8** %2
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br label %25
25: ; preds = %21, %17, %13, %9, %5
%26 = phi i1 [ true, %17 ], [ true, %13 ], [ true, %9 ], [ true, %5 ], [ %24, %21 ]
br label %27
27: ; preds = %25, %1
%28 = phi i1 [ false, %1 ], [ %26, %25 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
@.str = [3 x i8] c".b\00"
@.str.1 = [4 x i8] c".bf\00"
@.str.2 = [4 x i8] c".br\00"
@.str.3 = [5 x i8] c".wit\00"
@.str.4 = [7 x i8] c".brain\00"
define i32 @hasExt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %6
%10 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %3, %6, %9, %12, %15, %1
%20 = phi i32 [ 0, %1 ], [ 1, %12 ], [ 1, %9 ], [ 1, %6 ], [ 1, %3 ], [ %18, %15 ]
ret i32 %20
}