// File: /workspace/github_c_makefile_star2_O0/ryvnf[P]czc/eval.c
// Function: alignof_type
size_t alignof_type(struct loc *loc, struct type *type)
{
    switch (type_type(type->tag)) {
        case VOID_TYPE_FLAG:
            fatal(loc, "cannot compute the size of void");
            return 0;
        case FUNC_TYPE_FLAG:
            fatal(loc, "cannot compute the size of a function");
            return 0;
        case BOOL_TYPE_FLAG:
        case INT_TYPE_FLAG:
        case FLOAT_TYPE_FLAG:
            return sizeof_basic_type(type);
        case PTR_TYPE_FLAG:
            // This would not be portable on computers where size of function
            // pointers is different from regular pointers.
            return sizeof (void *);
        case ARRAY_TYPE_FLAG: {
            struct type *elem_type = array_type(type)->of;
            return alignof_type(loc, elem_type);
        }
        case STRUCT_TYPE_FLAG: {
            size_t n_fields = struct_type(type)->n_fields;
            struct field *fields = struct_type(type)->fields;
            size_t max_align = 1;

            for (size_t i = 0; i < n_fields; i++) {
                size_t align = alignof_type(loc, fields[i].type);
                if (align > max_align)
                    max_align = align;
            }

            return max_align;
        }
    }

    unreachable();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x6f00
movl %eax, %ecx
movl %ecx, -0x4c(%rbp)
subl $0x1, %eax
je 0x8562
jmp 0x8517
movl -0x4c(%rbp), %eax
subl $0x2, %eax
je 0x8586
jmp 0x8521
movl -0x4c(%rbp), %eax
subl $0x4, %eax
je 0x8586
jmp 0x852b
movl -0x4c(%rbp), %eax
subl $0x8, %eax
je 0x8598
jmp 0x8535
movl -0x4c(%rbp), %eax
subl $0x10, %eax
je 0x85a5
jmp 0x853f
movl -0x4c(%rbp), %eax
subl $0x20, %eax
je 0x8574
jmp 0x8549
movl -0x4c(%rbp), %eax
subl $0x40, %eax
je 0x85cc
jmp 0x8553
movl -0x4c(%rbp), %eax
subl $0x80, %eax
je 0x8586
jmp 0x8654
movq -0x10(%rbp), %rdi
leaq 0xad2c(%rip), %rsi      # 0x13299
movb $0x0, %al
callq 0x6610
movq -0x10(%rbp), %rdi
leaq 0xad3a(%rip), %rsi      # 0x132b9
movb $0x0, %al
callq 0x6610
movq -0x18(%rbp), %rdi
callq 0xfcf0
movq %rax, -0x8(%rbp)
jmp 0x8675
movq $0x8, -0x8(%rbp)
jmp 0x8675
movq -0x18(%rbp), %rdi
callq 0x10490
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x84f0
movq %rax, -0x8(%rbp)
jmp 0x8675
movq -0x18(%rbp), %rdi
callq 0x10570
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10570
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movq $0x1, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x864a
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x84f0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x863a
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x863c
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x85fe
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8675
leaq 0xab35(%rip), %rdi      # 0x13190
leaq 0xab54(%rip), %rsi      # 0x131b6
movl $0x314, %edx            # imm = 0x314
leaq 0xac71(%rip), %rcx      # 0x132df
movb $0x0, %al
callq 0x6510
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop