// File: /workspace/github_c_makefile_star2_O3/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, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r13
movq %rdi, %r15
movq %rcx, 0x28(%rsp)
movl $0x0, (%rcx)
movl $0x100, %r12d           # imm = 0x100
xorl %eax, %eax
xorl %ecx, %ecx
movq $0x0, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movq %rcx, %rbx
movq (%r15), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x27b0a
movq %r13, %rdi
callq 0x12ad0
cmpl $0x2, (%r13)
movq %rax, 0x30(%rsp)
jne 0x27a18
cmpb $0x2c, (%rax)
jne 0x27a18
cmpb $0x0, 0x1(%rax)
je 0x27af4
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
movq 0x28(%rsp), %rcx
orl %eax, (%rcx)
movq %r15, %r14
movq %r15, %rdi
movq %r13, %rbp
movq %r13, %rsi
leaq 0x7(%rsp), %rdx
movq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x1f62c
movq %rax, %r13
cmpl $0x0, (%r15)
jne 0x27b7e
cmpl $0x5, (%r13)
jne 0x27b0f
cmpq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rax
jne 0x27a8d
testq %rax, %rax
jne 0x27b32
movq %r12, %rdi
callq 0x121d0
testq %rax, %rax
je 0x27b5a
leaq 0x10(%rbx), %rcx
movq %rcx, 0x20(%rsp)
testq %r13, %r13
je 0x27abd
movq 0x148(%r13), %rcx
movq %rcx, -0x100(%rax,%r12)
movb 0x7(%rsp), %cl
movb %cl, -0xf8(%rax,%r12)
movq %rax, %r15
movq %r13, %rdi
callq 0x2b166
movq %r15, %rax
jmp 0x27ac9
movq $-0x1, -0x100(%rax,%r12)
movq %r14, %r15
movq %rbp, %r13
cmpl $0x2, (%rbp)
movq 0x30(%rsp), %rbp
jne 0x27b02
cmpb $0x2c, (%rbp)
jne 0x27b02
addq $0x10, %r12
leaq 0x1(%rbx), %rcx
cmpb $0x0, 0x1(%rbp)
je 0x279d0
jmp 0x27b02
movq %r13, %rbp
movq %r15, %r14
xorl %r13d, %r13d
jmp 0x27a5e
incq %rbx
jmp 0x27b94
xorl %r13d, %r13d
jmp 0x27b7e
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4bf71(%rip), %r8      # 0x73a91
movq 0x8(%rsp), %rdi
movl $0x4d, %esi
movl $0xbb, %r9d
jmp 0x27b53
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4bf4e(%rip), %r8      # 0x73a91
movq 0x8(%rsp), %rdi
movl $0x4e, %esi
movl $0xc3, %r9d
callq 0x145c8
jmp 0x27b7e
leaq 0x4bf30(%rip), %rdx     # 0x73a91
movq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0xc9, %ecx
callq 0x145a4
movq $0x0, 0x10(%rsp)
movq %r13, %rdi
callq 0x2b166
movq 0x10(%rsp), %rdi
callq 0x122c0
xorl %ebx, %ebx
xorl %eax, %eax
movq 0x18(%rsp), %rcx
movq %rbx, (%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq