#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 *);
char *dequote(char *s) {
  int l;
  if (*s != '"')
    return (s);
  l = strlen(s);
  if (*(s + l - 1) == '"') {
    *(s + l - 1) = 0;
  }
  return (s + 1);
}


x86 assembly (clang, -O0):
<dequote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1139 <dequote+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <dequote+0x64>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1168 <dequote+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequote>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x22,(%rdi)
jne    1133 <dequote+0x23>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x1(%rbx,%rax,1)
jne    112f <dequote+0x1f>
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @dequote(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 34
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 34
br i1 %10, label %11, label %12
11: ; preds = %4
store i8 0, i8* %8
br label %12
12: ; preds = %11, %4
%13 = getelementptr inbounds i8, i8* %0, i64 1
br label %14
14: ; preds = %1, %12
%15 = phi i8* [ %13, %12 ], [ %0, %1 ]
ret i8* %15
}