#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 *);
void splitcommand(char *zeile, char **vec) {
  int i = 0;
  for (vec[i] = strtok(zeile, " \t\n"); vec[i];
       vec[++i] = strtok(NULL, " \t\n"))
    ;
}


x86 assembly (clang, -O0):
<splitcommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     118a <splitcommand+0x7a>
jmp    115e <splitcommand+0x4e>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe97(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1146 <splitcommand+0x36>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitcommand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1156 <splitcommand+0x46>
add    $0x8,%rbx
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
mov    %rax,(%rbx)
add    $0x8,%rbx
test   %rax,%rax
jne    1140 <splitcommand+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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