#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 */
scalar_t__ strtol(char *, char **, int /*<<< orphan*/);
char translate_escape(char **s) {
  switch (*(++(*s))) {
  case '0':
    return (char)strtol(*s, s, 0);
    break;
  case 'b':
    return '\b';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  default:
    return **s;
  }
  return '\0';
}


x86 assembly (clang, -O0):
<translate_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl 0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x30,%eax
je     1186 <translate_escape+0x76>
jmp    1142 <translate_escape+0x32>
mov    -0x14(%rbp),%eax
sub    $0x62,%eax
je     11a0 <translate_escape+0x90>
jmp    1153 <translate_escape+0x43>
mov    -0x14(%rbp),%eax
sub    $0x6e,%eax
je     11a9 <translate_escape+0x99>
jmp    1164 <translate_escape+0x54>
mov    -0x14(%rbp),%eax
sub    $0x72,%eax
je     11b2 <translate_escape+0xa2>
jmp    1175 <translate_escape+0x65>
mov    -0x14(%rbp),%eax
sub    $0x74,%eax
je     11bb <translate_escape+0xab>
jmp    11c4 <translate_escape+0xb4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %al,-0x1(%rbp)
jmp    11d0 <translate_escape+0xc0>
movb   $0x8,-0x1(%rbp)
jmp    11d0 <translate_escape+0xc0>
movb   $0xa,-0x1(%rbp)
jmp    11d0 <translate_escape+0xc0>
movb   $0xd,-0x1(%rbp)
jmp    11d0 <translate_escape+0xc0>
movb   $0x9,-0x1(%rbp)
jmp    11d0 <translate_escape+0xc0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_escape>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rax
lea    0x1(%rax),%rdi
mov    %rdi,(%rsi)
mov    0x1(%rax),%cl
movsbl %cl,%eax
lea    -0x62(%rax),%edx
cmp    $0x12,%edx
ja     1142 <translate_escape+0x32>
mov    $0x8,%al
lea    0xecb(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0xa,%al
pop    %rcx
ret
cmp    $0x30,%eax
jne    1150 <translate_escape+0x40>
xor    %edx,%edx
call   1030 <strtol@plt>
pop    %rcx
ret
mov    %ecx,%eax
pop    %rcx
ret
mov    $0xd,%al
pop    %rcx
ret
mov    $0x9,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @translate_escape(i8** %0) {
%2 = alloca i8
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %19 [
i32 48, label %9
i32 98, label %15
i32 110, label %16
i32 114, label %17
i32 116, label %18
]
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %3
%13 = call i64 @strtol(i8* %11, i8** %12, i32 0)
%14 = trunc i64 %13 to i8
store i8 %14, i8* %2
br label %23
15: ; preds = %1
store i8 8, i8* %2
br label %23
16: ; preds = %1
store i8 10, i8* %2
br label %23
17: ; preds = %1
store i8 13, i8* %2
br label %23
18: ; preds = %1
store i8 9, i8* %2
br label %23
19: ; preds = %1
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = load i8, i8* %21
store i8 %22, i8* %2
br label %23
23: ; preds = %19, %18, %17, %16, %15, %9
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @translate_escape(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 48, label %6
i32 98, label %13
i32 110, label %9
i32 114, label %10
i32 116, label %11
]
6: ; preds = %1
%7 = tail call i64 @strtol(i8* %3, i8** %0, i32 0)
%8 = trunc i64 %7 to i8
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %6
%14 = phi i8 [ %4, %12 ], [ 9, %11 ], [ 13, %10 ], [ 10, %9 ], [ %8, %6 ], [ 8, %1 ]
ret i8 %14
}