#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*/ scanf(char *, char *);
int readinput(char *c) {
  scanf("%s", c);
  if (c[0] == 'n' && c[1] == 'e') {
    return 0;
  } else if (c[0] == 'o' && c[1] == 'x' && c[2] == 'i') {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<readinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    1159 <readinput+0x49>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x65,%eax
jne    1159 <readinput+0x49>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <readinput+0x93>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6f,%eax
jne    1197 <readinput+0x87>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    1197 <readinput+0x87>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x69,%eax
jne    1197 <readinput+0x87>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <readinput+0x93>
jmp    119c <readinput+0x8c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readinput>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    (%rbx),%al
cmp    $0x6f,%al
je     1137 <readinput+0x27>
cmp    $0x6e,%al
jne    1148 <readinput+0x38>
xor    %eax,%eax
cmpb   $0x65,0x1(%rbx)
jne    1148 <readinput+0x38>
pop    %rbx
ret
cmpb   $0x78,0x1(%rbx)
jne    1148 <readinput+0x38>
mov    $0x1,%eax
cmpb   $0x69,0x2(%rbx)
je     1135 <readinput+0x25>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @readinput(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 110
br i1 %10, label %11, label %18
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 101
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 0, i32* %2
br label %39
18: ; preds = %11, %1
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 111
br i1 %23, label %24, label %37
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 120
br i1 %29, label %30, label %37
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 105
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 1, i32* %2
br label %39
37: ; preds = %30, %24, %18
br label %38
38: ; preds = %37
store i32 -1, i32* %2
br label %39
39: ; preds = %38, %36, %17
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @readinput(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i8, i8* %0
switch i8 %3, label %16 [
i8 110, label %4
i8 111, label %8
]
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 101
br i1 %7, label %17, label %16
8: ; preds = %1
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 120
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 105
br i1 %15, label %17, label %16
16: ; preds = %1, %4, %8, %12
br label %17
17: ; preds = %12, %4, %16
%18 = phi i32 [ -1, %16 ], [ 0, %4 ], [ 1, %12 ]
ret i32 %18
}