#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*/ memmove(char *, char *, int);
int strlen(char *);
int manifest_removeticks(char *string) {
  if ((string[0] == 39) || (string[0] == 34))
    memmove(string, string + 1, strlen(string));
  if ((string[(strlen(string) - 1)] == 39) ||
      (string[(strlen(string) - 1)] == 34))
    string[(strlen(string) - 1)] = 0;
  else if ((string[(strlen(string) - 2)] == 39) ||
           (string[(strlen(string) - 2)] == 34)) {
    string[(strlen(string) - 1)] = 0;
    string[(strlen(string) - 1)] = 0;
  } else if ((string[(strlen(string) - 1)] == ',') &&
             (string[(strlen(string) - 2)] != 34) &&
             (string[(strlen(string) - 2)] != 39))
    string[(strlen(string) - 1)] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<manifest_removeticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     114c <manifest_removeticks+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1178 <manifest_removeticks+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     11cc <manifest_removeticks+0xac>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    11f2 <manifest_removeticks+0xd2>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1336 <manifest_removeticks+0x216>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     1246 <manifest_removeticks+0x126>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    128d <manifest_removeticks+0x16d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1331 <manifest_removeticks+0x211>
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    132c <manifest_removeticks+0x20c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     132c <manifest_removeticks+0x20c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     132c <manifest_removeticks+0x20c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1331 <manifest_removeticks+0x211>
jmp    1336 <manifest_removeticks+0x216>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manifest_removeticks>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
cmp    $0x27,%al
je     1131 <manifest_removeticks+0x11>
cmp    $0x22,%al
jne    114a <manifest_removeticks+0x2a>
lea    0x1(%rbx),%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x27,-0x1(%rax,%rbx,1)
je     119d <manifest_removeticks+0x7d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x1(%rax,%rbx,1)
je     119d <manifest_removeticks+0x7d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x27,-0x2(%rax,%rbx,1)
je     118e <manifest_removeticks+0x6e>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x2(%rax,%rbx,1)
jne    11b6 <manifest_removeticks+0x96>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x2c,-0x1(%rax,%rbx,1)
jne    11ac <manifest_removeticks+0x8c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x2(%rax,%rbx,1)
je     11ac <manifest_removeticks+0x8c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x27,-0x2(%rax,%rbx,1)
jne    119d <manifest_removeticks+0x7d>
jmp    11ac <manifest_removeticks+0x8c>

LLVM IR (-O0):
define i32 @manifest_removeticks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 39
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 34
br i1 %13, label %14, label %21
14: ; preds = %8, %1
%15 = load i8*, i8** %2
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8*, i8** %2
%19 = call i32 @strlen(i8* %18)
%20 = call i32 @memmove(i8* %15, i8* %17, i32 %19)
br label %21
21: ; preds = %14, %8
%22 = load i8*, i8** %2
%23 = load i8*, i8** %2
%24 = call i32 @strlen(i8* %23)
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 39
br i1 %30, label %41, label %31
31: ; preds = %21
%32 = load i8*, i8** %2
%33 = load i8*, i8** %2
%34 = call i32 @strlen(i8* %33)
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %32, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 34
br i1 %40, label %41, label %48
41: ; preds = %31, %21
%42 = load i8*, i8** %2
%43 = load i8*, i8** %2
%44 = call i32 @strlen(i8* %43)
%45 = sub nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %42, i64 %46
store i8 0, i8* %47
br label %120
48: ; preds = %31
%49 = load i8*, i8** %2
%50 = load i8*, i8** %2
%51 = call i32 @strlen(i8* %50)
%52 = sub nsw i32 %51, 2
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %49, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 39
br i1 %57, label %68, label %58
58: ; preds = %48
%59 = load i8*, i8** %2
%60 = load i8*, i8** %2
%61 = call i32 @strlen(i8* %60)
%62 = sub nsw i32 %61, 2
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %59, i64 %63
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 34
br i1 %67, label %68, label %81
68: ; preds = %58, %48
%69 = load i8*, i8** %2
%70 = load i8*, i8** %2
%71 = call i32 @strlen(i8* %70)
%72 = sub nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %69, i64 %73
store i8 0, i8* %74
%75 = load i8*, i8** %2
%76 = load i8*, i8** %2
%77 = call i32 @strlen(i8* %76)
%78 = sub nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %75, i64 %79
store i8 0, i8* %80
br label %119
81: ; preds = %58
%82 = load i8*, i8** %2
%83 = load i8*, i8** %2
%84 = call i32 @strlen(i8* %83)
%85 = sub nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %82, i64 %86
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 44
br i1 %90, label %91, label %118
91: ; preds = %81
%92 = load i8*, i8** %2
%93 = load i8*, i8** %2
%94 = call i32 @strlen(i8* %93)
%95 = sub nsw i32 %94, 2
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %92, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp ne i32 %99, 34
br i1 %100, label %101, label %118
101: ; preds = %91
%102 = load i8*, i8** %2
%103 = load i8*, i8** %2
%104 = call i32 @strlen(i8* %103)
%105 = sub nsw i32 %104, 2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %102, i64 %106
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp ne i32 %109, 39
br i1 %110, label %111, label %118
111: ; preds = %101
%112 = load i8*, i8** %2
%113 = load i8*, i8** %2
%114 = call i32 @strlen(i8* %113)
%115 = sub nsw i32 %114, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %112, i64 %116
store i8 0, i8* %117
br label %118
118: ; preds = %111, %101, %91, %81
br label %119
119: ; preds = %118, %68
br label %120
120: ; preds = %119, %41
ret i32 0
}

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