#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 */
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
void tokenize(char *input, char **tokens) {
  char *str;
  if ((str = strtok(input, "")) != NULL)
    if (strcmp(str, "who") != 0 && strcmp(str, "what") != 0)
      return;
  if ((str = strtok(NULL, "")) != NULL)
    if (strcmp(str, "is") != 0)
      return;
  *tokens = strtok(NULL, "\n");
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118c <tokenize+0x6c>
mov    -0x18(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1187 <tokenize+0x67>
mov    -0x18(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1187 <tokenize+0x67>
jmp    11e8 <tokenize+0xc8>
jmp    118c <tokenize+0x6c>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe76(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11ce <tokenize+0xae>
mov    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11c9 <tokenize+0xa9>
jmp    11e8 <tokenize+0xc8>
jmp    11ce <tokenize+0xae>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe33(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xedf(%rip),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     1163 <tokenize+0x43>
mov    %rax,%rbx
lea    0xebe(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1163 <tokenize+0x43>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    119b <tokenize+0x7b>
lea    0xea3(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     118a <tokenize+0x6a>
lea    0xe8c(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    119b <tokenize+0x7b>
lea    0xe7b(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"who\00"
@.str.2 = [5 x i8] c"what\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @tokenize(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %31
18: ; preds = %13, %9
br label %19
19: ; preds = %18, %2
%20 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %20, i8** %5
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i8*, i8** %5
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
br label %31
27: ; preds = %22
br label %28
28: ; preds = %27, %19
%29 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%30 = load i8**, i8*** %4
store i8* %29, i8** %30
br label %31
31: ; preds = %28, %26, %17
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"who\00"
@.str.2 = [5 x i8] c"what\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @tokenize(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* %3, 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 %19
11: ; preds = %5, %8, %2
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14, %11
%18 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i8* %18, i8** %1
br label %19
19: ; preds = %14, %8, %17
ret void
}