#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__ strcasecmp(char const *, char const *);
unsigned is_user_id(const char *name) {
  static const char *user_ids[] = {
      "username",     "MSN-usernmae", "POP3-user",
      "computername", "e-mail",       "AIM-Screen-Name",
      "hostname",     "passport",     0};
  unsigned i;
  for (i = 0; user_ids[i]; i++) {
    if (strcasecmp(name, user_ids[i]) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_user_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2f01(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     117c <is_user_id+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2ee6(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1169 <is_user_id+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_user_id+0x73>
jmp    116e <is_user_id+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_user_id+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_user_id>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c0 <is_user_id+0xb0>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@is_user_id.user_ids = internal global [9 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* null]
@.str = [9 x i8] c"username\00"
@.str.1 = [13 x i8] c"MSN-usernmae\00"
@.str.2 = [10 x i8] c"POP3-user\00"
@.str.3 = [13 x i8] c"computername\00"
@.str.4 = [7 x i8] c"e-mail\00"
@.str.5 = [16 x i8] c"AIM-Screen-Name\00"
@.str.6 = [9 x i8] c"hostname\00"
@.str.7 = [9 x i8] c"passport\00"
define i32 @is_user_id(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [9 x i8*], [9 x i8*]* @is_user_id.user_ids, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %24
11: ; preds = %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [9 x i8*], [9 x i8*]* @is_user_id.user_ids, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i64 @strcasecmp(i8* %12, i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 1, i32* %2
br label %25
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [9 x i8] c"username\00"
@.str.1 = [13 x i8] c"MSN-usernmae\00"
@.str.2 = [10 x i8] c"POP3-user\00"
@.str.3 = [13 x i8] c"computername\00"
@.str.4 = [7 x i8] c"e-mail\00"
@.str.5 = [16 x i8] c"AIM-Screen-Name\00"
@.str.6 = [9 x i8] c"hostname\00"
@.str.7 = [9 x i8] c"passport\00"
define i32 @is_user_id(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %26, label %7
7: ; preds = %4
%8 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %26, label %10
10: ; preds = %7
%11 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %26, label %13
13: ; preds = %10
%14 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %13
%17 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %22, %19, %16, %13, %10, %7, %4, %1
%27 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ %25, %22 ]
ret i32 %27
}