#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 _citrus_memory_stream {
  int dummy;
};

/* Variables and functions */
int _citrus_memory_stream_getc(struct _citrus_memory_stream *);
int /*<<< orphan*/ _citrus_memory_stream_ungetc(struct _citrus_memory_stream *,
                                                int);
int _citrus_prop_read_chr_common(struct _citrus_memory_stream *, int *, int);
int _citrus_prop_read_character_common(
    struct _citrus_memory_stream *__restrict ms, int *__restrict result) {
  int base, ch;
  ch = _citrus_memory_stream_getc(ms);
  if (ch != '\\')
    *result = ch;
  else {
    ch = _citrus_memory_stream_getc(ms);
    base = 16;
    switch (ch) {
    case 'a':
      *result = '\a';
      break;
    case 'b':
      *result = '\b';
      break;
    case 'f':
      *result = '\f';
      break;
    case 'n':
      *result = '\n';
      break;
    case 'r':
      *result = '\r';
      break;
    case 't':
      *result = '\t';
      break;
    case 'v':
      *result = '\v';
      break;
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
      _citrus_memory_stream_ungetc(ms, ch);
      base -= 8;
    case 'x':
      return (_citrus_prop_read_chr_common(ms, result, base));
    default:
      *result = ch;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<_citrus_prop_read_character_common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_citrus_memory_stream_getc@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x5c,-0x20(%rbp)
je     1164 <_citrus_prop_read_character_common+0x34>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1244 <_citrus_prop_read_character_common+0x114>
mov    -0x10(%rbp),%rdi
call   1040 <_citrus_memory_stream_getc@plt>
mov    %eax,-0x20(%rbp)
movl   $0x10,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x48,%eax
ja     1236 <_citrus_prop_read_character_common+0x106>
mov    -0x28(%rbp),%rax
lea    0xe69(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
jmp    123f <_citrus_prop_read_character_common+0x10f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1030 <_citrus_memory_stream_ungetc@plt>
mov    -0x1c(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <_citrus_prop_read_chr_common@plt>
mov    %eax,-0x4(%rbp)
jmp    124b <_citrus_prop_read_character_common+0x11b>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1244 <_citrus_prop_read_character_common+0x114>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_prop_read_character_common>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_citrus_memory_stream_getc@plt>
cmp    $0x5c,%eax
jne    118c <_citrus_prop_read_character_common+0x5c>
mov    %rbx,%rdi
call   1040 <_citrus_memory_stream_getc@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0x48,%ecx
ja     118c <_citrus_prop_read_character_common+0x5c>
mov    $0x10,%edx
lea    0xe9e(%rip),%rsi
movslq (%rsi,%rcx,4),%rcx
add    %rsi,%rcx
jmp    *%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_citrus_memory_stream_ungetc@plt>
mov    $0x8,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <_citrus_prop_read_chr_common@plt>
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movl   $0x8,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0xc,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0xa,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0xd,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0x9,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0xb,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>
movl   $0x7,(%r14)
jmp    118f <_citrus_prop_read_character_common+0x5f>

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

LLVM IR (-O2):
%struct._citrus_memory_stream = type { i32 }
define i32 @_citrus_prop_read_character_common(%struct._citrus_memory_stream* noalias %0, i32* noalias %1) {
%3 = tail call i32 @_citrus_memory_stream_getc(%struct._citrus_memory_stream* %0)
%4 = icmp eq i32 %3, 92
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 %3, i32* %1
br label %21
6: ; preds = %2
%7 = tail call i32 @_citrus_memory_stream_getc(%struct._citrus_memory_stream* %0)
switch i32 %7, label %20 [
i32 97, label %8
i32 98, label %9
i32 102, label %10
i32 110, label %11
i32 114, label %12
i32 116, label %13
i32 118, label %14
i32 48, label %15
i32 49, label %15
i32 50, label %15
i32 51, label %15
i32 52, label %15
i32 53, label %15
i32 54, label %15
i32 55, label %15
i32 120, label %17
]
8: ; preds = %6
store i32 7, i32* %1
br label %21
9: ; preds = %6
store i32 8, i32* %1
br label %21
10: ; preds = %6
store i32 12, i32* %1
br label %21
11: ; preds = %6
store i32 10, i32* %1
br label %21
12: ; preds = %6
store i32 13, i32* %1
br label %21
13: ; preds = %6
store i32 9, i32* %1
br label %21
14: ; preds = %6
store i32 11, i32* %1
br label %21
15: ; preds = %6, %6, %6, %6, %6, %6, %6, %6
%16 = tail call i32 @_citrus_memory_stream_ungetc(%struct._citrus_memory_stream* %0, i32 %7)
br label %17
17: ; preds = %6, %15
%18 = phi i32 [ 16, %6 ], [ 8, %15 ]
%19 = tail call i32 @_citrus_prop_read_chr_common(%struct._citrus_memory_stream* %0, i32* %1, i32 %18)
br label %21
20: ; preds = %6
store i32 %7, i32* %1
br label %21
21: ; preds = %5, %20, %14, %13, %12, %11, %10, %9, %8, %17
%22 = phi i32 [ %19, %17 ], [ 0, %8 ], [ 0, %9 ], [ 0, %10 ], [ 0, %11 ], [ 0, %12 ], [ 0, %13 ], [ 0, %14 ], [ 0, %20 ], [ 0, %5 ]
ret i32 %22
}