// File: /workspace/github_c_makefile_star2_O2/hsjoihs[P]c-compiler/parse_analyze_toplevel.c
// Function: record_if_global_struct_or_enum_declaration
static void
record_if_global_struct_or_enum_declaration(struct AnalyzerState *ptr_ps,
                                            const struct Type *ref_type)
{
	switch (ref_type->type_category) {
	case ARRAY:
	case FN:
	case PTR_:
		record_if_global_struct_or_enum_declaration(ptr_ps,
		                                            ref_type->derived_from);
		return;
	case VOID_:
	case INT_:
	case CHAR_:
		return;
	case STRUCT_NOT_UNION:
	case UNION:
		record_global_struct_or_union_declaration(ptr_ps, ref_type);
		return;
	case ENUM_:
		record_global_enum_declaration(ptr_ps, ref_type);
		return;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, -0x38(%rbp)
leaq 0xad83(%rip), %rax      # 0xd3f8
movl (%rsi), %ecx
cmpq $0x8, %rcx
ja 0x2826
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%rsi), %rsi
jmp 0x2675
pushq $0xa
popq %rcx
leaq -0x98(%rbp), %r14
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x81cb
xorl %r13d, %r13d
movl %eax, %edi
xorl %eax, %eax
callq 0x128c
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x27e3
movslq (%rax), %r12
movq %rax, -0x40(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x10d0
movq %rax, %r14
testl %r12d, %r12d
movl $0x0, %r15d
cmovgl %r12d, %r15d
movq -0x38(%rbp), %rbx
cmpq %r13, %r15
je 0x2720
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e24
movl %eax, (%r14,%r13,8)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1f2e
movl %eax, 0x4(%r14,%r13,8)
incq %r13
jmp 0x26ef
cmpl $0x5, -0x98(%rbp)
jne 0x2798
leaq -0x9a9(%rip), %rax      # 0x1d87
jmp 0x279f
movq 0x40(%rsi), %rbx
movq 0x48(%rsi), %r15
xorl %r14d, %r14d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x128c
testq %r15, %r15
je 0x27e3
movq %rbx, -0x30(%rbp)
movl (%r15), %ebx
movq 0x8(%r15), %r12
callq 0x49f5
movq %rax, %r15
testl %ebx, %ebx
cmovlel %r14d, %ebx
cmpq %r14, %rbx
je 0x27f2
movq (%r12,%r14,8), %r13
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x10d0
movq %r13, (%rax)
movl %r14d, 0x8(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x4a57
incq %r14
jmp 0x2769
leaq -0xa9f(%rip), %rax      # 0x1d00
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq *%rax
movq %rax, %r14
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10d0
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq (%r12), %rcx
movq %rcx, 0x8(%rax)
movq %r14, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq 0x78(%rcx), %rdi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0x9250
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %rbx
leaq 0x88(%rbx), %rdi
movq %r15, %rsi
callq 0x4ab0
movq 0x80(%rbx), %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9250
movq 0x137cb(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
leaq 0xaeef(%rip), %rsi      # 0xd726
leaq 0xaf88(%rip), %rdx      # 0xd7c6
xorl %eax, %eax
callq 0x10f0
pushq $0x1
popq %rdi
callq 0x1170