// File: /workspace/github_c_makefile_star2_O3/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 0xe5b6(%rip), %r14      # 0x13d58
cmpl $0x426f, %eax           # imm = 0x426F
jg 0x57db
cmpl $0x421f, %eax           # imm = 0x421F
jle 0x584e
cmpl $0x423f, %eax           # imm = 0x423F
jg 0x5870
leal -0x4220(%rax), %ecx
cmpl $0xb, %ecx
jae 0x59b4
movq %rbx, %rdi
callq 0x5da5
jmp 0x5a68
cmpl $0x42c1, %eax           # imm = 0x42C1
jle 0x5813
leal -0x42d0(%rax), %ecx
cmpl $0x26, %ecx
ja 0x593d
leaq 0x821c(%rip), %rax      # 0xda14
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movl $0xe, %esi
movl $0x1, %edx
jmp 0x5a63
cmpl $0x42b0, %eax           # imm = 0x42B0
jg 0x58db
leal -0x4280(%rax), %ecx
cmpl $0x30, %ecx
ja 0x59a4
movabsq $0x300010001, %rdx      # imm = 0x300010001
btq %rcx, %rdx
jae 0x5991
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x59c7
cmpl $0x2fff, %eax           # imm = 0x2FFF
jg 0x5885
cmpl $0x1, %eax
jg 0x58f7
testl %eax, %eax
je 0x59d1
cmpl $0x1, %eax
je 0x58cf
jmp 0x5a70
leal -0x4260(%rax), %ecx
cmpl $0x4, %ecx
jae 0x58b3
movq %rbx, %rdi
movl $0xe, %esi
jmp 0x58ca
cmpl $0x41ff, %eax           # imm = 0x41FF
jg 0x5917
cmpl $0x3000, %eax           # imm = 0x3000
je 0x59e0
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x5a70
movq %rbx, %rdi
callq 0x62db
jmp 0x5a68
leal -0x4250(%rax), %ecx
cmpl $0x2, %ecx
jae 0x596d
movq %rbx, %rdi
movl $0x8e, %esi
callq 0x5b3f
leaq 0xe48a(%rip), %r14      # 0x13d60
jmp 0x5a70
leal -0x42c0(%rax), %ecx
cmpl $0x2, %ecx
jae 0x5979
movq %rbx, %rdi
movl $0x6, %esi
jmp 0x59c7
cmpl $0x2, %eax
je 0x58cf
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x5a70
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6215
jmp 0x5a68
cmpl $0x4200, %eax           # imm = 0x4200
je 0x59ec
cmpl $0x4210, %eax           # imm = 0x4210
jne 0x5a70
movq %r15, %rdi
movq %rbx, %rsi
callq 0x56e8
jmp 0x5a68
cmpl $0x42c2, %eax           # imm = 0x42C2
je 0x5841
cmpl $0x5000, %eax           # imm = 0x5000
jne 0x5a70
movq %rbx, %rdi
callq 0x61e7
jmp 0x5a68
movq %rbx, %rdi
movl $0x6, %esi
jmp 0x5a61
cmpl $0x4240, %eax           # imm = 0x4240
je 0x59bf
jmp 0x5a70
cmpl $0x42b1, %eax           # imm = 0x42B1
jne 0x5a70
movq %rbx, %rdi
callq 0x5ccc
jmp 0x5a68
cmpq $0x30, %rcx
jne 0x59a4
movq %rbx, %rdi
callq 0x5c12
jmp 0x5a68
cmpl $0x4270, %eax           # imm = 0x4270
je 0x5841
jmp 0x5a70
cmpl $0x4230, %eax           # imm = 0x4230
jne 0x5a70
movq %rbx, %rdi
movl $0x80, %esi
callq 0x5abb
jmp 0x5a68
leaq 0xe3a8(%rip), %rax      # 0x13d80
movq (%rax), %r14
jmp 0x5a6b
leaq 0xe375(%rip), %r14      # 0x13d5c
jmp 0x5a70
movq %rbx, %rdi
xorl %esi, %esi
callq 0x27e8
xorl %edi, %edi
movq %rax, %rsi
callq 0x578e
movl $0x1, %esi
movq %rbx, %rdi
callq 0x27e8
movq %r15, %rdi
movq %rax, %rsi
callq 0x578e
jmp 0x5a68
movq %rbx, %rdi
callq 0x611d
jmp 0x5a68
movq %rbx, %rdi
callq 0x5f26
jmp 0x5a70
movq %rbx, %rdi
callq 0x5f54
jmp 0x5a68
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6350
jmp 0x5a68
movq %rbx, %rdi
callq 0x5f96
jmp 0x5a68
movq %rbx, %rdi
movl $0x80, %esi
jmp 0x5a61
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x5bbe
movq %rax, %r14
testq %r14, %r14
je 0x5a91
movl $0x3ff, %eax            # imm = 0x3FF
andl (%r14), %eax
cmpl $0x100, %eax            # imm = 0x100
jne 0x5a94
movq 0x8(%rbx), %rdi
leaq 0x850f(%rip), %rsi      # 0xdf99
xorl %eax, %eax
callq 0x4fa1
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x5ea1
jmp 0x5a68
movq %rbx, %rdi
callq 0x5ed6
jmp 0x5a68
movq %rbx, %rdi
callq 0x602b
jmp 0x5a68