// File: /workspace/github_cpp_makefile_star2_O1/acliusBackHome[P]kamaya/dist/ParseType.cpp
// Function: ParseType::ParseType(BaseType, int)
ParseType::ParseType(BaseType b_type, int spe) {
    pointer_level = array_size = lower_type = 0;
    specifier = 0;
    if (spe & S_UNSIGNED) {
        specifier |= S_UNSIGNED;
    }
    if (spe & S_LONG) {
        specifier |= S_LONG;
    }
    fields = nullptr;
    type_id = (size_t) -1;
    if (!specifier) {
        type_id = b_type;
    }
    base_type = b_type;
    switch (base_type) {
        case T_UNKNOWN:
        case T_VOID:
            type_size = 0;
            break;
        case T_SHORT:
            // 取消long 修饰符, short没有long 修饰符
            specifier &= (~((int) S_LONG));
            type_size = sizeof(short);
            break;
        case T_INT:
            if (specifier & S_LONG) {
                type_size = sizeof(long int);
            } else {
                type_size = sizeof(int);
            }
            break;
        case T_LONG:
            if (specifier & S_LONG) {
                type_size = sizeof(long long);
            } else {
                type_size = sizeof(long);
            }
            break;
        case T_FLOAT:
            // 取消unsigned long修饰符, float没有unsigned long 修饰符
            // long float  在C89标准中已经删除
            specifier &= (~((int) S_UNSIGNED));
            specifier &= (~((int) S_LONG));
            type_size = sizeof(float);
            break;
        case T_DOUBLE:
            specifier &= (~((int) S_UNSIGNED));
            if (specifier & S_LONG) {
                type_size = sizeof(long double);
            } else {
                type_size = sizeof(double);
            }
            break;
        case T_BOOL:
            specifier &= (~((int) S_UNSIGNED));
            specifier &= (~((int) S_LONG));
            type_size = sizeof(bool);
            break;
        case T_CHAR:
            specifier &= (~((int) S_UNSIGNED));
            type_size = sizeof(char);
            break;
        case T_ENUM:
            specifier &= (~((int) S_UNSIGNED));
            specifier &= (~((int) S_LONG));
            type_size = sizeof(int);
            break;
    }
    if (base_type <= T_DOUBLE && base_type >= T_BOOL) {
        // 注册能够自动转换的类型
        // undefined表示可以直接自动类型转换
        size_t this_type_id = get_id();
        op_able.insert(pair<OpAble, size_t>(OpAble(E_UNDEFINED, this_type_id, this_type_id), this_type_id));
        for (size_t i = T_BOOL; i <= T_DOUBLE; ++i) {
            op_able.insert(pair<OpAble, size_t>(OpAble(E_UNDEFINED, this_type_id, i), i));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movl %edx, %eax
andl $0x3, %eax
movl %eax, 0x4(%rdi)
movl %esi, %eax
movq $-0x1, %rcx
cmoveq %rax, %rcx
movq $0x0, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movl %esi, (%rdi)
cmpl $0x9, %esi
ja 0x27688
leaq 0x1f7e0(%rip), %rcx     # 0x46e04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
jmp 0x27684
movl $0x0, 0x4(%rbx)
movl $0x4, %eax
jmp 0x27684
andl $0x1, %edx
movl %edx, 0x4(%rbx)
movl $0x2, %eax
jmp 0x27684
movl $0x0, 0x4(%rbx)
jmp 0x2765b
andl $0x2, %edx
movl %edx, 0x4(%rbx)
movl $0x1, %eax
jmp 0x27684
andl $0x2, %edx
movl %edx, 0x4(%rbx)
leaq 0x8(,%rdx,4), %rax
jmp 0x27684
andl $0x2, %edx
leaq 0x4(,%rdx,2), %rax
jmp 0x27684
movl $0x8, %eax
movq %rax, 0x20(%rbx)
decl %esi
cmpl $0x6, %esi
ja 0x276fd
movq 0x18(%rbx), %r14
cmpq $-0x1, %r14
jne 0x276a8
movq %rbx, %rdi
callq 0x27f08
movq %rax, %r14
movq %rax, 0x18(%rbx)
leaq -0x40(%rbp), %rbx
movq %r14, (%rbx)
movq %r14, 0x8(%rbx)
movl $0x0, 0x10(%rbx)
movq %r14, 0x18(%rbx)
leaq 0x35c93(%rip), %r15     # 0x5d358
movq %r15, %rdi
movq %rbx, %rsi
callq 0x29a08
movl $0x1, %r12d
movq %r12, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movq %r12, -0x28(%rbp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x29a08
incq %r12
cmpq $0x8, %r12
jne 0x276d6
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq