#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 */
typedef int /*<<< orphan*/ noisew;

/* Variables and functions */
int strcmp(char const *, char const *);
int noiseword(const char *word) {
  const char *noisew[] = {"the", "and",  "a",   "to",   "of",  "in",   "i",
                          "is",  "that", "it",  "on",   "you", "this", "for",
                          "but", "with", "are", "have", "be",  "at",   "or",
                          "as",  "was",  "so",  "if",   "out", "not"};
  int end = sizeof(noisew) / sizeof(noisew[0]) - 1;
  int begin = 0;
  int mid;
  int cond = 0;
  while (begin <= end) {
    mid = (begin + end) / 2;
    if ((cond = strcmp(word, noisew[mid])) == 0)
      return 1;
    else if (cond < 0)
      end = mid - 1;
    else
      begin = mid + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<noiseword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0x2c03(%rip),%rsi
mov    $0xd8,%edx
call   1040 <memcpy@plt>
movl   $0x1a,-0xf4(%rbp)
movl   $0x0,-0xf8(%rbp)
movl   $0x0,-0x100(%rbp)
mov    -0xf8(%rbp),%eax
cmp    -0xf4(%rbp),%eax
jg     11fe <noiseword+0xde>
mov    -0xf8(%rbp),%eax
add    -0xf4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xfc(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0xfc(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rsi
ff
call   1030 <strcmp@plt>
mov    %eax,-0x100(%rbp)
cmp    $0x0,%eax
jne    11c4 <noiseword+0xa4>
movl   $0x1,-0x4(%rbp)
jmp    1205 <noiseword+0xe5>
cmpl   $0x0,-0x100(%rbp)
jge    11e5 <noiseword+0xc5>
mov    -0xfc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    11f4 <noiseword+0xd4>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    11f9 <noiseword+0xd9>
jmp    1165 <noiseword+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noiseword>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
mov    $0x1a,%r12d
xor    %ebx,%ebx
lea    0xf2a(%rip),%r15
jmp    113a <noiseword+0x2a>
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r12d,%ebx
jg     116a <noiseword+0x5a>
lea    (%rbx,%r12,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
movslq (%r15,%rax,4),%rsi
add    %r15,%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     116e <noiseword+0x5e>
jns    1130 <noiseword+0x20>
add    $0xffffffff,%ebp
mov    %ebp,%r12d
cmp    %r12d,%ebx
jle    113a <noiseword+0x2a>
xor    %eax,%eax
jmp    1173 <noiseword+0x63>
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"the\00"
@.str.1 = [4 x i8] c"and\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [3 x i8] c"to\00"
@.str.4 = [3 x i8] c"of\00"
@.str.5 = [3 x i8] c"in\00"
@.str.6 = [2 x i8] c"i\00"
@.str.7 = [3 x i8] c"is\00"
@.str.8 = [5 x i8] c"that\00"
@.str.9 = [3 x i8] c"it\00"
@.str.10 = [3 x i8] c"on\00"
@.str.11 = [4 x i8] c"you\00"
@.str.12 = [5 x i8] c"this\00"
@.str.13 = [4 x i8] c"for\00"
@.str.14 = [4 x i8] c"but\00"
@.str.15 = [5 x i8] c"with\00"
@.str.16 = [4 x i8] c"are\00"
@.str.17 = [5 x i8] c"have\00"
@.str.18 = [3 x i8] c"be\00"
@.str.19 = [3 x i8] c"at\00"
@.str.20 = [3 x i8] c"or\00"
@.str.21 = [3 x i8] c"as\00"
@.str.22 = [4 x i8] c"was\00"
@.str.23 = [3 x i8] c"so\00"
@.str.24 = [3 x i8] c"if\00"
@.str.25 = [4 x i8] c"out\00"
@.str.26 = [4 x i8] c"not\00"
@__const.noiseword.noisew = [27 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0)]
define i32 @noiseword(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [27 x i8*]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
%9 = bitcast [27 x i8*]* %4 to i8*
store i32 26, i32* %5
store i32 0, i32* %6
store i32 0, i32* %8
br label %10
10: ; preds = %37, %1
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %10
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
%18 = sdiv i32 %17, 2
store i32 %18, i32* %7
%19 = load i8*, i8** %3
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [27 x i8*], [27 x i8*]* %4, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %19, i8* %23)
store i32 %24, i32* %8
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %14
store i32 1, i32* %2
br label %39
27: ; preds = %14
%28 = load i32, i32* %8
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %5
br label %36
33: ; preds = %27
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36
br label %10
38: ; preds = %10
store i32 0, i32* %2
br label %39
39: ; preds = %38, %26
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
@.str = [4 x i8] c"the\00"
@.str.1 = [4 x i8] c"and\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [3 x i8] c"to\00"
@.str.4 = [3 x i8] c"of\00"
@.str.5 = [3 x i8] c"in\00"
@.str.6 = [2 x i8] c"i\00"
@.str.7 = [3 x i8] c"is\00"
@.str.8 = [5 x i8] c"that\00"
@.str.9 = [3 x i8] c"it\00"
@.str.10 = [3 x i8] c"on\00"
@.str.11 = [4 x i8] c"you\00"
@.str.12 = [5 x i8] c"this\00"
@.str.13 = [4 x i8] c"for\00"
@.str.14 = [4 x i8] c"but\00"
@.str.15 = [5 x i8] c"with\00"
@.str.16 = [4 x i8] c"are\00"
@.str.17 = [5 x i8] c"have\00"
@.str.18 = [3 x i8] c"be\00"
@.str.19 = [3 x i8] c"at\00"
@.str.20 = [3 x i8] c"or\00"
@.str.21 = [3 x i8] c"as\00"
@.str.22 = [4 x i8] c"was\00"
@.str.23 = [3 x i8] c"so\00"
@.str.24 = [3 x i8] c"if\00"
@.str.25 = [4 x i8] c"out\00"
@.str.26 = [4 x i8] c"not\00"
@reltable.noiseword = [27 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.6 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.8 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.10 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.13 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.14 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.15 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.16 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.17 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.18 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.19 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.20 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.21 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.22 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.23 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.24 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.25 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.26 to i64), i64 ptrtoint ([27 x i32]* @reltable.noiseword to i64)) to i32)]
define i32 @noiseword(i8* nocapture %0) {
br label %2
2: ; preds = %1, %12
%3 = phi i32 [ 0, %1 ], [ %17, %12 ]
%4 = phi i32 [ 26, %1 ], [ %16, %12 ]
%5 = add nsw i32 %3, %4
%6 = sdiv i32 %5, 2
%7 = sext i32 %6 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([27 x i32]* @reltable.noiseword to i8*), i64 %8)
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %2
%13 = icmp slt i32 %10, 0
%14 = add nsw i32 %6, -1
%15 = add nsw i32 %6, 1
%16 = select i1 %13, i32 %14, i32 %4
%17 = select i1 %13, i32 %3, i32 %15
%18 = icmp sgt i32 %17, %16
br i1 %18, label %19, label %2
19: ; preds = %12, %2
%20 = phi i32 [ 1, %2 ], [ 0, %12 ]
ret i32 %20
}