#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 *expand8to16NoCopy(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):
<expand8to16NoCopy>:
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 <expand8to16NoCopy+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 <expand8to16NoCopy+0xa5>
lea    0xf72(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16NoCopy+0xa5>
lea    0xf67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16NoCopy+0xa5>
lea    0xf6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16NoCopy+0xa5>
lea    0xf6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16NoCopy+0xa5>
lea    0xf80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <expand8to16NoCopy+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):
<expand8to16NoCopy>:
lea    -0x2b(%rdi),%ecx
cmp    $0x32,%ecx
ja     1137 <expand8to16NoCopy+0x27>
lea    0xfad(%rip),%rax
lea    0xeda(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xfa0(%rip),%rax
ret
movsbl %dil,%edi
jmp    1030 <other@plt>
lea    0xfa2(%rip),%rax
ret
lea    0xf82(%rip),%rax
ret
lea    0xfa5(%rip),%rax
ret
lea    0xfc0(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c">>>>\00"
@.str.1 = [5 x i8] c"<<<<\00"
@.str.2 = [19 x i8] c">+<+[>-]>[->>+<]<<\00"
@.str.3 = [19 x i8] c">+<[>-]>[->>-<]<<-\00"
@.str.4 = [35 x i8] c">+<[>-]>[->+>[<-]<[<]>[-<+>]]<-[+<\00"
@.str.5 = [34 x i8] c">+<[>-]>[->+>[<-]<[<]>[-<+>]]<-]<\00"
define i8* @expand8to16NoCopy(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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 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 = [5 x i8] c">>>>\00"
@.str.1 = [5 x i8] c"<<<<\00"
@.str.2 = [19 x i8] c">+<+[>-]>[->>+<]<<\00"
@.str.3 = [19 x i8] c">+<[>-]>[->>-<]<<-\00"
@.str.4 = [35 x i8] c">+<[>-]>[->+>[<-]<[<]>[-<+>]]<-[+<\00"
@.str.5 = [34 x i8] c">+<[>-]>[->+>[<-]<[<]>[-<+>]]<-]<\00"
define i8* @expand8to16NoCopy(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 ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}