#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 getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int c;
  long linelength = 0, linenumber = 1;
  while ((c = getc(stdin)) != EOF) {
    if (c != '\n') {
      if (c == '\t') {
        linelength += 8;
      } else {
        linelength++;
      }
    } else {
      if (linelength > 80)
        printf("%li\n", linenumber);
      linenumber++;
      linelength = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     11d0 <main+0xb0>
cmpl   $0xa,-0x14(%rbp)
je     119c <main+0x7c>
cmpl   $0x9,-0x14(%rbp)
jne    118b <main+0x6b>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1197 <main+0x77>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11cb <main+0xab>
cmpq   $0x50,-0x20(%rbp)
jle    11b7 <main+0x97>
mov    -0x28(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    0x2eb8(%rip),%r15
mov    (%r15),%edi
call   1040 <getc@plt>
mov    0x2ea1(%rip),%r12
cmp    (%r12),%eax
jne    1151 <main+0x31>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    $0x1,%r13d
xor    %ebx,%ebx
lea    0xea0(%rip),%r14
jmp    1184 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r13
xor    %ebx,%ebx
mov    (%r15),%edi
call   1040 <getc@plt>
cmp    (%r12),%eax
je     1145 <main+0x25>
cmp    $0xa,%eax
je     11a0 <main+0x80>
cmp    $0x9,%eax
jne    11c0 <main+0xa0>
add    $0x8,%rbx
jmp    1176 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x51,%rbx
jl     1170 <main+0x50>
mov    %r14,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
jmp    1176 <main+0x56>

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
@.str = [5 x i8] c"%li\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %7
store i64 1, i64* %8
br label %9
9: ; preds = %36, %2
%10 = load i32, i32* @stdin
%11 = call i32 @getc(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %37
14: ; preds = %9
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 9
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i64, i64* %7
%22 = add nsw i64 %21, 8
store i64 %22, i64* %7
br label %26
23: ; preds = %17
%24 = load i64, i64* %7
%25 = add nsw i64 %24, 1
store i64 %25, i64* %7
br label %26
26: ; preds = %23, %20
br label %36
27: ; preds = %14
%28 = load i64, i64* %7
%29 = icmp sgt i64 %28, 80
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i64, i64* %8
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %31)
br label %33
33: ; preds = %30, %27
%34 = load i64, i64* %8
%35 = add nsw i64 %34, 1
store i64 %35, i64* %8
store i64 0, i64* %7
br label %36
36: ; preds = %33, %26
br label %9
37: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@.str = [5 x i8] c"%li\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @getc(i32 %3)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %28, label %7
7: ; preds = %2, %21
%8 = phi i32 [ %25, %21 ], [ %4, %2 ]
%9 = phi i64 [ %23, %21 ], [ 1, %2 ]
%10 = phi i64 [ %22, %21 ], [ 0, %2 ]
switch i32 %8, label %13 [
i32 10, label %15
i32 9, label %11
]
11: ; preds = %7
%12 = add nsw i64 %10, 8
br label %21
13: ; preds = %7
%14 = add nsw i64 %10, 1
br label %21
15: ; preds = %7
%16 = icmp sgt i64 %10, 80
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %19
19: ; preds = %17, %15
%20 = add nsw i64 %9, 1
br label %21
21: ; preds = %11, %13, %19
%22 = phi i64 [ %12, %11 ], [ %14, %13 ], [ 0, %19 ]
%23 = phi i64 [ %9, %11 ], [ %9, %13 ], [ %20, %19 ]
%24 = load i32, i32* @stdin
%25 = tail call i32 @getc(i32 %24)
%26 = load i32, i32* @EOF
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %7
28: ; preds = %21, %2
ret i32 0
}