// File: joncampbell123[P]haxcc/haxpp.cpp
// Function: parse_string_char_escape(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
unsigned long long parse_string_char_escape(string::iterator &li,const string::iterator lie) {
    unsigned long long r = ' ';
    char c;

    if (li == lie) throw invalid_argument("expected string char escape");
    if (*li != '\\') throw invalid_argument("expected string char escape backslash");
    li++;
    if (li == lie) throw invalid_argument("expected string char escape and char");
    c = (*li++);

    switch (c) {
        case 'a':   return 0x07;
        case 'b':   return 0x08;
        case 'e':   return 0x1B;
        case 'f':   return 0x0C;
        case 'n':   return 0x0A;
        case 'r':   return 0x0D;
        case 't':   return 0x09;
        case 'v':   return 0x0B;
        case '\\':  return 0x5C;
        case '\'':  return 0x27;
        case '\"':  return 0x22;
        case '?':   return 0x3F;
        case 'x':   return parse_escape_hex(li,lie,2,2);
        case 'u':   return parse_escape_hex(li,lie,4,4);
        case 'U':   return parse_escape_hex(li,lie,8,8);
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            li--; /* step back so it can parse the first digit we just ate */
            return parse_escape_oct(li,lie,1,3);
        default:
            fprintf(stderr,"WARNING: Unknown char escape \\%c\n",c);
            break;
    };

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq $0x20, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x15b70
testb $0x1, %al
jne 0x5bde
jmp 0x5c31
movl $0x10, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0x1f05c(%rip), %rsi     # 0x24c55
callq 0x3530
jmp 0x5c00
movq -0x78(%rbp), %rdi
movq 0x2d3cd(%rip), %rsi     # 0x32fd8
movq 0x2d3ae(%rip), %rdx     # 0x32fc0
callq 0x34b0
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31f0
jmp 0x5eca
movq -0x18(%rbp), %rdi
callq 0x15a50
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0x5c95
movl $0x10, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x80(%rbp)
leaq 0x1f014(%rip), %rsi     # 0x24c71
callq 0x3530
jmp 0x5c64
movq -0x80(%rbp), %rdi
movq 0x2d369(%rip), %rsi     # 0x32fd8
movq 0x2d34a(%rip), %rdx     # 0x32fc0
callq 0x34b0
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31f0
jmp 0x5eca
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x15a70
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x15b70
testb $0x1, %al
jne 0x5cb7
jmp 0x5d13
movl $0x10, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
leaq 0x1efc2(%rip), %rsi     # 0x24c97
callq 0x3530
jmp 0x5cdc
movq -0x88(%rbp), %rdi
movq 0x2d2ee(%rip), %rsi     # 0x32fd8
movq 0x2d2cf(%rip), %rdx     # 0x32fc0
callq 0x34b0
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31f0
jmp 0x5eca
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x15a70
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x15a50
movb (%rax), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x90(%rbp)
subl $0x56, %eax
ja 0x5e99
movq -0x90(%rbp), %rax
leaq 0x1e419(%rip), %rcx     # 0x24170
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x7, -0x8(%rbp)
jmp 0x5ebd
movq $0x8, -0x8(%rbp)
jmp 0x5ebd
movq $0x1b, -0x8(%rbp)
jmp 0x5ebd
movq $0xc, -0x8(%rbp)
jmp 0x5ebd
movq $0xa, -0x8(%rbp)
jmp 0x5ebd
movq $0xd, -0x8(%rbp)
jmp 0x5ebd
movq $0x9, -0x8(%rbp)
jmp 0x5ebd
movq $0xb, -0x8(%rbp)
jmp 0x5ebd
movq $0x5c, -0x8(%rbp)
jmp 0x5ebd
movq $0x27, -0x8(%rbp)
jmp 0x5ebd
movq $0x22, -0x8(%rbp)
jmp 0x5ebd
movq $0x3f, -0x8(%rbp)
jmp 0x5ebd
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
movl $0x2, %ecx
movl %ecx, %edx
callq 0x5a80
movq %rax, -0x8(%rbp)
jmp 0x5ebd
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
movl $0x4, %ecx
movl %ecx, %edx
callq 0x5a80
movq %rax, -0x8(%rbp)
jmp 0x5ebd
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rsi
movl $0x8, %ecx
movl %ecx, %edx
callq 0x5a80
movq %rax, -0x8(%rbp)
jmp 0x5ebd
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x15bb0
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
movl $0x1, %edx
movl $0x3, %ecx
callq 0x5950
movq %rax, -0x8(%rbp)
jmp 0x5ebd
movq 0x2d118(%rip), %rax     # 0x32fb8
movq (%rax), %rdi
movsbl -0x21(%rbp), %edx
leaq 0x1ee0e(%rip), %rsi     # 0x24cbc
movb $0x0, %al
callq 0x33f0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34e0
nopw %cs:(%rax,%rax)