// File: /workspace/github_c_makefile_star2_O2/been-jamming[P]MinimalCC/types.c
// Function: parse_type_recursive
static void parse_type_recursive(type *t, char **c, char *identifier_name, char *argument_names, unsigned int identifier_length, unsigned int num_arguments){
	type inner_type = EMPTY_TYPE;
	type list_type = EMPTY_TYPE;

	skip_whitespace(c);
	while(**c == '*'){
		add_type_entry(t, type_pointer);
		++*c;
		skip_whitespace(c);
	}

	if(!parse_identifier(c, identifier_name, identifier_length) && **c == '('){
		++*c;
		skip_whitespace(c);
		parse_type_recursive(&inner_type, c, identifier_name, argument_names, identifier_length, num_arguments);
		if(**c != ')'){
			snprintf(error_message, sizeof(error_message), "Expected ')'");
			do_error(1);
		}
		++*c;
	}

	skip_whitespace(c);

	if(**c == '('){
		add_type_entry(t, type_returns);
		++*c;
		skip_whitespace(c);
		parse_type_arguments(t, c, argument_names, identifier_length, num_arguments);
		++*c;
		add_type_entry(t, type_function);
		if(**c == '(' || **c == '['){
			snprintf(error_message, sizeof(error_message), "Invalid type");
			do_error(1);
		}
	} else if(**c == '['){
		while(**c == '['){
			add_type_entry(&list_type, type_list);
			++*c;
			list_type.list_indicies[list_type.current_index] = strtol(*c, c, 10);
			list_type.current_index++;
			skip_whitespace(c);
			if(**c != ']'){
				snprintf(error_message, sizeof(error_message), "Expected ']'");
				do_error(1);
			}
			++*c;
		}
	}


	append_type(t, list_type);
	append_type(t, inner_type);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r9d, %r12d
movl %r8d, %r15d
movq %rcx, 0x40(%rsp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movdqu 0x4df5(%rip), %xmm0     # 0xc788
movdqa %xmm0, 0xc0(%rsp)
movups 0x4dd5(%rip), %xmm1     # 0xc778
movaps %xmm1, 0xb0(%rsp)
movups 0x4db6(%rip), %xmm2     # 0xc768
movaps %xmm2, 0xa0(%rsp)
movups 0x4d97(%rip), %xmm3     # 0xc758
movaps %xmm3, 0x90(%rsp)
movdqa %xmm0, 0x80(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x60(%rsp)
movaps %xmm3, 0x50(%rsp)
movq %rsi, %rdi
callq 0x7549
pushq $0x4
popq %rbp
movq (%r14), %rax
cmpb $0x2a, (%rax)
jne 0x7a0b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7204
incq (%r14)
movq %r14, %rdi
callq 0x7549
jmp 0x79ec
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x7368
testb %al, %al
jne 0x7a8c
movq (%r14), %rax
cmpb $0x28, (%rax)
jne 0x7a8c
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x7549
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq 0x40(%rsp), %rcx
movl %r15d, %r8d
movl %r12d, %r9d
callq 0x7966
movq (%r14), %rax
cmpb $0x29, (%rax)
je 0x7a86
leaq 0x4a80(%rip), %rax      # 0xc4e0
movabsq $0x27292720646574, %rcx # imm = 0x27292720646574
movq %rcx, 0x5(%rax)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
pushq $0x1
popq %rdi
callq 0x56c5
movq (%r14), %rax
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x7549
movq (%r14), %rdi
movzbl (%rdi), %eax
cmpl $0x28, %eax
je 0x7b65
cmpl $0x5b, %eax
jne 0x7bd9
movdqa 0x50(%rsp), %xmm0
movb $0x5b, %al
movq 0x60(%rsp), %r13
pushq $0xa
popq %rbp
leaq 0x4a1d(%rip), %r12      # 0xc4e0
pushq $0x1
popq %r15
cmpb $0x5b, %al
jne 0x7b58
movdqa %xmm0, 0x40(%rsp)
incq %rdi
movq %rdi, (%r14)
movq %r14, %rsi
movl %ebp, %edx
callq 0x1120
movl 0x88(%rsp), %ecx
movl %eax, 0x68(%rsp,%rcx,4)
incl 0x88(%rsp)
movq %r14, %rdi
callq 0x7549
movq (%r14), %rax
cmpb $0x5d, (%rax)
je 0x7b2f
movabsq $0x275d2720646574, %rax # imm = 0x275D2720646574
movq %rax, 0x5(%r12)
movabsq $0x6465746365707845, %rax # imm = 0x6465746365707845
movq %rax, (%r12)
movl %r15d, %edi
callq 0x56c5
movq (%r14), %rax
movdqa 0x40(%rsp), %xmm0
paddq %xmm0, %xmm0
por 0x14bf(%rip), %xmm0     # 0x9000
leaq 0x1(,%r13,2), %r13
leaq 0x1(%rax), %rdi
movq %rdi, (%r14)
movb 0x1(%rax), %al
jmp 0x7ac7
movq %r13, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
jmp 0x7bd9
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x7204
incq (%r14)
movq %r14, %rdi
callq 0x7549
movq %rbx, %rdi
movq %r14, %rsi
movq 0x40(%rsp), %rdx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x7c58
incq (%r14)
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x7204
movq (%r14), %rax
movzbl (%rax), %eax
cmpl $0x5b, %eax
je 0x7baf
cmpl $0x28, %eax
jne 0x7bd9
leaq 0x492a(%rip), %rax      # 0xc4e0
movabsq $0x65707974206469, %rcx # imm = 0x65707974206469
movq %rcx, 0x5(%rax)
movabsq $0x2064696c61766e49, %rcx # imm = 0x2064696C61766E49
movq %rcx, (%rax)
pushq $0x1
popq %rdi
callq 0x56c5
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x7279
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movaps 0xb0(%rsp), %xmm2
movaps 0xc0(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x7279
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq