#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
char *str_tok(char *, char *);
int main(void) {
  char *temp;
  while ((temp = str_tok("Hallo Du:Bist,Doof", " :,")) != NULL) {
    printf("Token: %s\n", temp);
  }
  while ((temp = str_tok("Urghaeiieirier:,ifdafer:urieieieiierrer:fiieriuuier",
                         ":,")) != NULL) {
    printf("Token: \"%s\"\n", temp);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <str_tok@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
jmp    116a <main+0x4a>
lea    0xeb1(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <str_tok@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11a0 <main+0x80>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x4a>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1040 <str_tok@plt>
test   %rax,%rax
je     117b <main+0x5b>
lea    0xed3(%rip),%r14
lea    0xeb5(%rip),%r15
lea    0xec1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <str_tok@plt>
test   %rax,%rax
jne    1160 <main+0x40>
lea    0xea0(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <str_tok@plt>
test   %rax,%rax
je     11cb <main+0xab>
lea    0xebc(%rip),%r14
lea    0xe81(%rip),%r15
lea    0xe6c(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <str_tok@plt>
test   %rax,%rax
jne    11b0 <main+0x90>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Hallo Du:Bist,Doof\00"
@.str.1 = [4 x i8] c" :,\00"
@.str.2 = [11 x i8] c"Token: %s\0A\00"
@.str.3 = [52 x i8] c"Urghaeiieirier:,ifdafer:urieieieiierrer:fiieriuuier\00"
@.str.4 = [3 x i8] c":,\00"
@.str.5 = [13 x i8] c"Token: \22%s\22\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i8* @str_tok(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = call i8* @str_tok(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i8* %11, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %14)
br label %10
16: ; preds = %10
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hallo Du:Bist,Doof\00"
@.str.1 = [4 x i8] c" :,\00"
@.str.2 = [11 x i8] c"Token: %s\0A\00"
@.str.3 = [52 x i8] c"Urghaeiieirier:,ifdafer:urieieieiierrer:fiieriuuier\00"
@.str.4 = [3 x i8] c":,\00"
@.str.5 = [13 x i8] c"Token: \22%s\22\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i8* @str_tok(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %6, %0
%4 = tail call i8* @str_tok(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %16, label %11
6: ; preds = %0, %6
%7 = phi i8* [ %9, %6 ], [ %1, %0 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = tail call i8* @str_tok(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %3, label %6
11: ; preds = %3, %11
%12 = phi i8* [ %14, %11 ], [ %4, %3 ]
%13 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %12)
%14 = tail call i8* @str_tok(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %11
16: ; preds = %11, %3
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}