// File: /workspace/github_c_makefile_star2_O0/ryvnf[P]czc/type.c
// Function: resolve_selfref
bool resolve_selfref(struct type **type, bool selfref_ok)
{
    switch (type_type((*type)->tag)) {
        case SELFREF_TYPE_FLAG:
            if (selfref_ok) {
                *type = selfref_type(*type)->sym->type;
            }
            return selfref_ok;
        case PTR_TYPE_FLAG:
            return resolve_selfref(&ptr_type(*type)->to, selfref_ok);
        case ARRAY_TYPE_FLAG:
            return resolve_selfref(&array_type(*type)->of, selfref_ok);
        case FUNC_TYPE_FLAG:
            for (size_t i = 0; i < func_type(*type)->n_params; i++)
                if (!resolve_selfref(&func_type(*type)->params[i], selfref_ok))
                    return false;
            return resolve_selfref(&func_type(*type)->ret, selfref_ok);
        case STRUCT_TYPE_FLAG:
            return resolve_selfref_struct(struct_type(*type), selfref_ok);
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x10f30
movl %eax, %ecx
movl %ecx, -0x24(%rbp)
subl $0x8, %eax
je 0x11286
jmp 0x1121e
movl -0x24(%rbp), %eax
subl $0x10, %eax
je 0x112b0
jmp 0x1122c
movl -0x24(%rbp), %eax
subl $0x20, %eax
je 0x112da
jmp 0x1123a
movl -0x24(%rbp), %eax
subl $0x40, %eax
je 0x1136f
jmp 0x11248
movl -0x24(%rbp), %eax
subl $0x100, %eax            # imm = 0x100
jne 0x11392
jmp 0x11258
testb $0x1, -0x11(%rbp)
je 0x11279
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10590
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x11396
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10420
movq %rax, %rdi
addq $0x8, %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x111f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x11396
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10490
movq %rax, %rdi
addq $0x8, %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x111f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x11396
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10500
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq 0x10(%rcx), %rax
jae 0x11348
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10500
movq %rax, %rdi
addq $0x20, %rdi
movq -0x20(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x111f0
testb $0x1, %al
jne 0x11338
movb $0x0, -0x1(%rbp)
jmp 0x11396
jmp 0x1133a
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x112e2
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10500
movq %rax, %rdi
addq $0x8, %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x111f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x11396
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10570
movq %rax, %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x11120
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x11396
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)