// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/parser_graphics.c
// Function: subtilis_parser_circle
void subtilis_parser_circle(subtilis_parser_t *p, subtilis_token_t *t,
			    subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_exp_t *e[3];
	size_t i;
	int32_t plot_code = 145;

	memset(&e, 0, sizeof(e));

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	if ((t->type == SUBTILIS_TOKEN_KEYWORD) &&
	    (t->tok.keyword.type == SUBTILIS_KEYWORD_FILL)) {
		plot_code = 153;
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}

	prv_simple_plot(p, t, 4, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	tbuf = subtilis_token_get_text(t);
	if (t->type != SUBTILIS_TOKEN_OPERATOR) {
		subtilis_error_set_expected(err, ",", tbuf, p->l->stream->name,
					    p->l->line);
		return;
	}

	if (strcmp(tbuf, ",")) {
		subtilis_error_set_expected(err, ",", tbuf, p->l->stream->name,
					    p->l->line);
		return;
	}

	e[0] = subtilis_exp_new_int32(plot_code, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	e[0] = subtilis_type_if_exp_to_var(p, e[0], err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

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

	e[1] = subtilis_parser_int_var_expression(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e[2] = subtilis_exp_new_int32(0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e[2] = subtilis_type_if_exp_to_var(p, e[2], err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_PLOT,
					  e[0]->exp.ir_op, e[1]->exp.ir_op,
					  e[2]->exp.ir_op, err);

cleanup:

	for (i = 0; i < 3; i++)
		subtilis_exp_delete(e[i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%rdi), %rdi
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x25340
movl $0x91, %ebp
cmpl $0x1, (%r15)
jne 0x25328
cmpl $0x35, 0x8(%r15)
jne 0x25328
movq (%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x25340
movl $0x99, %ebp
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
movq %rbx, %rcx
callq 0x25104
cmpl $0x0, (%rbx)
je 0x2534d
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x12ad0
movq %rax, %r12
movl $0xf4, %r10d
cmpl $0x2, (%r15)
jne 0x2537d
leaq 0x4e22d(%rip), %rsi     # 0x73598
movq %r12, %rdi
callq 0x12160
movl $0xfa, %r10d
testl %eax, %eax
je 0x253af
movq (%r14), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4e63d(%rip), %rax     # 0x739cc
leaq 0x4e202(%rip), %rdx     # 0x73598
movq %rbx, %rdi
movl $0x1d, %esi
movq %r12, %rcx
pushq %r10
pushq %rax
callq 0x1442a
addq $0x30, %rsp
jmp 0x25344
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2bb29
movq %rax, (%rsp)
cmpl $0x0, (%rbx)
jne 0x25340
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x36269
movq %rax, (%rsp)
cmpl $0x0, (%rbx)
jne 0x25340
movq %rax, %r12
movq (%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x25465
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1ebbe
movq %rax, 0x8(%rsp)
cmpl $0x0, (%rbx)
jne 0x25465
movq %rax, %r15
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2bb29
movq %rax, 0x10(%rsp)
cmpl $0x0, (%rbx)
jne 0x25465
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x36269
movq %rax, 0x10(%rsp)
cmpl $0x0, (%rbx)
jne 0x25465
movq 0x48(%r14), %rdi
movq 0x148(%r12), %rdx
movq 0x148(%r15), %rcx
movq 0x148(%rax), %r8
movl $0x56, %esi
movq %rbx, %r9
callq 0x2c0c2
xorl %ebx, %ebx
movq (%rsp,%rbx,8), %rdi
callq 0x2b4c3
incq %rbx
cmpq $0x3, %rbx
jne 0x25467
jmp 0x25340