// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/common/lexer.c
// Function: prv_validate_identifier
static void prv_validate_identifier(subtilis_lexer_t *l, subtilis_token_t *t,
				    char ch, subtilis_error_t *err)
{
	if (ch == 0) {
		ch = prv_complete_identifier(l, t, ch, err);
		if (l->index == l->buf_end) {
			t->tok.id_type.type = SUBTILIS_TYPE_REAL;
		} else if (ch == '$') {
			t->tok.id_type.type = SUBTILIS_TYPE_STRING;
			prv_set_next_with_err(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else if (ch == '%') {
			t->tok.id_type.type = SUBTILIS_TYPE_INTEGER;
			prv_set_next_with_err(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else if (ch == '&') {
			t->tok.id_type.type = SUBTILIS_TYPE_BYTE;
			prv_set_next_with_err(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else if (ch == '@') {
			prv_set_next_with_err(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			prv_complete_custom_type(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else {
			t->tok.id_type.type = SUBTILIS_TYPE_REAL;
		}
	} else {
		if (ch == '$') {
			t->tok.id_type.type = SUBTILIS_TYPE_STRING;
		} else if (ch == '%') {
			t->tok.id_type.type = SUBTILIS_TYPE_INTEGER;
		} else if (ch == '&') {
			t->tok.id_type.type = SUBTILIS_TYPE_BYTE;
		} else if (ch == '@') {
			prv_complete_custom_type(l, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else {
			t->tok.id_type.type = SUBTILIS_TYPE_REAL;
		}
	}

	prv_check_token_buffer(l, t, err, SUBTILIS_ERROR_IDENTIFIER_TOO_LONG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x15248
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
movq -0x20(%rbp), %rcx
movsbl %al, %edx
callq 0x152e0
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x360(%rcx), %rax
jne 0x15145
movq -0x10(%rbp), %rax
movl $0x4, 0x8(%rax)
jmp 0x15246
movsbl -0x11(%rbp), %eax
cmpl $0x24, %eax
jne 0x1517d
movq -0x10(%rbp), %rax
movl $0x7, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x14700
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x15178
jmp 0x152da
jmp 0x15244
movsbl -0x11(%rbp), %eax
cmpl $0x25, %eax
jne 0x151b5
movq -0x10(%rbp), %rax
movl $0x5, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x14700
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x151b0
jmp 0x152da
jmp 0x15242
movsbl -0x11(%rbp), %eax
cmpl $0x26, %eax
jne 0x151ea
movq -0x10(%rbp), %rax
movl $0x6, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x14700
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x151e8
jmp 0x152da
jmp 0x15240
movsbl -0x11(%rbp), %eax
cmpl $0x40, %eax
jne 0x15233
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x14700
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x15212
jmp 0x152da
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x153c0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x15231
jmp 0x152da
jmp 0x1523e
movq -0x10(%rbp), %rax
movl $0x4, 0x8(%rax)
jmp 0x15240
jmp 0x15242
jmp 0x15244
jmp 0x15246
jmp 0x152c4
movsbl -0x11(%rbp), %eax
cmpl $0x24, %eax
jne 0x1525e
movq -0x10(%rbp), %rax
movl $0x7, 0x8(%rax)
jmp 0x152c2
movsbl -0x11(%rbp), %eax
cmpl $0x25, %eax
jne 0x15274
movq -0x10(%rbp), %rax
movl $0x5, 0x8(%rax)
jmp 0x152c0
movsbl -0x11(%rbp), %eax
cmpl $0x26, %eax
jne 0x1528a
movq -0x10(%rbp), %rax
movl $0x6, 0x8(%rax)
jmp 0x152be
movsbl -0x11(%rbp), %eax
cmpl $0x40, %eax
jne 0x152b1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x153c0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x152af
jmp 0x152da
jmp 0x152bc
movq -0x10(%rbp), %rax
movl $0x4, 0x8(%rax)
jmp 0x152be
jmp 0x152c0
jmp 0x152c2
jmp 0x152c4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x9, %ecx
callq 0x14bb0
addq $0x20, %rsp
popq %rbp
retq