char *gimmestr(char *s) {
  static char buf[32];
  char *p;
  p = buf;
  if (s[0] == '"' && s[1] == '"')
    return "";
  ++s;
  while (*s != '"')
    *p++ = *s++;
  *p = 0;
  return buf;
}


x86 assembly (clang, -O0):
<gimmestr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
lea    0x2f21(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1144 <gimmestr+0x44>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x22,%eax
jne    1144 <gimmestr+0x44>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <gimmestr+0x99>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1187 <gimmestr+0x87>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1150 <gimmestr+0x50>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2e9b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gimmestr>:
mov    0x1(%rdi),%al
cmpb   $0x22,(%rdi)
jne    1114 <gimmestr+0x14>
cmp    $0x22,%al
jne    1121 <gimmestr+0x21>
lea    0xeed(%rip),%rax
ret
cmp    $0x22,%al
jne    1121 <gimmestr+0x21>
lea    0x2f11(%rip),%rcx
jmp    1141 <gimmestr+0x41>
add    $0x2,%rdi
lea    0x2f04(%rip),%rcx
nopl   0x0(%rax)
mov    %al,(%rcx)
add    $0x1,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0x22,%al
jne    1130 <gimmestr+0x30>
movb   $0x0,(%rcx)
lea    0x2ee5(%rip),%rax
ret

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

LLVM IR (-O2):
@gimmestr.buf = internal global [32 x i8] zeroinitializer
@.str = [1 x i8] zeroinitializer
define i8* @gimmestr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 34
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 34
br i1 %3, label %7, label %8
7: ; preds = %1
br i1 %6, label %21, label %9
8: ; preds = %1
br i1 %6, label %19, label %9
9: ; preds = %7, %8
%10 = getelementptr inbounds i8, i8* %0, i64 1
br label %11
11: ; preds = %9, %11
%12 = phi i8 [ %17, %11 ], [ %5, %9 ]
%13 = phi i8* [ %16, %11 ], [ %10, %9 ]
%14 = phi i8* [ %15, %11 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @gimmestr.buf, i64 0, i64 0), %9 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %12, i8* %14
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 34
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @gimmestr.buf, i64 0, i64 0), %8 ], [ %15, %11 ]
store i8 0, i8* %20
br label %21
21: ; preds = %7, %19
%22 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @gimmestr.buf, i64 0, i64 0), %19 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %22
}