#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 */
struct mntent {
  char *mnt_type;
};

/* Variables and functions */
scalar_t__ strcmp(char *, char *);
bool valid_mntent(struct mntent *me) {
  char *ty = me->mnt_type;
  bool valid_mnt_type =
      !(strcmp(ty, "proc") && strcmp(ty, "tmpfs") && strcmp(ty, "sysfs"));
  return valid_mnt_type;
}


x86 assembly (clang, -O0):
<valid_mntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x15(%rbp)
je     1185 <valid_mntent+0x75>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x15(%rbp)
je     1185 <valid_mntent+0x75>
mov    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_mntent>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rbx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     115b <valid_mntent+0x4b>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     115b <valid_mntent+0x4b>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mntent = type { i8* }
@.str = [5 x i8] c"proc\00"
@.str.1 = [6 x i8] c"tmpfs\00"
@.str.2 = [6 x i8] c"sysfs\00"
define i32 @valid_mntent(%struct.mntent* %0) {
%2 = alloca %struct.mntent*
%3 = alloca i8*
%4 = alloca i32
store %struct.mntent* %0, %struct.mntent** %2
%5 = load %struct.mntent*, %struct.mntent** %2
%6 = getelementptr inbounds %struct.mntent, %struct.mntent* %5, i32 0, i32 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %15, %11, %1
%20 = phi i1 [ false, %11 ], [ false, %1 ], [ %18, %15 ]
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
store i32 %22, i32* %4
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.mntent = type { i8* }
@.str = [5 x i8] c"proc\00"
@.str.1 = [6 x i8] c"tmpfs\00"
@.str.2 = [6 x i8] c"sysfs\00"
define i32 @valid_mntent(%struct.mntent* nocapture %0) {
%2 = getelementptr inbounds %struct.mntent, %struct.mntent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %1
%14 = phi i32 [ 1, %6 ], [ 1, %1 ], [ %12, %9 ]
ret i32 %14
}