// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_os.c
// Function: prv_get_output_args
static subtilis_ir_sys_out_reg_t *
prv_get_output_args(subtilis_parser_t *p, subtilis_token_t *t, size_t *no_args,
		    uint32_t *reg_mask, subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_exp_t *e;
	bool local;
	subtilis_ir_sys_out_reg_t *args = NULL;
	size_t count = 0;
	size_t max_count = 0;

	*reg_mask = 0;

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

		tbuf = subtilis_token_get_text(t);
		if ((t->type == SUBTILIS_TOKEN_OPERATOR) &&
		    (!strcmp(tbuf, ","))) {
			e = NULL;
		} else {
			*reg_mask |= 1 << count;
			e = subtilis_var_lookup_ref(p, t, &local, err);
			if (err->type != SUBTILIS_ERROR_OK)
				goto cleanup;
			if (e->type.type != SUBTILIS_TYPE_INTEGER) {
				subtilis_error_set_sys_bad_args(
				    err, p->l->stream->name, p->l->line);
				goto cleanup;
			}
		}

		if (count == max_count) {
			if (args) {
				subtilis_error_set_sys_max_too_many_args(
				    err, p->l->stream->name, p->l->line);
				goto cleanup;
			}
			max_count += 16;
			args = malloc(sizeof(*args) * max_count);
			if (!args) {
				subtilis_error_set_oom(err);
				goto cleanup;
			}
		}

		if (e) {
			args[count].reg = e->exp.ir_op.reg;
			args[count].local = local;
			subtilis_exp_delete(e);
			e = NULL;
		} else {
			args[count].reg = SIZE_MAX;
		}
		count++;
	} while ((t->type == SUBTILIS_TOKEN_OPERATOR) && (!strcmp(tbuf, ",")));

	*no_args = count;
	return args;

cleanup:

	subtilis_exp_delete(e);
	free(args);
	*no_args = 0;

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x133f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x32060
jmp 0x3225c
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x32095
movq -0x38(%rbp), %rdi
leaq 0x78528(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
jne 0x32095
movq $0x0, -0x40(%rbp)
jmp 0x32113
movq -0x58(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq -0x41(%rbp), %rdx
callq 0x25b40
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x320d3
jmp 0x3225c
movq -0x40(%rbp), %rax
cmpl $0x5, (%rax)
je 0x32111
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x4d, %esi
leaq 0x789b2(%rip), %r8      # 0xaaab3
movl $0xbb, %r9d
callq 0x15930
jmp 0x3225c
jmp 0x32113
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x321a2
cmpq $0x0, -0x50(%rbp)
je 0x3215d
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x4e, %esi
leaq 0x78966(%rip), %r8      # 0xaaab3
movl $0xc3, %r9d
callq 0x15930
jmp 0x3225c
movq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
shlq $0x4, %rdi
callq 0x121b0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x321a0
movq -0x30(%rbp), %rdi
movl $0x1, %esi
leaq 0x78922(%rip), %rdx     # 0xaaab3
movl $0xc9, %ecx
callq 0x158e0
jmp 0x3225c
jmp 0x321a2
cmpq $0x0, -0x40(%rbp)
je 0x321f1
movq -0x40(%rbp), %rax
movq 0x148(%rax), %rcx
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movb -0x41(%rbp), %cl
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq -0x40(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x40(%rbp)
jmp 0x32207
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $-0x1, (%rax)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl $0x2, (%rcx)
movb %al, -0x61(%rbp)
jne 0x3223c
movq -0x38(%rbp), %rdi
leaq 0x7837d(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x3203e
movq -0x58(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x32281
movq -0x40(%rbp), %rdi
callq 0x36ee0
movq -0x50(%rbp), %rdi
callq 0x12290
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)