#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();
int main(void) {
  int ch;
  int counter = 0;
  while ((ch = getchar()) != EOF) {
    if (ch != '\n')
      continue;
    ch = getchar();
    switch (ch) {
    case EOF:
      return 0;
    case '\n':
      while ((ch = getchar()) == '\n')
        if (counter++ >= 255)
          return 1;
      if (ch == EOF)
        return 1;
      else
        return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x80,%eax
je     11f0 <main+0xe0>
cmpl   $0xa,-0x8(%rbp)
je     114a <main+0x3a>
jmp    1126 <main+0x16>
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xa,%eax
je     1187 <main+0x77>
jmp    1168 <main+0x58>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
jne    11eb <main+0xdb>
jmp    117b <main+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <main+0xe7>
jmp    118c <main+0x7c>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
jne    11c6 <main+0xb6>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xff,%eax
jl     11c1 <main+0xb1>
movl   $0x1,-0x4(%rbp)
jmp    11f7 <main+0xe7>
jmp    118c <main+0x7c>
cmpl   $0x80,-0x8(%rbp)
jne    11df <main+0xcf>
movl   $0x1,-0x4(%rbp)
jmp    11f7 <main+0xe7>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <main+0xe7>
jmp    1126 <main+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
jmp    112c <main+0x1c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%ebx
cmp    $0x80,%eax
je     1186 <main+0x76>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1120 <main+0x10>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x80,%eax
je     1186 <main+0x76>
cmp    $0xa,%eax
jne    112c <main+0x1c>
mov    $0x100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1178 <main+0x68>
add    $0xffffffff,%ebx
jne    1160 <main+0x50>
mov    $0x1,%ebx
jmp    1186 <main+0x76>
mov    $0x1,%ebx
cmp    $0x80,%eax
je     1186 <main+0x76>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %30, %10, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 128
br i1 %6, label %7, label %31
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
br label %4
11: ; preds = %7
%12 = call i32 (...) @getchar()
store i32 %12, i32* %2
%13 = load i32, i32* %2
switch i32 %13, label %30 [
i32 128, label %14
i32 10, label %15
]
14: ; preds = %11
store i32 0, i32* %1
br label %32
15: ; preds = %11
br label %16
16: ; preds = %24, %15
%17 = call i32 (...) @getchar()
store i32 %17, i32* %2
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
%22 = icmp sge i32 %20, 255
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %1
br label %32
24: ; preds = %19
br label %16
25: ; preds = %16
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 128
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %1
br label %32
29: ; preds = %25
store i32 0, i32* %1
br label %32
30: ; preds = %11
br label %4
31: ; preds = %4
store i32 1, i32* %1
br label %32
32: ; preds = %31, %29, %28, %23, %14
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %5 [
i32 128, label %13
i32 10, label %3
]
3: ; preds = %1
%4 = tail call i32 (...) @getchar()
switch i32 %4, label %5 [
i32 128, label %13
i32 10, label %6
]
5: ; preds = %3, %1
br label %1
6: ; preds = %3, %9
%7 = phi i32 [ %10, %9 ], [ 0, %3 ]
%8 = tail call i32 (...) @getchar()
switch i32 %8, label %13 [
i32 10, label %9
i32 128, label %12
]
9: ; preds = %6
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, 256
br i1 %11, label %12, label %6
12: ; preds = %9, %6
br label %13
13: ; preds = %1, %3, %6, %12
%14 = phi i32 [ 1, %12 ], [ 0, %6 ], [ 1, %1 ], [ 0, %3 ]
ret i32 %14
}