// File: /workspace/github_c_makefile_star2_O3/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 0x58cb(%rip), %xmm0     # 0xd788
movdqa %xmm0, 0xb0(%rsp)
movups 0x58ab(%rip), %xmm1     # 0xd778
movaps %xmm1, 0xa0(%rsp)
movups 0x588c(%rip), %xmm2     # 0xd768
movaps %xmm2, 0x90(%rsp)
movups 0x586d(%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 0x79e2
movq (%r14), %rax
cmpb $0x2a, (%rax)
jne 0x7f3f
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 0x7f0b
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x7729
testb %al, %al
jne 0x7fc0
movq (%r14), %rax
cmpb $0x28, (%rax)
jne 0x7fc0
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x79e2
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x7e92
movq (%r14), %rax
cmpb $0x29, (%rax)
je 0x7fba
leaq 0x554e(%rip), %rax      # 0xd4e0
movabsq $0x27292720646574, %rcx # imm = 0x27292720646574
movq %rcx, 0x5(%rax)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movl $0x1, %edi
callq 0x5b10
movq (%r14), %rax
incq %rax
movq %rax, (%r14)
movq %r14, %rdi
callq 0x79e2
movq (%r14), %rdi
movzbl (%rdi), %eax
cmpl $0x28, %eax
je 0x809a
cmpl $0x5b, %eax
jne 0x813b
movq 0x40(%rsp), %r15
movdqu 0x48(%rsp), %xmm0
movl 0x78(%rsp), %ebp
leaq 0x54ea(%rip), %r12      # 0xd4e0
movabsq $0x6465746365707845, %r13 # imm = 0x6465746365707845
paddq %xmm0, %xmm0
por 0x2014(%rip), %xmm0     # 0xa020
movdqa %xmm0, 0xc0(%rsp)
movdqu %xmm0, 0x48(%rsp)
incq %rdi
movq %rdi, (%r14)
movq %r14, %rsi
movl $0xa, %edx
callq 0x1120
movl %ebp, %ecx
movl %eax, 0x58(%rsp,%rcx,4)
movl 0x78(%rsp), %ebp
incl %ebp
movl %ebp, 0x78(%rsp)
movq %r14, %rdi
callq 0x79e2
movq (%r14), %rax
cmpb $0x5d, (%rax)
je 0x806e
movabsq $0x275d2720646574, %rax # imm = 0x275D2720646574
movq %rax, 0x5(%r12)
movq %r13, (%r12)
movl $0x1, %edi
callq 0x5b10
movq (%r14), %rax
leaq 0x1(,%r15,2), %r15
leaq 0x1(%rax), %rdi
movq %rdi, (%r14)
cmpb $0x5b, 0x1(%rax)
movdqa 0xc0(%rsp), %xmm0
je 0x8000
movq %r15, 0x40(%rsp)
jmp 0x813b
shlq (%rbx)
movdqu 0x8(%rbx), %xmm0
paddq %xmm0, %xmm0
por 0x1f72(%rip), %xmm0     # 0xa020
movdqu %xmm0, 0x8(%rbx)
incq %rdi
movq %rdi, (%r14)
movq %r14, %rdi
callq 0x79e2
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x81b7
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 0x810f
cmpl $0x28, %eax
jne 0x813b
leaq 0x53ca(%rip), %rax      # 0xd4e0
movabsq $0x65707974206469, %rcx # imm = 0x65707974206469
movq %rcx, 0x5(%rax)
movabsq $0x2064696c61766e49, %rcx # imm = 0x2064696C61766E49
movq %rcx, (%rax)
movl $0x1, %edi
callq 0x5b10
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 0x7627
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 0x7627
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq