#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 strtol(char const *, char **, int);
char _kt_backslash_escape(const char *string, const char **endp) {
  char c;
  switch (*string) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
    c = strtol(string, (char **)&string, 8);
    break;
  case 'a':
    c = '\a';
    string++;
    break;
  case 'b':
    c = '\b';
    string++;
    break;
  case 'e':
  case 'E':
    c = '\033';
    string++;
    break;
  case 'f':
    c = '\f';
    string++;
    break;
  case 'n':
    c = '\n';
    string++;
    break;
  case 'r':
    c = '\r';
    string++;
    break;
  case 't':
    c = '\t';
    string++;
    break;
  case 'v':
    c = '\v';
    string++;
    break;
  case '\0':
    c = '\\';
    break;
  default:
    c = *string++;
    break;
  };
  if (endp)
    *endp = string;
  return c;
}


x86 assembly (clang, -O0):
<_kt_backslash_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x76,%eax
ja     1215 <_kt_backslash_escape+0x105>
mov    -0x20(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %al,-0x11(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0x7,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0x8,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0x1b,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0xc,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0xa,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0xd,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0x9,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0xb,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
movb   $0x5c,-0x11(%rbp)
jmp    1229 <_kt_backslash_escape+0x119>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     123f <_kt_backslash_escape+0x12f>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movsbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kt_backslash_escape>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,0x8(%rsp)
movsbl (%rdi),%ecx
cmp    $0x76,%ecx
ja     1155 <_kt_backslash_escape+0x45>
mov    $0x5c,%al
lea    0xed2(%rip),%rdx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <strtol@plt>
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0x1b,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    %ecx,%eax
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0x7,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0x8,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0xc,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0xa,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0xd,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0x9,%al
jmp    11bb <_kt_backslash_escape+0xab>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
mov    $0xb,%al
test   %rbx,%rbx
je     11c8 <_kt_backslash_escape+0xb8>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @_kt_backslash_escape(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %37 [
i32 48, label %9
i32 49, label %9
i32 50, label %9
i32 51, label %9
i32 52, label %9
i32 53, label %9
i32 54, label %9
i32 55, label %9
i32 97, label %12
i32 98, label %15
i32 101, label %18
i32 69, label %18
i32 102, label %21
i32 110, label %24
i32 114, label %27
i32 116, label %30
i32 118, label %33
i32 0, label %36
]
9: ; preds = %2, %2, %2, %2, %2, %2, %2, %2
%10 = load i8*, i8** %3
%11 = call signext i8 @strtol(i8* %10, i8** %3, i32 8)
store i8 %11, i8* %5
br label %41
12: ; preds = %2
store i8 7, i8* %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %41
15: ; preds = %2
store i8 8, i8* %5
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %41
18: ; preds = %2, %2
store i8 27, i8* %5
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %41
21: ; preds = %2
store i8 12, i8* %5
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %41
24: ; preds = %2
store i8 10, i8* %5
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %41
27: ; preds = %2
store i8 13, i8* %5
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %41
30: ; preds = %2
store i8 9, i8* %5
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %41
33: ; preds = %2
store i8 11, i8* %5
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %3
br label %41
36: ; preds = %2
store i8 92, i8* %5
br label %41
37: ; preds = %2
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
%40 = load i8, i8* %38
store i8 %40, i8* %5
br label %41
41: ; preds = %37, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9
%42 = load i8**, i8*** %4
%43 = icmp ne i8** %42, null
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i8*, i8** %3
%46 = load i8**, i8*** %4
store i8* %45, i8** %46
br label %47
47: ; preds = %44, %41
%48 = load i8, i8* %5
ret i8 %48
}

LLVM IR (-O2):
define signext i8 @_kt_backslash_escape(i8* %0, i8** writeonly %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
switch i32 %5, label %24 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 97, label %8
i32 98, label %10
i32 101, label %12
i32 69, label %12
i32 102, label %14
i32 110, label %16
i32 114, label %18
i32 116, label %20
i32 118, label %22
i32 0, label %26
]
6: ; preds = %2, %2, %2, %2, %2, %2, %2, %2
%7 = call signext i8 @strtol(i8* %0, i8** %3, i32 8)
br label %26
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %9, i8** %3
br label %26
10: ; preds = %2
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %11, i8** %3
br label %26
12: ; preds = %2, %2
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %13, i8** %3
br label %26
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %15, i8** %3
br label %26
16: ; preds = %2
%17 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %17, i8** %3
br label %26
18: ; preds = %2
%19 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %19, i8** %3
br label %26
20: ; preds = %2
%21 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %21, i8** %3
br label %26
22: ; preds = %2
%23 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %23, i8** %3
br label %26
24: ; preds = %2
%25 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %25, i8** %3
br label %26
26: ; preds = %2, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6
%27 = phi i8 [ %4, %24 ], [ 11, %22 ], [ 9, %20 ], [ 13, %18 ], [ 10, %16 ], [ 12, %14 ], [ 27, %12 ], [ 8, %10 ], [ 7, %8 ], [ %7, %6 ], [ 92, %2 ]
%28 = icmp eq i8** %1, null
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = load i8*, i8** %3
store i8* %30, i8** %1
br label %31
31: ; preds = %29, %26
ret i8 %27
}