#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 */
scalar_t__ isspace(char const);
char *stomp_deescape(const char *path, char *path2) {
  const char *src = path;
  char *dst = path2;
  while (isspace(*src))
    src++;
  while (*src) {
    if (*src == '\\') {
      src++;
      if (*src == 'r')
        *dst++ = '\r';
      else if (*src == 'n')
        *dst++ = '\n';
      else if (*src == 'c')
        *dst++ = ':';
      else if (*src == '\\')
        *dst++ = '\\';
    } else {
      if ((src[0] == '.') && (src[1] == '.'))
        src += 2;
      else
        *dst++ = *src;
    }
    src++;
  }
  *dst = '\0';
  return path2;
}


x86 assembly (clang, -O0):
<stomp_deescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1157 <stomp_deescape+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <stomp_deescape+0x20>
jmp    115c <stomp_deescape+0x4c>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     128f <stomp_deescape+0x17f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1230 <stomp_deescape+0x120>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    11ac <stomp_deescape+0x9c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0xd,(%rax)
jmp    122b <stomp_deescape+0x11b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    11d3 <stomp_deescape+0xc3>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0xa,(%rax)
jmp    1226 <stomp_deescape+0x116>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    11fa <stomp_deescape+0xea>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3a,(%rax)
jmp    1221 <stomp_deescape+0x111>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    121c <stomp_deescape+0x10c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x5c,(%rax)
jmp    1221 <stomp_deescape+0x111>
jmp    1226 <stomp_deescape+0x116>
jmp    122b <stomp_deescape+0x11b>
jmp    127e <stomp_deescape+0x16e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1262 <stomp_deescape+0x152>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1262 <stomp_deescape+0x152>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1279 <stomp_deescape+0x169>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    127e <stomp_deescape+0x16e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115c <stomp_deescape+0x4c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stomp_deescape>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <stomp_deescape+0x10>
lea    0xec7(%rip),%rax
mov    %r14,%rcx
jmp    1152 <stomp_deescape+0x42>
xchg   %ax,%ax
test   %dl,%dl
je     11c7 <stomp_deescape+0xb7>
mov    %dl,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
movzbl (%rbx),%edx
cmp    $0x2e,%dl
je     1190 <stomp_deescape+0x80>
cmp    $0x5c,%dl
jne    1140 <stomp_deescape+0x30>
movzbl 0x1(%rbx),%edx
add    $0x1,%rbx
add    $0xa4,%dl
cmp    $0x16,%dl
ja     119a <stomp_deescape+0x8a>
movzbl %dl,%edx
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
movb   $0x5c,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
jmp    1152 <stomp_deescape+0x42>
nopl   0x0(%rax,%rax,1)
cmpb   $0x2e,0x1(%rbx)
jne    1148 <stomp_deescape+0x38>
add    $0x2,%rbx
add    $0x1,%rbx
jmp    1152 <stomp_deescape+0x42>
movb   $0x3a,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
jmp    1152 <stomp_deescape+0x42>
movb   $0xa,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
jmp    1152 <stomp_deescape+0x42>
movb   $0xd,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
jmp    1152 <stomp_deescape+0x42>
movb   $0x0,(%rcx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stomp_deescape(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %14, %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
br label %9
17: ; preds = %9
br label %18
18: ; preds = %86, %17
%19 = load i8*, i8** %5
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %22, label %89
22: ; preds = %18
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 92
br i1 %26, label %27, label %65
27: ; preds = %22
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %5
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 114
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %6
store i8 13, i8* %35
br label %64
37: ; preds = %27
%38 = load i8*, i8** %5
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 110
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = load i8*, i8** %6
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %6
store i8 10, i8* %43
br label %63
45: ; preds = %37
%46 = load i8*, i8** %5
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 99
br i1 %49, label %50, label %53
50: ; preds = %45
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %6
store i8 58, i8* %51
br label %62
53: ; preds = %45
%54 = load i8*, i8** %5
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 92
br i1 %57, label %58, label %61
58: ; preds = %53
%59 = load i8*, i8** %6
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %6
store i8 92, i8* %59
br label %61
61: ; preds = %58, %53
br label %62
62: ; preds = %61, %50
br label %63
63: ; preds = %62, %42
br label %64
64: ; preds = %63, %34
br label %86
65: ; preds = %22
%66 = load i8*, i8** %5
%67 = getelementptr inbounds i8, i8* %66, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 46
br i1 %70, label %71, label %80
71: ; preds = %65
%72 = load i8*, i8** %5
%73 = getelementptr inbounds i8, i8* %72, i64 1
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 46
br i1 %76, label %77, label %80
77: ; preds = %71
%78 = load i8*, i8** %5
%79 = getelementptr inbounds i8, i8* %78, i64 2
store i8* %79, i8** %5
br label %85
80: ; preds = %71, %65
%81 = load i8*, i8** %5
%82 = load i8, i8* %81
%83 = load i8*, i8** %6
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %6
store i8 %82, i8* %83
br label %85
85: ; preds = %80, %77
br label %86
86: ; preds = %85, %64
%87 = load i8*, i8** %5
%88 = getelementptr inbounds i8, i8* %87, i32 1
store i8* %88, i8** %5
br label %18
89: ; preds = %18
%90 = load i8*, i8** %6
store i8 0, i8* %90
%91 = load i8*, i8** %4
ret i8* %91
}

LLVM IR (-O2):
define i8* @stomp_deescape(i8* nocapture %0, i8* returned writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %32
%10 = phi i8* [ %35, %32 ], [ %4, %3 ]
%11 = phi i8* [ %34, %32 ], [ %1, %3 ]
%12 = load i8, i8* %10
switch i8 %12, label %30 [
i8 0, label %36
i8 92, label %13
i8 46, label %24
]
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
switch i8 %15, label %32 [
i8 114, label %16
i8 110, label %18
i8 99, label %20
i8 92, label %22
]
16: ; preds = %13
%17 = getelementptr inbounds i8, i8* %11, i64 1
store i8 13, i8* %11
br label %32
18: ; preds = %13
%19 = getelementptr inbounds i8, i8* %11, i64 1
store i8 10, i8* %11
br label %32
20: ; preds = %13
%21 = getelementptr inbounds i8, i8* %11, i64 1
store i8 58, i8* %11
br label %32
22: ; preds = %13
%23 = getelementptr inbounds i8, i8* %11, i64 1
store i8 92, i8* %11
br label %32
24: ; preds = %9
%25 = getelementptr inbounds i8, i8* %10, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 46
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = getelementptr inbounds i8, i8* %10, i64 2
br label %32
30: ; preds = %9, %24
%31 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %12, i8* %11
br label %32
32: ; preds = %13, %28, %30, %16, %20, %22, %18
%33 = phi i8* [ %14, %16 ], [ %14, %18 ], [ %14, %20 ], [ %14, %22 ], [ %29, %28 ], [ %10, %30 ], [ %14, %13 ]
%34 = phi i8* [ %17, %16 ], [ %19, %18 ], [ %21, %20 ], [ %23, %22 ], [ %11, %28 ], [ %31, %30 ], [ %11, %13 ]
%35 = getelementptr inbounds i8, i8* %33, i64 1
br label %9
36: ; preds = %9
store i8 0, i8* %11
ret i8* %1
}