#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 */
#define EOF 128
int /*<<< orphan*/ do_destringify();
int /*<<< orphan*/ error(char *);
int getchar();
int /*<<< orphan*/ putchar(int);
void do_print(void) {
  int c;
  for (;;) {
    switch (c = getchar()) {
    case '@':
      if ((c = getchar()) == '@') {
        putchar('\n');
        return;
      } else if (c == '"') {
        do_destringify();
      } else {
        putchar('@');
        putchar(c);
      }
      break;
    case EOF:
      error("syntax error: unexpected EOF after @");
      break;
    default:
      putchar(c);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<do_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x40,%eax
je     1178 <do_print+0x38>
jmp    1165 <do_print+0x25>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
je     11cd <do_print+0x8d>
jmp    11de <do_print+0x9e>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x40,%eax
jne    119b <do_print+0x5b>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret
cmpl   $0x22,-0x4(%rbp)
jne    11b1 <do_print+0x71>
mov    $0x0,%al
call   1040 <do_destringify@plt>
jmp    11c3 <do_print+0x83>
mov    $0x40,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    11c8 <do_print+0x88>
jmp    11e6 <do_print+0xa6>
lea    0xe2c(%rip),%rdi
call   1060 <error@plt>
jmp    11e6 <do_print+0xa6>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1148 <do_print+0x8>

x86 assembly (clang, -O2):
<do_print>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rbx
jmp    1158 <do_print+0x18>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <error@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x80,%eax
je     1150 <do_print+0x10>
cmp    $0x40,%eax
jne    11a0 <do_print+0x60>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x22,%eax
je     11a9 <do_print+0x69>
mov    %eax,%ebp
cmp    $0x40,%eax
je     11b2 <do_print+0x72>
mov    $0x40,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
jmp    1158 <do_print+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1158 <do_print+0x18>
xor    %eax,%eax
call   1040 <do_destringify@plt>
jmp    1158 <do_print+0x18>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"syntax error: unexpected EOF after @\00"
define void @do_print() {
%1 = alloca i32
br label %2
2: ; preds = %25, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
switch i32 %3, label %22 [
i32 64, label %4
i32 128, label %20
]
4: ; preds = %2
%5 = call i32 (...) @getchar()
store i32 %5, i32* %1
%6 = icmp eq i32 %5, 64
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 @putchar(i32 10)
ret void
9: ; preds = %4
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 34
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @do_destringify()
br label %18
14: ; preds = %9
%15 = call i32 @putchar(i32 64)
%16 = load i32, i32* %1
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %14, %12
br label %19
19: ; preds = %18
br label %25
20: ; preds = %2
%21 = call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %25
22: ; preds = %2
%23 = load i32, i32* %1
%24 = call i32 @putchar(i32 %23)
br label %25
25: ; preds = %22, %20, %19
br label %2
}

LLVM IR (-O2):
@.str = [37 x i8] c"syntax error: unexpected EOF after @\00"
define void @do_print() {
br label %1
1: ; preds = %12, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %15 [
i32 64, label %3
i32 128, label %13
]
3: ; preds = %1
%4 = tail call i32 (...) @getchar()
switch i32 %4, label %9 [
i32 64, label %5
i32 34, label %7
]
5: ; preds = %3
%6 = tail call i32 @putchar(i32 10)
ret void
7: ; preds = %3
%8 = tail call i32 (...) @do_destringify()
br label %12
9: ; preds = %3
%10 = tail call i32 @putchar(i32 64)
%11 = tail call i32 @putchar(i32 %4)
br label %12
12: ; preds = %9, %7, %15, %13
br label %1
13: ; preds = %1
%14 = tail call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %12
15: ; preds = %1
%16 = tail call i32 @putchar(i32 %2)
br label %12
}