#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 */
char *ext_pos(char const *);
int /*<<< orphan*/ strcasecmp(char const *, char *);
int is_plist_file(const char *name) {
  const char *ext = ext_pos(name);
  if (ext && (!strcasecmp(ext, "m3u") || !strcasecmp(ext, "pls")))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_plist_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ext_pos@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1182 <is_plist_file+0x62>
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1176 <is_plist_file+0x56>
mov    -0x18(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1182 <is_plist_file+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1189 <is_plist_file+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_plist_file>:
push   %rbp
push   %rbx
push   %rax
call   1040 <ext_pos@plt>
test   %rax,%rax
je     115b <is_plist_file+0x3b>
mov    %rax,%rbx
lea    0xec9(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     115d <is_plist_file+0x3d>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     115d <is_plist_file+0x3d>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"m3u\00"
@.str.1 = [4 x i8] c"pls\00"
define i32 @is_plist_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* @ext_pos(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = call i32 @strcasecmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = call i32 @strcasecmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13, %9
store i32 1, i32* %2
br label %19
18: ; preds = %13, %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"m3u\00"
@.str.1 = [4 x i8] c"pls\00"
define i32 @is_plist_file(i8* %0) {
%2 = tail call i8* @ext_pos(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %1
br label %11
11: ; preds = %4, %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ], [ 1, %4 ]
ret i32 %12
}