// File: /workspace/github_cpp_makefile_star2_O2/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:
movl %edx, %eax
andl $0x1, %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movl %eax, 0x4(%rdi)
movl %esi, %ecx
testb $0x2, %dl
jne 0x211e0
orq $-0x1, 0x18(%rdi)
testl %eax, %eax
jne 0x211ef
xorl %eax, %eax
movq %rcx, %rdx
jmp 0x211e9
orl $0x2, %eax
movl %eax, 0x4(%rdi)
pushq $-0x1
popq %rdx
movq %rdx, 0x18(%rdi)
jmp 0x211f2
pushq $0x1
popq %rax
movl %esi, (%rdi)
cmpl $0x9, %esi
ja 0x21211
pushq $0x1
popq %rdx
leaq 0x19b99(%rip), %r8      # 0x3ad9c
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
andq $0x0, 0x20(%rdi)
decl %esi
cmpl $0x7, %esi
jb 0x2126a
retq
andl $0x1, %eax
movl %eax, 0x4(%rdi)
pushq $0x2
jmp 0x21255
andl $0x0, 0x4(%rdi)
movq $0x4, 0x20(%rdi)
retq
andl $0x0, 0x4(%rdi)
jmp 0x21266
andl $-0x2, %eax
movl %eax, 0x4(%rdi)
jmp 0x21266
andl $0x0, 0x4(%rdi)
pushq $0x4
jmp 0x21255
andl $-0x2, %eax
leaq 0x4(,%rax,2), %rdx
jmp 0x21266
pushq $0x8
popq %rdx
jmp 0x21266
andl $-0x2, %eax
movl %eax, 0x4(%rdi)
leaq 0x8(,%rax,4), %rdx
movq %rdx, 0x20(%rdi)
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
callq 0x212de
movq %rax, %rbx
leaq -0x40(%rbp), %r14
movq %rax, (%r14)
movq %rax, 0x8(%r14)
andl $0x0, 0x10(%r14)
movq %rax, 0x18(%r14)
leaq 0x3308c(%rip), %r15     # 0x54328
movq %r15, %rdi
movq %r14, %rsi
callq 0x22fca
pushq $0x1
popq %r12
cmpq $0x8, %r12
je 0x212d1
movq %r12, -0x40(%rbp)
movq %rbx, -0x38(%rbp)
andl $0x0, -0x30(%rbp)
movq %r12, -0x28(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x22fca
incq %r12
jmp 0x212ab
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq