#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 */
unsigned char *unescape_c(char *str, int len) {
  int c;
  int escaped;
  int offset;
  int rlen;
  char *ptr;
  if (!str || len <= 0)
    return NULL;
  for (ptr = str; *ptr != 0 && offset < len; ptr++) {
    offset = ptr - str;
    rlen = len - offset;
    if (*ptr != '\\')
      continue;
    switch (*ptr) {
    case 'a':
      c = '\007';
      break;
    case 'b':
      c = '\b';
      break;
    case 'f':
      c = '\f';
      break;
    case 'n':
      c = '\n';
      break;
    case 'r':
      c = '\r';
      break;
    case 't':
      c = '\t';
      break;
    case 'v':
      c = '\013';
      break;
    case '\\':
      c = '\\';
      break;
    case '?':
      c = '?';
      break;
    case '\'':
      c = '\'';
      break;
    case '"':
      c = '\"';
      break;
    case 'x':
      break;
    default:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<unescape_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <unescape_c+0x20>
cmpl   $0x0,-0x14(%rbp)
jg     112d <unescape_c+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    1263 <unescape_c+0x163>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x31(%rbp)
je     1156 <unescape_c+0x56>
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1166 <unescape_c+0x66>
jmp    1263 <unescape_c+0x163>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1192 <unescape_c+0x92>
jmp    1252 <unescape_c+0x152>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x56,%eax
ja     1248 <unescape_c+0x148>
mov    -0x40(%rbp),%rax
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x8,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0xc,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0xa,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0xd,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x9,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0xb,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x5c,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x3f,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x27,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
movl   $0x22,-0x18(%rbp)
jmp    124d <unescape_c+0x14d>
jmp    124d <unescape_c+0x14d>
jmp    124d <unescape_c+0x14d>
jmp    1252 <unescape_c+0x152>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1135 <unescape_c+0x35>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape_c>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @unescape_c(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13, %2
store i8* null, i8** %3
br label %66
17: ; preds = %13
%18 = load i8*, i8** %4
store i8* %18, i8** %10
br label %19
19: ; preds = %63, %17
%20 = load i8*, i8** %10
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = load i32, i32* %8
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br label %28
28: ; preds = %24, %19
%29 = phi i1 [ false, %19 ], [ %27, %24 ]
br i1 %29, label %30, label %66
30: ; preds = %28
%31 = load i8*, i8** %10
%32 = load i8*, i8** %4
%33 = ptrtoint i8* %31 to i64
%34 = ptrtoint i8* %32 to i64
%35 = sub i64 %33, %34
%36 = trunc i64 %35 to i32
store i32 %36, i32* %8
%37 = load i32, i32* %5
%38 = load i32, i32* %8
%39 = sub nsw i32 %37, %38
store i32 %39, i32* %9
%40 = load i8*, i8** %10
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 92
br i1 %43, label %44, label %45
44: ; preds = %30
br label %63
45: ; preds = %30
%46 = load i8*, i8** %10
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
switch i32 %48, label %61 [
i32 97, label %49
i32 98, label %50
i32 102, label %51
i32 110, label %52
i32 114, label %53
i32 116, label %54
i32 118, label %55
i32 92, label %56
i32 63, label %57
i32 39, label %58
i32 34, label %59
i32 120, label %60
]
49: ; preds = %45
store i32 7, i32* %6
br label %62
50: ; preds = %45
store i32 8, i32* %6
br label %62
51: ; preds = %45
store i32 12, i32* %6
br label %62
52: ; preds = %45
store i32 10, i32* %6
br label %62
53: ; preds = %45
store i32 13, i32* %6
br label %62
54: ; preds = %45
store i32 9, i32* %6
br label %62
55: ; preds = %45
store i32 11, i32* %6
br label %62
56: ; preds = %45
store i32 92, i32* %6
br label %62
57: ; preds = %45
store i32 63, i32* %6
br label %62
58: ; preds = %45
store i32 39, i32* %6
br label %62
59: ; preds = %45
store i32 34, i32* %6
br label %62
60: ; preds = %45
br label %62
61: ; preds = %45
br label %62
62: ; preds = %61, %60, %59, %58, %57, %56, %55, %54, %53, %52, %51, %50, %49
br label %63
63: ; preds = %62, %44
%64 = load i8*, i8** %10
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %10
br label %19
66: ; preds = %16, %28
%67 = load i8*, i8** %3
ret i8* %67
}

LLVM IR (-O2):
define noalias i8* @unescape_c(i8* %0, i32 %1) {
ret i8* null
}