#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 */
int /*<<< orphan*/ isxdigit(char const);
int xdigitValue(char const);
int readTagCharacter(const char **s) {
  int c = **s;
  (*s)++;
  if (c == '\\') {
    switch (**s) {
    case 't':
      c = '\t';
      (*s)++;
      break;
    case 'r':
      c = '\r';
      (*s)++;
      break;
    case 'n':
      c = '\n';
      (*s)++;
      break;
    case '\\':
      c = '\\';
      (*s)++;
      break;
    case 'a':
      c = '\a';
      (*s)++;
      break;
    case 'b':
      c = '\b';
      (*s)++;
      break;
    case 'v':
      c = '\v';
      (*s)++;
      break;
    case 'f':
      c = '\f';
      (*s)++;
      break;
    case 'x':
      if (isxdigit((*s)[1]) && isxdigit((*s)[2])) {
        int val = (xdigitValue((*s)[1]) << 4) | xdigitValue((*s)[2]);
        if (val < 0x80) {
          (*s) += 3;
          c = val;
        }
      }
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<readTagCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
cmpl   $0x5c,-0xc(%rbp)
jne    12e3 <readTagCharacter+0x1c3>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
add    $0xffffffa4,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x1c,%eax
ja     12de <readTagCharacter+0x1be>
mov    -0x18(%rbp),%rax
lea    0xe88(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0xd,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0x5c,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0x8,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0xb,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
movl   $0xc,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    12de <readTagCharacter+0x1be>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%edi
call   1040 <isxdigit@plt>
cmp    $0x0,%eax
je     12d9 <readTagCharacter+0x1b9>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl 0x2(%rax),%edi
call   1040 <isxdigit@plt>
cmp    $0x0,%eax
je     12d9 <readTagCharacter+0x1b9>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%edi
call   1030 <xdigitValue@plt>
shl    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl 0x2(%rax),%edi
call   1030 <xdigitValue@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x80,-0x10(%rbp)
jge    12d4 <readTagCharacter+0x1b4>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    12d9 <readTagCharacter+0x1b9>
jmp    12de <readTagCharacter+0x1be>
jmp    12e3 <readTagCharacter+0x1c3>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTagCharacter>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%rcx
movsbl (%rcx),%ebp
lea    0x1(%rcx),%rax
mov    %rax,(%rdi)
cmp    $0x5c,%ebp
jne    11b4 <readTagCharacter+0x94>
movsbl (%rax),%eax
mov    $0x5c,%ebp
add    $0xffffffa4,%eax
cmp    $0x1c,%eax
ja     11b4 <readTagCharacter+0x94>
mov    %rdi,%rbx
lea    0xeb0(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
add    $0x2,%rcx
mov    $0x5c,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0x7,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0x8,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0xc,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0xa,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0xd,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0x9,%eax
jmp    11af <readTagCharacter+0x8f>
add    $0x2,%rcx
mov    $0xb,%eax
mov    %rcx,(%rbx)
mov    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
movsbl 0x2(%rcx),%edi
call   1040 <isxdigit@plt>
test   %eax,%eax
je     11b4 <readTagCharacter+0x94>
mov    (%rbx),%rax
movsbl 0x2(%rax),%edi
call   1040 <isxdigit@plt>
test   %eax,%eax
je     11b4 <readTagCharacter+0x94>
mov    (%rbx),%rax
movsbl 0x1(%rax),%edi
call   1030 <xdigitValue@plt>
mov    %eax,%r14d
shl    $0x4,%r14d
mov    (%rbx),%rax
movsbl 0x2(%rax),%edi
call   1030 <xdigitValue@plt>
or     %r14d,%eax
cmp    $0x7f,%eax
jg     11b4 <readTagCharacter+0x94>
mov    (%rbx),%rcx
add    $0x3,%rcx
jmp    11af <readTagCharacter+0x8f>

LLVM IR (-O0):
define i32 @readTagCharacter(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %9
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 92
br i1 %13, label %14, label %88
14: ; preds = %1
%15 = load i8**, i8*** %2
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %87 [
i32 116, label %19
i32 114, label %23
i32 110, label %27
i32 92, label %31
i32 97, label %35
i32 98, label %39
i32 118, label %43
i32 102, label %47
i32 120, label %51
]
19: ; preds = %14
store i32 9, i32* %3
%20 = load i8**, i8*** %2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
br label %87
23: ; preds = %14
store i32 13, i32* %3
%24 = load i8**, i8*** %2
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %24
br label %87
27: ; preds = %14
store i32 10, i32* %3
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %28
br label %87
31: ; preds = %14
store i32 92, i32* %3
%32 = load i8**, i8*** %2
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %32
br label %87
35: ; preds = %14
store i32 7, i32* %3
%36 = load i8**, i8*** %2
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %36
br label %87
39: ; preds = %14
store i32 8, i32* %3
%40 = load i8**, i8*** %2
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %40
br label %87
43: ; preds = %14
store i32 11, i32* %3
%44 = load i8**, i8*** %2
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %44
br label %87
47: ; preds = %14
store i32 12, i32* %3
%48 = load i8**, i8*** %2
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %48
br label %87
51: ; preds = %14
%52 = load i8**, i8*** %2
%53 = load i8*, i8** %52
%54 = getelementptr inbounds i8, i8* %53, i64 1
%55 = load i8, i8* %54
%56 = call i32 @isxdigit(i8 signext %55)
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %86
58: ; preds = %51
%59 = load i8**, i8*** %2
%60 = load i8*, i8** %59
%61 = getelementptr inbounds i8, i8* %60, i64 2
%62 = load i8, i8* %61
%63 = call i32 @isxdigit(i8 signext %62)
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %86
65: ; preds = %58
%66 = load i8**, i8*** %2
%67 = load i8*, i8** %66
%68 = getelementptr inbounds i8, i8* %67, i64 1
%69 = load i8, i8* %68
%70 = call i32 @xdigitValue(i8 signext %69)
%71 = shl i32 %70, 4
%72 = load i8**, i8*** %2
%73 = load i8*, i8** %72
%74 = getelementptr inbounds i8, i8* %73, i64 2
%75 = load i8, i8* %74
%76 = call i32 @xdigitValue(i8 signext %75)
%77 = or i32 %71, %76
store i32 %77, i32* %4
%78 = load i32, i32* %4
%79 = icmp slt i32 %78, 128
br i1 %79, label %80, label %85
80: ; preds = %65
%81 = load i8**, i8*** %2
%82 = load i8*, i8** %81
%83 = getelementptr inbounds i8, i8* %82, i64 3
store i8* %83, i8** %81
%84 = load i32, i32* %4
store i32 %84, i32* %3
br label %85
85: ; preds = %80, %65
br label %86
86: ; preds = %85, %58, %51
br label %87
87: ; preds = %14, %86, %47, %43, %39, %35, %31, %27, %23, %19
br label %88
88: ; preds = %87, %1
%89 = load i32, i32* %3
ret i32 %89
}

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