#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*/ sprintf(char *, char *, char);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void ScanForSlashOpts(char *Text) {
  int i;
  char Temp[10], Buffer[100] = "", Next;
  for (i = 0; Text[i] != '\x00'; i++) {
    if (Text[i] == 0x5C) {
      Next = Text[i + 1];
      if (Next == '\x00') {
        strcat(Buffer, "\\");
        break;
      }
      switch (Next) {
      case 'n':
        strcat(Buffer, "\n");
        i++;
        break;
      case 'r':
        strcat(Buffer, "\r");
        i++;
        break;
      case 't':
        strcat(Buffer, "\t");
        i++;
        break;
      case 'a':
        strcat(Buffer, "\a");
        i++;
        break;
      case 'f':
        strcat(Buffer, "\f");
        i++;
        break;
      case 'v':
        strcat(Buffer, "\v");
        i++;
        break;
      case 'b':
        strcat(Buffer, "\b");
        i++;
        break;
      case 0x5C:
        strcat(Buffer, "\\");
        i++;
        break;
      case 0x0027:
        strcat(Buffer, "\'");
        i++;
        break;
      case '"':
        strcat(Buffer, "\"");
        i++;
        break;
      default:
        break;
      }
    } else {
      sprintf(Temp, "%c", Text[i]);
      strcat(Buffer, Temp);
    }
  }
  strcpy(Text, Buffer);
}


x86 assembly (clang, -O0):
<ScanForSlashOpts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1370 <ScanForSlashOpts+0x230>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1334 <ScanForSlashOpts+0x1f4>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x81(%rbp)
movsbl -0x81(%rbp),%eax
cmp    $0x0,%eax
jne    11cb <ScanForSlashOpts+0x8b>
lea    -0x80(%rbp),%rdi
lea    0xf93(%rip),%rsi
call   1050 <strcat@plt>
jmp    1370 <ScanForSlashOpts+0x230>
movsbl -0x81(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x54,%eax
ja     132a <ScanForSlashOpts+0x1ea>
mov    -0x90(%rbp),%rax
lea    0xe0b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x80(%rbp),%rdi
lea    0xf4d(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xf31(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xf15(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xef9(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
lea    -0x80(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    132f <ScanForSlashOpts+0x1ef>
jmp    132f <ScanForSlashOpts+0x1ef>
jmp    135d <ScanForSlashOpts+0x21d>
lea    -0x16(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe21(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1060 <sprintf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x16(%rbp),%rsi
call   1050 <strcat@plt>
jmp    1362 <ScanForSlashOpts+0x222>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <ScanForSlashOpts+0x26>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScanForSlashOpts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
xor    %r12d,%r12d
lea    0xe9c(%rip),%rbp
lea    0x10(%rsp),%r15
lea    0x6(%rsp),%r13
jmp    118c <ScanForSlashOpts+0x6c>
mov    %r15,%rdi
lea    0xfdc(%rip),%rsi
nopw   0x0(%rax,%rax,1)
call   1040 <strcat@plt>
mov    %r14d,%r12d
add    $0x1,%r12d
movslq %r12d,%r14
movzbl (%rbx,%r14,1),%eax
cmp    $0x5c,%al
je     11c0 <ScanForSlashOpts+0xa0>
test   %al,%al
je     1276 <ScanForSlashOpts+0x156>
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <strcat@plt>
add    $0x1,%r12d
jmp    118c <ScanForSlashOpts+0x6c>
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rbx,%r14,1),%eax
test   %eax,%eax
je     1265 <ScanForSlashOpts+0x145>
add    $0xffffffde,%eax
cmp    $0x54,%eax
ja     11b4 <ScanForSlashOpts+0x94>
add    $0x1,%r14
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    %r15,%rdi
lea    0xf78(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf6a(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf4e(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf47(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf3e(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf2b(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf16(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf09(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
mov    %r15,%rdi
lea    0xf00(%rip),%rsi
jmp    1180 <ScanForSlashOpts+0x60>
lea    0xee8(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <strcat@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [2 x i8] c"\07\00"
@.str.5 = [2 x i8] c"\0C\00"
@.str.6 = [2 x i8] c"\0B\00"
@.str.7 = [2 x i8] c"\08\00"
@.str.8 = [2 x i8] c"'\00"
@.str.9 = [2 x i8] c"\22\00"
@.str.10 = [3 x i8] c"%c\00"
define void @ScanForSlashOpts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca [100 x i8]
%6 = alloca i8
store i8* %0, i8** %2
%7 = bitcast [100 x i8]* %5 to i8*
store i32 0, i32* %3
br label %8
8: ; preds = %104, %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %107
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 92
br i1 %23, label %24, label %92
24: ; preds = %16
%25 = load i8*, i8** %2
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
%30 = load i8, i8* %29
store i8 %30, i8* %6
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %24
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%36 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %107
37: ; preds = %24
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
switch i32 %39, label %90 [
i32 110, label %40
i32 114, label %45
i32 116, label %50
i32 97, label %55
i32 102, label %60
i32 118, label %65
i32 98, label %70
i32 92, label %75
i32 39, label %80
i32 34, label %85
]
40: ; preds = %37
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %91
45: ; preds = %37
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%47 = call i32 @strcat(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %91
50: ; preds = %37
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%52 = call i32 @strcat(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
br label %91
55: ; preds = %37
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%57 = call i32 @strcat(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %91
60: ; preds = %37
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%62 = call i32 @strcat(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %91
65: ; preds = %37
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%67 = call i32 @strcat(i8* %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%68 = load i32, i32* %3
%69 = add nsw i32 %68, 1
store i32 %69, i32* %3
br label %91
70: ; preds = %37
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%72 = call i32 @strcat(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %91
75: ; preds = %37
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%77 = call i32 @strcat(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %3
br label %91
80: ; preds = %37
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%82 = call i32 @strcat(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%83 = load i32, i32* %3
%84 = add nsw i32 %83, 1
store i32 %84, i32* %3
br label %91
85: ; preds = %37
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%87 = call i32 @strcat(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %91
90: ; preds = %37
br label %91
91: ; preds = %90, %85, %80, %75, %70, %65, %60, %55, %50, %45, %40
br label %103
92: ; preds = %16
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%94 = load i8*, i8** %2
%95 = load i32, i32* %3
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
%98 = load i8, i8* %97
%99 = call i32 @sprintf(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8 signext %98)
%100 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%101 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%102 = call i32 @strcat(i8* %100, i8* %101)
br label %103
103: ; preds = %92, %91
br label %104
104: ; preds = %103
%105 = load i32, i32* %3
%106 = add nsw i32 %105, 1
store i32 %106, i32* %3
br label %8
107: ; preds = %34, %8
%108 = load i8*, i8** %2
%109 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%110 = call i32 @strcpy(i8* %108, i8* %109)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"\0D\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [2 x i8] c"\07\00"
@.str.5 = [2 x i8] c"\0C\00"
@.str.6 = [2 x i8] c"\0B\00"
@.str.7 = [2 x i8] c"\08\00"
@.str.8 = [2 x i8] c"'\00"
@.str.9 = [2 x i8] c"\22\00"
define void @ScanForSlashOpts(i8* %0) {
%2 = alloca [10 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
br label %7
7: ; preds = %44, %1
%8 = phi i32 [ 0, %1 ], [ %46, %44 ]
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
switch i8 %11, label %42 [
i8 0, label %47
i8 92, label %12
]
12: ; preds = %7
%13 = add nsw i32 %8, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %47
20: ; preds = %12
%21 = sext i8 %16 to i32
switch i32 %21, label %44 [
i32 110, label %22
i32 114, label %24
i32 116, label %26
i32 97, label %28
i32 102, label %30
i32 118, label %32
i32 98, label %34
i32 92, label %36
i32 39, label %38
i32 34, label %40
]
22: ; preds = %20
%23 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
24: ; preds = %20
%25 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
26: ; preds = %20
%27 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %44
28: ; preds = %20
%29 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %44
30: ; preds = %20
%31 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %44
32: ; preds = %20
%33 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %44
34: ; preds = %20
%35 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %44
36: ; preds = %20
%37 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %44
38: ; preds = %20
%39 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %44
40: ; preds = %20
%41 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %44
42: ; preds = %7
store i8 %11, i8* %4
store i8 0, i8* %6
%43 = call i32 @strcat(i8* %5, i8* %4)
br label %44
44: ; preds = %42, %20, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22
%45 = phi i32 [ %8, %20 ], [ %13, %40 ], [ %13, %38 ], [ %13, %36 ], [ %13, %34 ], [ %13, %32 ], [ %13, %30 ], [ %13, %28 ], [ %13, %26 ], [ %13, %24 ], [ %13, %22 ], [ %8, %42 ]
%46 = add nsw i32 %45, 1
br label %7
47: ; preds = %7, %18
%48 = call i32 @strcpy(i8* %0, i8* %5)
ret void
}