#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 /*<<< orphan*/ decode(char *, char *);
int /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ prepareMapping(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char line[800000];
  char mapEncodeToDecode[256];
  prepareMapping(mapEncodeToDecode);
  while (gets(line) != NULL) {
    decode(line, mapEncodeToDecode);
    printf("%s\n", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc3610,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc3610(%rbp),%rdi
call   1030 <prepareMapping@plt>
lea    -0xc3510(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     119f <main+0x5f>
lea    -0xc3510(%rbp),%rdi
lea    -0xc3610(%rbp),%rsi
call   1060 <decode@plt>
lea    -0xc3510(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
jmp    115e <main+0x1e>
mov    -0x4(%rbp),%eax
add    $0xc3610,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc3600,%rsp
mov    %rsp,%rdi
call   1030 <prepareMapping@plt>
lea    0x100(%rsp),%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     11a3 <main+0x63>
lea    0x100(%rsp),%rbx
mov    %rsp,%r14
lea    0xe88(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <decode@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0xc3600,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [800000 x i8]
%3 = alloca [256 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @prepareMapping(i8* %4)
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [800000 x i8], [800000 x i8]* %2, i64 0, i64 0
%8 = call i32* @gets(i8* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = getelementptr inbounds [800000 x i8], [800000 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = call i32 @decode(i8* %11, i8* %12)
%14 = getelementptr inbounds [800000 x i8], [800000 x i8]* %2, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %6
16: ; preds = %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [800000 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [800000 x i8], [800000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @prepareMapping(i8* %4)
%6 = call i32* @gets(i8* %3)
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %0, %8
%9 = call i32 @decode(i8* %3, i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%11 = call i32* @gets(i8* %3)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %8
13: ; preds = %8, %0
ret i32 0
}