#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__ strchr(char const *, char const);
void my_dequote(char *out, const char *in, const char *special) {
  const char *p;
  char *q;
  char c;
  p = in;
  q = out;
  while ((c = *(p++))) {
    if (c == '\\' && strchr(special, *p)) {
      *(q++) = *(p++);
    } else {
      *(q++) = c;
    }
  }
  *q = '\0';
}


x86 assembly (clang, -O0):
<my_dequote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x29(%rbp)
cmp    $0x0,%al
je     11b7 <my_dequote+0xa7>
movsbl -0x29(%rbp),%eax
cmp    $0x5c,%eax
jne    119e <my_dequote+0x8e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     119e <my_dequote+0x8e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    11b2 <my_dequote+0xa2>
mov    -0x29(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    1134 <my_dequote+0x24>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_dequote>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
jmp    113e <my_dequote+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %al,%al
je     116c <my_dequote+0x5c>
mov    %al,(%r15)
add    $0x1,%r15
mov    %r12,%rbx
lea    0x1(%rbx),%r12
movzbl (%rbx),%eax
cmp    $0x5c,%al
jne    1130 <my_dequote+0x20>
movsbl (%r12),%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1168 <my_dequote+0x58>
movzbl 0x1(%rbx),%eax
add    $0x2,%rbx
mov    %rbx,%r12
jmp    1134 <my_dequote+0x24>
mov    $0x5c,%al
jmp    1134 <my_dequote+0x24>
movb   $0x0,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @my_dequote(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %5
store i8* %10, i8** %7
%11 = load i8*, i8** %4
store i8* %11, i8** %8
br label %12
12: ; preds = %37, %3
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %7
%15 = load i8, i8* %13
store i8 %15, i8* %9
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %38
17: ; preds = %12
%18 = load i8, i8* %9
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 92
br i1 %20, label %21, label %33
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = load i8*, i8** %7
%24 = load i8, i8* %23
%25 = call i64 @strchr(i8* %22, i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %21
%28 = load i8*, i8** %7
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %7
%30 = load i8, i8* %28
%31 = load i8*, i8** %8
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %8
store i8 %30, i8* %31
br label %37
33: ; preds = %21, %17
%34 = load i8, i8* %9
%35 = load i8*, i8** %8
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %8
store i8 %34, i8* %35
br label %37
37: ; preds = %33, %27
br label %12
38: ; preds = %12
%39 = load i8*, i8** %8
store i8 0, i8* %39
ret void
}

LLVM IR (-O2):
define void @my_dequote(i8* nocapture writeonly %0, i8* nocapture %1, i8* %2) {
br label %4
4: ; preds = %16, %3
%5 = phi i8* [ %0, %3 ], [ %19, %16 ]
%6 = phi i8* [ %1, %3 ], [ %18, %16 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
switch i8 %8, label %16 [
i8 0, label %20
i8 92, label %9
]
9: ; preds = %4
%10 = load i8, i8* %7
%11 = tail call i64 @strchr(i8* %2, i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %6, i64 2
%15 = load i8, i8* %7
br label %16
16: ; preds = %9, %4, %13
%17 = phi i8 [ %15, %13 ], [ %8, %4 ], [ 92, %9 ]
%18 = phi i8* [ %14, %13 ], [ %7, %4 ], [ %7, %9 ]
%19 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %17, i8* %5
br label %4
20: ; preds = %4
store i8 0, i8* %5
ret void
}