// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_call.c
// Function: prv_process_param
static void prv_process_param(subtilis_parser_t *p, subtilis_token_t *t,
			      size_t *num_iparams, size_t *num_fparams,
			      const subtilis_symbol_t **symbol,
			      subtilis_type_t *ptype, subtilis_error_t *err)
{
	size_t reg_num;
	const char *tbuf;
	char *var_name;
	subtilis_type_t type;

	subtilis_type_init_copy(&type, &t->tok.id_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	tbuf = subtilis_token_get_text(t);
	var_name = malloc(strlen(tbuf) + 1);
	if (!var_name) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}
	strcpy(var_name, tbuf);

	if ((type.type == SUBTILIS_TYPE_FN) ||
	    (type.type == SUBTILIS_TYPE_REC)) {
		subtilis_complete_custom_type(p, var_name, &type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	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, "("))) {
		prv_process_array_param_type(p, t, &type, ptype, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		reg_num = SUBTILIS_IR_REG_TEMP_START + *num_iparams;
		*num_iparams += 1;

		*symbol = subtilis_symbol_table_insert(p->local_st, var_name,
						       ptype, err);
	} else if ((t->type == SUBTILIS_TOKEN_OPERATOR) &&
		   (!strcmp(tbuf, "{"))) {
		prv_process_vector_param_type(p, t, &type, ptype, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		*num_iparams += 1;

		*symbol = subtilis_symbol_table_insert(p->local_st, var_name,
						       ptype, err);
	} else if (subtilis_type_if_is_numeric(&type)) {
		subtilis_type_copy(ptype, &type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		switch (subtilis_type_if_reg_type(&type)) {
		case SUBTILIS_IR_REG_TYPE_INTEGER:
			reg_num = SUBTILIS_IR_REG_TEMP_START + *num_iparams;
			*num_iparams += 1;
			break;
		case SUBTILIS_IR_REG_TYPE_REAL:
			reg_num = *num_fparams;
			*num_fparams += 1;
			break;
		default:
			subtilis_error_set_assertion_failed(err);
			goto cleanup;
		}

		*symbol = subtilis_symbol_table_insert_reg(
		    p->local_st, var_name, ptype, reg_num, err);
	} else if (type.type == SUBTILIS_TYPE_FN) {
		subtilis_type_copy(ptype, &type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		subtilis_complete_custom_type(p, var_name, ptype, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		reg_num = SUBTILIS_IR_REG_TEMP_START + *num_iparams;
		*num_iparams += 1;
		*symbol = subtilis_symbol_table_insert_reg(
		    p->local_st, var_name, ptype, reg_num, err);
	} else if (type.type == SUBTILIS_TYPE_REC) {
		subtilis_type_copy(ptype, &type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		subtilis_complete_custom_type(p, var_name, ptype, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		*num_iparams += 1;
		*symbol = subtilis_symbol_table_insert(p->local_st, var_name,
						       ptype, err);
	} else {
		/* reference type */

		subtilis_type_copy(ptype, &type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		*num_iparams += 1;
		*symbol = subtilis_symbol_table_insert(p->local_st, var_name,
						       ptype, err);
	}

cleanup:

	free(var_name);
	subtilis_type_free(&type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq 0x10(%rbp), %rdx
leaq -0x190(%rbp), %rdi
callq 0x3dec0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2263d
jmp 0x22a7c
movq -0x10(%rbp), %rdi
callq 0x12d70
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x120d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x22689
movq 0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x87fb6(%rip), %rdx     # 0xaa630
movl $0x262, %ecx            # imm = 0x262
callq 0x158e0
jmp 0x22a67
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x12060
cmpl $0x9, -0x190(%rbp)
je 0x226a8
cmpl $0x16, -0x190(%rbp)
jne 0x226d0
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq 0x10(%rbp), %rcx
leaq -0x190(%rbp), %rdx
callq 0x25e50
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x226ce
jmp 0x22a67
jmp 0x226d0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x133f0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x226f2
jmp 0x22a67
movq -0x10(%rbp), %rdi
callq 0x12d70
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x22790
movq -0x40(%rbp), %rdi
leaq 0x88b85(%rip), %rsi     # 0xab29c
callq 0x12140
cmpl $0x0, %eax
jne 0x22790
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq 0x10(%rbp), %r8
leaq -0x190(%rbp), %rdx
callq 0x22a90
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2274b
jmp 0x22a67
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x3c480
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a65
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x2280e
movq -0x40(%rbp), %rdi
leaq 0x8ae67(%rip), %rsi     # 0xad60b
callq 0x12140
cmpl $0x0, %eax
jne 0x2280e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq 0x10(%rbp), %r8
leaq -0x190(%rbp), %rdx
callq 0x22bb0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x227d8
jmp 0x22a67
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x3c480
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a63
leaq -0x190(%rbp), %rdi
callq 0x49d10
testb $0x1, %al
jne 0x22823
jmp 0x228f1
movq -0x30(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq -0x190(%rbp), %rsi
callq 0x3e4f0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x22845
jmp 0x22a67
leaq -0x190(%rbp), %rdi
callq 0x4a550
movl %eax, %ecx
movl %ecx, -0x194(%rbp)
testl %eax, %eax
je 0x2286c
jmp 0x2285f
movl -0x194(%rbp), %eax
subl $0x1, %eax
je 0x2288b
jmp 0x228a6
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x228c5
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x228c5
movq 0x10(%rbp), %rdi
movl $0xf, %esi
leaq 0x87d7a(%rip), %rdx     # 0xaa630
movl $0x296, %ecx            # imm = 0x296
callq 0x158e0
jmp 0x22a67
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x3cc20
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a61
cmpl $0x9, -0x190(%rbp)
jne 0x2298c
movq -0x30(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq -0x190(%rbp), %rsi
callq 0x3e4f0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x22920
jmp 0x22a67
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x25e50
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x22943
jmp 0x22a67
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x3cc20
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a5f
cmpl $0x16, -0x190(%rbp)
jne 0x22a0d
movq -0x30(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq -0x190(%rbp), %rsi
callq 0x3e4f0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x229b7
jmp 0x22a67
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x25e50
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x229da
jmp 0x22a67
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x3c480
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a5d
movq -0x30(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq -0x190(%rbp), %rsi
callq 0x3e4f0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x22a2c
jmp 0x22a67
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x3c480
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22a5f
jmp 0x22a61
jmp 0x22a63
jmp 0x22a65
jmp 0x22a67
movq -0x48(%rbp), %rdi
callq 0x12290
leaq -0x190(%rbp), %rdi
callq 0x3e100
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)