// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x12eda
cmpl $0x0, (%rbx)
je 0x26580
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, (%r14)
jne 0x265a5
movq %r14, %rdi
callq 0x12ad0
leaq 0x4d0b3(%rip), %rsi     # 0x73648
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x26681
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1e874
cmpl $0x0, (%rbx)
jne 0x26571
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3691f
cmpl $0x0, (%rbx)
jne 0x26571
movq %rax, %r12
movq %r14, %rdi
callq 0x12ad0
cmpl $0x2, (%r14)
jne 0x2662c
movq %rax, %r13
leaq 0x4cfb2(%rip), %rsi     # 0x73598
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x2662c
leaq 0x4d424(%rip), %rsi     # 0x73a1d
movq %r13, %rdi
callq 0x12160
testl %eax, %eax
je 0x26671
leaq 0x4d443(%rip), %rsi     # 0x73a4f
movq %r13, %rdi
callq 0x12160
testl %eax, %eax
jne 0x267c8
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x26a68
jmp 0x2663a
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x268a1
cmpl $0x0, (%rbx)
jne 0x2685d
movq %r12, %rdi
callq 0x2b4c3
cmpl $0x2, (%r14)
jne 0x2685a
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
je 0x265a5
jmp 0x26571
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x26921
jmp 0x2663a
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x26571
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1e874
cmpl $0x0, (%rbx)
jne 0x26571
leaq 0x5077e(%rip), %rbp     # 0x76e34
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3691f
cmpl $0x0, (%rbx)
jne 0x26571
movq %rax, %r12
movq %r14, %rdi
callq 0x12ad0
movq %rax, %r13
cmpl $0x2, (%r14)
jne 0x267fd
movq %r13, %rdi
leaq 0x4cea9(%rip), %rsi     # 0x73598
callq 0x12160
testl %eax, %eax
je 0x26745
movq %r13, %rdi
movq %rbp, %rsi
callq 0x12160
testl %eax, %eax
je 0x26828
movq %r13, %rdi
leaq 0x4d308(%rip), %rsi     # 0x73a1d
callq 0x12160
testl %eax, %eax
je 0x26755
movq %r13, %rdi
leaq 0x4d327(%rip), %rsi     # 0x73a4f
callq 0x12160
testl %eax, %eax
jne 0x26873
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x26a68
jmp 0x26763
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x268a1
jmp 0x26763
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x26921
cmpl $0x0, (%rbx)
jne 0x2685d
movq %r12, %rdi
callq 0x2b4c3
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x2685a
cmpl $0x2, (%r14)
jne 0x267ac
movq %r14, %rdi
callq 0x12ad0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x12160
testl %eax, %eax
je 0x26843
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1e874
cmpl $0x0, (%rbx)
je 0x266b6
jmp 0x26571
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4d24f(%rip), %rax     # 0x73a29
leaq 0x4d23e(%rip), %rdx     # 0x73a1f
movq %rbx, %rdi
movl $0x1d, %esi
movq %r13, %rcx
pushq $0xfb
pushq %rax
callq 0x1442a
addq $0x10, %rsp
jmp 0x2685d
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4d21a(%rip), %rax     # 0x73a29
leaq 0x4d23b(%rip), %rdx     # 0x73a51
movq %rbx, %rdi
movl $0x1d, %esi
movq %r13, %rcx
pushq $0xa7
jmp 0x267f1
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x268a1
cmpl $0x0, (%rbx)
jne 0x2685d
movq %r12, %rdi
callq 0x2b4c3
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
je 0x26571
xorl %r12d, %r12d
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b4c3
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4d1a4(%rip), %rax     # 0x73a29
leaq 0x4d1b6(%rip), %rdx     # 0x73a42
movq %rbx, %rdi
movl $0x1d, %esi
movq %r13, %rcx
pushq $0xa1
jmp 0x267f1