#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 */
scalar_t__ isspace(unsigned char);
int readquote(const char **buffer, const char **s, size_t *l) {
  while (isspace((unsigned char)**buffer))
    (*buffer)++;
  if (**buffer != '"')
    return 0;
  (*buffer)++;
  *l = 0;
  *s = *buffer;
  while (**buffer != '"' && **buffer != '\0') {
    (*buffer)++;
    (*l)++;
  }
  if (**buffer != '"')
    return 0;
  (*buffer)++;
  return 1;
}


x86 assembly (clang, -O0):
<readquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1150 <readquote+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1124 <readquote+0x14>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     116f <readquote+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1226 <readquote+0x116>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x22,%ecx
mov    %al,-0x21(%rbp)
je     11c1 <readquote+0xb1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    11d1 <readquote+0xc1>
jmp    11f2 <readquote+0xe2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1196 <readquote+0x86>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1211 <readquote+0x101>
movl   $0x0,-0x4(%rbp)
jmp    1226 <readquote+0x116>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readquote>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%rax
movzbl (%rax),%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <isspace@plt>
test   %rax,%rax
je     114a <readquote+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%edi
jmp    1130 <readquote+0x20>
mov    (%rbx),%rcx
xor    %eax,%eax
cmpb   $0x22,(%rcx)
jne    1199 <readquote+0x89>
add    $0x1,%rcx
mov    %rcx,(%rbx)
movq   $0x0,(%r14)
mov    %rcx,(%r15)
mov    (%rbx),%rsi
mov    $0x1,%edx
nopl   (%rax)
movzbl -0x1(%rsi,%rdx,1),%ecx
test   %cl,%cl
je     1199 <readquote+0x89>
cmp    $0x22,%cl
je     118e <readquote+0x7e>
lea    (%rsi,%rdx,1),%rcx
mov    %rcx,(%rbx)
mov    %rdx,(%r14)
add    $0x1,%rdx
jmp    1170 <readquote+0x60>
add    %rdx,%rsi
mov    %rsi,(%rbx)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @readquote(i8** nocapture %0, i8** nocapture writeonly %1, i64* nocapture %2) {
%4 = load i8*, i8** %0
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 zeroext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %3, %8
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 zeroext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %3
%15 = load i8*, i8** %0
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 34
br i1 %17, label %18, label %30
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %19, i8** %0
store i64 0, i64* %2
store i8* %19, i8** %1
%20 = load i8*, i8** %0
br label %21
21: ; preds = %25, %18
%22 = phi i64 [ %27, %25 ], [ 0, %18 ]
%23 = phi i8* [ %26, %25 ], [ %20, %18 ]
%24 = load i8, i8* %23
switch i8 %24, label %25 [
i8 34, label %28
i8 0, label %30
]
25: ; preds = %21
%26 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %26, i8** %0
%27 = add i64 %22, 1
store i64 %27, i64* %2
br label %21
28: ; preds = %21
%29 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %29, i8** %0
br label %30
30: ; preds = %21, %14, %28
%31 = phi i32 [ 1, %28 ], [ 0, %14 ], [ 0, %21 ]
ret i32 %31
}