#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 ARRAY_SIZE(char const **);
scalar_t__ IS(char const *, char const *);
const char *map_reg(const char *reg) {
  const char *regs_f[] = {"eax", "ebx", "ecx", "edx", "esi", "edi"};
  const char *regs_w[] = {"ax", "bx", "cx", "dx", "si", "di"};
  const char *regs_b[] = {"al", "bl", "cl", "dl"};
  int i;
  for (i = 0; i < ARRAY_SIZE(regs_w); i++)
    if (IS(reg, regs_w[i]))
      return regs_f[i];
  for (i = 0; i < ARRAY_SIZE(regs_b); i++)
    if (IS(reg, regs_b[i]))
      return regs_f[i];
  return reg;
}


x86 assembly (clang, -O0):
<map_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xeaa(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe9c(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe8e(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xe59(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe52(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe4b(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe44(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe3d(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe36(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c16(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0x2c10(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0x2c0a(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0x2c07(%rip),%rax
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x98(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <ARRAY_SIZE@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
cmp    %ecx,%eax
jge    1291 <map_reg+0x161>
mov    -0x10(%rbp),%rdi
movslq -0x94(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rsi
call   1040 <IS@plt>
cmp    $0x0,%rax
je     1278 <map_reg+0x148>
movslq -0x94(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
mov    %rax,-0x8(%rbp)
jmp    131b <map_reg+0x1eb>
jmp    127d <map_reg+0x14d>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    121f <map_reg+0xef>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x9c(%rbp)
lea    -0x90(%rbp),%rdi
call   1050 <ARRAY_SIZE@plt>
mov    %eax,%ecx
mov    -0x9c(%rbp),%eax
cmp    %ecx,%eax
jge    1313 <map_reg+0x1e3>
mov    -0x10(%rbp),%rdi
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rsi
ff
call   1040 <IS@plt>
cmp    $0x0,%rax
je     12fa <map_reg+0x1ca>
movslq -0x94(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
mov    %rax,-0x8(%rbp)
jmp    131b <map_reg+0x1eb>
jmp    12ff <map_reg+0x1cf>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    129b <map_reg+0x16b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_reg>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%r15
lea    0xeca(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xec2(%rip),%rax
mov    %rax,0x58(%rsp)
lea    0xeba(%rip),%rax
mov    %rax,0x60(%rsp)
lea    0xeb2(%rip),%rax
mov    %rax,0x68(%rsp)
lea    0xeaa(%rip),%rax
mov    %rax,0x70(%rsp)
lea    0xea2(%rip),%rax
mov    %rax,0x78(%rsp)
lea    0xe83(%rip),%rax
mov    %rax,(%rsp)
lea    0xe7c(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe74(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe6c(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe64(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe5c(%rip),%rax
mov    %rax,0x28(%rsp)
movaps 0x2c4b(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c2f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
call   1040 <ARRAY_SIZE@plt>
test   %eax,%eax
jle    1214 <map_reg+0xf4>
xor    %ebx,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <IS@plt>
test   %rax,%rax
jne    1257 <map_reg+0x137>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <ARRAY_SIZE@plt>
cltq
cmp    %rax,%rbx
jl     11f0 <map_reg+0xd0>
lea    0x30(%rsp),%rdi
call   1040 <ARRAY_SIZE@plt>
test   %eax,%eax
jle    125e <map_reg+0x13e>
xor    %ebx,%ebx
lea    0x30(%rsp),%r14
nopl   0x0(%rax)
mov    0x30(%rsp,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <IS@plt>
test   %rax,%rax
jne    1257 <map_reg+0x137>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <ARRAY_SIZE@plt>
cltq
cmp    %rax,%rbx
jl     1230 <map_reg+0x110>
jmp    125e <map_reg+0x13e>
mov    %ebx,%eax
mov    0x50(%rsp,%rax,8),%r15
mov    %r15,%rax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"eax\00"
@.str.1 = [4 x i8] c"ebx\00"
@.str.2 = [4 x i8] c"ecx\00"
@.str.3 = [4 x i8] c"edx\00"
@.str.4 = [4 x i8] c"esi\00"
@.str.5 = [4 x i8] c"edi\00"
@.str.6 = [3 x i8] c"ax\00"
@.str.7 = [3 x i8] c"bx\00"
@.str.8 = [3 x i8] c"cx\00"
@.str.9 = [3 x i8] c"dx\00"
@.str.10 = [3 x i8] c"si\00"
@.str.11 = [3 x i8] c"di\00"
@.str.12 = [3 x i8] c"al\00"
@.str.13 = [3 x i8] c"bl\00"
@.str.14 = [3 x i8] c"cl\00"
@.str.15 = [3 x i8] c"dl\00"
@__const.map_reg.regs_b = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0)]
define i8* @map_reg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [6 x i8*]
%5 = alloca [6 x i8*]
%6 = alloca [4 x i8*]
%7 = alloca i32
store i8* %0, i8** %3
%8 = bitcast [6 x i8*]* %4 to i8*
%9 = bitcast i8* %8 to [6 x i8*]*
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8** %15
%16 = bitcast [6 x i8*]* %5 to i8*
%17 = bitcast i8* %16 to [6 x i8*]*
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8** %20
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8** %21
%22 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8** %22
%23 = getelementptr inbounds [6 x i8*], [6 x i8*]* %17, i32 0, i32 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8** %23
%24 = bitcast [4 x i8*]* %6 to i8*
store i32 0, i32* %7
br label %25
25: ; preds = %44, %1
%26 = load i32, i32* %7
%27 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 0
%28 = call i32 @ARRAY_SIZE(i8** %27)
%29 = icmp slt i32 %26, %28
br i1 %29, label %30, label %47
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @IS(i8* %31, i8* %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %30
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 %40
%42 = load i8*, i8** %41
store i8* %42, i8** %2
br label %72
43: ; preds = %30
br label %44
44: ; preds = %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %25
47: ; preds = %25
store i32 0, i32* %7
br label %48
48: ; preds = %67, %47
%49 = load i32, i32* %7
%50 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
%51 = call i32 @ARRAY_SIZE(i8** %50)
%52 = icmp slt i32 %49, %51
br i1 %52, label %53, label %70
53: ; preds = %48
%54 = load i8*, i8** %3
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %56
%58 = load i8*, i8** %57
%59 = call i64 @IS(i8* %54, i8* %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %66
61: ; preds = %53
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 %63
%65 = load i8*, i8** %64
store i8* %65, i8** %2
br label %72
66: ; preds = %53
br label %67
67: ; preds = %66
%68 = load i32, i32* %7
%69 = add nsw i32 %68, 1
store i32 %69, i32* %7
br label %48
70: ; preds = %48
%71 = load i8*, i8** %3
store i8* %71, i8** %2
br label %72
72: ; preds = %70, %61, %38
%73 = load i8*, i8** %2
ret i8* %73
}

LLVM IR (-O2):
@.str = [4 x i8] c"eax\00"
@.str.1 = [4 x i8] c"ebx\00"
@.str.2 = [4 x i8] c"ecx\00"
@.str.3 = [4 x i8] c"edx\00"
@.str.4 = [4 x i8] c"esi\00"
@.str.5 = [4 x i8] c"edi\00"
@.str.6 = [3 x i8] c"ax\00"
@.str.7 = [3 x i8] c"bx\00"
@.str.8 = [3 x i8] c"cx\00"
@.str.9 = [3 x i8] c"dx\00"
@.str.10 = [3 x i8] c"si\00"
@.str.11 = [3 x i8] c"di\00"
@.str.12 = [3 x i8] c"al\00"
@.str.13 = [3 x i8] c"bl\00"
@.str.14 = [3 x i8] c"cl\00"
@.str.15 = [3 x i8] c"dl\00"
@__const.map_reg.regs_b = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0)]
define i8* @map_reg(i8* %0) {
%2 = alloca [6 x i8*]
%3 = alloca [6 x i8*]
%4 = alloca [4 x i8*]
%5 = bitcast [6 x i8*]* %2 to i8*
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %11
%12 = bitcast [6 x i8*]* %3 to i8*
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8** %18
%19 = bitcast [4 x i8*]* %4 to i8*
%20 = call i32 @ARRAY_SIZE(i8** %13)
%21 = icmp sgt i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %32, %1
%23 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 0
%24 = call i32 @ARRAY_SIZE(i8** %23)
%25 = icmp sgt i32 %24, 0
br i1 %25, label %37, label %53
26: ; preds = %1, %32
%27 = phi i64 [ %33, %32 ], [ 0, %1 ]
%28 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i64 @IS(i8* %0, i8* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %48
32: ; preds = %26
%33 = add nuw nsw i64 %27, 1
%34 = call i32 @ARRAY_SIZE(i8** %13)
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %26, label %22
37: ; preds = %22, %43
%38 = phi i64 [ %44, %43 ], [ 0, %22 ]
%39 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 %38
%40 = load i8*, i8** %39
%41 = call i64 @IS(i8* %0, i8* %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %37
%44 = add nuw nsw i64 %38, 1
%45 = call i32 @ARRAY_SIZE(i8** %23)
%46 = sext i32 %45 to i64
%47 = icmp slt i64 %44, %46
br i1 %47, label %37, label %53
48: ; preds = %26, %37
%49 = phi i64 [ %38, %37 ], [ %27, %26 ]
%50 = and i64 %49, 4294967295
%51 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %50
%52 = load i8*, i8** %51
br label %53
53: ; preds = %43, %48, %22
%54 = phi i8* [ %0, %22 ], [ %52, %48 ], [ %0, %43 ]
ret i8* %54
}