// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/parse_type.c
// Function: from_type3_to_type
static struct Type from_type3_to_type(const void **type3)
{
	struct Type type;
	const struct TypeNode *ptr_elem = type3[0];
	struct TypeNode elem = *ptr_elem;
	type = elem;
	switch (elem.type_category) {
	case INT_:
	case CHAR_:
	case STRUCT_NOT_UNION:
	case UNION:
	case VOID_:
	case ENUM_:
		return type;

	case PTR_:
	case ARRAY:
	case FN: {
		struct Type *ptr_to_current_type = calloc(1, sizeof(struct Type));
		*ptr_to_current_type = from_type3_to_type(type3 + 1);

		type.derived_from = ptr_to_current_type;

		if (type.type_category == ARRAY &&
		    type.derived_from->type_category == FN) {
			fprintf(stderr, "It is illegal to declare an array of functions\n");
			exit(EXIT_FAILURE);
		} else if (type.type_category == FN &&
		           type.derived_from->type_category == FN) {
			fprintf(stderr,
			        "It is illegal for a function to return a function type\n");
			exit(EXIT_FAILURE);
		} else if (type.type_category == FN &&
		           type.derived_from->type_category == ARRAY) {
			fprintf(stderr,
			        "It is illegal for a function to return an array type\n");
			exit(EXIT_FAILURE);
		}
		return type;
	}
	}
	fprintf(stderr,
	        "****************************\n"
	        "* INTERNAL COMPILER ERROR @ %s\n"
	        "* Unexpected value of TypeCategory: `elem.type_category` is `%d`\n"
	        "****************************\n",
	        __func__, elem.type_category);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xd0(%rbp)
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
movq %rsi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movups 0x40(%rax), %xmm0
movaps %xmm0, -0x20(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x30(%rbp)
movaps %xmm2, -0x40(%rbp)
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x20(%rbp), %xmm0
movups %xmm0, 0x40(%rdi)
movaps -0x60(%rbp), %xmm0
movaps -0x50(%rbp), %xmm1
movaps -0x40(%rbp), %xmm2
movaps -0x30(%rbp), %xmm3
movups %xmm3, 0x30(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
movl -0x60(%rbp), %eax
movl %eax, -0xbc(%rbp)
testl %eax, %eax
je 0xbf3f
jmp 0xbf1c
movl -0xbc(%rbp), %eax
decl %eax
subl $0x3, %eax
jb 0xbf44
jmp 0xbf2b
movl -0xbc(%rbp), %eax
addl $-0x4, %eax
subl $0x4, %eax
ja 0xc056
jmp 0xbf3f
jmp 0xc082
movl $0x1, %edi
movl $0x50, %esi
callq 0x10b0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
leaq -0xb8(%rbp), %rdi
callq 0xbe90
movq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
movq -0xd0(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
cmpl $0x2, (%rax)
jne 0xbfd4
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x3, (%rax)
jne 0xbfd4
movq 0x1003f(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x9695(%rip), %rsi      # 0x15658
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0xd0(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xc012
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x3, (%rax)
jne 0xc012
movq 0x10001(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x9687(%rip), %rsi      # 0x15688
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0xd0(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xc050
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x2, (%rax)
jne 0xc050
movq 0xffc3(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x9681(%rip), %rsi      # 0x156c0
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
jmp 0xc052
jmp 0xc054
jmp 0xc082
movq 0xff9b(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
movl -0x60(%rbp), %ecx
leaq 0x968c(%rip), %rsi      # 0x156f6
leaq 0x9720(%rip), %rdx      # 0x15791
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0xc8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)