#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*/ free(char *);
char *strdup(char *);
void remove_quotes(char *s) {
  char *tmp = strdup(s);
  char *c;
  int i = 0;
  for (c = tmp; '\0' != *c; c++)
    switch (*c) {
    case '\'':
      break;
    default:
      s[i] = *c;
      i++;
    }
  s[i] = '\0';
  free(tmp);
}


x86 assembly (clang, -O0):
<remove_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     11a1 <remove_quotes+0x81>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
sub    $0x27,%al
jne    1171 <remove_quotes+0x51>
jmp    116c <remove_quotes+0x4c>
jmp    118b <remove_quotes+0x6b>
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1190 <remove_quotes+0x70>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <remove_quotes+0x28>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_quotes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strdup@plt>
xor    %ecx,%ecx
mov    %rax,%rdx
jmp    1144 <remove_quotes+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rdx
movzbl (%rdx),%ebx
cmp    $0x27,%bl
je     1140 <remove_quotes+0x20>
movslq %ecx,%rcx
test   %bl,%bl
je     115c <remove_quotes+0x3c>
mov    %bl,(%r14,%rcx,1)
add    $0x1,%ecx
jmp    1140 <remove_quotes+0x20>
movb   $0x0,(%r14,%rcx,1)
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @remove_quotes(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
br label %3
3: ; preds = %11, %1
%4 = phi i8* [ %2, %1 ], [ %13, %11 ]
%5 = phi i32 [ 0, %1 ], [ %12, %11 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %14
i8 39, label %11
]
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %6, i8* %9
%10 = add nsw i32 %5, 1
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ %5, %3 ]
%13 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
14: ; preds = %3
%15 = sext i32 %5 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %16
%17 = tail call i32 @free(i8* %2)
ret void
}