#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__ does_extension_match(char const *, char *);
char *strrchr(char const *, char);
int is_au_snd_file(const char *filename) {
  const char *cptr;
  if (!(cptr = strrchr(filename, '.')))
    return 0;
  cptr++;
  if (does_extension_match(cptr, "au"))
    return 1;
  if (does_extension_match(cptr, "snd"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_au_snd_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1154 <is_au_snd_file+0x34>
movl   $0x0,-0x4(%rbp)
jmp    11b3 <is_au_snd_file+0x93>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <does_extension_match@plt>
cmp    $0x0,%rax
je     1186 <is_au_snd_file+0x66>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <is_au_snd_file+0x93>
mov    -0x18(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1040 <does_extension_match@plt>
cmp    $0x0,%rax
je     11ac <is_au_snd_file+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <is_au_snd_file+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_au_snd_file>:
push   %rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1155 <is_au_snd_file+0x35>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <does_extension_match@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1159 <is_au_snd_file+0x39>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <does_extension_match@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"au\00"
@.str.1 = [4 x i8] c"snd\00"
define i32 @is_au_snd_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %22
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i64 @does_extension_match(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %22
16: ; preds = %9
%17 = load i8*, i8** %4
%18 = call i64 @does_extension_match(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %15, %8
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"au\00"
@.str.1 = [4 x i8] c"snd\00"
define i32 @is_au_snd_file(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i64 @does_extension_match(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @does_extension_match(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %4, %1
%13 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %8 ]
ret i32 %13
}