// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movl %r8d, %r15d
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movdqu 0x58cf(%rip), %xmm0     # 0xd788
movdqa %xmm0, 0xb0(%rsp)
movups 0x58af(%rip), %xmm1     # 0xd778
movaps %xmm1, 0xa0(%rsp)
movups 0x5890(%rip), %xmm2     # 0xd768
movaps %xmm2, 0x90(%rsp)
movups 0x5871(%rip), %xmm3     # 0xd758
movaps %xmm3, 0x80(%rsp)
movdqa %xmm0, 0x70(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x40(%rsp)
movq %rsi, %rdi
callq 0x799f
movq (%r14), %rax
cmpb $0x2a, (%rax)
jne 0x7f3b
movdqu (%rbx), %xmm0
paddq %xmm0, %xmm0
movdqu %xmm0, (%rbx)
movq 0x10(%rbx), %rcx
leaq 0x1(,%rcx,2), %rcx
movq %rcx, 0x10(%rbx)
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
jmp 0x7f07
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x76de
testb %al, %al
jne 0x7fb6
movq (%r14), %rax
cmpb $0x28, (%rax)
jne 0x7fb6
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x799f
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x7e8e
movq (%r14), %rax
cmpb $0x29, (%rax)
je 0x7fb3
leaq 0x5552(%rip), %rax      # 0xd4e0
movabsq $0x27292720646574, %rcx # imm = 0x27292720646574
movq %rcx, 0x5(%rax)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movl $0x1, %edi
callq 0x5ae0
incq (%r14)
movq %r14, %rdi
callq 0x799f
movq (%r14), %rax
movzbl (%rax), %ecx
cmpl $0x28, %ecx
je 0x8090
cmpl $0x5b, %ecx
jne 0x8131
movq 0x40(%rsp), %r15
movq (%r14), %rdi
cmpb $0x5b, (%rdi)
jne 0x8086
movdqu 0x48(%rsp), %xmm0
leaq 0x54ec(%rip), %r12      # 0xd4e0
movabsq $0x275d2720646574, %r13 # imm = 0x275D2720646574
movabsq $0x6465746365707845, %rbp # imm = 0x6465746365707845
paddq %xmm0, %xmm0
por 0x201c(%rip), %xmm0     # 0xa030
movdqa %xmm0, 0xc0(%rsp)
movdqu %xmm0, 0x48(%rsp)
incq %rdi
movq %rdi, (%r14)
movq %r14, %rsi
movl $0xa, %edx
callq 0x1120
movl 0x78(%rsp), %ecx
movl %eax, 0x58(%rsp,%rcx,4)
incl 0x78(%rsp)
movq %r14, %rdi
callq 0x799f
movq (%r14), %rax
cmpb $0x5d, (%rax)
je 0x8065
movq %r13, 0x5(%r12)
movq %rbp, (%r12)
movl $0x1, %edi
callq 0x5ae0
leaq 0x1(,%r15,2), %r15
movq (%r14), %rax
leaq 0x1(%rax), %rdi
movq %rdi, (%r14)
cmpb $0x5b, 0x1(%rax)
movdqa 0xc0(%rsp), %xmm0
je 0x8008
movq %r15, 0x40(%rsp)
jmp 0x8131
shlq (%rbx)
movdqu 0x8(%rbx), %xmm0
paddq %xmm0, %xmm0
por 0x1f8c(%rip), %xmm0     # 0xa030
movdqu %xmm0, 0x8(%rbx)
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x799f
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x81ad
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(,%rcx,2), %rcx
movq %rcx, (%rbx)
shlq 0x8(%rbx)
leaq 0x1(,%rdx,2), %rcx
movq %rcx, 0x10(%rbx)
movzbl 0x1(%rax), %eax
cmpl $0x5b, %eax
je 0x8105
cmpl $0x28, %eax
jne 0x8131
leaq 0x53d4(%rip), %rax      # 0xd4e0
movabsq $0x65707974206469, %rcx # imm = 0x65707974206469
movq %rcx, 0x5(%rax)
movabsq $0x2064696c61766e49, %rcx # imm = 0x2064696C61766E49
movq %rcx, (%rax)
movl $0x1, %edi
callq 0x5ae0
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x70(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x75e3
movaps 0x80(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
movaps 0xa0(%rsp), %xmm2
movaps 0xb0(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x75e3
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq