#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*/ assert(char const *);
char *strchr(char const *, char);
int switch_string_has_escaped_data(const char *in) {
  const char *i;
  assert(in);
  i = strchr(in, '\\');
  while (i && *i == '\\') {
    i++;
    if (*i == '\\' || *i == 'n' || *i == 's' || *i == 't' || *i == '\'') {
      return 1;
    }
    i = strchr(i, '\\');
  }
  return 0;
}


x86 assembly (clang, -O0):
<switch_string_has_escaped_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1167 <switch_string_has_escaped_data+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1177 <switch_string_has_escaped_data+0x57>
jmp    11f6 <switch_string_has_escaped_data+0xd6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     11d3 <switch_string_has_escaped_data+0xb3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
je     11d3 <switch_string_has_escaped_data+0xb3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     11d3 <switch_string_has_escaped_data+0xb3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
je     11d3 <switch_string_has_escaped_data+0xb3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    11df <switch_string_has_escaped_data+0xbf>
movl   $0x1,-0x4(%rbp)
jmp    11fd <switch_string_has_escaped_data+0xdd>
mov    -0x18(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1147 <switch_string_has_escaped_data+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_string_has_escaped_data>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     117c <switch_string_has_escaped_data+0x5c>
mov    $0x1840001,%ebx
cmpb   $0x5c,(%rax)
jne    117c <switch_string_has_escaped_data+0x5c>
movzbl 0x1(%rax),%edx
mov    $0x1,%ecx
lea    -0x5c(%rdx),%esi
cmp    $0x18,%sil
ja     1161 <switch_string_has_escaped_data+0x41>
movzbl %sil,%esi
bt     %rsi,%rbx
jb     117e <switch_string_has_escaped_data+0x5e>
cmp    $0x27,%dl
je     117e <switch_string_has_escaped_data+0x5e>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1140 <switch_string_has_escaped_data+0x20>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @switch_string_has_escaped_data(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = call i8* @strchr(i8* %7, i8 signext 92)
store i8* %8, i8** %4
br label %9
9: ; preds = %47, %1
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 92
br label %17
17: ; preds = %12, %9
%18 = phi i1 [ false, %9 ], [ %16, %12 ]
br i1 %18, label %19, label %50
19: ; preds = %17
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 92
br i1 %25, label %46, label %26
26: ; preds = %19
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 110
br i1 %30, label %46, label %31
31: ; preds = %26
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 115
br i1 %35, label %46, label %36
36: ; preds = %31
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 116
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = load i8*, i8** %4
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 39
br i1 %45, label %46, label %47
46: ; preds = %41, %36, %31, %26, %19
store i32 1, i32* %2
br label %51
47: ; preds = %41
%48 = load i8*, i8** %4
%49 = call i8* @strchr(i8* %48, i8 signext 92)
store i8* %49, i8** %4
br label %9
50: ; preds = %17
store i32 0, i32* %2
br label %51
51: ; preds = %50, %46
%52 = load i32, i32* %2
ret i32 %52
}

LLVM IR (-O2):
define i32 @switch_string_has_escaped_data(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %1, %12
%6 = phi i8* [ %13, %12 ], [ %3, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 92
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
switch i8 %11, label %12 [
i8 92, label %15
i8 110, label %15
i8 115, label %15
i8 116, label %15
i8 39, label %15
]
12: ; preds = %9
%13 = tail call i8* @strchr(i8* %10, i8 signext 92)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %5
15: ; preds = %9, %9, %9, %9, %9, %12, %5, %1
%16 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 0, %12 ], [ 1, %9 ], [ 1, %9 ], [ 1, %9 ], [ 1, %9 ], [ 1, %9 ]
ret i32 %16
}