// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_output.c
// Function: subtilis_parser_vdu
void subtilis_parser_vdu(subtilis_parser_t *p, subtilis_token_t *t,
			 subtilis_error_t *err)
{
	subtilis_exp_t *e;
	const char *tbuf;

	/*
	 * NOTE that there is a problem with the grammar here.  We cannot
	 * allow a VDU statement to terminate with an operator otherwise
	 * we will not know whether a variable following the operator
	 * should be sent to the VDU driver or be used to assign a value to
	 * a variable, e.g,
	 *
	 * VDU 19,2,4;0;
	 * A% = 10
	 *
	 * will fail to parse.  Consequently, subtilis will allow
	 *
	 * VDU [19,2,4;0;]
	 */

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (t->type == SUBTILIS_TOKEN_OPERATOR) {
		tbuf = subtilis_token_get_text(t);
		if (strcmp(tbuf, "[") == 0) {
			prv_vdu_brackets(p, t, err);
			return;
		}
	}

	do {
		e = subtilis_parser_priority7(p, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		e = subtilis_type_if_to_int(p, e, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		tbuf = subtilis_token_get_text(t);
		if (t->type == SUBTILIS_TOKEN_OPERATOR) {
			if (strcmp(tbuf, ",") == 0) {
				prv_vdu_byte(p, e, err);
			} else if (strcmp(tbuf, ";") == 0) {
				prv_vdu_2bytes(p, e, err);
			} else if (strcmp(tbuf, "|") == 0) {
				prv_vdu_1byte9zeros(p, e, err);
			} else {
				subtilis_error_set_expected(
				    err, ",. ; or |", tbuf, p->l->stream->name,
				    p->l->line);
				goto cleanup;
			}
		} else {
			prv_vdu_byte(p, e, err);
		}
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		subtilis_exp_delete(e);
		e = NULL;

		if (t->type != SUBTILIS_TOKEN_OPERATOR)
			break;

		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

	} while (true);

cleanup:
	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x133f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x301d6
jmp 0x303b0
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x30219
movq -0x10(%rbp), %rdi
callq 0x12d70
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x7a461(%rip), %rsi     # 0xaa658
callq 0x12140
cmpl $0x0, %eax
jne 0x30217
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x303c0
jmp 0x303b0
jmp 0x30219
jmp 0x3021b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x24550
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3023e
jmp 0x303b0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x488b0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x30261
jmp 0x303b0
movq -0x10(%rbp), %rdi
callq 0x12d70
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x30340
movq -0x28(%rbp), %rdi
leaq 0x7a323(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
jne 0x302a6
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x30660
jmp 0x3033e
movq -0x28(%rbp), %rdi
leaq 0x7a7ac(%rip), %rsi     # 0xaaa5d
callq 0x12140
cmpl $0x0, %eax
jne 0x302ce
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x30700
jmp 0x3033c
movq -0x28(%rbp), %rdi
leaq 0x7a7b6(%rip), %rsi     # 0xaaa8f
callq 0x12140
cmpl $0x0, %eax
jne 0x302f6
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x30900
jmp 0x3033a
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x7a73f(%rip), %rdx     # 0xaaa5f
leaq 0x7a742(%rip), %rax     # 0xaaa69
movq %rax, (%rsp)
movl $0xfb, 0x8(%rsp)
callq 0x156d0
jmp 0x303a7
jmp 0x3033c
jmp 0x3033e
jmp 0x30351
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x30660
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3035c
jmp 0x303a7
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
je 0x30378
jmp 0x303a5
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x133f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x30397
jmp 0x303b0
jmp 0x30399
movb $0x1, %al
testb $0x1, %al
jne 0x3021b
jmp 0x303a5
jmp 0x303a7
movq -0x20(%rbp), %rdi
callq 0x36ee0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)