#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 EOF;
int getchar();
int /*<<< orphan*/ putnonblank(int);
void afterquote() {
  int c;
  putnonblank('"');
  while ((c = getchar()) != EOF && c != '"' && c != '\n') {
    putnonblank(c);
    if (c == '\\')
      if ((c = getchar()) != EOF)
        putnonblank(c);
  }
  if (c != EOF)
    putnonblank(c);
}


x86 assembly (clang, -O0):
<afterquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x22,%edi
call   1030 <putnonblank@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ea1(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     116b <afterquote+0x4b>
xor    %eax,%eax
cmpl   $0x22,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116b <afterquote+0x4b>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    117b <afterquote+0x5b>
jmp    11b8 <afterquote+0x98>
mov    -0x4(%rbp),%edi
call   1030 <putnonblank@plt>
cmpl   $0x5c,-0x4(%rbp)
jne    11b3 <afterquote+0x93>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e4a(%rip),%rcx
cmp    (%rcx),%eax
je     11ae <afterquote+0x8e>
mov    -0x4(%rbp),%edi
call   1030 <putnonblank@plt>
jmp    11b3 <afterquote+0x93>
jmp    1132 <afterquote+0x12>
mov    -0x4(%rbp),%eax
mov    0x2e26(%rip),%rcx
cmp    (%rcx),%eax
je     11d2 <afterquote+0xb2>
mov    -0x4(%rbp),%edi
call   1030 <putnonblank@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afterquote>:
push   %r14
push   %rbx
push   %rax
mov    $0x22,%edi
call   1030 <putnonblank@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eac(%rip),%r14
cmp    (%r14),%eax
jne    1149 <afterquote+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    115e <afterquote+0x3e>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1141 <afterquote+0x21>
cmp    $0xa,%ebx
je     1189 <afterquote+0x69>
cmp    $0x22,%ebx
je     1189 <afterquote+0x69>
mov    %ebx,%edi
call   1030 <putnonblank@plt>
cmp    $0x5c,%ebx
jne    1150 <afterquote+0x30>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1150 <afterquote+0x30>
mov    %eax,%edi
call   1030 <putnonblank@plt>
jmp    1150 <afterquote+0x30>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putnonblank@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @afterquote() {
%1 = alloca i32
%2 = call i32 @putnonblank(i32 34)
br label %3
3: ; preds = %28, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 34
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 10
br label %13
13: ; preds = %10, %7, %3
%14 = phi i1 [ false, %7 ], [ false, %3 ], [ %12, %10 ]
br i1 %14, label %15, label %29
15: ; preds = %13
%16 = load i32, i32* %1
%17 = call i32 @putnonblank(i32 %16)
%18 = load i32, i32* %1
%19 = icmp eq i32 %18, 92
br i1 %19, label %20, label %28
20: ; preds = %15
%21 = call i32 (...) @getchar()
store i32 %21, i32* %1
%22 = load i32, i32* @EOF
%23 = icmp ne i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %1
%26 = call i32 @putnonblank(i32 %25)
br label %27
27: ; preds = %24, %20
br label %28
28: ; preds = %27, %15
br label %3
29: ; preds = %13
%30 = load i32, i32* %1
%31 = load i32, i32* @EOF
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load i32, i32* %1
%35 = call i32 @putnonblank(i32 %34)
br label %36
36: ; preds = %33, %29
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @afterquote() {
%1 = tail call i32 @putnonblank(i32 34)
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = freeze i32 %3
%5 = icmp eq i32 %2, %4
br i1 %5, label %24, label %6
6: ; preds = %0, %17
%7 = phi i32 [ %18, %17 ], [ %2, %0 ]
switch i32 %7, label %8 [
i32 34, label %22
i32 10, label %22
]
8: ; preds = %6
%9 = tail call i32 @putnonblank(i32 %7)
%10 = icmp eq i32 %7, 92
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = tail call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @putnonblank(i32 %12)
br label %17
17: ; preds = %11, %15, %8
%18 = tail call i32 (...) @getchar()
%19 = load i32, i32* @EOF
%20 = freeze i32 %19
%21 = icmp eq i32 %18, %20
br i1 %21, label %24, label %6
22: ; preds = %6, %6
%23 = tail call i32 @putnonblank(i32 %7)
br label %24
24: ; preds = %17, %0, %22
ret void
}