#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*/ strcmp(char const *, char const *);
const char *lookup_fabricated_answer(const char *token) {
  static const char *answers[] = {
      "no",        "Tell me more about the detail.",
      "yes",       "Tell me more about the detail.",
      "fuck",      "Don't be so rude again!",
      "shit",      "Don't be so rude again!",
      "you",       "Let's not talk about me.",
      "think",     "Why do you think that?",
      "hate",      "So you hate something -- tell me more.",
      "what",      "Why do you ask?",
      "want",      "Why do you want that?",
      "need",      "We all need many things -- is this special?",
      "why",       "Remember, therapy is good for you.",
      "know",      "How do you know that?",
      "murder",    "I don't like killing.",
      "kill",      "It is wrong to kill.",
      "jerk",      "Don't ever call me a jerk!",
      "can't",     "Don't be negative -- be positive.",
      "failure",   "Strive for success.",
      "never",     "Don't be negative -- be positive.",
      "unhappy",   "Why are you unhappy?",
      "beautiful", "I'm sure you like her, don't you?",
      "like",      "Why do you like that?",
      "love",      "Remember, love everything what you love.",
      NULL};
  int index = 0;
  while (answers[index]) {
    if (!strcmp(answers[index], token))
      return answers[index + 1];
    index += 2;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<lookup_fabricated_answer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2f02(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1185 <lookup_fabricated_answer+0x75>
movslq -0x14(%rbp),%rcx
lea    0x2eec(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1177 <lookup_fabricated_answer+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2ec6(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    118d <lookup_fabricated_answer+0x7d>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <lookup_fabricated_answer+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_fabricated_answer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
mov    $0x1,%ebx
lea    0x2b89(%rip),%r12
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    -0x8(%r12,%rbx,8),%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114d <lookup_fabricated_answer+0x3d>
add    $0x2,%rbx
cmp    $0x2d,%rbx
jne    1130 <lookup_fabricated_answer+0x20>
jmp    1151 <lookup_fabricated_answer+0x41>
mov    (%r12,%rbx,8),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@lookup_fabricated_answer.answers = internal global [45 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 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 ([16 x i8], [16 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.40, i32 0, i32 0), i8* null]
@.str = [3 x i8] c"no\00"
@.str.1 = [31 x i8] c"Tell me more about the detail.\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [5 x i8] c"fuck\00"
@.str.4 = [24 x i8] c"Don't be so rude again!\00"
@.str.5 = [5 x i8] c"shit\00"
@.str.6 = [4 x i8] c"you\00"
@.str.7 = [25 x i8] c"Let's not talk about me.\00"
@.str.8 = [6 x i8] c"think\00"
@.str.9 = [23 x i8] c"Why do you think that?\00"
@.str.10 = [5 x i8] c"hate\00"
@.str.11 = [39 x i8] c"So you hate something -- tell me more.\00"
@.str.12 = [5 x i8] c"what\00"
@.str.13 = [16 x i8] c"Why do you ask?\00"
@.str.14 = [5 x i8] c"want\00"
@.str.15 = [22 x i8] c"Why do you want that?\00"
@.str.16 = [5 x i8] c"need\00"
@.str.17 = [44 x i8] c"We all need many things -- is this special?\00"
@.str.18 = [4 x i8] c"why\00"
@.str.19 = [35 x i8] c"Remember, therapy is good for you.\00"
@.str.20 = [5 x i8] c"know\00"
@.str.21 = [22 x i8] c"How do you know that?\00"
@.str.22 = [7 x i8] c"murder\00"
@.str.23 = [22 x i8] c"I don't like killing.\00"
@.str.24 = [5 x i8] c"kill\00"
@.str.25 = [21 x i8] c"It is wrong to kill.\00"
@.str.26 = [5 x i8] c"jerk\00"
@.str.27 = [27 x i8] c"Don't ever call me a jerk!\00"
@.str.28 = [6 x i8] c"can't\00"
@.str.29 = [34 x i8] c"Don't be negative -- be positive.\00"
@.str.30 = [8 x i8] c"failure\00"
@.str.31 = [20 x i8] c"Strive for success.\00"
@.str.32 = [6 x i8] c"never\00"
@.str.33 = [8 x i8] c"unhappy\00"
@.str.34 = [21 x i8] c"Why are you unhappy?\00"
@.str.35 = [10 x i8] c"beautiful\00"
@.str.36 = [34 x i8] c"I'm sure you like her, don't you?\00"
@.str.37 = [5 x i8] c"like\00"
@.str.38 = [22 x i8] c"Why do you like that?\00"
@.str.39 = [5 x i8] c"love\00"
@.str.40 = [41 x i8] c"Remember, love everything what you love.\00"
define i8* @lookup_fabricated_answer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [45 x i8*], [45 x i8*]* @lookup_fabricated_answer.answers, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %28
11: ; preds = %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [45 x i8*], [45 x i8*]* @lookup_fabricated_answer.answers, i64 0, i64 %13
%15 = load i8*, i8** %14
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %15, i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %11
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [45 x i8*], [45 x i8*]* @lookup_fabricated_answer.answers, i64 0, i64 %22
%24 = load i8*, i8** %23
store i8* %24, i8** %2
br label %29
25: ; preds = %11
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 2
store i32 %27, i32* %4
br label %5
28: ; preds = %5
store i8* null, i8** %2
br label %29
29: ; preds = %28, %19
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
@lookup_fabricated_answer.answers = internal unnamed_addr constant [45 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 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 ([16 x i8], [16 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.40, i32 0, i32 0), i8* null]
@.str = [3 x i8] c"no\00"
@.str.1 = [31 x i8] c"Tell me more about the detail.\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [5 x i8] c"fuck\00"
@.str.4 = [24 x i8] c"Don't be so rude again!\00"
@.str.5 = [5 x i8] c"shit\00"
@.str.6 = [4 x i8] c"you\00"
@.str.7 = [25 x i8] c"Let's not talk about me.\00"
@.str.8 = [6 x i8] c"think\00"
@.str.9 = [23 x i8] c"Why do you think that?\00"
@.str.10 = [5 x i8] c"hate\00"
@.str.11 = [39 x i8] c"So you hate something -- tell me more.\00"
@.str.12 = [5 x i8] c"what\00"
@.str.13 = [16 x i8] c"Why do you ask?\00"
@.str.14 = [5 x i8] c"want\00"
@.str.15 = [22 x i8] c"Why do you want that?\00"
@.str.16 = [5 x i8] c"need\00"
@.str.17 = [44 x i8] c"We all need many things -- is this special?\00"
@.str.18 = [4 x i8] c"why\00"
@.str.19 = [35 x i8] c"Remember, therapy is good for you.\00"
@.str.20 = [5 x i8] c"know\00"
@.str.21 = [22 x i8] c"How do you know that?\00"
@.str.22 = [7 x i8] c"murder\00"
@.str.23 = [22 x i8] c"I don't like killing.\00"
@.str.24 = [5 x i8] c"kill\00"
@.str.25 = [21 x i8] c"It is wrong to kill.\00"
@.str.26 = [5 x i8] c"jerk\00"
@.str.27 = [27 x i8] c"Don't ever call me a jerk!\00"
@.str.28 = [6 x i8] c"can't\00"
@.str.29 = [34 x i8] c"Don't be negative -- be positive.\00"
@.str.30 = [8 x i8] c"failure\00"
@.str.31 = [20 x i8] c"Strive for success.\00"
@.str.32 = [6 x i8] c"never\00"
@.str.33 = [8 x i8] c"unhappy\00"
@.str.34 = [21 x i8] c"Why are you unhappy?\00"
@.str.35 = [10 x i8] c"beautiful\00"
@.str.36 = [34 x i8] c"I'm sure you like her, don't you?\00"
@.str.37 = [5 x i8] c"like\00"
@.str.38 = [22 x i8] c"Why do you like that?\00"
@.str.39 = [5 x i8] c"love\00"
@.str.40 = [41 x i8] c"Remember, love everything what you love.\00"
define i8* @lookup_fabricated_answer(i8* nocapture %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i64 [ 0, %1 ], [ %14, %13 ]
%4 = getelementptr inbounds [45 x i8*], [45 x i8*]* @lookup_fabricated_answer.answers, i64 0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = and i64 %3, 4294967294
%10 = or i64 %9, 1
%11 = getelementptr inbounds [45 x i8*], [45 x i8*]* @lookup_fabricated_answer.answers, i64 0, i64 %10
%12 = load i8*, i8** %11
br label %16
13: ; preds = %2
%14 = add nuw nsw i64 %3, 2
%15 = icmp eq i64 %14, 44
br i1 %15, label %16, label %2
16: ; preds = %13, %8
%17 = phi i8* [ %12, %8 ], [ null, %13 ]
ret i8* %17
}