// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_call.c
// Function: subtilis_parser_call_known_ptr
subtilis_exp_t *subtilis_parser_call_known_ptr(subtilis_parser_t *p,
					       subtilis_token_t *t,
					       const subtilis_type_t *type,
					       size_t reg,
					       subtilis_error_t *err)
{
	size_t i;
	subtilis_exp_t *args[SUBTILIS_MAX_ARGS];
	size_t num_args = 0;
	subtilis_parser_param_t *params = NULL;
	subtilis_ir_arg_t *ir_args = NULL;

	num_args = subtilis_var_bracketed_args_have_b(p, t, args,
						      SUBTILIS_MAX_ARGS, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	if (num_args != type->params.fn.num_params) {
		subtilis_error_set_bad_arg_count(
		    err, num_args, type->params.fn.num_params,
		    p->l->stream->name, p->l->line);
		goto on_error;
	}

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

	params = prv_call_ptr_parameters(p, args, num_args, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	ir_args = prv_parser_to_ir_args(params, num_args, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;
	prv_delete_params(params, num_args);
	params = NULL;

	p->current->proc_called = true;

	return subtilis_exp_add_call_ptr(p, ir_args, type->params.fn.ret_val,
					 reg, num_args, err);

on_error:
	free(ir_args);
	prv_delete_params(params, num_args);
	for (i = 0; i < num_args; i++)
		subtilis_exp_delete(args[i]);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x148(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x158(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdx
movq -0x30(%rbp), %r8
movl $0x20, %ecx
callq 0x255b0
movq %rax, -0x148(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1fcaa
movq $0x0, -0x8(%rbp)
jmp 0x1fe3e
movq -0x148(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x1fd0a
movq -0x30(%rbp), %rdi
movq -0x148(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x28, %esi
leaq 0x8a93c(%rip), %rax     # 0xaa630
movq %rax, (%rsp)
movl $0x5b2, 0x8(%rsp)       # imm = 0x5B2
callq 0x157b0
jmp 0x1fde3
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 0x1fd2c
jmp 0x1fde3
movq -0x10(%rbp), %rdi
leaq -0x140(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x1fe50
movq %rax, -0x150(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1fd60
jmp 0x1fde3
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x1eed0
movq %rax, -0x158(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1fd89
jmp 0x1fde3
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x1f090
movq $0x0, -0x150(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movb $0x1, 0xe0(%rax)
movq -0x10(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rcx
movq -0x148(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x373c0
movq %rax, -0x8(%rbp)
jmp 0x1fe3e
movq -0x158(%rbp), %rdi
callq 0x12290
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x1f090
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x148(%rbp), %rax
jae 0x1fe36
movq -0x38(%rbp), %rax
movq -0x140(%rbp,%rax,8), %rdi
callq 0x36ee0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1fe0a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax,%rax)