#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);
int main(int argc, char **argv) {
  int c, lines = 1;
  while ((c = getchar()) != EOF) {
    if (c > 127)
      printf("%i\n", lines);
    if (c == '\n')
      lines++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
je     1187 <main+0x67>
cmpl   $0x7f,-0x14(%rbp)
jle    116f <main+0x4f>
mov    -0x18(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xa,-0x14(%rbp)
jne    1182 <main+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r15
cmp    (%r15),%eax
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
mov    $0x1,%ebx
lea    0xeab(%rip),%r14
jmp    1178 <main+0x58>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
cmp    $0xa,%ebp
sete   %al
add    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
je     113a <main+0x1a>
cmp    $0x80,%ebp
jl     1160 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1160 <main+0x40>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %19, label %6
6: ; preds = %2, %12
%7 = phi i32 [ %16, %12 ], [ %3, %2 ]
%8 = phi i32 [ %15, %12 ], [ 1, %2 ]
%9 = icmp sgt i32 %7, 127
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %12
12: ; preds = %10, %6
%13 = icmp eq i32 %7, 10
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %8, %14
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %6
19: ; preds = %12, %2
ret i32 0
}