#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*/ printf(char *, int);
char getASCII(int utf8) {
  char ascii = '.';
  char mainMap[] = "AAAAAAACEEEEIIIIDNOOOOOx0UUUUY.B"
                   "aaaaaaaceeeeiiiionooooo-ouuuuy.y"
                   "AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGg"
                   "GgGgHhHhIiIiIiIiIiIiJjKkkLlLlLlL"
                   "lLlNnNnNnnnnOoOoOo..RrRrRrSsSsSs"
                   "SsTtTtFfUuUuUuUuUuUuWwYyYZzZzZzf"
                   "bB...............FfG...IKkl..N.0"
                   "................................"
                   "|..!.........AaIiOoUuUuUuUuUueAa"
                   "AaAaGgGgKkQqQq33J...GgHpNnAaAa00"
                   "AaAaEeEeIiIiOoOoRrRrUuUuSsTt33Hh"
                   "nd..ZzAaEeOoOoOoOoYylnrj..ACcLTs";
  int extraUtfMap[] = {225, 0};
  char extraChrMap[] = {'a', '.'};
  int i;
  if ((utf8 >= 0x00C0) && (utf8 <= 0x022F)) {
    ascii = mainMap[utf8 - 0x00C0];
  } else {
    for (i = 0; (extraUtfMap[i] != utf8) && (extraUtfMap[i] != 0); i++) {
      if (extraUtfMap[i] == 0) {
        printf("Unhandled UTF-8 code! %d\n", utf8);
      }
      ascii = extraChrMap[i];
    }
  }
  return ascii;
}


x86 assembly (clang, -O0):
<getASCII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x2e,-0x5(%rbp)
lea    -0x190(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x181,%edx
call   1040 <memcpy@plt>
mov    0x1033(%rip),%rax
mov    %rax,-0x198(%rbp)
mov    0x102d(%rip),%ax
mov    %ax,-0x19a(%rbp)
cmpl   $0xc0,-0x4(%rbp)
jl     1199 <getASCII+0x79>
cmpl   $0x22f,-0x4(%rbp)
jg     1199 <getASCII+0x79>
mov    -0x4(%rbp),%eax
sub    $0xc0,%eax
cltq
mov    -0x190(%rbp,%rax,1),%al
mov    %al,-0x5(%rbp)
jmp    123b <getASCII+0x11b>
movl   $0x0,-0x1a0(%rbp)
movslq -0x1a0(%rbp),%rax
mov    -0x198(%rbp,%rax,4),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x1a1(%rbp)
je     11da <getASCII+0xba>
movslq -0x1a0(%rbp),%rax
cmpl   $0x0,-0x198(%rbp,%rax,4)
setne  %al
mov    %al,-0x1a1(%rbp)
mov    -0x1a1(%rbp),%al
test   $0x1,%al
jne    11ed <getASCII+0xcd>
jmp    1236 <getASCII+0x116>
movslq -0x1a0(%rbp),%rax
cmpl   $0x0,-0x198(%rbp,%rax,4)
jne    1211 <getASCII+0xf1>
mov    -0x4(%rbp),%esi
lea    0xf82(%rip),%rdi
call   1030 <printf@plt>
movslq -0x1a0(%rbp),%rax
mov    -0x19a(%rbp,%rax,1),%al
mov    %al,-0x5(%rbp)
mov    -0x1a0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a0(%rbp)
jmp    11a3 <getASCII+0x83>
jmp    123b <getASCII+0x11b>
movsbl -0x5(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getASCII>:
add    $0xffffff40,%edi
mov    $0x61,%al
cmp    $0x16f,%edi
ja     111c <getASCII+0x1c>
mov    %edi,%eax
lea    0xee7(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.getASCII.mainMap = [385 x i8] c"AAAAAAACEEEEIIIIDNOOOOOx0UUUUY.Baaaaaaaceeeeiiiionooooo-ouuuuy.yAaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIiJjKkkLlLlLlLlLlNnNnNnnnnOoOoOo..RrRrRrSsSsSsSsTtTtFfUuUuUuUuUuUuWwYyYZzZzZzfbB...............FfG...IKkl..N.0................................|..!.........AaIiOoUuUuUuUuUueAaAaAaGgGgKkQqQq33J...GgHpNnAaAa00AaAaEeEeIiIiOoOoRrRrUuUuSsTt33Hhnd..ZzAaEeOoOoOoOoYylnrj..ACcLTs\00"
@__const.getASCII.extraUtfMap = [2 x i32] [i32 225, i32 0]
@__const.getASCII.extraChrMap = [2 x i8] c"a."
@.str = [26 x i8] c"Unhandled UTF-8 code! %d\0A\00"
define signext i8 @getASCII(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [385 x i8]
%5 = alloca [2 x i32]
%6 = alloca [2 x i8]
%7 = alloca i32
store i32 %0, i32* %2
store i8 46, i8* %3
%8 = bitcast [385 x i8]* %4 to i8*
%9 = bitcast [2 x i32]* %5 to i8*
%10 = bitcast [2 x i8]* %6 to i8*
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 192
br i1 %12, label %13, label %22
13: ; preds = %1
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 559
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 192
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [385 x i8], [385 x i8]* %4, i64 0, i64 %19
%21 = load i8, i8* %20
store i8 %21, i8* %3
br label %56
22: ; preds = %13, %1
store i32 0, i32* %7
br label %23
23: ; preds = %52, %22
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %2
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %36
30: ; preds = %23
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = icmp ne i32 %34, 0
br label %36
36: ; preds = %30, %23
%37 = phi i1 [ false, %23 ], [ %35, %30 ]
br i1 %37, label %38, label %55
38: ; preds = %36
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i32, i32* %2
%46 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %44, %38
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 %49
%51 = load i8, i8* %50
store i8 %51, i8* %3
br label %52
52: ; preds = %47
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %23
55: ; preds = %36
br label %56
56: ; preds = %55, %16
%57 = load i8, i8* %3
ret i8 %57
}

LLVM IR (-O2):
@__const.getASCII.mainMap = [385 x i8] c"AAAAAAACEEEEIIIIDNOOOOOx0UUUUY.Baaaaaaaceeeeiiiionooooo-ouuuuy.yAaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIiJjKkkLlLlLlLlLlNnNnNnnnnOoOoOo..RrRrRrSsSsSsSsTtTtFfUuUuUuUuUuUuWwYyYZzZzZzfbB...............FfG...IKkl..N.0................................|..!.........AaIiOoUuUuUuUuUueAaAaAaGgGgKkQqQq33J...GgHpNnAaAa00AaAaEeEeIiIiOoOoRrRrUuUuSsTt33Hhnd..ZzAaEeOoOoOoOoYylnrj..ACcLTs\00"
define signext i8 @getASCII(i32 %0) {
%2 = add i32 %0, -192
%3 = icmp ult i32 %2, 368
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds [385 x i8], [385 x i8]* @__const.getASCII.mainMap, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %1, %4
%9 = phi i8 [ %7, %4 ], [ 97, %1 ]
ret i8 %9
}