// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rdx, 0x20(%rsp)
movq %rsi, %rbp
movq %rdi, %r12
movq %rcx, 0x30(%rsp)
movl $0x0, (%rcx)
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
xorl %r14d, %r14d
movq %rdi, 0x18(%rsp)
movq %rcx, %rbx
movq (%r12), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12eda
cmpl $0x0, (%r15)
jne 0x27ced
movq %rbp, %rdi
callq 0x12ad0
movq %rax, 0x28(%rsp)
cmpl $0x2, (%rbp)
jne 0x27c0d
movq 0x28(%rsp), %rdi
leaq 0x4b998(%rip), %rsi     # 0x73598
callq 0x12160
testl %eax, %eax
je 0x27cd3
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
movq 0x30(%rsp), %rcx
orl %eax, (%rcx)
movq %r12, %rdi
movq %rbp, %rsi
leaq 0xf(%rsp), %rdx
movq %r15, %rcx
callq 0x1f5ea
movq %rax, %r12
cmpl $0x0, (%r15)
jne 0x27d65
cmpl $0x5, (%r12)
jne 0x27cf2
cmpq %r14, %rbx
movq 0x10(%rsp), %rax
jne 0x27c74
testq %rax, %rax
jne 0x27d18
addq $0x10, %r14
movq %r14, %rdi
shlq $0x4, %rdi
callq 0x121d0
testq %rax, %rax
je 0x27d43
testq %r12, %r12
movq %rax, 0x10(%rsp)
je 0x27c9d
movq 0x148(%r12), %rcx
movq %rcx, (%rax,%r13)
movb 0xf(%rsp), %dl
movb %dl, 0x8(%rax,%r13)
movq %r12, %rdi
callq 0x2b4c3
jmp 0x27ca5
movq $-0x1, (%rax,%r13)
movq 0x18(%rsp), %r12
cmpl $0x2, (%rbp)
jne 0x27cdb
movq 0x28(%rsp), %rdi
leaq 0x4b8dc(%rip), %rsi     # 0x73598
callq 0x12160
addq $0x10, %r13
leaq 0x1(%rbx), %rcx
testl %eax, %eax
je 0x27bc5
jmp 0x27cdb
xorl %r12d, %r12d
jmp 0x27c48
incq %rbx
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
jmp 0x27d80
xorl %r12d, %r12d
jmp 0x27d65
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4bd6b(%rip), %r8      # 0x73a73
movq %r15, %rdi
movl $0x4d, %esi
movl $0xbb, %r9d
jmp 0x27d3c
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4bd45(%rip), %r8      # 0x73a73
movq %r15, %rdi
movl $0x4e, %esi
movl $0xc3, %r9d
callq 0x14618
jmp 0x27d65
leaq 0x4bd29(%rip), %rdx     # 0x73a73
movq %r15, %rdi
movl $0x1, %esi
movl $0xc9, %ecx
callq 0x145f4
movq $0x0, 0x10(%rsp)
movq %r12, %rdi
callq 0x2b4c3
movq 0x10(%rsp), %rdi
callq 0x122c0
xorl %ebx, %ebx
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movq %rbx, (%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq