#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 */
char *strtok(char *, char const *);
void parse(char *line, char **argv) {
  const char *delimiters = " \t\n\a\r";
  char *token = strtok(line, delimiters);
  while (token != NULL) {
    *argv++ = token;
    token = strtok(NULL, delimiters);
  }
  *argv = NULL;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <parse+0x63>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    113c <parse+0x2c>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     1146 <parse+0x36>
lea    0xed1(%rip),%r14
nop
mov    %rax,(%rbx)
add    $0x8,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <parse+0x20>
movq   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c" \09\0A\07\0D\00"
define void @parse(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = call i8* @strtok(i8* %7, i8* %8)
store i8* %9, i8** %6
br label %10
10: ; preds = %13, %2
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i8*, i8** %6
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %4
store i8* %14, i8** %15
%17 = load i8*, i8** %5
%18 = call i8* @strtok(i8* null, i8* %17)
store i8* %18, i8** %6
br label %10
19: ; preds = %10
%20 = load i8**, i8*** %4
store i8* null, i8** %20
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" \09\0A\07\0D\00"
define void @parse(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
store i8* %6, i8** %7
%9 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i8** [ %1, %2 ], [ %8, %5 ]
store i8* null, i8** %12
ret void
}