#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 *other(char);
char *expand8to16(char b) {
  switch (b) {
  case '>':
    return ">>>";
    break;
  case '<':
    return "<<<";
    break;
  case '+':
    return "+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]";
    break;
  case '-':
    return "+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<";
    break;
  case '[':
    return ">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]";
    break;
  case ']':
    return ">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]";
    break;
  }
  return other(b);
}


x86 assembly (clang, -O0):
<expand8to16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffd5,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x32,%eax
ja     11a8 <expand8to16+0x98>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
lea    0xf71(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
lea    0xf65(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
lea    0xf7b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
lea    0xf93(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
lea    0xfb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16+0xa5>
movsbl -0x9(%rbp),%edi
call   1030 <other@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand8to16>:
lea    -0x2b(%rdi),%ecx
cmp    $0x32,%ecx
ja     1137 <expand8to16+0x27>
lea    0xfad(%rip),%rax
lea    0xeda(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf9e(%rip),%rax
ret
movsbl %dil,%edi
jmp    1030 <other@plt>
lea    0xfb3(%rip),%rax
ret
lea    0xf81(%rip),%rax
ret
lea    0xfcb(%rip),%rax
ret
lea    0xff8(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c">>>\00"
@.str.1 = [4 x i8] c"<<<\00"
@.str.2 = [38 x i8] c"+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]\00"
@.str.3 = [40 x i8] c"+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<\00"
@.str.4 = [53 x i8] c">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]\00"
@.str.5 = [50 x i8] c">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]\00"
define i8* @expand8to16(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 62, label %6
i32 60, label %7
i32 43, label %8
i32 45, label %9
i32 91, label %10
i32 93, label %11
]
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %1
%13 = load i8, i8* %3
%14 = call i8* @other(i8 signext %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %11, %10, %9, %8, %7, %6
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [4 x i8] c">>>\00"
@.str.1 = [4 x i8] c"<<<\00"
@.str.2 = [38 x i8] c"+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]\00"
@.str.3 = [40 x i8] c"+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<\00"
@.str.4 = [53 x i8] c">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]\00"
@.str.5 = [50 x i8] c">[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]\00"
define i8* @expand8to16(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 62, label %10
i32 60, label %3
i32 43, label %4
i32 45, label %5
i32 91, label %6
i32 93, label %7
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = tail call i8* @other(i8 signext %0)
br label %10
10: ; preds = %1, %8, %7, %6, %5, %4, %3
%11 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}