#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 int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ parse_args(int, char const **, int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main(int argc, const char **argv) {
  uint8_t translate_table[256];
  parse_args(argc, argv, translate_table);
  int ch;
  while ((ch = getchar()) != EOF)
    putchar(translate_table[ch]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x410(%rbp),%rdx
call   1040 <parse_args@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x414(%rbp)
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%eax
je     1190 <main+0x60>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,4),%edi
call   1030 <putchar@plt>
jmp    115c <main+0x2c>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rdx
call   1040 <parse_args@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9a(%rip),%rbx
cmp    (%rbx),%eax
je     1175 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cltq
mov    (%rsp,%rax,4),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%11 = call i32 @parse_args(i32 %8, i8** %9, i32* %10)
br label %12
12: ; preds = %16, %2
%13 = call i32 (...) @getchar()
store i32 %13, i32* %7
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @putchar(i32 %20)
br label %12
22: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [256 x i32]
%4 = bitcast [256 x i32]* %3 to i8*
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 0
%6 = call i32 @parse_args(i32 %0, i8** %1, i32* %5)
%7 = call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %19, label %10
10: ; preds = %2, %10
%11 = phi i32 [ %16, %10 ], [ %7, %2 ]
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @putchar(i32 %14)
%16 = call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %10
19: ; preds = %10, %2
ret i32 0
}