// File: /workspace/github_c_makefile_star2_O1/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 0x401bc
movl %ecx, %r15d
movq %rdx, %rbp
leaq 0x2(%rdi), %r14
movzbl 0x1(%rdi), %eax
movsbl %al, %r12d
cmpq $0x3f, %rax
ja 0x40209
movabsq $0xff000000000000, %rcx # imm = 0xFF000000000000
btq %rax, %rcx
jae 0x401f5
addq $0x4, %rdi
cmpq %rbp, %rdi
cmovaeq %rbp, %rdi
addl $-0x30, %r12d
cmpq %rdi, %r14
jae 0x401c7
movsbl (%r14), %eax
addl $-0x30, %eax
cmpl $0x7, %eax
ja 0x401c7
leal (%rax,%r12,8), %r12d
incq %r14
jmp 0x401a2
incq %rdi
movq %rdi, %r14
jmp 0x40319
cmpl $0x8, %r15d
jg 0x40307
movl %r12d, %eax
andl $0x100, %eax            # imm = 0x100
je 0x40307
leaq 0xc6a0(%rip), %rsi      # 0x4c886
movq %r8, %rdi
xorl %eax, %eax
callq 0x118b4
jmp 0x40307
movabsq $-0x7fffff7c00000000, %rcx # imm = 0x8000008400000000
btq %rax, %rcx
jb 0x40307
leal -0x5c(%rax), %ecx
cmpl $0xa, %ecx
jbe 0x40238
addl $-0x6e, %eax
cmpl $0xa, %eax
ja 0x402f3
leaq 0xc5a0(%rip), %rcx      # 0x4c7c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, %r12d
jmp 0x40307
leaq 0xc559(%rip), %rax      # 0x4c798
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x7, %r12d
jmp 0x40307
movl $0xc, %r12d
jmp 0x40307
movl $0x1b, %r12d
jmp 0x40307
movl $0x8, %r12d
jmp 0x40307
xorl %r12d, %r12d
cmpq %rbp, %r14
jae 0x40307
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 0x2fb94
cmpl $0x10, %eax
ja 0x40307
movl %eax, %r13d
testl %r12d, 0xc(%rsp)
je 0x402ca
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rdi
leaq 0xc5a2(%rip), %rsi      # 0x4c865
xorl %eax, %eax
callq 0x118b4
incq %r14
shll $0x4, %r12d
addl %r13d, %r12d
cmpq %rbp, %r14
jne 0x40297
jmp 0x40307
movl $0xd, %r12d
jmp 0x40307
movl $0xb, %r12d
jmp 0x40307
movl $0x9, %r12d
jmp 0x40307
leaq 0xc5af(%rip), %rsi      # 0x4c8a9
movq %r8, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x118b4
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