#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*/ executeGo(char *);
int /*<<< orphan*/ executeLook(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
bool parseAndExecute(char *input) {
  char *verb = strtok(input, " \n");
  char *noun = strtok(NULL, " \n");
  if (verb != NULL) {
    if (strcmp(verb, "quit") == 0) {
      return false;
    } else if (strcmp(verb, "look") == 0) {
      executeLook(noun);
    } else if (strcmp(verb, "go") == 0) {
      executeGo(noun);
    } else {
      printf("I don't know how to '%s'.\n", verb);
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<parseAndExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe85(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1224 <parseAndExecute+0xd4>
mov    -0x18(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11b5 <parseAndExecute+0x65>
movl   $0x0,-0x4(%rbp)
jmp    122b <parseAndExecute+0xdb>
mov    -0x18(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11dd <parseAndExecute+0x8d>
mov    -0x20(%rbp),%rdi
call   1030 <executeLook@plt>
jmp    121a <parseAndExecute+0xca>
mov    -0x18(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <parseAndExecute+0xb5>
mov    -0x20(%rbp),%rdi
call   1050 <executeGo@plt>
jmp    1215 <parseAndExecute+0xc5>
mov    -0x18(%rbp),%rsi
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
jmp    121a <parseAndExecute+0xca>
jmp    121f <parseAndExecute+0xcf>
jmp    1224 <parseAndExecute+0xd4>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseAndExecute>:
push   %r15
push   %r14
push   %rbx
lea    0xea4(%rip),%r14
mov    %r14,%rsi
call   1070 <strtok@plt>
mov    %rax,%r15
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1070 <strtok@plt>
test   %r15,%r15
je     11da <parseAndExecute+0x8a>
mov    %rax,%r14
lea    0xe81(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11df <parseAndExecute+0x8f>
lea    0xe72(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c8 <parseAndExecute+0x78>
lea    0xe63(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11d2 <parseAndExecute+0x82>
lea    0xe52(%rip),%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
jmp    11da <parseAndExecute+0x8a>
mov    %r14,%rdi
call   1030 <executeLook@plt>
jmp    11da <parseAndExecute+0x8a>
mov    %r14,%rdi
call   1050 <executeGo@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \0A\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [5 x i8] c"look\00"
@.str.3 = [3 x i8] c"go\00"
@.str.4 = [27 x i8] c"I don't know how to '%s'.\0A\00"
define i32 @parseAndExecute(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
%8 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %36
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %2
br label %37
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i32 @executeLook(i8* %21)
br label %34
23: ; preds = %16
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i8*, i8** %5
%29 = call i32 @executeGo(i8* %28)
br label %33
30: ; preds = %23
%31 = load i8*, i8** %4
%32 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %30, %27
br label %34
34: ; preds = %33, %20
br label %35
35: ; preds = %34
br label %36
36: ; preds = %35, %1
store i32 1, i32* %2
br label %37
37: ; preds = %36, %15
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c" \0A\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [5 x i8] c"look\00"
@.str.3 = [3 x i8] c"go\00"
@.str.4 = [27 x i8] c"I don't know how to '%s'.\0A\00"
define i32 @parseAndExecute(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %2, null
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @executeLook(i8* %3)
br label %20
13: ; preds = %8
%14 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @executeGo(i8* %3)
br label %20
18: ; preds = %13
%19 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %2)
br label %20
20: ; preds = %1, %11, %18, %16, %5
%21 = phi i32 [ 0, %5 ], [ 1, %16 ], [ 1, %18 ], [ 1, %11 ], [ 1, %1 ]
ret i32 %21
}