// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/parse_analyze_toplevel.c
// Function: align_of
int align_of(const struct AnalyzerState *ptr_ps, const struct Type *ref_type)
{
	const struct Type type = *ref_type;
	switch (type.type_category) {
	case INT_:
		return 4;
	case PTR_:
		return 8;
	case CHAR_:
		return 1;
	case ARRAY:
		return align_of(ptr_ps, type.derived_from);
	case FN:
		fprintf(stderr,
		        "a function type does not have a size or an alignment\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 alignment of an incomplete type `");
			debug_print_type(&type);
			fprintf(stderr, "`\n");
			exit(EXIT_FAILURE);
		}
		return ptr_info->s_and_a.alignment;
	case VOID_:
		fprintf(stderr, "cannot get alignment of `void`\n");
		exit(EXIT_FAILURE);
	case ENUM_:
		return 4;
	}

	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 0x2882
movq -0x88(%rbp), %rax
leaq 0x10c30(%rip), %rcx     # 0x133b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, -0x4(%rbp)
jmp 0x28ae
movl $0x8, -0x4(%rbp)
jmp 0x28ae
movl $0x1, -0x4(%rbp)
jmp 0x28ae
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2720
movl %eax, -0x4(%rbp)
jmp 0x28ae
movq 0x1982f(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10d67(%rip), %rsi     # 0x1353a
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 0x284b
movq 0x197e9(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10d57(%rip), %rsi     # 0x13570
movb $0x0, %al
callq 0x10d0
leaq -0x70(%rbp), %rdi
callq 0xb390
movq 0x197c8(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x11767(%rip), %rsi     # 0x13fa1
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0x80(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x28ae
movq 0x1979a(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0x10d3c(%rip), %rsi     # 0x135a4
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movl $0x4, -0x4(%rbp)
jmp 0x28ae
movq 0x1976f(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
movl -0x70(%rbp), %ecx
leaq 0x10c01(%rip), %rsi     # 0x13497
leaq 0x10d27(%rip), %rdx     # 0x135c4
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)