#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 getchar();
scalar_t__ isspace(char);
char *getcppline() {
  int c;
  static char buf[2048];
  char *p;
  p = buf;
  do {
    switch (c = getchar()) {
    case ' ':
      if (p != buf)
        *p++ = c;
      break;
    case EOF:
      if (p == buf)
        return (char *)NULL;
    case '\n':
      *p = '\0';
      break;
    case ']':
      if ((p != buf) && (*(p - 1) == '\\')) {
        *(p - 1) = c;
        c = ' ';
      } else
        *p = '\0';
      break;
    default:
      *p++ = c;
    }
  } while (c != EOF && c != '\n' && c != ']');
  while (--p >= buf && isspace(*p))
    *p = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<getcppline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x2f11(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
sub    $0xa,%eax
je     11d4 <getcppline+0xb4>
jmp    1150 <getcppline+0x30>
mov    -0x1c(%rbp),%eax
sub    $0x20,%eax
je     1185 <getcppline+0x65>
jmp    1161 <getcppline+0x41>
mov    -0x1c(%rbp),%eax
sub    $0x5d,%eax
je     11e0 <getcppline+0xc0>
jmp    1172 <getcppline+0x52>
mov    -0x1c(%rbp),%eax
sub    $0x80,%eax
je     11b1 <getcppline+0x91>
jmp    1226 <getcppline+0x106>
lea    0x2eb4(%rip),%rax
cmp    %rax,-0x18(%rbp)
je     11ac <getcppline+0x8c>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    123c <getcppline+0x11c>
lea    0x2e88(%rip),%rax
cmp    %rax,-0x18(%rbp)
jne    11cf <getcppline+0xaf>
movq   $0x0,-0x8(%rbp)
jmp    12da <getcppline+0x1ba>
jmp    11d4 <getcppline+0xb4>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    123c <getcppline+0x11c>
lea    0x2e59(%rip),%rax
cmp    %rax,-0x18(%rbp)
je     121a <getcppline+0xfa>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
jne    121a <getcppline+0xfa>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,-0x1(%rax)
movl   $0x20,-0xc(%rbp)
jmp    1221 <getcppline+0x101>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    123c <getcppline+0x11c>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1241 <getcppline+0x121>
xor    %eax,%eax
cmpl   $0x80,-0xc(%rbp)
mov    %al,-0x1d(%rbp)
je     126c <getcppline+0x14c>
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0x1d(%rbp)
je     126c <getcppline+0x14c>
cmpl   $0x5d,-0xc(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1133 <getcppline+0x13>
jmp    127c <getcppline+0x15c>
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
lea    0x2daf(%rip),%rdx
cmp    %rdx,%rcx
mov    %al,-0x1e(%rbp)
jb     12b3 <getcppline+0x193>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    12c3 <getcppline+0x1a3>
jmp    12cf <getcppline+0x1af>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    127c <getcppline+0x15c>
lea    0x2d6a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcppline>:
push   %r15
push   %r14
push   %rbx
lea    0x2f14(%rip),%r15
xor    %r14d,%r14d
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x5c,%eax
jg     1170 <getcppline+0x50>
cmp    $0xa,%eax
je     1185 <getcppline+0x65>
cmp    $0x20,%eax
jne    11b0 <getcppline+0x90>
mov    $0x20,%eax
cmp    %r15,%rbx
je     11cd <getcppline+0xad>
movb   $0x20,(%rbx)
jmp    11b2 <getcppline+0x92>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x5d,%eax
je     1190 <getcppline+0x70>
cmp    $0x80,%eax
jne    11b0 <getcppline+0x90>
cmp    %r15,%rbx
je     1219 <getcppline+0xf9>
movb   $0x0,(%rbx)
cmp    $0xa,%eax
jne    11bb <getcppline+0x9b>
jmp    11da <getcppline+0xba>
nop
cmp    %r15,%rbx
je     11d7 <getcppline+0xb7>
cmpb   $0x5c,-0x1(%rbx)
jne    11d7 <getcppline+0xb7>
movb   $0x5d,-0x1(%rbx)
mov    $0x20,%eax
cmp    $0xa,%eax
jne    11bb <getcppline+0x9b>
jmp    11da <getcppline+0xba>
nopl   0x0(%rax,%rax,1)
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%eax
je     11da <getcppline+0xba>
cmp    $0x80,%eax
je     11da <getcppline+0xba>
cmp    $0x5d,%eax
jne    1140 <getcppline+0x20>
jmp    11da <getcppline+0xba>
mov    %r15,%rbx
cmp    $0xa,%eax
jne    11bb <getcppline+0x9b>
jmp    11da <getcppline+0xba>
movb   $0x0,(%rbx)
add    $0xffffffffffffffff,%rbx
lea    0x2e5b(%rip),%r14
cmp    %r14,%rbx
jb     1219 <getcppline+0xf9>
lea    0x2e4f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1219 <getcppline+0xf9>
movb   $0x0,(%rbx)
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1200 <getcppline+0xe0>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@getcppline.buf = internal global [2048 x i8] zeroinitializer
define i8* @getcppline() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i8*
store i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %54, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
switch i32 %5, label %39 [
i32 32, label %6
i32 128, label %15
i32 10, label %20
i32 93, label %22
]
6: ; preds = %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 %11, i8* %12
br label %14
14: ; preds = %9, %6
br label %44
15: ; preds = %4
%16 = load i8*, i8** %3
%17 = icmp eq i8* %16, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %17, label %18, label %19
18: ; preds = %15
store i8* null, i8** %1
br label %71
19: ; preds = %15
br label %20
20: ; preds = %4, %19
%21 = load i8*, i8** %3
store i8 0, i8* %21
br label %44
22: ; preds = %4
%23 = load i8*, i8** %3
%24 = icmp ne i8* %23, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 -1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 92
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = load i32, i32* %2
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 -1
store i8 %33, i8* %35
store i32 32, i32* %2
br label %38
36: ; preds = %25, %22
%37 = load i8*, i8** %3
store i8 0, i8* %37
br label %38
38: ; preds = %36, %31
br label %44
39: ; preds = %4
%40 = load i32, i32* %2
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %3
store i8 %41, i8* %42
br label %44
44: ; preds = %39, %38, %20, %14
br label %45
45: ; preds = %44
%46 = load i32, i32* %2
%47 = icmp ne i32 %46, 128
br i1 %47, label %48, label %54
48: ; preds = %45
%49 = load i32, i32* %2
%50 = icmp ne i32 %49, 10
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* %2
%53 = icmp ne i32 %52, 93
br label %54
54: ; preds = %51, %48, %45
%55 = phi i1 [ false, %48 ], [ false, %45 ], [ %53, %51 ]
br i1 %55, label %4, label %56
56: ; preds = %54
br label %57
57: ; preds = %68, %56
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i32 -1
store i8* %59, i8** %3
%60 = icmp uge i8* %59, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %60, label %61, label %66
61: ; preds = %57
%62 = load i8*, i8** %3
%63 = load i8, i8* %62
%64 = call i64 @isspace(i8 signext %63)
%65 = icmp ne i64 %64, 0
br label %66
66: ; preds = %61, %57
%67 = phi i1 [ false, %57 ], [ %65, %61 ]
br i1 %67, label %68, label %70
68: ; preds = %66
%69 = load i8*, i8** %3
store i8 0, i8* %69
br label %57
70: ; preds = %66
store i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), i8** %1
br label %71
71: ; preds = %70, %18
%72 = load i8*, i8** %1
ret i8* %72
}

LLVM IR (-O2):
@getcppline.buf = internal global [2048 x i8] zeroinitializer
define i8* @getcppline() {
br label %1
1: ; preds = %22, %0
%2 = phi i8* [ getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), %0 ], [ %24, %22 ]
%3 = tail call i32 (...) @getchar()
switch i32 %3, label %19 [
i32 32, label %4
i32 128, label %8
i32 10, label %10
i32 93, label %11
]
4: ; preds = %1
%5 = icmp eq i8* %2, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %5, label %22, label %6
6: ; preds = %4
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8 32, i8* %2
br label %22
8: ; preds = %1
%9 = icmp eq i8* %2, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %9, label %37, label %10
10: ; preds = %8, %1
store i8 0, i8* %2
br label %22
11: ; preds = %1
%12 = icmp eq i8* %2, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = getelementptr inbounds i8, i8* %2, i64 -1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 92
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 93, i8* %14
br label %22
18: ; preds = %11, %13
store i8 0, i8* %2
br label %25
19: ; preds = %1
%20 = trunc i32 %3 to i8
%21 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %20, i8* %2
br label %22
22: ; preds = %10, %19, %6, %4, %17
%23 = phi i32 [ %3, %19 ], [ 32, %17 ], [ %3, %10 ], [ 32, %6 ], [ 32, %4 ]
%24 = phi i8* [ %21, %19 ], [ %2, %17 ], [ %2, %10 ], [ %7, %6 ], [ getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), %4 ]
switch i32 %23, label %1 [
i32 128, label %25
i32 93, label %25
i32 10, label %25
]
25: ; preds = %22, %22, %22, %18
%26 = phi i8* [ %2, %18 ], [ %24, %22 ], [ %24, %22 ], [ %24, %22 ]
%27 = getelementptr inbounds i8, i8* %26, i64 -1
%28 = icmp ult i8* %27, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %28, label %37, label %29
29: ; preds = %25, %34
%30 = phi i8* [ %35, %34 ], [ %27, %25 ]
%31 = load i8, i8* %30
%32 = tail call i64 @isspace(i8 signext %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %29
store i8 0, i8* %30
%35 = getelementptr inbounds i8, i8* %30, i64 -1
%36 = icmp ult i8* %35, getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0)
br i1 %36, label %37, label %29
37: ; preds = %8, %34, %29, %25
%38 = phi i8* [ getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), %25 ], [ getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), %29 ], [ getelementptr inbounds ([2048 x i8], [2048 x i8]* @getcppline.buf, i64 0, i64 0), %34 ], [ null, %8 ]
ret i8* %38
}