// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_lexer.c
// Function: lexEscChar
static char lexEscChar(Lexer *lex, bool *escaped)
{
    if (escaped) *escaped = false;
    char ch = lexChar(lex);

    if (ch == '\\')
    {
        if (escaped) *escaped = true;
        ch = lexChar(lex);

        switch (ch)
        {
            case '0': return '\0';
            case 'a': return '\a';
            case 'b': return '\b';
            case 'f': return '\f';
            case 'n': return '\n';
            case 'r': return '\r';
            case 't': return '\t';
            case 'v': return '\v';
            case 'x':
            {
                lexChar(lex);

                unsigned int hex = 0;
                int len = 0;
                const int items = sscanf(lex->buf + lex->bufPos, "%x%n", &hex, &len);

                if (items < 1 || hex > 0xFF)
                {
                    lex->error->handler(lex->error->context, "Illegal character code");
                    lex->tok.kind = TOK_NONE;
                    return 0;
                }

                lex->bufPos += len - 1;
                lex->pos += len - 1;
                return (char)hex;
            }
            default: return ch;
        }
    }
    return ch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1c4ce
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1bff0
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x5c, %eax
jne 0x1c62e
cmpq $0x0, -0x18(%rbp)
je 0x1c4f5
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1bff0
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
addl $-0x30, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x48, %eax
ja 0x1c626
movq -0x30(%rbp), %rax
leaq 0x1bcff6(%rip), %rcx    # 0x1d9518
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, -0x1(%rbp)
jmp 0x1c634
movb $0x7, -0x1(%rbp)
jmp 0x1c634
movb $0x8, -0x1(%rbp)
jmp 0x1c634
movb $0xc, -0x1(%rbp)
jmp 0x1c634
movb $0xa, -0x1(%rbp)
jmp 0x1c634
movb $0xd, -0x1(%rbp)
jmp 0x1c634
movb $0x9, -0x1(%rbp)
jmp 0x1c634
movb $0xb, -0x1(%rbp)
jmp 0x1c634
movq -0x10(%rbp), %rdi
callq 0x1bff0
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rdi
leaq 0x1bd25e(%rip), %rsi    # 0x1d9802
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
movb $0x0, %al
callq 0x32c0
movl %eax, -0x28(%rbp)
cmpl $0x1, -0x28(%rbp)
jl 0x1c5c5
cmpl $0xff, -0x20(%rbp)
jbe 0x1c5fe
movq -0x10(%rbp), %rax
movq 0x268(%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x268(%rax), %rax
movq 0x20(%rax), %rdi
leaq 0x1bd21e(%rip), %rsi    # 0x1d9807
movb $0x0, %al
callq *%rcx
movq -0x10(%rbp), %rax
movl $0x0, 0x28(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x1c634
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
addl 0x18(%rax), %ecx
movl %ecx, 0x18(%rax)
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
movl -0x20(%rbp), %eax
movb %al, -0x1(%rbp)
jmp 0x1c634
movb -0x19(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x1c634
movb -0x19(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)