#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 EOF;
int getchar();
int /*<<< orphan*/ putchar(char);
void trans(char s1[], char s2[]) {
  int i;
  int n;
  int holder;
  char ascii[256];
  for (n = 0; n < 256; n++) {
    ascii[n] = n;
  }
  for (i = 0; s1[i] != '\0'; i++) {
    if (s2[i] != s1[i]) {
      ascii[(int)s1[i]] = s2[i];
    }
  }
  while ((holder = getchar()) != EOF) {
    putchar(ascii[holder]);
  }
}


x86 assembly (clang, -O0):
<trans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x100,-0x18(%rbp)
jge    1165 <trans+0x45>
mov    -0x18(%rbp),%eax
mov    %al,%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x120(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <trans+0x1a>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11d4 <trans+0xb4>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     11c1 <trans+0xa1>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rdx
movsbl (%rax,%rdx,1),%eax
cltq
mov    %cl,-0x120(%rbp,%rax,1)
jmp    11c6 <trans+0xa6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <trans+0x4c>
jmp    11d9 <trans+0xb9>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2dfe(%rip),%rcx
cmp    (%rcx),%eax
je     1208 <trans+0xe8>
movslq -0x1c(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
jmp    11d9 <trans+0xb9>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trans>:
push   %rbx
sub    $0x100,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
mov    (%rdi),%al
test   %al,%al
je     122e <trans+0x10e>
xor    %ecx,%ecx
jmp    121d <trans+0xfd>
nopl   0x0(%rax)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
je     122e <trans+0x10e>
movzbl (%rsi,%rcx,1),%edx
cmp    %al,%dl
je     1210 <trans+0xf0>
movsbq %al,%rax
mov    %dl,(%rsp,%rax,1)
jmp    1210 <trans+0xf0>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2dac(%rip),%rbx
cmp    (%rbx),%eax
je     1256 <trans+0x136>
cltq
movsbl (%rsp,%rax,1),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1240 <trans+0x120>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @trans(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %6
br label %9
9: ; preds = %18, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 256
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %6
%14 = trunc i32 %13 to i8
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %16
store i8 %14, i8* %17
br label %18
18: ; preds = %12
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %9
21: ; preds = %9
store i32 0, i32* %5
br label %22
22: ; preds = %59, %21
%23 = load i8*, i8** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %62
30: ; preds = %22
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = load i8*, i8** %3
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %36, %42
br i1 %43, label %44, label %58
44: ; preds = %30
%45 = load i8*, i8** %4
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = load i8, i8* %48
%50 = load i8*, i8** %3
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %56
store i8 %49, i8* %57
br label %58
58: ; preds = %44, %30
br label %59
59: ; preds = %58
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %22
62: ; preds = %22
br label %63
63: ; preds = %67, %62
%64 = call i32 (...) @getchar()
store i32 %64, i32* %7
%65 = load i32, i32* @EOF
%66 = icmp ne i32 %64, %65
br i1 %66, label %67, label %73
67: ; preds = %63
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = call i32 @putchar(i8 signext %71)
br label %63
73: ; preds = %63
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @trans(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = bitcast [256 x i8]* %3 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %5
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 16
%7 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 32
%9 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, <16 x i8>* %9
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 48
%11 = bitcast i8* %10 to <16 x i8>*
store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, <16 x i8>* %11
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 64
%13 = bitcast i8* %12 to <16 x i8>*
store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, <16 x i8>* %13
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 80
%15 = bitcast i8* %14 to <16 x i8>*
store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, <16 x i8>* %15
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 96
%17 = bitcast i8* %16 to <16 x i8>*
store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, <16 x i8>* %17
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 112
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, <16 x i8>* %19
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 128
%21 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 -128, i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113>, <16 x i8>* %21
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 144
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> <i8 -112, i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97>, <16 x i8>* %23
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 160
%25 = bitcast i8* %24 to <16 x i8>*
store <16 x i8> <i8 -96, i8 -95, i8 -94, i8 -93, i8 -92, i8 -91, i8 -90, i8 -89, i8 -88, i8 -87, i8 -86, i8 -85, i8 -84, i8 -83, i8 -82, i8 -81>, <16 x i8>* %25
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 176
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> <i8 -80, i8 -79, i8 -78, i8 -77, i8 -76, i8 -75, i8 -74, i8 -73, i8 -72, i8 -71, i8 -70, i8 -69, i8 -68, i8 -67, i8 -66, i8 -65>, <16 x i8>* %27
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 192
%29 = bitcast i8* %28 to <16 x i8>*
store <16 x i8> <i8 -64, i8 -63, i8 -62, i8 -61, i8 -60, i8 -59, i8 -58, i8 -57, i8 -56, i8 -55, i8 -54, i8 -53, i8 -52, i8 -51, i8 -50, i8 -49>, <16 x i8>* %29
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 208
%31 = bitcast i8* %30 to <16 x i8>*
store <16 x i8> <i8 -48, i8 -47, i8 -46, i8 -45, i8 -44, i8 -43, i8 -42, i8 -41, i8 -40, i8 -39, i8 -38, i8 -37, i8 -36, i8 -35, i8 -34, i8 -33>, <16 x i8>* %31
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 224
%33 = bitcast i8* %32 to <16 x i8>*
store <16 x i8> <i8 -32, i8 -31, i8 -30, i8 -29, i8 -28, i8 -27, i8 -26, i8 -25, i8 -24, i8 -23, i8 -22, i8 -21, i8 -20, i8 -19, i8 -18, i8 -17>, <16 x i8>* %33
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 240
%35 = bitcast i8* %34 to <16 x i8>*
store <16 x i8> <i8 -16, i8 -15, i8 -14, i8 -13, i8 -12, i8 -11, i8 -10, i8 -9, i8 -8, i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1>, <16 x i8>* %35
%36 = load i8, i8* %0
%37 = icmp eq i8 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %51, %2
%39 = tail call i32 (...) @getchar()
%40 = load i32, i32* @EOF
%41 = icmp eq i32 %39, %40
br i1 %41, label %65, label %56
42: ; preds = %2, %51
%43 = phi i64 [ %52, %51 ], [ 0, %2 ]
%44 = phi i8 [ %54, %51 ], [ %36, %2 ]
%45 = getelementptr inbounds i8, i8* %1, i64 %43
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, %44
br i1 %47, label %51, label %48
48: ; preds = %42
%49 = sext i8 %44 to i64
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %49
store i8 %46, i8* %50
br label %51
51: ; preds = %42, %48
%52 = add nuw i64 %43, 1
%53 = getelementptr inbounds i8, i8* %0, i64 %52
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 0
br i1 %55, label %38, label %42
56: ; preds = %38, %56
%57 = phi i32 [ %62, %56 ], [ %39, %38 ]
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = tail call i32 @putchar(i8 signext %60)
%62 = tail call i32 (...) @getchar()
%63 = load i32, i32* @EOF
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %56
65: ; preds = %56, %38
ret void
}