#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
char *strsepesc(char **, char *, char, int);
int main() {
  char s[] = "d;f\\;fs:w\\:\\;;", delim[] = ";:", *tmp = s;
  char *token = strsepesc(&tmp, delim, '\\', 1);
  while (token) {
    printf(">>%s<<%s<<\n", token, tmp);
    token = strsepesc(&tmp, delim, '\\', 1);
    printf("read\n");
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaa(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0x16(%rbp)
mov    0xe99(%rip),%al
mov    %al,-0x14(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x16(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x5c,%edx
mov    $0x1,%ecx
call   1030 <strsepesc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11fb <main+0xcb>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x16(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x5c,%edx
mov    $0x1,%ecx
call   1030 <strsepesc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    119e <main+0x6e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movabs $0x3b3b5c3a5c773a,%rax
mov    %rax,0x1f(%rsp)
movabs $0x3a73663b5c663b64,%rax
66 73 3a
mov    %rax,0x18(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x3a3b,0xc(%rsp)
lea    0x18(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x5c,%edx
mov    $0x1,%ecx
call   1030 <strsepesc@plt>
test   %rax,%rax
je     120f <main+0xcf>
mov    %rax,%rbx
lea    0xe68(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xe63(%rip),%r13
mov    0x2e1e(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x5c,%edx
mov    $0x1,%ecx
call   1030 <strsepesc@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1040 <puts@plt>
mov    0x0(%rbp),%edi
call   1060 <fflush@plt>
test   %rbx,%rbx
jne    11d0 <main+0x90>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.s = [15 x i8] c"d;f\\;fs:w\\:\\;;\00"
@__const.main.delim = [3 x i8] c";:\00"
@.str = [12 x i8] c">>%s<<%s<<\0A\00"
@.str.1 = [6 x i8] c"read\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [3 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [15 x i8]* %2 to i8*
%7 = bitcast [3 x i8]* %3 to i8*
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
store i8* %8, i8** %4
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%10 = call i8* @strsepesc(i8** %4, i8* %9, i8 signext 92, i32 1)
store i8* %10, i8** %5
br label %11
11: ; preds = %14, %0
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%19 = call i8* @strsepesc(i8** %4, i8* %18, i8 signext 92, i32 1)
store i8* %19, i8** %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
br label %11
23: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [15 x i8] c"d;f\\;fs:w\\:\\;;\00"
@__const.main.delim = [3 x i8] c";:\00"
@.str = [12 x i8] c">>%s<<%s<<\0A\00"
@stdout = global i32 0
@str = [5 x i8] c"read\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [3 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = bitcast i8** %3 to i8*
store i8* %4, i8** %3
%7 = call i8* @strsepesc(i8** %3, i8* %5, i8 signext 92, i32 1)
%8 = icmp eq i8* %7, null
br i1 %8, label %18, label %9
9: ; preds = %0, %9
%10 = phi i8* [ %13, %9 ], [ %7, %0 ]
%11 = load i8*, i8** %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = call i8* @strsepesc(i8** %3, i8* %5, i8 signext 92, i32 1)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
%17 = icmp eq i8* %13, null
br i1 %17, label %18, label %9
18: ; preds = %9, %0
ret i32 0
}