#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 /*<<< orphan*/ strcmp(char const *, char const *);
int /*<<< orphan*/ strncmp(char const *, char *, int);
int is_alsa_item(const char *word) {
  static const char *known_items[] = {"AC97_BUS", NULL};
  const char **p;
  if (!strncmp(word, "SND_", 4))
    return 1;
  for (p = known_items; *p; p++)
    if (!strcmp(word, *p))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_alsa_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1156 <is_alsa_item+0x36>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <is_alsa_item+0x91>
lea    0x2ee3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     11aa <is_alsa_item+0x8a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1194 <is_alsa_item+0x74>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <is_alsa_item+0x91>
jmp    1199 <is_alsa_item+0x79>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1161 <is_alsa_item+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alsa_item>:
push   %rbx
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1153 <is_alsa_item+0x33>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@is_alsa_item.known_items = internal global [2 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* null]
@.str = [9 x i8] c"AC97_BUS\00"
@.str.1 = [5 x i8] c"SND_\00"
define i32 @is_alsa_item(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %26
9: ; preds = %1
store i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @is_alsa_item.known_items, i64 0, i64 0), i8*** %4
br label %10
10: ; preds = %22, %9
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = call i32 @strcmp(i8* %15, i8* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %14
store i32 1, i32* %2
br label %26
21: ; preds = %14
br label %22
22: ; preds = %21
%23 = load i8**, i8*** %4
%24 = getelementptr inbounds i8*, i8** %23, i32 1
store i8** %24, i8*** %4
br label %10
25: ; preds = %10
store i32 0, i32* %2
br label %26
26: ; preds = %25, %20, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [9 x i8] c"AC97_BUS\00"
@.str.1 = [5 x i8] c"SND_\00"
define i32 @is_alsa_item(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}