#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 *);
int isQuoted(char *s) {
  int i;
  if (s != NULL) {
    if ((i = strlen(s)) > 1) {
      if ((s[0] == '\'' && s[i - 1] == '\'') ||
          (s[0] == '"' && s[i - 1] == '"')) {
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isQuoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a6 <isQuoted+0x96>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x1,%eax
jle    11a1 <isQuoted+0x91>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    1166 <isQuoted+0x56>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     1190 <isQuoted+0x80>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    119c <isQuoted+0x8c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    119c <isQuoted+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    11ad <isQuoted+0x9d>
jmp    11a1 <isQuoted+0x91>
jmp    11a6 <isQuoted+0x96>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isQuoted>:
push   %rbx
test   %rdi,%rdi
je     114d <isQuoted+0x3d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     114d <isQuoted+0x3d>
mov    (%rbx),%cl
cmp    $0x22,%cl
je     113f <isQuoted+0x2f>
cmp    $0x27,%cl
jne    114d <isQuoted+0x3d>
add    $0xffffffff,%eax
mov    $0x1,%ecx
cmpb   $0x27,(%rbx,%rax,1)
jne    114d <isQuoted+0x3d>
jmp    114f <isQuoted+0x3f>
add    $0xffffffff,%eax
mov    $0x1,%ecx
cmpb   $0x22,(%rbx,%rax,1)
je     114f <isQuoted+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isQuoted(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %44
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %43
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 39
br i1 %16, label %17, label %26
17: ; preds = %11
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 39
br i1 %25, label %41, label %26
26: ; preds = %17, %11
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 34
br i1 %31, label %32, label %42
32: ; preds = %26
%33 = load i8*, i8** %3
%34 = load i32, i32* %4
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, 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 %42
41: ; preds = %32, %17
store i32 1, i32* %2
br label %45
42: ; preds = %32, %26
br label %43
43: ; preds = %42, %7
br label %44
44: ; preds = %43, %1
store i32 0, i32* %2
br label %45
45: ; preds = %44, %41
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
define i32 @isQuoted(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i8, i8* %0
switch i8 %7, label %20 [
i8 39, label %8
i8 34, label %14
]
8: ; preds = %6
%9 = add nsw i32 %4, -1
%10 = zext 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 %21, label %20
14: ; preds = %6
%15 = add nsw i32 %4, -1
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 34
br i1 %19, label %21, label %20
20: ; preds = %6, %8, %3, %14, %1
br label %21
21: ; preds = %8, %14, %20
%22 = phi i32 [ 0, %20 ], [ 1, %14 ], [ 1, %8 ]
ret i32 %22
}