#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
main() {
  int i, j;
  printf("static unsigned short	zenmap1[]= {\n\t");
  for (; (i = getchar()) >= 0;) {
    if (i == '\n') {
      putchar('\n');
      putchar('\t');
      continue;
    }
    j = getchar() & 0xff;
    if (i < 0x80)
      printf("0x0000,");
    else
      printf("0x%02x%02x,", i & 0x7f, j & 0x7f);
  }
  printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jl     11d1 <main+0xa1>
cmpl   $0xa,-0x8(%rbp)
jne    1183 <main+0x53>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1050 <getchar@plt>
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    11b2 <main+0x82>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cc <main+0x9c>
mov    -0x8(%rbp),%esi
and    $0x7f,%esi
mov    -0xc(%rbp),%edx
and    $0x7f,%edx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    114d <main+0x1d>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
test   %eax,%eax
js     11c6 <main+0x86>
mov    %eax,%ebp
lea    0xebf(%rip),%r14
lea    0xec0(%rip),%rbx
jmp    1191 <main+0x51>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
test   %eax,%eax
js     11c6 <main+0x86>
cmp    $0xa,%ebp
je     1170 <main+0x30>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x7f,%ebp
ja     11b0 <main+0x70>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1184 <main+0x44>
xchg   %ax,%ax
and    $0x7f,%ebp
and    $0x7f,%eax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1184 <main+0x44>
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"static unsigned short\09zenmap1[]= {\0A\09\00"
@.str.1 = [8 x i8] c"0x0000,\00"
@.str.2 = [12 x i8] c"0x%02x%02x,\00"
@.str.3 = [4 x i8] c"};\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %27, %11, %0
%6 = call i32 (...) @getchar()
store i32 %6, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @putchar(i8 signext 10)
%13 = call i32 @putchar(i8 signext 9)
br label %5
14: ; preds = %8
%15 = call i32 (...) @getchar()
%16 = and i32 %15, 255
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 128
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %27
21: ; preds = %14
%22 = load i32, i32* %2
%23 = and i32 %22, 127
%24 = load i32, i32* %3
%25 = and i32 %24, 127
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %25)
br label %27
27: ; preds = %21, %19
br label %5
28: ; preds = %5
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"static unsigned short\09zenmap1[]= {\0A\09\00"
@.str.1 = [8 x i8] c"0x0000,\00"
@.str.2 = [12 x i8] c"0x%02x%02x,\00"
@str = [3 x i8] c"};\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %22
4: ; preds = %0, %10
%5 = phi i32 [ %11, %10 ], [ %2, %0 ]
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call i32 @putchar(i8 signext 10)
%9 = tail call i32 @putchar(i8 signext 9)
br label %10
10: ; preds = %16, %18, %7
%11 = tail call i32 (...) @getchar()
%12 = icmp sgt i32 %11, -1
br i1 %12, label %4, label %22
13: ; preds = %4
%14 = tail call i32 (...) @getchar()
%15 = icmp ult i32 %5, 128
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
18: ; preds = %13
%19 = and i32 %5, 127
%20 = and i32 %14, 127
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %20)
br label %10
22: ; preds = %10, %0
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}