#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 */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
void consume_quoted_string() {
  char c;
  while ((c = getchar()) != EOF) {
    putchar(c);
    if (c == '"') {
      break;
    }
    if (c == '\\') {
      putchar(getchar());
    }
  }
}


x86 assembly (clang, -O0):
<consume_quoted_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    0x2eac(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1183 <consume_quoted_string+0x63>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
jne    1162 <consume_quoted_string+0x42>
jmp    1183 <consume_quoted_string+0x63>
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
jne    117e <consume_quoted_string+0x5e>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1128 <consume_quoted_string+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_quoted_string>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1172 <consume_quoted_string+0x52>
mov    %eax,%ebx
jmp    115d <consume_quoted_string+0x3d>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1172 <consume_quoted_string+0x52>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    $0x5c,%bpl
je     1140 <consume_quoted_string+0x20>
cmp    $0x22,%bl
jne    114f <consume_quoted_string+0x2f>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @consume_quoted_string() {
%1 = alloca i8
br label %2
2: ; preds = %22, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i8, i8* %1
%10 = call i32 @putchar(i8 signext %9)
%11 = load i8, i8* %1
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 34
br i1 %13, label %14, label %15
14: ; preds = %8
br label %23
15: ; preds = %8
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call signext i8 (...) @getchar()
%21 = call i32 @putchar(i8 signext %20)
br label %22
22: ; preds = %19, %15
br label %2
23: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @consume_quoted_string() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %10
%5 = phi i8 [ %11, %10 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i8 signext %5)
switch i8 %5, label %10 [
i8 34, label %14
i8 92, label %7
]
7: ; preds = %4
%8 = tail call signext i8 (...) @getchar()
%9 = tail call i32 @putchar(i8 signext %8)
br label %10
10: ; preds = %4, %7
%11 = tail call signext i8 (...) @getchar()
%12 = load i8, i8* @EOF
%13 = icmp eq i8 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %10, %4, %0
ret void
}