// File: 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
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x28(%rax)
movl $0x0, 0x4(%rax)
movl -0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x55f80
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x4(%rax)
movl -0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x55f9b
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x4(%rax)
movq -0xc8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq $-0x1, 0x18(%rax)
cmpl $0x0, 0x4(%rax)
jne 0x55fc6
movq -0xc8(%rbp), %rax
movl -0xc(%rbp), %ecx
movq %rcx, 0x18(%rax)
movq -0xc8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl (%rax), %eax
movq %rax, -0xd0(%rbp)
subq $0x9, %rax
ja 0x5615c
movq -0xd0(%rbp), %rax
leaq 0x39d81(%rip), %rcx     # 0x8fd74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0xc8(%rbp), %rax
movq $0x0, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x4(%rax)
movq $0x2, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x56050
movq -0xc8(%rbp), %rax
movq $0x8, 0x20(%rax)
jmp 0x5605f
movq -0xc8(%rbp), %rax
movq $0x4, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x56087
movq -0xc8(%rbp), %rax
movq $0x8, 0x20(%rax)
jmp 0x56096
movq -0xc8(%rbp), %rax
movq $0x8, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movl 0x4(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x4(%rax)
movq $0x4, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x560ed
movq -0xc8(%rbp), %rax
movq $0x10, 0x20(%rax)
jmp 0x560fc
movq -0xc8(%rbp), %rax
movq $0x8, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movl 0x4(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x4(%rax)
movq $0x1, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movq $0x1, 0x20(%rax)
jmp 0x5615c
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movl 0x4(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x4(%rax)
movq $0x4, 0x20(%rax)
movq -0xc8(%rbp), %rax
cmpl $0x7, (%rax)
jg 0x5624a
movq -0xc8(%rbp), %rax
cmpl $0x1, (%rax)
jl 0x5624a
movq -0xc8(%rbp), %rdi
callq 0x56260
movq %rax, -0x18(%rbp)
movl $0x0, -0x54(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x54(%rbp), %rsi
leaq -0x18(%rbp), %rcx
movq %rcx, %rdx
callq 0x592e0
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x59320
leaq 0x711e9(%rip), %rdi     # 0xc73a8
leaq -0x38(%rbp), %rsi
callq 0x592a0
movq %rax, -0x68(%rbp)
movb %dl, -0x60(%rbp)
movq $0x1, -0x70(%rbp)
cmpq $0x7, -0x70(%rbp)
ja 0x56248
movl $0x0, -0xac(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xac(%rbp), %rsi
leaq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x592e0
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59320
leaq 0x71187(%rip), %rdi     # 0xc73a8
leaq -0x90(%rbp), %rsi
callq 0x592a0
movq %rax, -0xc0(%rbp)
movb %dl, -0xb8(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x561d7
jmp 0x5624a
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)