#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*/ printf(char *);
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  int n_char, n_paren, n_continue;
  n_continue = 0;
  printf("\n    ");
  n_char = 4;
  while ((c = getchar()) != EOF) {
    if (c == '#') {
      printf("\n    ");
      n_char = 4;
      n_continue = 0;
      n_paren = 0;
    } else if (c == '\\') {
      if ((c = getchar()) == '\n') {
        if ((c = getchar()) == '#') {
          printf("\n    ");
          n_char = 4;
          n_continue = 0;
          n_paren = 0;
        }
      }
    }
    if (n_char >= 65 && c != ')' && n_paren > 0) {
      printf("&\n");
      n_continue += 1;
      if (n_continue >= 39) {
        printf("!***** WARNING: continue lines > MAX_CONTINUE *****\n");
        n_continue = 0;
      }
      printf("&    ");
      n_char = 5;
      n_paren = 0;
    }
    if (c != ' ' && c != '\n' && c != '#') {
      putchar(c);
      n_char += 1;
    }
    if (n_char >= 65 && c == ')')
      n_paren += 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x4,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
je     12bd <main+0x18d>
cmpl   $0x23,-0x8(%rbp)
jne    11a2 <main+0x72>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1202 <main+0xd2>
cmpl   $0x5c,-0x8(%rbp)
jne    11fd <main+0xcd>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
jne    11f8 <main+0xc8>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x23,%eax
jne    11f3 <main+0xc3>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    11f8 <main+0xc8>
jmp    11fd <main+0xcd>
jmp    1202 <main+0xd2>
cmpl   $0x41,-0xc(%rbp)
jl     126c <main+0x13c>
cmpl   $0x29,-0x8(%rbp)
je     126c <main+0x13c>
cmpl   $0x0,-0x10(%rbp)
jle    126c <main+0x13c>
lea    0xddf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x27,-0x14(%rbp)
jl     1252 <main+0x122>
lea    0xdc3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
lea    0xde5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     129b <main+0x16b>
cmpl   $0xa,-0x8(%rbp)
je     129b <main+0x16b>
cmpl   $0x23,-0x8(%rbp)
je     129b <main+0x16b>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     12b8 <main+0x188>
cmpl   $0x29,-0x8(%rbp)
jne    12b8 <main+0x188>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e83(%rip),%rbx
cmp    (%rbx),%eax
jne    117a <main+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
mov    $0x4,%r12d
movabs $0x900000400,%r15
xor    %r14d,%r14d
jmp    11df <main+0x9f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe59(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4,%r12d
mov    $0x23,%ebp
xor    %r14d,%r14d
xor    %r13d,%r13d
cmp    $0x41,%r12d
setge  %al
cmp    $0x29,%ebp
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    %eax,%r13d
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
cmp    (%rbx),%eax
je     1169 <main+0x29>
cmp    $0x5c,%ebp
je     11f0 <main+0xb0>
cmp    $0x23,%ebp
je     11a0 <main+0x60>
jmp    1210 <main+0xd0>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
cmp    $0xa,%eax
jne    1210 <main+0xd0>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
cmp    $0x23,%eax
je     11a0 <main+0x60>
nopl   0x0(%rax)
cmp    $0x41,%r12d
jl     125c <main+0x11c>
cmp    $0x29,%ebp
je     125c <main+0x11c>
test   %r13d,%r13d
jle    125c <main+0x11c>
lea    0xde5(%rip),%rdi
call   1040 <puts@plt>
cmp    $0x26,%r14d
jge    1238 <main+0xf8>
add    $0x1,%r14d
jmp    1247 <main+0x107>
lea    0xdcf(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
lea    0xdb8(%rip),%rdi
call   1050 <printf@plt>
xor    %r13d,%r13d
mov    $0x5,%r12d
cmp    $0x23,%ebp
ja     126d <main+0x12d>
mov    %ebp,%eax
bt     %rax,%r15
jb     11bd <main+0x7d>
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
jmp    11bd <main+0x7d>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A \00"
@EOF = global i32 0
@.str.1 = [3 x i8] c"&\0A\00"
@.str.2 = [53 x i8] c"!***** WARNING: continue lines > MAX_CONTINUE *****\0A\00"
@.str.3 = [6 x i8] c"& \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 4, i32* %3
br label %7
7: ; preds = %72, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %73
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 35
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 4, i32* %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %30
16: ; preds = %11
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = call i32 (...) @getchar()
store i32 %20, i32* %2
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = call i32 (...) @getchar()
store i32 %23, i32* %2
%24 = icmp eq i32 %23, 35
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 4, i32* %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %27
27: ; preds = %25, %22
br label %28
28: ; preds = %27, %19
br label %29
29: ; preds = %28, %16
br label %30
30: ; preds = %29, %14
%31 = load i32, i32* %3
%32 = icmp sge i32 %31, 65
br i1 %32, label %33, label %49
33: ; preds = %30
%34 = load i32, i32* %2
%35 = icmp ne i32 %34, 41
br i1 %35, label %36, label %49
36: ; preds = %33
%37 = load i32, i32* %4
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %49
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
%43 = load i32, i32* %5
%44 = icmp sge i32 %43, 39
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %47
47: ; preds = %45, %39
%48 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 5, i32* %3
store i32 0, i32* %4
br label %49
49: ; preds = %47, %36, %33, %30
%50 = load i32, i32* %2
%51 = icmp ne i32 %50, 32
br i1 %51, label %52, label %63
52: ; preds = %49
%53 = load i32, i32* %2
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %63
55: ; preds = %52
%56 = load i32, i32* %2
%57 = icmp ne i32 %56, 35
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = load i32, i32* %2
%60 = call i32 @putchar(i32 %59)
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %63
63: ; preds = %58, %55, %52, %49
%64 = load i32, i32* %3
%65 = icmp sge i32 %64, 65
br i1 %65, label %66, label %72
66: ; preds = %63
%67 = load i32, i32* %2
%68 = icmp eq i32 %67, 41
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %72
72: ; preds = %69, %66, %63
br label %7
73: ; preds = %7
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A \00"
@EOF = global i32 0
@.str.3 = [6 x i8] c"& \00"
@str = [2 x i8] c"&\00"
@str.4 = [52 x i8] c"!***** WARNING: continue lines > MAX_CONTINUE *****\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %56, label %5
5: ; preds = %0, %43
%6 = phi i32 [ %53, %43 ], [ %2, %0 ]
%7 = phi i32 [ %44, %43 ], [ 0, %0 ]
%8 = phi i32 [ %52, %43 ], [ undef, %0 ]
%9 = phi i32 [ %47, %43 ], [ 4, %0 ]
switch i32 %6, label %20 [
i32 35, label %10
i32 92, label %12
]
10: ; preds = %5
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %43
12: ; preds = %5
%13 = tail call i32 (...) @getchar()
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = tail call i32 (...) @getchar()
%17 = icmp eq i32 %16, 35
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %43
20: ; preds = %5, %15, %12
%21 = phi i32 [ %16, %15 ], [ %13, %12 ], [ %6, %5 ]
%22 = icmp sgt i32 %9, 64
%23 = icmp ne i32 %21, 41
%24 = and i1 %22, %23
%25 = icmp sgt i32 %8, 0
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %36
27: ; preds = %20
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%29 = add nsw i32 %7, 1
%30 = icmp sgt i32 %7, 37
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %27
%34 = phi i32 [ 0, %31 ], [ %29, %27 ]
%35 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %33, %20
%37 = phi i32 [ 5, %33 ], [ %9, %20 ]
%38 = phi i32 [ 0, %33 ], [ %8, %20 ]
%39 = phi i32 [ %34, %33 ], [ %7, %20 ]
switch i32 %21, label %40 [
i32 35, label %43
i32 32, label %43
i32 10, label %43
]
40: ; preds = %36
%41 = tail call i32 @putchar(i32 %21)
%42 = add nsw i32 %37, 1
br label %43
43: ; preds = %10, %18, %36, %36, %36, %40
%44 = phi i32 [ %39, %40 ], [ %39, %36 ], [ %39, %36 ], [ %39, %36 ], [ 0, %18 ], [ 0, %10 ]
%45 = phi i32 [ %38, %40 ], [ %38, %36 ], [ %38, %36 ], [ %38, %36 ], [ 0, %18 ], [ 0, %10 ]
%46 = phi i32 [ %21, %40 ], [ %21, %36 ], [ %21, %36 ], [ %21, %36 ], [ 35, %18 ], [ 35, %10 ]
%47 = phi i32 [ %42, %40 ], [ %37, %36 ], [ %37, %36 ], [ %37, %36 ], [ 4, %18 ], [ 4, %10 ]
%48 = icmp sgt i32 %47, 64
%49 = icmp eq i32 %46, 41
%50 = and i1 %49, %48
%51 = zext i1 %50 to i32
%52 = add nsw i32 %45, %51
%53 = tail call i32 (...) @getchar()
%54 = load i32, i32* @EOF
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %5
56: ; preds = %43, %0
ret i32 0
}