#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 */
size_t fread(unsigned char **, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  unsigned char buffer[8192];
  bool done = false;
  while (!done) {
    size_t len = fread(&buffer, 1, 8192, stdin);
    if (len < 8192) {
      done = true;
    }
    for (size_t i = 0; i < len; i++) {
      if (buffer[i] > 127) {
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2030,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2014(%rbp)
cmpl   $0x0,-0x2014(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <main+0x35>
jmp    11ea <main+0xda>
lea    -0x2010(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x2000,%edx
call   1030 <fread@plt>
mov    %rax,-0x2020(%rbp)
cmpq   $0x2000,-0x2020(%rbp)
jae    1186 <main+0x76>
movl   $0x1,-0x2014(%rbp)
movq   $0x0,-0x2028(%rbp)
mov    -0x2028(%rbp),%rax
cmp    -0x2020(%rbp),%rax
jae    11e5 <main+0xd5>
mov    -0x2028(%rbp),%rax
movzbl -0x2010(%rbp,%rax,1),%eax
ff
cmp    $0x7f,%eax
jle    11c9 <main+0xb9>
movl   $0x1,-0x4(%rbp)
jmp    11f1 <main+0xe1>
jmp    11ce <main+0xbe>
mov    -0x2028(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2028(%rbp)
jmp    1191 <main+0x81>
jmp    112c <main+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2008,%rsp
mov    0x2ec7(%rip),%r14
mov    %rsp,%rbx
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x2000,%rax
jb     1181 <main+0x71>
mov    (%r14),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2000,%edx
call   1030 <fread@plt>
test   %rax,%rax
je     1130 <main+0x20>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rsp,%rcx,1)
js     1171 <main+0x61>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1160 <main+0x50>
jmp    1130 <main+0x20>
mov    $0x1,%eax
add    $0x2008,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
jmp    1176 <main+0x66>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [8192 x i8]
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %33, %0
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %34
10: ; preds = %6
%11 = bitcast [8192 x i8]* %2 to i8**
%12 = load i32, i32* @stdin
%13 = call i64 @fread(i8** %11, i32 1, i32 8192, i32 %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = icmp ult i64 %14, 8192
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %17
17: ; preds = %16, %10
store i64 0, i64* %5
br label %18
18: ; preds = %30, %17
%19 = load i64, i64* %5
%20 = load i64, i64* %4
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %33
22: ; preds = %18
%23 = load i64, i64* %5
%24 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp sgt i32 %26, 127
br i1 %27, label %28, label %29
28: ; preds = %22
store i32 1, i32* %1
br label %35
29: ; preds = %22
br label %30
30: ; preds = %29
%31 = load i64, i64* %5
%32 = add i64 %31, 1
store i64 %32, i64* %5
br label %18
33: ; preds = %18
br label %6
34: ; preds = %6
store i32 0, i32* %1
br label %35
35: ; preds = %34, %28
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [8192 x i8]
%2 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
%3 = bitcast [8192 x i8]* %1 to i8**
br label %5
4: ; preds = %10, %5
br i1 %8, label %5, label %18
5: ; preds = %0, %4
%6 = load i32, i32* @stdin
%7 = call i64 @fread(i8** %3, i32 1, i32 8192, i32 %6)
%8 = icmp ugt i64 %7, 8191
%9 = icmp eq i64 %7, 0
br i1 %9, label %4, label %12
10: ; preds = %12
%11 = icmp eq i64 %17, %7
br i1 %11, label %4, label %12
12: ; preds = %5, %10
%13 = phi i64 [ %17, %10 ], [ 0, %5 ]
%14 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = icmp slt i8 %15, 0
%17 = add nuw i64 %13, 1
br i1 %16, label %18, label %10
18: ; preds = %4, %12
%19 = phi i32 [ 1, %12 ], [ 0, %4 ]
ret i32 %19
}