#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 */
typedef size_t uint8_t;

/* Variables and functions */
int fread(size_t *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(size_t *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ makeLUT(size_t *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *args[]) {
  uint8_t lut[256];
  makeLUT(lut);
  uint8_t in;
  int nr = fread(&in, 1, 1, stdin);
  while (nr > 0) {
    fwrite(&lut[in], 1, 1, stdout);
    nr = fread(&in, 1, 1, stdin);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
call   1030 <makeLUT@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%ecx
lea    -0x818(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fread@plt>
mov    %eax,-0x81c(%rbp)
cmpl   $0x0,-0x81c(%rbp)
jle    11d5 <main+0xa5>
mov    -0x818(%rbp),%rax
lea    -0x810(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
mov    0x2e38(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <fwrite@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%ecx
lea    -0x818(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fread@plt>
mov    %eax,-0x81c(%rbp)
jmp    1177 <main+0x47>
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x810,%rsp
lea    0x10(%rsp),%rdi
call   1030 <makeLUT@plt>
mov    0x2e9b(%rip),%r14
mov    (%r14),%ecx
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
test   %eax,%eax
jle    11b8 <main+0x88>
mov    0x2e69(%rip),%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%rax
lea    (%rsp,%rax,8),%rdi
add    $0x10,%rdi
mov    (%r15),%ecx
mov    $0x1,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    (%r14),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
test   %eax,%eax
jg     1180 <main+0x50>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i64]
%7 = alloca i64
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [256 x i64], [256 x i64]* %6, i64 0, i64 0
%10 = call i32 @makeLUT(i64* %9)
%11 = load i32, i32* @stdin
%12 = call i32 @fread(i64* %7, i32 1, i32 1, i32 %11)
store i32 %12, i32* %8
br label %13
13: ; preds = %16, %2
%14 = load i32, i32* %8
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i64, i64* %7
%18 = getelementptr inbounds [256 x i64], [256 x i64]* %6, i64 0, i64 %17
%19 = load i32, i32* @stdout
%20 = call i32 @fwrite(i64* %18, i32 1, i32 1, i32 %19)
%21 = load i32, i32* @stdin
%22 = call i32 @fread(i64* %7, i32 1, i32 1, i32 %21)
store i32 %22, i32* %8
br label %13
23: ; preds = %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i64]
%4 = alloca i64
%5 = bitcast [256 x i64]* %3 to i8*
%6 = getelementptr inbounds [256 x i64], [256 x i64]* %3, i64 0, i64 0
%7 = call i32 @makeLUT(i64* %6)
%8 = bitcast i64* %4 to i8*
%9 = load i32, i32* @stdin
%10 = call i32 @fread(i64* %4, i32 1, i32 1, i32 %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %2, %12
%13 = load i64, i64* %4
%14 = getelementptr inbounds [256 x i64], [256 x i64]* %3, i64 0, i64 %13
%15 = load i32, i32* @stdout
%16 = call i32 @fwrite(i64* %14, i32 1, i32 1, i32 %15)
%17 = load i32, i32* @stdin
%18 = call i32 @fread(i64* %4, i32 1, i32 1, i32 %17)
%19 = icmp sgt i32 %18, 0
br i1 %19, label %12, label %20
20: ; preds = %12, %2
ret i32 0
}