#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 */
struct _asm_context {
  int dummy;
};

/* Variables and functions */
int tokens_get_char(struct _asm_context *);
int /*<<< orphan*/ tokens_unget_char(struct _asm_context *, int);
int process_escape(struct _asm_context *asm_context, int process_zero) {
  int ch = tokens_get_char(asm_context);
  switch (ch) {
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case '"':
    return '"';
  case '\\':
    return '\\';
  case '\'':
    return '\'';
  case '0':
    if (process_zero == 1) {
      return '\0';
    }
    break;
  }
  tokens_unget_char(asm_context, ch);
  return '\\';
}


x86 assembly (clang, -O0):
<process_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tokens_get_char@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x22,%eax
je     11d9 <process_escape+0xb9>
jmp    114f <process_escape+0x2f>
mov    -0x1c(%rbp),%eax
sub    $0x27,%eax
je     11f1 <process_escape+0xd1>
jmp    1160 <process_escape+0x40>
mov    -0x1c(%rbp),%eax
sub    $0x30,%eax
je     11fd <process_escape+0xdd>
jmp    1171 <process_escape+0x51>
mov    -0x1c(%rbp),%eax
sub    $0x5c,%eax
je     11e5 <process_escape+0xc5>
jmp    1182 <process_escape+0x62>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
je     11b5 <process_escape+0x95>
jmp    1193 <process_escape+0x73>
mov    -0x1c(%rbp),%eax
sub    $0x72,%eax
je     11c1 <process_escape+0xa1>
jmp    11a4 <process_escape+0x84>
mov    -0x1c(%rbp),%eax
sub    $0x74,%eax
je     11cd <process_escape+0xad>
jmp    1218 <process_escape+0xf8>
movl   $0xa,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
movl   $0xd,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
movl   $0x9,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
movl   $0x22,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
movl   $0x5c,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
movl   $0x27,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
cmpl   $0x1,-0x14(%rbp)
jne    1213 <process_escape+0xf3>
movl   $0x0,-0x4(%rbp)
jmp    122b <process_escape+0x10b>
jmp    1218 <process_escape+0xf8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <tokens_unget_char@plt>
movl   $0x5c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_escape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <tokens_get_char@plt>
mov    %eax,%ecx
mov    %eax,%esi
cmp    $0x5b,%eax
jle    115a <process_escape+0x3a>
add    $0xffffffa4,%ecx
cmp    $0x18,%ecx
ja     1170 <process_escape+0x50>
mov    $0xa,%eax
lea    0xeb6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xd,%eax
jmp    1188 <process_escape+0x68>
cmp    $0x22,%ecx
je     117f <process_escape+0x5f>
cmp    $0x27,%ecx
je     117f <process_escape+0x5f>
cmp    $0x30,%ecx
jne    1170 <process_escape+0x50>
xor    %eax,%eax
cmp    $0x1,%ebp
je     1188 <process_escape+0x68>
mov    %rbx,%rdi
call   1040 <tokens_unget_char@plt>
mov    $0x5c,%eax
jmp    1188 <process_escape+0x68>
mov    %esi,%eax
jmp    1188 <process_escape+0x68>
mov    $0x9,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct._asm_context = type { i32 }
define i32 @process_escape(%struct._asm_context* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct._asm_context*
%5 = alloca i32
%6 = alloca i32
store %struct._asm_context* %0, %struct._asm_context** %4
store i32 %1, i32* %5
%7 = load %struct._asm_context*, %struct._asm_context** %4
%8 = call i32 @tokens_get_char(%struct._asm_context* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
switch i32 %9, label %21 [
i32 110, label %10
i32 114, label %11
i32 116, label %12
i32 34, label %13
i32 92, label %14
i32 39, label %15
i32 48, label %16
]
10: ; preds = %2
store i32 10, i32* %3
br label %25
11: ; preds = %2
store i32 13, i32* %3
br label %25
12: ; preds = %2
store i32 9, i32* %3
br label %25
13: ; preds = %2
store i32 34, i32* %3
br label %25
14: ; preds = %2
store i32 92, i32* %3
br label %25
15: ; preds = %2
store i32 39, i32* %3
br label %25
16: ; preds = %2
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %3
br label %25
20: ; preds = %16
br label %21
21: ; preds = %2, %20
%22 = load %struct._asm_context*, %struct._asm_context** %4
%23 = load i32, i32* %6
%24 = call i32 @tokens_unget_char(%struct._asm_context* %22, i32 %23)
store i32 92, i32* %3
br label %25
25: ; preds = %21, %19, %15, %14, %13, %12, %11, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
%struct._asm_context = type { i32 }
define i32 @process_escape(%struct._asm_context* %0, i32 %1) {
%3 = tail call i32 @tokens_get_char(%struct._asm_context* %0)
switch i32 %3, label %11 [
i32 110, label %13
i32 114, label %4
i32 116, label %5
i32 34, label %6
i32 92, label %7
i32 39, label %8
i32 48, label %9
]
4: ; preds = %2
br label %13
5: ; preds = %2
br label %13
6: ; preds = %2
br label %13
7: ; preds = %2
br label %13
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = icmp eq i32 %1, 1
br i1 %10, label %13, label %11
11: ; preds = %9, %2
%12 = tail call i32 @tokens_unget_char(%struct._asm_context* %0, i32 %3)
br label %13
13: ; preds = %9, %2, %11, %8, %7, %6, %5, %4
%14 = phi i32 [ 92, %11 ], [ %3, %8 ], [ %3, %7 ], [ %3, %6 ], [ 9, %5 ], [ 13, %4 ], [ 10, %2 ], [ 0, %9 ]
ret i32 %14
}