// File: /workspace/github_c_makefile_star2_O0/Yamsman[P]scc/src/lex.c
// Function: lex_eschar
char lex_eschar(lexer *lx) {
	//Simple escape characters
	s_pos loc = lx->tgt->loc;
	switch (lex_cur(lx)) {
		case '\'': lex_advc(lx); return '\'';
		case '\"': lex_advc(lx); return '\"';
		case '\?': lex_advc(lx); return '\?';
		case '\\': lex_advc(lx); return '\\';
		case 'a':  lex_advc(lx); return '\a';
		case 'b':  lex_advc(lx); return '\b';
		case 'f':  lex_advc(lx); return '\f';
		case 'n':  lex_advc(lx); return '\n';
		case 'r':  lex_advc(lx); return '\r';
		case 't':  lex_advc(lx); return '\t';
		case 'v':  lex_advc(lx); return '\v';
	}

	//Number escape character
	char cur = lex_cur(lx);
	unsigned int val = 0;
	if (cur == 'x') {
		//Hexadecimal
		cur = lex_advc(lx);
		if (!isxdigit(cur)) {
			c_warn(&loc, "\\x escape character without hexadecimal digits\n");
			return 0;
		}

		//Read number and check range
		while (isxdigit(cur)) {
			int dval = (!isdigit(cur)) ? 10 + (tolower(cur) - 'a') : (cur - '0');
			val = (val * 16) + dval;
			cur = lex_advc(lx);
		}
		if (val > 0xFF)
			c_warn(&loc, "hexadecimal escape char out of range\n");
	} else if (isdigit(cur) && cur != '8' && cur != '9') {
		//Octal
		//Read number
		while (isdigit(cur) && cur != '8' && cur != '9') {
			val = (val * 8) + (cur - '0');
			cur = lex_advc(lx);
		}

		//Check range
		if (val > 0377)
			c_warn(&loc, "octal escape char out of range\n");
	}

	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq %rcx, -0x20(%rbp)
movups 0x28(%rax), %xmm0
movaps %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x81b0
movsbl %al, %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x54, %eax
ja 0x8adb
movq -0x48(%rbp), %rax
leaq 0x8fa4(%rip), %rcx      # 0x119b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x27, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x22, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x3f, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x5c, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x7, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x8, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0xc, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0xa, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0xd, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0x9, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81f0
movb $0xb, -0x1(%rbp)
jmp 0x8ca2
movq -0x10(%rbp), %rdi
callq 0x81b0
movb %al, -0x31(%rbp)
movl $0x0, -0x38(%rbp)
movsbl -0x31(%rbp), %eax
cmpl $0x78, %eax
jne 0x8bd9
movq -0x10(%rbp), %rdi
callq 0x81f0
movb %al, -0x31(%rbp)
callq 0x3240
movq (%rax), %rax
movsbl -0x31(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x8b3f
leaq -0x30(%rbp), %rdi
leaq 0x94c7(%rip), %rsi      # 0x11ff6
movb $0x0, %al
callq 0x3980
movb $0x0, -0x1(%rbp)
jmp 0x8ca2
jmp 0x8b41
callq 0x3240
movq (%rax), %rax
movsbl -0x31(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x8bb9
callq 0x3240
movq (%rax), %rax
movsbl -0x31(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x8b8f
movsbl -0x31(%rbp), %edi
callq 0x3180
subl $0x61, %eax
addl $0xa, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8b99
movsbl -0x31(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
shll $0x4, %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x81f0
movb %al, -0x31(%rbp)
jmp 0x8b41
cmpl $0xff, -0x38(%rbp)
jbe 0x8bd4
leaq -0x30(%rbp), %rdi
leaq 0x9459(%rip), %rsi      # 0x12026
movb $0x0, %al
callq 0x3980
jmp 0x8c9c
callq 0x3240
movq (%rax), %rax
movsbl -0x31(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x8c9a
movsbl -0x31(%rbp), %eax
cmpl $0x38, %eax
je 0x8c9a
movsbl -0x31(%rbp), %eax
cmpl $0x39, %eax
je 0x8c9a
jmp 0x8c16
callq 0x3240
movq (%rax), %rax
movsbl -0x31(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x4d(%rbp)
je 0x8c54
movsbl -0x31(%rbp), %ecx
xorl %eax, %eax
cmpl $0x38, %ecx
movb %al, -0x4d(%rbp)
je 0x8c54
movsbl -0x31(%rbp), %eax
cmpl $0x39, %eax
setne %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x8c5d
jmp 0x8c7d
movl -0x38(%rbp), %eax
shll $0x3, %eax
movsbl -0x31(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x81f0
movb %al, -0x31(%rbp)
jmp 0x8c16
cmpl $0xff, -0x38(%rbp)
jbe 0x8c98
leaq -0x30(%rbp), %rdi
leaq 0x93bb(%rip), %rsi      # 0x1204c
movb $0x0, %al
callq 0x3980
jmp 0x8c9a
jmp 0x8c9c
movl -0x38(%rbp), %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)