#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*/ Trim(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void UnQuote(char *pszString) {
  int iLast;
  int iQuotes;
  char chCurr;
  char *pszSearch;
  Trim(pszString);
  if (pszString && *pszString) {
    iLast = strlen(pszString) - 1;
    if ((pszString[0] == '\"') && (pszString[iLast] == '\"')) {
      iQuotes = 0;
      pszSearch = pszString;
      while ((chCurr = *pszSearch++)) {
        if (chCurr == '\"')
          ++iQuotes;
      }
      if (iQuotes == 2) {
        pszString[iLast] = '\0';
        strcpy(pszString, &pszString[1]);
      }
    }
  }
}


x86 assembly (clang, -O0):
<UnQuote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Trim@plt>
cmpq   $0x0,-0x8(%rbp)
je     120b <UnQuote+0xdb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     120b <UnQuote+0xdb>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1206 <UnQuote+0xd6>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1206 <UnQuote+0xd6>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     11da <UnQuote+0xaa>
movsbl -0x11(%rbp),%eax
cmp    $0x22,%eax
jne    11d5 <UnQuote+0xa5>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a3 <UnQuote+0x73>
cmpl   $0x2,-0x10(%rbp)
jne    1201 <UnQuote+0xd1>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
jmp    1206 <UnQuote+0xd6>
jmp    120b <UnQuote+0xdb>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnQuote>:
push   %rbx
mov    %rdi,%rbx
call   1040 <Trim@plt>
test   %rbx,%rbx
je     1199 <UnQuote+0x69>
cmpb   $0x0,(%rbx)
je     1199 <UnQuote+0x69>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmpb   $0x22,(%rbx)
jne    1199 <UnQuote+0x69>
movslq %eax,%rsi
cmpb   $0x22,-0x1(%rsi,%rbx,1)
jne    1199 <UnQuote+0x69>
lea    0x1(%rbx),%rdx
xor    %ecx,%ecx
mov    $0x22,%al
jmp    117a <UnQuote+0x4a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
movzbl (%rdx),%eax
add    $0x1,%rdx
cmp    $0x22,%al
je     1170 <UnQuote+0x40>
test   %al,%al
jne    1173 <UnQuote+0x43>
cmp    $0x2,%ecx
jne    1199 <UnQuote+0x69>
movb   $0x0,-0x1(%rbx,%rsi,1)
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>
pop    %rbx
ret

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

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