// File: /workspace/github_c_makefile_star2_O1/ryvnf[P]czc/eval.c
// Function: eval_type
struct type *eval_type(struct type *t, struct ast *ast)
{
    struct type *type;
    switch (ast->tag) {
        case COMMA_EXPR:
            eval_type(NULL, ast_ast(ast, 0));
            type = eval_type(t, ast_ast(ast, 1));
            break;

        case COND_EXPR:
            type = eval_cond_type(t, ast);
            break;

        case ASGN_EXPR:
        case ADD_ASGN_EXPR:
        case SUB_ASGN_EXPR:
        case MUL_ASGN_EXPR:
        case DIV_ASGN_EXPR:
        case REM_ASGN_EXPR:
        case OR_ASGN_EXPR:
        case XOR_ASGN_EXPR:
        case AND_ASGN_EXPR:
        case SHL_ASGN_EXPR:
        case SHR_ASGN_EXPR:
            type = eval_asgn_type(ast);
            break;

        case LOR_EXPR:
        case LAND_EXPR:
            type = eval_binop_type(ast, BOOL_TYPE_FLAG);
            break;

        case EQ_EXPR:
        case NE_EXPR:
            type = eval_relop_type(ast, BOOL_TYPE_FLAG | INT_TYPE_FLAG | FLOAT_TYPE_FLAG |
                    PTR_TYPE_FLAG);
            break;

        case LT_EXPR:
        case GT_EXPR:
        case LE_EXPR:
        case GE_EXPR:
            type = eval_relop_type(ast, INT_TYPE_FLAG | FLOAT_TYPE_FLAG | PTR_TYPE_FLAG);
            break;

        case OR_EXPR:
        case XOR_EXPR:
        case AND_EXPR:
        case SHL_EXPR:
        case SHR_EXPR:
        case REM_EXPR:
            type = eval_binop_type(ast, INT_TYPE_FLAG);
            break;

        case ADD_EXPR:
            type = eval_add_type(ast);
            break;

        case SUB_EXPR:
            type = eval_sub_type(ast);
            break;

        case MUL_EXPR:
        case DIV_EXPR:
            type = eval_binop_type(ast, INT_TYPE_FLAG | FLOAT_TYPE_FLAG);
            break;

        case NOT_EXPR:
            type = eval_unop_type(ast, BOOL_TYPE_FLAG, false);
            break;

        case COMPL_EXPR:
            type = eval_unop_type(ast, INT_TYPE_FLAG, false);
            break;

        case UPLUS_EXPR:
        case NEG_EXPR:
            type = eval_unop_type(ast, INT_TYPE_FLAG | FLOAT_TYPE_FLAG, false);
            break;

        case REF_EXPR:
            type = eval_ref_type(ast);
            break;

        case PRE_INC_EXPR:
        case PRE_DEC_EXPR:
        case POST_INC_EXPR:
        case POST_DEC_EXPR:
            type = eval_unop_type(ast, INT_TYPE_FLAG | FLOAT_TYPE_FLAG | PTR_TYPE_FLAG, true);
            break;

        case SIZEOF_EXPR:
            type = eval_sizeof_type(ast);
            break;

        case CAST_EXPR:
            type = eval_cast_type(ast);
            break;

        case DEREF_EXPR:
            type = eval_deref_type(ast);
            break;

        case SUBSCR_EXPR:
            type = eval_subscr_type(ast);
            break;

        case CALL_EXPR:
            type = eval_call_type(ast);
            break;

        case MEMBER_EXPR:
            type = eval_member_type(ast);
            break;

        case INT_CONST:
            type = const_int_type;
            break;

        case FLOAT_CONST:
            type = const_float_type;
            break;

        case STR_LIT:
            type = eval_str_lit_type(ast);
            break;

        case TRUE_CONST:
            type = bool_type;
            break;

        case FALSE_CONST:
            type = bool_type;
            break;

        case NULL_CONST:
            type = void_ptr_type;
            break;

        case NAME:
            type = eval_name_type(t, ast);
            break;

        case DECL:
            type = eval_decl_type(ast);
            break;

        case INIT_EXPR:
            type = eval_init_type(t, ast);
            break;
    }

    if (type && type_type(type->tag) == SELFREF_TYPE_FLAG)
        fatal(ast->loc, "type cannot refer to itself in constant context");

    return type;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl (%rsi), %eax
leaq 0xe580(%rip), %r14      # 0x13d58
cmpl $0x426f, %eax           # imm = 0x426F
jg 0x5811
cmpl $0x421f, %eax           # imm = 0x421F
jle 0x5884
cmpl $0x423f, %eax           # imm = 0x423F
jg 0x58a6
leal -0x4220(%rax), %ecx
cmpl $0xb, %ecx
jae 0x59ea
movq %rbx, %rdi
callq 0x5dd5
jmp 0x5a9b
cmpl $0x42c1, %eax           # imm = 0x42C1
jle 0x5849
leal -0x42d0(%rax), %ecx
cmpl $0x26, %ecx
ja 0x5973
leaq 0x81e6(%rip), %rax      # 0xda14
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movl $0xe, %esi
movl $0x1, %edx
jmp 0x5a96
cmpl $0x42b0, %eax           # imm = 0x42B0
jg 0x5911
leal -0x4280(%rax), %ecx
cmpl $0x30, %ecx
ja 0x59da
movabsq $0x300010001, %rdx      # imm = 0x300010001
btq %rcx, %rdx
jae 0x59c7
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x59fd
cmpl $0x2fff, %eax           # imm = 0x2FFF
jg 0x58bb
cmpl $0x1, %eax
jg 0x592d
testl %eax, %eax
je 0x5a07
cmpl $0x1, %eax
je 0x5905
jmp 0x5a9e
leal -0x4260(%rax), %ecx
cmpl $0x4, %ecx
jae 0x58e9
movq %rbx, %rdi
movl $0xe, %esi
jmp 0x5900
cmpl $0x41ff, %eax           # imm = 0x41FF
jg 0x594d
cmpl $0x3000, %eax           # imm = 0x3000
je 0x5a16
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x5a9e
movq %rbx, %rdi
callq 0x6345
jmp 0x5a9b
leal -0x4250(%rax), %ecx
cmpl $0x2, %ecx
jae 0x59a3
movq %rbx, %rdi
movl $0x8e, %esi
callq 0x5b6f
leaq 0xe454(%rip), %r14      # 0x13d60
jmp 0x5a9e
leal -0x42c0(%rax), %ecx
cmpl $0x2, %ecx
jae 0x59af
movq %rbx, %rdi
movl $0x6, %esi
jmp 0x59fd
cmpl $0x2, %eax
je 0x5905
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x5a9e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x627f
jmp 0x5a9b
cmpl $0x4200, %eax           # imm = 0x4200
je 0x5a1f
cmpl $0x4210, %eax           # imm = 0x4210
jne 0x5a9e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x571e
jmp 0x5a9b
cmpl $0x42c2, %eax           # imm = 0x42C2
je 0x5877
cmpl $0x5000, %eax           # imm = 0x5000
jne 0x5a9e
movq %rbx, %rdi
callq 0x6251
jmp 0x5a9b
movq %rbx, %rdi
movl $0x6, %esi
jmp 0x5a94
cmpl $0x4240, %eax           # imm = 0x4240
je 0x59f5
jmp 0x5a9e
cmpl $0x42b1, %eax           # imm = 0x42B1
jne 0x5a9e
movq %rbx, %rdi
callq 0x5cfc
jmp 0x5a9b
cmpq $0x30, %rcx
jne 0x59da
movq %rbx, %rdi
callq 0x5c42
jmp 0x5a9b
cmpl $0x4270, %eax           # imm = 0x4270
je 0x5877
jmp 0x5a9e
cmpl $0x4230, %eax           # imm = 0x4230
jne 0x5a9e
movq %rbx, %rdi
movl $0x80, %esi
callq 0x5aeb
jmp 0x5a9b
leaq 0xe372(%rip), %rax      # 0x13d80
movq (%rax), %r14
jmp 0x5a9e
leaq 0xe33f(%rip), %r14      # 0x13d5c
jmp 0x5a9e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x27c8
xorl %edi, %edi
movq %rax, %rsi
callq 0x57c4
movl $0x1, %esi
movq %rbx, %rdi
callq 0x27c8
movq %r15, %rdi
movq %rax, %rsi
callq 0x57c4
jmp 0x5a9b
movq %rbx, %rdi
callq 0x614d
jmp 0x5a9b
movq %rbx, %rdi
callq 0x5f56
jmp 0x5a9e
movq %rbx, %rdi
callq 0x5f84
jmp 0x5a9b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x63ba
jmp 0x5a9b
movq %rbx, %rdi
callq 0x5fc6
jmp 0x5a9b
movq %rbx, %rdi
movl $0x80, %esi
jmp 0x5a94
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x5bee
movq %rax, %r14
testq %r14, %r14
je 0x5ab2
movl $0x3ff, %eax            # imm = 0x3FF
andl (%r14), %eax
cmpl $0x100, %eax            # imm = 0x100
je 0x5ad9
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x5ed1
jmp 0x5a9b
movq %rbx, %rdi
callq 0x5f06
jmp 0x5a9b
movq %rbx, %rdi
callq 0x605b
jmp 0x5a9b
movq 0x8(%rbx), %rdi
leaq 0x84b5(%rip), %rsi      # 0xdf99
xorl %eax, %eax
callq 0x5011