// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/parse_analyze_toplevel.c
// Function: system_v_abi_class_of
enum SystemVAbiClass system_v_abi_class_of(const struct AnalyzerState *ptr_ps,
                                           const struct Type *ref_type)
{
	const struct Type type = *ref_type;
	switch (type.type_category) {
	case INT_:
	case PTR_:
	case CHAR_:
	case ARRAY:
	case ENUM_:
		return INTEGER_CLASS;
	case FN:
		fprintf(stderr, "function type does not have System V ABI class\n");
		exit(EXIT_FAILURE);
	case VOID_:
		fprintf(stderr, "type `void` does not have System V ABI class\n");
		exit(EXIT_FAILURE);
	case STRUCT_NOT_UNION:
	case UNION:
		if ((0)) { /* is local struct/union */
			unsupported("struct/union type declared locally");
		}
		const char *tag = type.s.struct_or_union_tag;
		const struct StructOrUnionInternalCompleteInfo *ptr_info =
		    lookup(ptr_ps->global_struct_or_union_tag_map, tag);
		if (!ptr_info) {
			fprintf(
			    stderr,
			    "tried to find the System V ABI class of incomplete type `");
			debug_print_type(&type);
			fprintf(stderr, "`\n");
			exit(EXIT_FAILURE);
		}

		if (size_of(ptr_ps, &type) > 2 * 8) {
			return MEMORY_CLASS;
		}
		return INTEGER_CLASS;
	}

	fprintf(stderr,
	        "****************************\n"
	        "* INTERNAL COMPILER ERROR @ %s\n"
	        "* Unexpected value of TypeCategory: `type.type_category` is `%d`\n"
	        "****************************\n",
	        __func__, type.type_category);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movups 0x40(%rax), %xmm0
movaps %xmm0, -0x30(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x40(%rbp)
movaps %xmm2, -0x50(%rbp)
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq %rax, -0x88(%rbp)
subq $0x8, %rax
ja 0x2a04
movq -0x88(%rbp), %rax
leaq 0x10ab4(%rip), %rcx     # 0x133d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x4(%rbp)
jmp 0x2a30
movq 0x196bc(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10c87(%rip), %rsi     # 0x135cd
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq 0x1969a(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10c95(%rip), %rsi     # 0x135fd
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x78(%rbp), %rsi
callq 0xcc00
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x29e0
movq 0x19654(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10c7d(%rip), %rsi     # 0x1362b
movb $0x0, %al
callq 0x10d0
leaq -0x70(%rbp), %rdi
callq 0xb390
movq 0x19633(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x115d2(%rip), %rsi     # 0x13fa1
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0x10(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2570
cmpl $0x10, %eax
jle 0x29fb
movl $0x1, -0x4(%rbp)
jmp 0x2a30
movl $0x0, -0x4(%rbp)
jmp 0x2a30
movq 0x195ed(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
movl -0x70(%rbp), %ecx
leaq 0x10a7f(%rip), %rsi     # 0x13497
leaq 0x10c46(%rip), %rdx     # 0x13665
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)