#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*/ Dbg(int, int, char *, ...);
int /*<<< orphan*/ StringIn(char, char *);
char *StringSkipTos(char *in, char *seps) {
  while (*in && !StringIn(*in, seps)) {
    if (*in == 92) {
      in++;
      if (*in == '\0') {
        Dbg(0x80, 1, "StringSkipTos");
        return (in);
      }
    }
    if (*in == '\0') {
      Dbg(0x80, 1, "StringSkipTos: hit end skipping to <%s>", seps);
      return (in);
    }
    in++;
  }
  if (*in != '\0')
    in++;
  return (in);
}


x86 assembly (clang, -O0):
<StringSkipTos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1162 <StringSkipTos+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1040 <StringIn@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1172 <StringSkipTos+0x52>
jmp    1212 <StringSkipTos+0xf2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    11c8 <StringSkipTos+0xa8>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11c3 <StringSkipTos+0xa3>
mov    $0x80,%edi
mov    $0x1,%esi
lea    0xe51(%rip),%rdx
mov    $0x0,%al
call   1030 <Dbg@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1236 <StringSkipTos+0x116>
jmp    11c8 <StringSkipTos+0xa8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1201 <StringSkipTos+0xe1>
mov    -0x18(%rbp),%rcx
mov    $0x80,%edi
mov    $0x1,%esi
lea    0xe21(%rip),%rdx
mov    $0x0,%al
call   1030 <Dbg@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1236 <StringSkipTos+0x116>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <StringSkipTos+0x10>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     122e <StringSkipTos+0x10e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringSkipTos>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1176 <StringSkipTos+0x56>
mov    %rsi,%r14
jmp    1150 <StringSkipTos+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %cl,%cl
je     118c <StringSkipTos+0x6c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1176 <StringSkipTos+0x56>
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <StringIn@plt>
movzbl (%rbx),%ecx
test   %eax,%eax
jne    117e <StringSkipTos+0x5e>
cmp    $0x5c,%cl
jne    1140 <StringSkipTos+0x20>
lea    0x1(%rbx),%r15
cmpb   $0x0,0x1(%rbx)
je     11ac <StringSkipTos+0x8c>
mov    %r15,%rbx
jmp    1144 <StringSkipTos+0x24>
xor    %r15d,%r15d
add    %rbx,%r15
jmp    11c4 <StringSkipTos+0xa4>
xor    %r15d,%r15d
test   %cl,%cl
setne  %r15b
add    %rbx,%r15
jmp    11c4 <StringSkipTos+0xa4>
lea    0xe7b(%rip),%rdx
mov    $0x80,%edi
mov    $0x1,%esi
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <Dbg@plt>
mov    %rbx,%r15
jmp    11c4 <StringSkipTos+0xa4>
lea    0xe4d(%rip),%rdx
mov    $0x80,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <Dbg@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"StringSkipTos\00"
@.str.1 = [40 x i8] c"StringSkipTos: hit end skipping to <%s>\00"
define i8* @StringSkipTos(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %45, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
%15 = call i32 @StringIn(i8 signext %13, i8* %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br label %18
18: ; preds = %11, %6
%19 = phi i1 [ false, %6 ], [ %17, %11 ]
br i1 %19, label %20, label %48
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 92
br i1 %24, label %25, label %36
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %25
%33 = call i32 (i32, i32, i8*, ...) @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%34 = load i8*, i8** %4
store i8* %34, i8** %3
br label %58
35: ; preds = %25
br label %36
36: ; preds = %35, %20
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %36
%42 = load i8*, i8** %5
%43 = call i32 (i32, i32, i8*, ...) @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %4
store i8* %44, i8** %3
br label %58
45: ; preds = %36
%46 = load i8*, i8** %4
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %4
br label %6
48: ; preds = %18
%49 = load i8*, i8** %4
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = load i8*, i8** %4
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %4
br label %56
56: ; preds = %53, %48
%57 = load i8*, i8** %4
store i8* %57, i8** %3
br label %58
58: ; preds = %56, %41, %32
%59 = load i8*, i8** %3
ret i8* %59
}

LLVM IR (-O2):
@.str = [14 x i8] c"StringSkipTos\00"
@.str.1 = [40 x i8] c"StringSkipTos: hit end skipping to <%s>\00"
define i8* @StringSkipTos(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %28, label %5
5: ; preds = %2, %23
%6 = phi i8 [ %26, %23 ], [ %3, %2 ]
%7 = phi i8* [ %25, %23 ], [ %0, %2 ]
%8 = tail call i32 @StringIn(i8 signext %6, i8* %1)
%9 = icmp eq i32 %8, 0
%10 = load i8, i8* %7
br i1 %9, label %14, label %11
11: ; preds = %5
%12 = icmp ne i8 %10, 0
%13 = zext i1 %12 to i64
br label %28
14: ; preds = %5
switch i8 %10, label %23 [
i8 92, label %15
i8 0, label %21
]
15: ; preds = %14
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = tail call i32 (i32, i32, i8*, ...) @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %32
21: ; preds = %14
%22 = tail call i32 (i32, i32, i8*, ...) @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %32
23: ; preds = %14, %15
%24 = phi i8* [ %16, %15 ], [ %7, %14 ]
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %5
28: ; preds = %23, %11, %2
%29 = phi i64 [ 0, %2 ], [ %13, %11 ], [ 0, %23 ]
%30 = phi i8* [ %0, %2 ], [ %7, %11 ], [ %25, %23 ]
%31 = getelementptr i8, i8* %30, i64 %29
br label %32
32: ; preds = %28, %21, %19
%33 = phi i8* [ %16, %19 ], [ %7, %21 ], [ %31, %28 ]
ret i8* %33
}