#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 */
char *malloc(int);
char *_leet(char *str, int len) {
  char *back, *dst;
  back = dst = malloc(len * 2 + 1);
  while (len-- >= 0) {
    switch (*str) {
    case 'e':
      *dst++ = '3';
      break;
    case 'a':
      *dst++ = '4';
      break;
    case 'l':
      *dst++ = '1';
      break;
    case 'i':
      *dst++ = '|';
      break;
    case 's':
      *dst++ = '5';
      break;
    case 'o':
      *dst++ = '0';
      break;
    case 't':
      *dst++ = '7';
      break;
    case 'x':
      *dst++ = '>';
      *dst++ = '<';
      break;
    case 'k':
      *dst++ = '|';
      *dst++ = '<';
      break;
    case 'L':
      *dst++ = '|';
      *dst++ = '_';
      break;
    default:
      *dst++ = *str;
    }
    str++;
  }
  *dst = '\0';
  return back;
}


x86 assembly (clang, -O0):
<_leet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jl     12ba <_leet+0x1aa>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x2c,%eax
ja     1292 <_leet+0x182>
mov    -0x28(%rbp),%rax
lea    0xe93(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x33,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x34,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x31,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x7c,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x35,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x30,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x37,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3e,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3c,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x7c,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3c,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x7c,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x5f,(%rax)
jmp    12a9 <_leet+0x199>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <_leet+0x25>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_leet>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    (%rbx,%rbx,1),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
test   %ebx,%ebx
js     11a6 <_leet+0x96>
add    $0x1,%ebx
xor    %edx,%edx
lea    0xec9(%rip),%r8
mov    %rax,%rcx
jmp    114c <_leet+0x3c>
mov    %dil,(%rcx)
nop
add    $0x1,%rcx
add    $0x1,%rdx
cmp    %edx,%ebx
je     11a6 <_leet+0x96>
movsbl (%r14,%rdx,1),%edi
lea    -0x4c(%rdi),%esi
cmp    $0x2c,%esi
ja     113c <_leet+0x2c>
movslq (%r8,%rsi,4),%rsi
add    %r8,%rsi
jmp    *%rsi
movw   $0x5f7c,(%rcx)
add    $0x2,%rcx
jmp    1144 <_leet+0x34>
movb   $0x34,(%rcx)
jmp    1140 <_leet+0x30>
movb   $0x33,(%rcx)
jmp    1140 <_leet+0x30>
movb   $0x7c,(%rcx)
jmp    1140 <_leet+0x30>
movw   $0x3c7c,(%rcx)
add    $0x2,%rcx
jmp    1144 <_leet+0x34>
movb   $0x31,(%rcx)
jmp    1140 <_leet+0x30>
movb   $0x30,(%rcx)
jmp    1140 <_leet+0x30>
movb   $0x35,(%rcx)
jmp    1140 <_leet+0x30>
movb   $0x37,(%rcx)
jmp    1140 <_leet+0x30>
movw   $0x3c3e,(%rcx)
add    $0x2,%rcx
jmp    1144 <_leet+0x34>
movb   $0x0,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_leet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 2
%9 = add nsw i32 %8, 1
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %6
store i8* %10, i8** %5
br label %11
11: ; preds = %60, %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp sge i32 %12, 0
br i1 %14, label %15, label %63
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %55 [
i32 101, label %19
i32 97, label %22
i32 108, label %25
i32 105, label %28
i32 115, label %31
i32 111, label %34
i32 116, label %37
i32 120, label %40
i32 107, label %45
i32 76, label %50
]
19: ; preds = %15
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %6
store i8 51, i8* %20
br label %60
22: ; preds = %15
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %6
store i8 52, i8* %23
br label %60
25: ; preds = %15
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
store i8 49, i8* %26
br label %60
28: ; preds = %15
%29 = load i8*, i8** %6
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %6
store i8 124, i8* %29
br label %60
31: ; preds = %15
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %6
store i8 53, i8* %32
br label %60
34: ; preds = %15
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %6
store i8 48, i8* %35
br label %60
37: ; preds = %15
%38 = load i8*, i8** %6
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %6
store i8 55, i8* %38
br label %60
40: ; preds = %15
%41 = load i8*, i8** %6
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %6
store i8 62, i8* %41
%43 = load i8*, i8** %6
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %6
store i8 60, i8* %43
br label %60
45: ; preds = %15
%46 = load i8*, i8** %6
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %6
store i8 124, i8* %46
%48 = load i8*, i8** %6
%49 = getelementptr inbounds i8, i8* %48, i32 1
store i8* %49, i8** %6
store i8 60, i8* %48
br label %60
50: ; preds = %15
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %6
store i8 124, i8* %51
%53 = load i8*, i8** %6
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %6
store i8 95, i8* %53
br label %60
55: ; preds = %15
%56 = load i8*, i8** %3
%57 = load i8, i8* %56
%58 = load i8*, i8** %6
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %6
store i8 %57, i8* %58
br label %60
60: ; preds = %55, %50, %45, %40, %37, %34, %31, %28, %25, %22, %19
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %3
br label %11
63: ; preds = %11
%64 = load i8*, i8** %6
store i8 0, i8* %64
%65 = load i8*, i8** %5
ret i8* %65
}

LLVM IR (-O2):
define i8* @_leet(i8* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = or i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp sgt i32 %1, -1
br i1 %6, label %7, label %43
7: ; preds = %2, %39
%8 = phi i32 [ %11, %39 ], [ %1, %2 ]
%9 = phi i8* [ %40, %39 ], [ %5, %2 ]
%10 = phi i8* [ %41, %39 ], [ %0, %2 ]
%11 = add nsw i32 %8, -1
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
switch i32 %13, label %37 [
i32 101, label %14
i32 97, label %16
i32 108, label %18
i32 105, label %20
i32 115, label %22
i32 111, label %24
i32 116, label %26
i32 120, label %28
i32 107, label %31
i32 76, label %34
]
14: ; preds = %7
%15 = getelementptr inbounds i8, i8* %9, i64 1
store i8 51, i8* %9
br label %39
16: ; preds = %7
%17 = getelementptr inbounds i8, i8* %9, i64 1
store i8 52, i8* %9
br label %39
18: ; preds = %7
%19 = getelementptr inbounds i8, i8* %9, i64 1
store i8 49, i8* %9
br label %39
20: ; preds = %7
%21 = getelementptr inbounds i8, i8* %9, i64 1
store i8 124, i8* %9
br label %39
22: ; preds = %7
%23 = getelementptr inbounds i8, i8* %9, i64 1
store i8 53, i8* %9
br label %39
24: ; preds = %7
%25 = getelementptr inbounds i8, i8* %9, i64 1
store i8 48, i8* %9
br label %39
26: ; preds = %7
%27 = getelementptr inbounds i8, i8* %9, i64 1
store i8 55, i8* %9
br label %39
28: ; preds = %7
%29 = getelementptr inbounds i8, i8* %9, i64 1
store i8 62, i8* %9
%30 = getelementptr inbounds i8, i8* %9, i64 2
store i8 60, i8* %29
br label %39
31: ; preds = %7
%32 = getelementptr inbounds i8, i8* %9, i64 1
store i8 124, i8* %9
%33 = getelementptr inbounds i8, i8* %9, i64 2
store i8 60, i8* %32
br label %39
34: ; preds = %7
%35 = getelementptr inbounds i8, i8* %9, i64 1
store i8 124, i8* %9
%36 = getelementptr inbounds i8, i8* %9, i64 2
store i8 95, i8* %35
br label %39
37: ; preds = %7
%38 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
br label %39
39: ; preds = %37, %34, %31, %28, %26, %24, %22, %20, %18, %16, %14
%40 = phi i8* [ %38, %37 ], [ %36, %34 ], [ %33, %31 ], [ %30, %28 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ]
%41 = getelementptr inbounds i8, i8* %10, i64 1
%42 = icmp eq i32 %8, 0
br i1 %42, label %43, label %7
43: ; preds = %39, %2
%44 = phi i8* [ %5, %2 ], [ %40, %39 ]
store i8 0, i8* %44
ret i8* %5
}