// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movl (%rsi), %edi
leal -0x1(%rdi), %eax
cmpl $0x3, %eax
jae 0x36bf
movq 0x8(%rsi), %rsi
jmp 0x36af
cmpl $0x8, %edi
ja 0x3897
movl $0x91, %eax
btl %edi, %eax
jb 0x3888
movl $0x60, %eax
btl %edi, %eax
jae 0x3796
leaq -0x98(%rbp), %r15
movl $0xa, %ecx
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0x9516
xorl %r14d, %r14d
movl %eax, %edi
xorl %eax, %eax
callq 0x243c
movq 0x38(%r15), %r13
testq %r13, %r13
je 0x3888
movq %rbx, -0x30(%rbp)
movslq (%r13), %rbx
movq 0x8(%r13), %r12
movl $0x8, %esi
movq %rbx, %rdi
callq 0x10d0
movq %rax, %r15
testq %rbx, %rbx
jle 0x377d
movq %r13, -0x40(%rbp)
xorl %r14d, %r14d
movq %r12, -0x38(%rbp)
movq %rbx, %r12
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %rax
movq (%rax,%r14,8), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2fe0
movl %eax, (%r15,%r14,8)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3070
movl %eax, 0x4(%r15,%r14,8)
incq %r14
cmpq %r14, %r12
jne 0x374a
movq -0x40(%rbp), %r13
cmpl $0x5, -0x98(%rbp)
jne 0x383d
leaq -0x85c(%rip), %rax      # 0x2f35
jmp 0x3844
cmpl $0x8, %edi
jne 0x3897
movq 0x40(%rsi), %r14
movq 0x48(%rsi), %r15
sete %al
movzbl %al, %edi
xorl %eax, %eax
callq 0x243c
testq %r15, %r15
je 0x3888
movq %r14, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
movslq (%r15), %rbx
movq 0x8(%r15), %r12
callq 0x5b39
movq %rax, %r15
testq %rbx, %rbx
jle 0x3809
xorl %r13d, %r13d
movq (%r12,%r13,8), %r14
movl $0x1, %edi
movl $0x10, %esi
callq 0x10d0
movq %r14, (%rax)
movl %r13d, 0x8(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x5ba7
incq %r13
cmpq %r13, %rbx
jne 0x37dc
movq -0x30(%rbp), %rbx
leaq 0x88(%rbx), %rdi
movq %r15, %rsi
callq 0x5bff
movq 0x80(%rbx), %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa2d8
leaq -0x9a4(%rip), %rax      # 0x2ea0
movq -0x30(%rbp), %rbx
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq *%rax
movq %rax, %r14
movl $0x1, %edi
movl $0x18, %esi
callq 0x10d0
movq %r13, (%rax)
movq (%r12), %rcx
movq %rcx, 0x8(%rax)
movq %r14, 0x10(%rax)
movq 0x78(%rbx), %rdi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0xa2d8
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x14bb