#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 *strchr(char const *, char);
int /*<<< orphan*/ strncmp(char *, char *, int);
int _is_passport_member(const char *email) {
  char *offset = strchr(email, '@');
  if (!offset)
    return 0;
  offset++;
  if (!strncmp(offset, "hotmail", 7) || !strncmp(offset, "msn", 3) ||
      !strncmp(offset, "live", 4))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<_is_passport_member>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <_is_passport_member+0x35>
movl   $0x0,-0x4(%rbp)
jmp    11ce <_is_passport_member+0xae>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     11bb <_is_passport_member+0x9b>
mov    -0x18(%rbp),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     11bb <_is_passport_member+0x9b>
mov    -0x18(%rbp),%rdi
lea    0xe64(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11c7 <_is_passport_member+0xa7>
movl   $0x1,-0x4(%rbp)
jmp    11ce <_is_passport_member+0xae>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_passport_member>:
push   %rbp
push   %rbx
push   %rax
mov    $0x40,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     118c <_is_passport_member+0x6c>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     118e <_is_passport_member+0x6e>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     118e <_is_passport_member+0x6e>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
jmp    118e <_is_passport_member+0x6e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"hotmail\00"
@.str.1 = [4 x i8] c"msn\00"
@.str.2 = [5 x i8] c"live\00"
define i32 @_is_passport_member(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = icmp eq i8* %2, null
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %4
%9 = tail call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = tail call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %11, %4, %8, %1
%16 = phi i32 [ 0, %1 ], [ 1, %8 ], [ 1, %4 ], [ %14, %11 ]
ret i32 %16
}