#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 *str_replace(char *, char *, char *);
char *decode_ts3_val(char *val) {
  val = str_replace(val, "\\\\", "\\");
  val = str_replace(val, "\\/", "/");
  val = str_replace(val, "\\s", " ");
  val = str_replace(val, "\\p", "|");
  val = str_replace(val, "\\a", "\007");
  val = str_replace(val, "\\b", "\010");
  val = str_replace(val, "\\f", "\014");
  val = str_replace(val, "\\n", "\012");
  val = str_replace(val, "\\r", "\015");
  val = str_replace(val, "\\t", "\011");
  return str_replace(val, "\\v", "\013");
}


x86 assembly (clang, -O0):
<decode_ts3_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed3(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
lea    0xea5(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe93(%rip),%rsi
lea    0xe8f(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe7d(%rip),%rsi
lea    0xe79(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
lea    0xe63(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
lea    0xe4d(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe3b(%rip),%rsi
lea    0xe37(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe25(%rip),%rsi
lea    0xe21(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe0f(%rip),%rsi
lea    0xe0b(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xdf9(%rip),%rsi
lea    0xdf5(%rip),%rdx
call   1030 <str_replace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_ts3_val>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee2(%rip),%rdx
call   1030 <str_replace@plt>
lea    0xed8(%rip),%rsi
lea    0xed2(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xec5(%rip),%rsi
lea    0xec1(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xeb4(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xea3(%rip),%rsi
lea    0xe9f(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe92(%rip),%rsi
lea    0xe8e(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe81(%rip),%rsi
lea    0xe7d(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe70(%rip),%rsi
lea    0xe6c(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe5f(%rip),%rsi
lea    0xe5b(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe4e(%rip),%rsi
lea    0xe4a(%rip),%rdx
mov    %rax,%rdi
call   1030 <str_replace@plt>
lea    0xe3d(%rip),%rsi
lea    0xe39(%rip),%rdx
mov    %rax,%rdi
pop    %rax
jmp    1030 <str_replace@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\\\\\00"
@.str.1 = [2 x i8] c"\\\00"
@.str.2 = [3 x i8] c"\\/\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [3 x i8] c"\\s\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [3 x i8] c"\\p\00"
@.str.7 = [2 x i8] c"|\00"
@.str.8 = [3 x i8] c"\\a\00"
@.str.9 = [2 x i8] c"\07\00"
@.str.10 = [3 x i8] c"\\b\00"
@.str.11 = [2 x i8] c"\08\00"
@.str.12 = [3 x i8] c"\\f\00"
@.str.13 = [2 x i8] c"\0C\00"
@.str.14 = [3 x i8] c"\\n\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [3 x i8] c"\\r\00"
@.str.17 = [2 x i8] c"\0D\00"
@.str.18 = [3 x i8] c"\\t\00"
@.str.19 = [2 x i8] c"\09\00"
@.str.20 = [3 x i8] c"\\v\00"
@.str.21 = [2 x i8] c"\0B\00"
define i8* @decode_ts3_val(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @str_replace(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @str_replace(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @str_replace(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i8* @str_replace(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = call i8* @str_replace(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = call i8* @str_replace(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = call i8* @str_replace(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i8* %16, i8** %2
%17 = load i8*, i8** %2
%18 = call i8* @str_replace(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
store i8* %18, i8** %2
%19 = load i8*, i8** %2
%20 = call i8* @str_replace(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
store i8* %20, i8** %2
%21 = load i8*, i8** %2
%22 = call i8* @str_replace(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
store i8* %22, i8** %2
%23 = load i8*, i8** %2
%24 = call i8* @str_replace(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
ret i8* %24
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\\\\00"
@.str.1 = [2 x i8] c"\\\00"
@.str.2 = [3 x i8] c"\\/\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [3 x i8] c"\\s\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [3 x i8] c"\\p\00"
@.str.7 = [2 x i8] c"|\00"
@.str.8 = [3 x i8] c"\\a\00"
@.str.9 = [2 x i8] c"\07\00"
@.str.10 = [3 x i8] c"\\b\00"
@.str.11 = [2 x i8] c"\08\00"
@.str.12 = [3 x i8] c"\\f\00"
@.str.13 = [2 x i8] c"\0C\00"
@.str.14 = [3 x i8] c"\\n\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [3 x i8] c"\\r\00"
@.str.17 = [2 x i8] c"\0D\00"
@.str.18 = [3 x i8] c"\\t\00"
@.str.19 = [2 x i8] c"\09\00"
@.str.20 = [3 x i8] c"\\v\00"
@.str.21 = [2 x i8] c"\0B\00"
define i8* @decode_ts3_val(i8* %0) {
%2 = tail call i8* @str_replace(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @str_replace(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i8* @str_replace(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%5 = tail call i8* @str_replace(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%6 = tail call i8* @str_replace(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%7 = tail call i8* @str_replace(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%8 = tail call i8* @str_replace(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%9 = tail call i8* @str_replace(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%10 = tail call i8* @str_replace(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%11 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%12 = tail call i8* @str_replace(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
ret i8* %12
}