// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/char.c
// Function: parse_escape
static const char *parse_escape(const char *p, unsigned *val, const char *end, int bits, struct position pos)
{
	unsigned c = *p++;
	unsigned d;
	if (c != '\\') {
		*val = c;
		return p;
	}

	c = *p++;
	switch (c) {
	case 'a': c = '\a'; break;
	case 'b': c = '\b'; break;
	case 't': c = '\t'; break;
	case 'n': c = '\n'; break;
	case 'v': c = '\v'; break;
	case 'f': c = '\f'; break;
	case 'r': c = '\r'; break;
	case 'e': c = '\e'; break;
	case 'x': {
		unsigned mask = -(1U << (bits - 4));
		for (c = 0; p < end; c = (c << 4) + d) {
			d = hexval(*p);
			if (d > 16)
				break;
			p++;
			if (c & mask) {
				warning(pos,
					"hex escape sequence out of range");
				mask = 0;
			}
		}
		break;
	}
	case '0'...'7': {
		if (p + 2 < end)
			end = p + 2;
		c -= '0';
		while (p < end && (d = *p - '0') < 8) {
			c = (c << 3) + d;
			p++;
		}
		if ((c & 0400) && bits < 9)
			warning(pos,
				"octal escape sequence out of range");
		break;
	}
	default:	/* everything else is left as is */
		warning(pos, "unknown escape sequence: '\\%c'", c);
		break;
	case '\\':
	case '\'':
	case '"':
	case '?':
		break;	/* those are legal, so no warnings */
	}
	*val = c & ~((~0U << (bits - 1)) << 1);
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movsbl (%rdi), %eax
cmpl $0x5c, %eax
jne 0x3f0d4
movl %ecx, %r15d
movq %rdx, %rbp
leaq 0x2(%rdi), %r14
movzbl 0x1(%rdi), %eax
movsbl %al, %r12d
cmpq $0x3f, %rax
ja 0x3f121
movabsq $0xff000000000000, %rcx # imm = 0xFF000000000000
btq %rax, %rcx
jae 0x3f10d
addq $0x4, %rdi
cmpq %rbp, %rdi
cmovaeq %rbp, %rdi
addl $-0x30, %r12d
cmpq %rdi, %r14
jae 0x3f0df
movsbl (%r14), %eax
addl $-0x30, %eax
cmpl $0x7, %eax
ja 0x3f0df
leal (%rax,%r12,8), %r12d
incq %r14
jmp 0x3f0ba
incq %rdi
movq %rdi, %r14
jmp 0x3f23a
cmpl $0x8, %r15d
jg 0x3f228
movl %r12d, %eax
andl $0x100, %eax            # imm = 0x100
je 0x3f228
leaq 0xc6f8(%rip), %rsi      # 0x4b7f6
movq %r8, %rdi
xorl %eax, %eax
callq 0x118fc
jmp 0x3f228
movabsq $-0x7fffff7c00000000, %rcx # imm = 0x8000008400000000
btq %rax, %rcx
jb 0x3f228
leal -0x5c(%rax), %ecx
cmpl $0xa, %ecx
jbe 0x3f150
addl $-0x6e, %eax
cmpl $0xa, %eax
ja 0x3f214
leaq 0xc5f8(%rip), %rcx      # 0x4b734
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, %r12d
jmp 0x3f228
leaq 0xc5b1(%rip), %rax      # 0x4b708
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x7, %r12d
jmp 0x3f228
movl $0xc, %r12d
jmp 0x3f228
movl $0x1b, %r12d
jmp 0x3f228
movl $0x8, %r12d
jmp 0x3f228
xorl %r12d, %r12d
cmpq %rbp, %r14
jae 0x3f228
movq %r8, 0x10(%rsp)
leal -0x4(%r15), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
movl %eax, 0xc(%rsp)
xorl %r12d, %r12d
movsbl (%r14), %edi
callq 0x2f558
cmpl $0x10, %eax
ja 0x3f228
movl %eax, %r13d
testl %r12d, 0xc(%rsp)
je 0x3f1e2
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rdi
leaq 0xc5fa(%rip), %rsi      # 0x4b7d5
xorl %eax, %eax
callq 0x118fc
incq %r14
shll $0x4, %r12d
addl %r12d, %r13d
movl %r13d, %r12d
cmpq %rbp, %r14
jne 0x3f1af
movq %rbp, %r14
movl %r13d, %r12d
jmp 0x3f228
movl $0xd, %r12d
jmp 0x3f228
movl $0xb, %r12d
jmp 0x3f228
movl $0x9, %r12d
jmp 0x3f228
leaq 0xc5fe(%rip), %rsi      # 0x4b819
movq %r8, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x118fc
decb %r15b
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl %r15d, %ecx
shll %cl, %eax
notl %eax
andl %r12d, %eax
movl %eax, (%rbx)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq