// File: /workspace/github_cpp_makefile_star2_O3/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
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 0x26f87
movq $-0x1, 0x18(%rbx)
testl %eax, %eax
jne 0x26f9a
xorl %eax, %eax
movq %rcx, %r14
jmp 0x26f94
orl $0x2, %eax
movl %eax, 0x4(%rbx)
movq $-0x1, %r14
movq %r14, 0x18(%rbx)
jmp 0x26fa6
movl $0x1, %eax
movq $-0x1, %r14
movl %esi, (%rbx)
cmpl $0x9, %esi
ja 0x26fc5
leaq 0x1ee50(%rip), %rdx     # 0x45e04
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq $0x0, 0x20(%rbx)
decl %esi
cmpl $0x7, %esi
jb 0x2703c
jmp 0x270a6
andl $0x1, %eax
movl %eax, 0x4(%rbx)
movl $0x2, %eax
jmp 0x27038
movl $0x0, 0x4(%rbx)
movq $0x4, 0x20(%rbx)
jmp 0x270a6
movl $0x0, 0x4(%rbx)
jmp 0x27001
andl $-0x2, %eax
movl %eax, 0x4(%rbx)
movl $0x1, %eax
jmp 0x27038
movl $0x0, 0x4(%rbx)
movl $0x4, %eax
jmp 0x27038
andl $-0x2, %eax
leaq 0x4(,%rax,2), %rax
jmp 0x27038
movl $0x8, %eax
jmp 0x27038
andl $-0x2, %eax
movl %eax, 0x4(%rbx)
leaq 0x8(,%rax,4), %rax
movq %rax, 0x20(%rbx)
cmpq $-0x1, %r14
jne 0x27051
movq %rbx, %rdi
callq 0x27870
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 0x352ea(%rip), %r15     # 0x5c358
movq %r15, %rdi
movq %rbx, %rsi
callq 0x291f0
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 0x291f0
incq %r12
cmpq $0x8, %r12
jne 0x2707f
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop