// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/parser_call.c
// Function: prv_call_parameters
static subtilis_parser_param_t *
prv_call_parameters(subtilis_parser_t *p, subtilis_exp_t **args,
		    size_t num_args, subtilis_check_args_t **check_args,
		    subtilis_error_t *err)
{
	size_t nop;
	size_t i;
	subtilis_parser_param_t *params = NULL;
	subtilis_exp_t *e = NULL;
	subtilis_check_args_t *an = NULL;

	params = malloc(num_args * sizeof(*params));
	if (!params) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	for (i = 0; i < num_args; i++)
		params[i].type.type = SUBTILIS_TYPE_VOID;

	for (i = 0; i < num_args; i++) {
		if (args[i]->partial_name) {
			if (!an) {
				an = calloc(num_args, sizeof(*an));
				if (!an) {
					subtilis_error_set_oom(err);
					goto on_error;
				}
			}
			an[i].arg_name =
			    malloc(strlen(args[i]->partial_name) + 1);
			if (!an[i].arg_name) {
				subtilis_error_set_oom(err);
				goto on_error;
			}
			strcpy(an[i].arg_name, args[i]->partial_name);
			an[i].call_site = args[i]->call_site;
		}
		e = subtilis_type_if_exp_to_var(p, args[i], err);
		args[i] = NULL;
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		subtilis_type_init_copy(&params[i].type, &e->type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		nop = subtilis_ir_section_add_nop(p->current, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		params[i].reg = e->exp.ir_op.reg;
		params[i].nop = nop;
		subtilis_exp_delete(e);
		e = NULL;
	}

	*check_args = an;

	return params;

on_error:

	if (an) {
		for (i = 0; i < num_args; i++)
			free(an[i].arg_name);
		free(an);
	}

	subtilis_exp_delete(e);
	prv_delete_params(params, num_args);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, 0x28(%rsp)
imulq $0x158, %rdx, %rdi      # imm = 0x158
callq 0x121d0
testq %rax, %rax
je 0x1abdc
movq %rax, %rbx
testq %r14, %r14
movq %rax, 0x18(%rsp)
movq %r15, 0x30(%rsp)
je 0x1abfa
movq %rbx, %rax
movq %r14, 0x10(%rsp)
movl $0x8, (%rax)
addq $0x158, %rax            # imm = 0x158
decq %r14
jne 0x1aa9a
movl $0x8, %r13d
movq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
movq %r12, 0x20(%rsp)
movq (%rbp,%r15,8), %rax
movq 0x160(%rax), %r14
testq %r14, %r14
je 0x1ab46
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x1aaf5
movl $0x10, %esi
movq 0x10(%rsp), %rdi
callq 0x12150
testq %rax, %rax
je 0x1ac23
movq %rbp, %r12
movq %r14, %rdi
movq %rax, %rbp
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rax, -0x8(%rbp,%r13)
testq %rax, %rax
movq %rbp, 0x8(%rsp)
je 0x1ac17
movq (%r12,%r15,8), %r14
movq 0x160(%r14), %rsi
movq %rax, %rdi
callq 0x12070
movq 0x168(%r14), %rax
movq %rax, (%rbp,%r13)
movq %r12, %rbp
movq 0x20(%rsp), %r12
movq (%rbp,%r15,8), %rsi
movq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0x36269
movq %rax, %r14
movq $0x0, (%rbp,%r15,8)
cmpl $0x0, (%r12)
jne 0x1ac48
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2f72e
cmpl $0x0, (%r12)
jne 0x1ac48
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rdi
movq %r12, %rsi
callq 0x2c2f8
cmpl $0x0, (%r12)
jne 0x1ac48
movq 0x148(%r14), %rcx
movq %rcx, 0x148(%rbx)
movq %rax, 0x150(%rbx)
movq %r14, %rdi
callq 0x2b4c3
incq %r15
addq $0x158, %rbx            # imm = 0x158
addq $0x10, %r13
cmpq %r15, 0x10(%rsp)
jne 0x1aac2
jmp 0x1ac03
leaq 0x58a3d(%rip), %rdx     # 0x73620
movq %r12, %rdi
movl $0x1, %esi
movl $0x7a, %ecx
callq 0x145f4
jmp 0x1ac92
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq 0x18(%rsp), %rax
jmp 0x1ac94
movl $0x8c, %ecx
movq 0x20(%rsp), %r12
jmp 0x1ac31
movl $0x85, %ecx
movq $0x0, 0x8(%rsp)
leaq 0x589e8(%rip), %rdx     # 0x73620
movq %r12, %rdi
movl $0x1, %esi
callq 0x145f4
xorl %r14d, %r14d
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0x1ac7d
cmpq $0x1, %r12
movq %r12, %rbx
adcq $0x0, %rbx
movq (%r15), %rdi
callq 0x122c0
addq $0x10, %r15
decq %rbx
jne 0x1ac62
movq 0x8(%rsp), %rdi
callq 0x122c0
movq %r14, %rdi
callq 0x2b4c3
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x1adb8
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq