#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 strlen(char *);
void I3_remove_quotes(char **ps) {
  char *ps1, *ps2;
  if (*ps[0] == '"')
    (*ps)++;
  if ((*ps)[strlen(*ps) - 1] == '"')
    (*ps)[strlen(*ps) - 1] = 0;
  ps1 = ps2 = *ps;
  while (ps2[0]) {
    if (ps2[0] == '\\') {
      ps2++;
    }
    ps1[0] = ps2[0];
    ps1++;
    ps2++;
  }
  ps1[0] = '\0';
}


x86 assembly (clang, -O0):
<I3_remove_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    113d <I3_remove_quotes+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1194 <I3_remove_quotes+0x84>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     11f5 <I3_remove_quotes+0xe5>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    11cc <I3_remove_quotes+0xbc>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11a3 <I3_remove_quotes+0x93>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I3_remove_quotes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
cmpb   $0x22,(%rbx)
jne    1126 <I3_remove_quotes+0x16>
add    $0x1,%rbx
mov    %rbx,(%r14)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x1(%rax,%rbx,1)
jne    1149 <I3_remove_quotes+0x39>
mov    (%r14),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    (%r14),%rax
mov    %rax,%rcx
jmp    1172 <I3_remove_quotes+0x62>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rcx),%edx
add    $0x1,%rcx
mov    %dl,(%rax)
add    $0x1,%rax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x5c,%dl
je     1160 <I3_remove_quotes+0x50>
test   %dl,%dl
jne    1168 <I3_remove_quotes+0x58>
movb   $0x0,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I3_remove_quotes(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 34
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %15
15: ; preds = %11, %1
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = call i32 @strlen(i8* %19)
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %17, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 34
br i1 %26, label %27, label %36
27: ; preds = %15
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = load i8**, i8*** %2
%31 = load i8*, i8** %30
%32 = call i32 @strlen(i8* %31)
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %29, i64 %34
store i8 0, i8* %35
br label %36
36: ; preds = %27, %15
%37 = load i8**, i8*** %2
%38 = load i8*, i8** %37
store i8* %38, i8** %4
store i8* %38, i8** %3
br label %39
39: ; preds = %53, %36
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i64 0
%42 = load i8, i8* %41
%43 = icmp ne i8 %42, 0
br i1 %43, label %44, label %63
44: ; preds = %39
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 92
br i1 %49, label %50, label %53
50: ; preds = %44
%51 = load i8*, i8** %4
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %4
br label %53
53: ; preds = %50, %44
%54 = load i8*, i8** %4
%55 = getelementptr inbounds i8, i8* %54, i64 0
%56 = load i8, i8* %55
%57 = load i8*, i8** %3
%58 = getelementptr inbounds i8, i8* %57, i64 0
store i8 %56, i8* %58
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %3
%61 = load i8*, i8** %4
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %4
br label %39
63: ; preds = %39
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 0
store i8 0, i8* %65
ret void
}

LLVM IR (-O2):
define void @I3_remove_quotes(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 34
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %6, i8** %0
br label %7
7: ; preds = %5, %1
%8 = phi i8* [ %6, %5 ], [ %2, %1 ]
%9 = tail call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 34
br i1 %14, label %15, label %21
15: ; preds = %7
%16 = load i8*, i8** %0
%17 = tail call i32 @strlen(i8* %16)
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 0, i8* %20
br label %21
21: ; preds = %15, %7
%22 = load i8*, i8** %0
br label %23
23: ; preds = %30, %21
%24 = phi i8* [ %22, %21 ], [ %33, %30 ]
%25 = phi i8* [ %22, %21 ], [ %34, %30 ]
%26 = load i8, i8* %25
switch i8 %26, label %30 [
i8 0, label %35
i8 92, label %27
]
27: ; preds = %23
%28 = getelementptr inbounds i8, i8* %25, i64 1
%29 = load i8, i8* %28
br label %30
30: ; preds = %23, %27
%31 = phi i8 [ %29, %27 ], [ %26, %23 ]
%32 = phi i8* [ %28, %27 ], [ %25, %23 ]
store i8 %31, i8* %24
%33 = getelementptr inbounds i8, i8* %24, i64 1
%34 = getelementptr inbounds i8, i8* %32, i64 1
br label %23
35: ; preds = %23
store i8 0, i8* %24
ret void
}