// File: /workspace/github_c_makefile_star2_O0/ryvnf[P]czc/parse.c
// Function: parse_type
static struct ast *parse_type(struct parse *parse)
{
    struct loc *line = get_linenr(parse);
    switch (peek_tok(parse)->type) {
        case '^': {
            parse->pos++;

	    struct ast *type = parse_type(parse);
            if (type == NULL)
                return type;

            return ast_new_ast(line, PTR_EXPR, 1, type);
        }
        case '[': {
            struct ast *expr = parse_enclosed(parse, '[', parse_expr, ']', false);
            if (expr == NULL)
                return NULL;

            struct ast *type = parse_type(parse);
            if (type == NULL) {
                ast_unref(expr);
                return type;
            }

            return ast_new_ast(line, ARRAY_EXPR, 2, type, expr);
        }
        case '(': {
            struct ast *param_list = parse_enclosed(parse, '(',
                    parse_param_list, ')', false);

            struct ast *type = parse_type(parse);
            if (type == NULL) {
                ast_unref(param_list);
                return NULL;
            }

            return ast_new_ast(line, FUNC_EXPR, 2, param_list, type);
        }
        case IDENT_TOK: {
            char *s = parse->tokens[parse->pos++].val.u.s;
            return ast_new_s(line, NAME, s);
        }
        case '{': {
            struct ast *field_list = parse_enclosed(parse, '{',
                    parse_decl_list, '}', false);
            return field_list;
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xcb70
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xcd10
movl (%rax), %eax
movl %eax, -0x54(%rbp)
subl $0x28, %eax
je 0xd5ec
jmp 0xd4e2
movl -0x54(%rbp), %eax
subl $0x5b, %eax
je 0xd567
jmp 0xd4ec
movl -0x54(%rbp), %eax
subl $0x5e, %eax
je 0xd517
jmp 0xd4f6
movl -0x54(%rbp), %eax
subl $0x7b, %eax
je 0xd69a
jmp 0xd504
movl -0x54(%rbp), %eax
subl $0x120, %eax            # imm = 0x120
je 0xd65a
jmp 0xd6c5
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0xd4b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xd545
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x4300, %esi           # imm = 0x4300
movl $0x1, %edx
movb $0x0, %al
callq 0x2510
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x10(%rbp), %rdi
movl $0x5b, %esi
leaq 0x2f9(%rip), %rdx       # 0xd870
movl $0x5d, %ecx
xorl %r8d, %r8d
callq 0xd7e0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xd59c
movq $0x0, -0x8(%rbp)
jmp 0xd6cd
movq -0x10(%rbp), %rdi
callq 0xd4b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xd5c6
movq -0x28(%rbp), %rdi
callq 0x27e0
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0x4301, %esi           # imm = 0x4301
movl $0x2, %edx
movb $0x0, %al
callq 0x2510
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x10(%rbp), %rdi
movl $0x28, %esi
leaq 0x294(%rip), %rdx       # 0xd890
movl $0x29, %ecx
xorl %r8d, %r8d
callq 0xd7e0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd4b0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xd637
movq -0x38(%rbp), %rdi
callq 0x27e0
movq $0x0, -0x8(%rbp)
jmp 0xd6cd
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movl $0x4302, %esi           # imm = 0x4302
movl $0x2, %edx
movb $0x0, %al
callq 0x2510
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x14(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x14(%rdx)
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x23a0
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq -0x10(%rbp), %rdi
movl $0x7b, %esi
leaq 0x306(%rip), %rdx       # 0xd9b0
movl $0x7d, %ecx
xorl %r8d, %r8d
callq 0xd7e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd6cd
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)