#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 getchar_no_eof();
int getchar_update_lineno();
int /*<<< orphan*/ putchar(int);
void copy_body(void) {
  int nesting = 0;
  while (1) {
    int c;
    c = getchar_no_eof();
    if (c == '}' && nesting == 0)
      return;
    putchar(c);
    switch (c) {
    default:
      break;
    case '{':
      ++nesting;
      break;
    case '}':
      --nesting;
      break;
    case '/':
      c = getchar_update_lineno();
      putchar(c);
      if (c == '/') {
        do {
          c = getchar_no_eof();
          putchar(c);
        } while (c != '\n');
      } else if (c == '*') {
        while (1) {
          c = getchar_no_eof();
          putchar(c);
          if (c == '*') {
            do {
              c = getchar_no_eof();
              putchar(c);
            } while (c == '*');
            if (c == '/')
              break;
          }
        }
      }
      break;
    case '"':
    case '\'': {
      int delim = c;
      do {
        c = getchar_no_eof();
        putchar(c);
        if (c == '\\') {
          c = getchar_no_eof();
          putchar(c);
          c = '\0';
        }
      } while (c != delim);
    } break;
    }
  }
}


x86 assembly (clang, -O0):
<copy_body>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x7d,-0x8(%rbp)
jne    1163 <copy_body+0x33>
cmpl   $0x0,-0x4(%rbp)
jne    1163 <copy_body+0x33>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x22,%eax
je     129a <copy_body+0x16a>
jmp    117f <copy_body+0x4f>
mov    -0x10(%rbp),%eax
sub    $0x27,%eax
je     129a <copy_body+0x16a>
jmp    1190 <copy_body+0x60>
mov    -0x10(%rbp),%eax
sub    $0x2f,%eax
je     11e4 <copy_body+0xb4>
jmp    11a1 <copy_body+0x71>
mov    -0x10(%rbp),%eax
sub    $0x7b,%eax
je     11c8 <copy_body+0x98>
jmp    11b2 <copy_body+0x82>
mov    -0x10(%rbp),%eax
sub    $0x7d,%eax
je     11d6 <copy_body+0xa6>
jmp    11c3 <copy_body+0x93>
jmp    12eb <copy_body+0x1bb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12eb <copy_body+0x1bb>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    12eb <copy_body+0x1bb>
mov    $0x0,%al
call   1050 <getchar_update_lineno@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x2f,-0x8(%rbp)
jne    1226 <copy_body+0xf6>
jmp    1205 <copy_body+0xd5>
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0xa,-0x8(%rbp)
jne    1205 <copy_body+0xd5>
jmp    1295 <copy_body+0x165>
cmpl   $0x2a,-0x8(%rbp)
jne    1290 <copy_body+0x160>
jmp    1235 <copy_body+0x105>
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x2a,-0x8(%rbp)
jne    1286 <copy_body+0x156>
jmp    1256 <copy_body+0x126>
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x2a,-0x8(%rbp)
je     1256 <copy_body+0x126>
cmpl   $0x2f,-0x8(%rbp)
jne    1281 <copy_body+0x151>
jmp    128b <copy_body+0x15b>
jmp    1286 <copy_body+0x156>
jmp    1235 <copy_body+0x105>
jmp    1290 <copy_body+0x160>
jmp    1295 <copy_body+0x165>
jmp    12eb <copy_body+0x1bb>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x5c,-0x8(%rbp)
jne    12d5 <copy_body+0x1a5>
mov    $0x0,%al
call   1040 <getchar_no_eof@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
jmp    12da <copy_body+0x1aa>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    12a0 <copy_body+0x170>
jmp    12eb <copy_body+0x1bb>
jmp    113f <copy_body+0xf>

x86 assembly (clang, -O2):
<copy_body>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
cmp    $0x7d,%eax
je     124b <copy_body+0x11b>
mov    %eax,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
cmp    $0x2e,%ebx
jle    1180 <copy_body+0x50>
cmp    $0x2f,%ebx
je     11bf <copy_body+0x8f>
cmp    $0x7b,%ebx
je     1227 <copy_body+0xf7>
cmp    $0x7d,%ebx
jne    1230 <copy_body+0x100>
add    $0xffffffff,%r14d
jmp    1230 <copy_body+0x100>
nopl   0x0(%rax)
cmp    $0x22,%ebx
je     1198 <copy_body+0x68>
cmp    $0x27,%ebx
je     1198 <copy_body+0x68>
jmp    1230 <copy_body+0x100>
nop
cmp    %ebx,%ebp
je     1230 <copy_body+0x100>
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0x5c,%ebp
jne    1190 <copy_body+0x60>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1190 <copy_body+0x60>
xor    %eax,%eax
call   1050 <getchar_update_lineno@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0x2f,%ebx
je     1210 <copy_body+0xe0>
cmp    $0x2a,%ebx
jne    1230 <copy_body+0x100>
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0x2a,%ebx
jne    11d9 <copy_body+0xa9>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0x2a,%ebx
je     11f0 <copy_body+0xc0>
cmp    $0x2f,%ebx
jne    11d9 <copy_body+0xa9>
jmp    1230 <copy_body+0x100>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0xa,%ebx
jne    1210 <copy_body+0xe0>
jmp    1230 <copy_body+0x100>
add    $0x1,%r14d
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar_no_eof@plt>
mov    %eax,%ebx
cmp    $0x7d,%eax
jne    1150 <copy_body+0x20>
test   %r14d,%r14d
jne    1150 <copy_body+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @copy_body() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %83
%5 = call i32 (...) @getchar_no_eof()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 125
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
ret void
12: ; preds = %8, %4
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
%15 = load i32, i32* %2
switch i32 %15, label %16 [
i32 123, label %17
i32 125, label %20
i32 47, label %23
i32 34, label %65
i32 39, label %65
]
16: ; preds = %12
br label %83
17: ; preds = %12
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %83
20: ; preds = %12
%21 = load i32, i32* %1
%22 = add nsw i32 %21, -1
store i32 %22, i32* %1
br label %83
23: ; preds = %12
%24 = call i32 (...) @getchar_update_lineno()
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = call i32 @putchar(i32 %25)
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 47
br i1 %28, label %29, label %38
29: ; preds = %23
br label %30
30: ; preds = %34, %29
%31 = call i32 (...) @getchar_no_eof()
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = call i32 @putchar(i32 %32)
br label %34
34: ; preds = %30
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 10
br i1 %36, label %30, label %37
37: ; preds = %34
br label %64
38: ; preds = %23
%39 = load i32, i32* %2
%40 = icmp eq i32 %39, 42
br i1 %40, label %41, label %63
41: ; preds = %38
br label %42
42: ; preds = %41, %61
%43 = call i32 (...) @getchar_no_eof()
store i32 %43, i32* %2
%44 = load i32, i32* %2
%45 = call i32 @putchar(i32 %44)
%46 = load i32, i32* %2
%47 = icmp eq i32 %46, 42
br i1 %47, label %48, label %61
48: ; preds = %42
br label %49
49: ; preds = %53, %48
%50 = call i32 (...) @getchar_no_eof()
store i32 %50, i32* %2
%51 = load i32, i32* %2
%52 = call i32 @putchar(i32 %51)
br label %53
53: ; preds = %49
%54 = load i32, i32* %2
%55 = icmp eq i32 %54, 42
br i1 %55, label %49, label %56
56: ; preds = %53
%57 = load i32, i32* %2
%58 = icmp eq i32 %57, 47
br i1 %58, label %59, label %60
59: ; preds = %56
br label %62
60: ; preds = %56
br label %61
61: ; preds = %60, %42
br label %42
62: ; preds = %59
br label %63
63: ; preds = %62, %38
br label %64
64: ; preds = %63, %37
br label %83
65: ; preds = %12, %12
%66 = load i32, i32* %2
store i32 %66, i32* %3
br label %67
67: ; preds = %78, %65
%68 = call i32 (...) @getchar_no_eof()
store i32 %68, i32* %2
%69 = load i32, i32* %2
%70 = call i32 @putchar(i32 %69)
%71 = load i32, i32* %2
%72 = icmp eq i32 %71, 92
br i1 %72, label %73, label %77
73: ; preds = %67
%74 = call i32 (...) @getchar_no_eof()
store i32 %74, i32* %2
%75 = load i32, i32* %2
%76 = call i32 @putchar(i32 %75)
store i32 0, i32* %2
br label %77
77: ; preds = %73, %67
br label %78
78: ; preds = %77
%79 = load i32, i32* %2
%80 = load i32, i32* %3
%81 = icmp ne i32 %79, %80
br i1 %81, label %67, label %82
82: ; preds = %78
br label %83
83: ; preds = %82, %64, %20, %17, %16
br label %4
}

LLVM IR (-O2):
define void @copy_body() {
%1 = tail call i32 (...) @getchar_no_eof()
%2 = icmp eq i32 %1, 125
br i1 %2, label %43, label %3
3: ; preds = %0, %37
%4 = phi i32 [ %39, %37 ], [ %1, %0 ]
%5 = phi i32 [ %38, %37 ], [ 0, %0 ]
%6 = tail call i32 @putchar(i32 %4)
switch i32 %4, label %37 [
i32 123, label %8
i32 125, label %10
i32 47, label %12
i32 34, label %7
i32 39, label %7
]
7: ; preds = %3, %3
br label %27
8: ; preds = %3
%9 = add nsw i32 %5, 1
br label %37
10: ; preds = %3
%11 = add nsw i32 %5, -1
br label %37
12: ; preds = %3
%13 = tail call i32 (...) @getchar_update_lineno()
%14 = tail call i32 @putchar(i32 %13)
switch i32 %13, label %37 [
i32 47, label %15
i32 42, label %19
]
15: ; preds = %12, %15
%16 = tail call i32 (...) @getchar_no_eof()
%17 = tail call i32 @putchar(i32 %16)
%18 = icmp eq i32 %16, 10
br i1 %18, label %37, label %15
19: ; preds = %12, %23
%20 = tail call i32 (...) @getchar_no_eof()
%21 = tail call i32 @putchar(i32 %20)
%22 = icmp eq i32 %20, 42
br i1 %22, label %24, label %23
23: ; preds = %24, %19
br label %19
24: ; preds = %19, %24
%25 = tail call i32 (...) @getchar_no_eof()
%26 = tail call i32 @putchar(i32 %25)
switch i32 %25, label %23 [
i32 42, label %24
i32 47, label %37
]
27: ; preds = %7, %34
%28 = tail call i32 (...) @getchar_no_eof()
%29 = tail call i32 @putchar(i32 %28)
%30 = icmp eq i32 %28, 92
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = tail call i32 (...) @getchar_no_eof()
%33 = tail call i32 @putchar(i32 %32)
br label %34
34: ; preds = %27, %31
%35 = phi i32 [ 0, %31 ], [ %28, %27 ]
%36 = icmp eq i32 %35, %4
br i1 %36, label %37, label %27
37: ; preds = %34, %15, %24, %8, %10, %3, %12
%38 = phi i32 [ %5, %3 ], [ %11, %10 ], [ %9, %8 ], [ %5, %12 ], [ %5, %24 ], [ %5, %15 ], [ %5, %34 ]
%39 = tail call i32 (...) @getchar_no_eof()
%40 = icmp eq i32 %39, 125
%41 = icmp eq i32 %38, 0
%42 = select i1 %40, i1 %41, i1 false
br i1 %42, label %43, label %3
43: ; preds = %37, %0
ret void
}